Subversion Repositories SmartDukaan

Rev

Rev 23400 | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift Compiler (0.7.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.warehouse;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class WarehouseService {

  public interface Iface extends in.shop2020.generic.GenericService.Iface {

    /**
     * Retrieves serialized inventory item given a serial number
     * 
     * @param serialNumber
     */
    public InventoryItem getInventoryItem(String serialNumber) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Retrieves non-serialized inventory item from a given supplier
     * 
     * @param itemNumber
     * @param itemId
     * @param fulfilmentWarehouseId
     * @param billingWarehouseId
     */
    public InventoryItem getNonSeralizedInventoryItem(String itemNumber, long itemId, long fulfilmentWarehouseId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Scan non-serialized items.
     * 
     * @param inventoryItem
     * @param type
     * @param quantity
     * @param billingWarehouseId
     * @param transferLotId
     */
    public void scan(InventoryItem inventoryItem, ScanType type, long quantity, long billingWarehouseId, long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Scan non-serialized items.
     * 
     * @param inventoryItem
     * @param scan
     */
    public void genericScan(InventoryItem inventoryItem, Scan scan) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Scan serialized items linked with an order. Returns its price.
     * 
     * @param serialNumber
     * @param type
     * @param orderId
     * @param fulfilmentWarehouseId
     * @param quantity
     * @param billingWarehouseId
     */
    public InventoryItem scanSerializedItemForOrder(String serialNumber, ScanType type, long orderId, long fulfilmentWarehouseId, double quantity, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Scan non-serialized items linked with an order.
     * 
     * @param inventoryItem
     * @param type
     * @param quantity
     * @param orderId
     * @param fulfilmentWarehouseId
     * @param billingWarehouseId
     */
    public InventoryItem scanForOrder(InventoryItem inventoryItem, ScanType type, long quantity, long orderId, long fulfilmentWarehouseId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Created item number to item id mapping
     * 
     * @param itemNumber
     * @param itemId
     */
    public void createItemNumberMapping(String itemNumber, long itemId) throws org.apache.thrift.TException;

    /**
     * Get itemNumber mappings for itemId
     * 
     * @param itemId
     */
    public List<String> getItemNumbers(long itemId) throws org.apache.thrift.TException;

    /**
     * Gets item ids for a given item number
     * 
     * @param itemNumber
     */
    public List<Long> getItemIds(String itemNumber) throws org.apache.thrift.TException;

    /**
     * Retrieves all inventory items given a last scan type
     * 
     * @param lastScanType
     */
    public List<InventoryItem> getInventoryItemsFromLastScanType(ScanType lastScanType) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Retrieves inventory item given a inventoryItem id
     * 
     * @param inventoryItemId
     */
    public InventoryItem getInventoryItemFromId(long inventoryItemId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Returns the purchase scans grouped by items for Purchase register reconciliation
     * 
     * @param startDate
     * @param endDate
     */
    public List<DetailedPurchaseScan> getPurchaseScans(long startDate, long endDate) throws org.apache.thrift.TException;

    /**
     * Returns the purchase scans between grn dates grouped by items for Purchase register reconciliation
     * 
     * @param startDate
     * @param endDate
     */
    public List<DetailedPurchaseScan> getPurchaseScansByGrnDate(long startDate, long endDate) throws org.apache.thrift.TException;

    /**
     * Returns the empty grn-ids between grn dates
     * 
     * @param startDate
     * @param endDate
     */
    public List<Long> getEmptyGrnsByDate(long startDate, long endDate) throws org.apache.thrift.TException;

    /**
     * Returns the invoices and the count of scans against on a given day.
     * 
     * @param date
     */
    public List<InvoiceScan> fetchScansPerInvoiceNumber(long date) throws org.apache.thrift.TException;

    /**
     * Returns inventory item for a given order
     * 
     * @param orderId
     */
    public InventoryItem getInventoryItemFromOrder(long orderId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Fetches the stock inventory age week-wise
     */
    public List<InventoryAge> getInventoryAge() throws org.apache.thrift.TException;

    /**
     * Fetches the scanRecords for a given item for a given time interval
     * 
     * @param itemId
     * @param fromDate
     * @param toDate
     */
    public List<Scan> getInventoryScansForItem(long itemId, long fromDate, long toDate) throws org.apache.thrift.TException;

    /**
     * Fetches the scanRecords for a given serialNumber for a given time interval
     * 
     * @param serialNumber
     */
    public List<Scan> getScanRecordsForSerialNumber(String serialNumber) throws org.apache.thrift.TException;

    /**
     * Inserts outgoing scans for Returned Items and updates returnId in InventoryItems
     * 
     * @param saleReturnItems
     * @param vendorId
     * @param billingWarehouseId
     */
    public long scanForPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Inserts scans for lost Items and updates lastScanType in InventoryItems
     * 
     * @param lostItems
     * @param vendorId
     * @param billingWarehouseId
     */
    public void scanForLostItem(List<InventoryItem> lostItems, long vendorId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Get inventory count for available Serialized items in our warehouses using entries in ScanNew table
     * 
     * @param physicalWarehouseId
     */
    public List<InventoryAvailability> getCurrentSerializedInventoryByScans(long physicalWarehouseId) throws org.apache.thrift.TException;

    /**
     * Get inventory count for available Serialized items in our warehouses using entries in ScanNew table
     * 
     * @param physicalWarehouseId
     */
    public List<InventoryAvailability> getCurrentNonSerializedInventoryByScans(long physicalWarehouseId) throws org.apache.thrift.TException;

    /**
     * Get inventory for Serialized items in our warehouses at a given date using entries in ScanNew table
     * 
     * @param date
     */
    public List<InventoryAvailability> getHistoricSerializedInventoryByScans(long date) throws org.apache.thrift.TException;

    /**
     * Get inventory for Non Serialized items in our warehouses at a given date using entries in ScanNew table
     * 
     * @param date
     */
    public List<InventoryAvailability> getHistoricNonSerializedInventoryByScans(long date) throws org.apache.thrift.TException;

    /**
     * Get inventory for Serialized items in our warehouses at a given date using entries in ScanNew table
     * 
     * @param date
     */
    public List<InventoryAvailability> getOurHistoricSerializedInventoryByScans(long date) throws org.apache.thrift.TException;

    /**
     * Get inventory for Non Serialized items in our warehouses at a given date using entries in ScanNew table
     * 
     * @param date
     */
    public List<InventoryAvailability> getOurHistoricNonSerializedInventoryByScans(long date) throws org.apache.thrift.TException;

    /**
     * Insert Purchase/Sale Entries for product billed by Hotspot using OURS_EXTERNAL Billing
     * 
     * @param itemId
     * @param serialNumber
     * @param itemNumber
     * @param invoiceNumber
     * @param warehouseId
     * @param unitPrice
     * @param nlc
     * @param orderId
     */
    public InventoryItem scanForOursExternalSale(long itemId, String serialNumber, String itemNumber, String invoiceNumber, long warehouseId, double unitPrice, double nlc, long orderId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Insert Purchase_Ret/Sale_Ret Entries for product billed by Hotspot using OURS_EXTERNAL Billing
     * 
     * @param orderId
     * @param unitPrice
     */
    public void scanForOursExternalSaleReturn(long orderId, double unitPrice) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * This returns movement for each non serialized item in the specified window.(Doesn't include Hotspot and Amazon w/h)
     * 
     * @param startDate
     * @param endDate
     */
    public List<InventoryMovement> getMovementNonSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException;

    /**
     * This returns movement for each serialized item in the specified window.(Doesn't include Hotspot and Amazon w/h)
     * 
     * @param startDate
     * @param endDate
     */
    public List<InventoryMovement> getMovementSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException;

    /**
     * This returns movement for each serialized item in the specified window.(Doesn't include Amazon w/h)
     * 
     * @param startDate
     * @param endDate
     */
    public List<InventoryMovement> getCompleteMovementSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException;

    /**
     * This returns movement for each non serialized item in the specified window.(Doesn't include Amazon w/h)
     * 
     * @param startDate
     * @param endDate
     */
    public List<InventoryMovement> getCompleteMovementNonSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException;

    public InventoryItem scanfreebie(long orderId, long freebieItemId, long freebieWarehouseId, ScanType scanType) throws WarehouseServiceException, org.apache.thrift.TException;

    public void reshipfreebie(long oldOrderId, long newOrderId, long freebieItemId, ScanType scanType) throws WarehouseServiceException, org.apache.thrift.TException;

    public boolean isItemTransferAllowed(long warehouseId, long transferWarehouseId) throws org.apache.thrift.TException;

    public long createTransferLot(long originWarehouseId, long destWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    public TransferLot getTransferLot(long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException;

    public void markTransferLotAsReceived(long id, String remoteTransferRefNumber) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<TransferLot> getTransferLotsByDate(long fromDate, long toDate) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<Long> getAllowedDestinationWarehousesForTransfer(long warehouseId) throws org.apache.thrift.TException;

    public Map<Long,Long> getItemsInTransferLot(long transferLotId) throws org.apache.thrift.TException;

    public void markItemsAsReceivedForTransferLot(long id) throws WarehouseServiceException, org.apache.thrift.TException;

    public TransferLotStatus updateTransferLotAfterItemReceive(long id) throws WarehouseServiceException, org.apache.thrift.TException;

    public void scanForTransferOut(List<InventoryItem> inventoryItems, ScanType type, long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException;

    public void scanForTransferIn(List<InventoryItem> inventoryItems, ScanType type, long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException;

    public void scanForOursThirdPartyReceive(List<InventoryItem> inventoryItems, long id) throws WarehouseServiceException, org.apache.thrift.TException;

    public long getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse(long itemId, long physicalWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<InTransitInventory> getInTransitInventory(long originWarehouseId) throws org.apache.thrift.TException;

    public boolean isItemAvailableForSale(long itemId, String serialNumber, long warehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Get inventory for Non Serialized items in our warehouses at a given date using entries in ScanNew table
     * 
     * @param date
     */
    public List<InventoryAvailability> getHistoricBadInventoryByScans(long date) throws WarehouseServiceException, org.apache.thrift.TException;

    public InventoryItem scanForBadSale(String serialNumber, String itemNumber, long itemId, long orderId, long fulfilmentWarehouseId, long quantity, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<InventoryItem> getTransferLotItemsForMarkReceive(long transferLotId, ScanType scanType) throws WarehouseServiceException, org.apache.thrift.TException;

    public void markItemsAsReceivedForTransferLotPartial(List<InventoryItem> inventoryItems, long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException;

    public void markTransferLotAsReceivedPartial(long id, String remoteTransferRefNumber) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<InventoryItem> getInventoryItemScannedInForPO(long itemId, List<Long> purchaseIds) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<AmazonTransferredSkuDetail> getAmazonTransferredSkuDetails(List<Long> itemIds) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<Scan> getScansforPurchase(long purchaseId, ScanType scanType) throws WarehouseServiceException, org.apache.thrift.TException;

    public long getCurrentBadQuantityForItem(long itemId, long currentWarehouseId, long physicalWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    public long scanForBadPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException;

    public Map<Long,Long> getItemsInPurchaseReturn(long purchaseReturnId, ScanType type, String returnTime) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<Scan> getScansForInventoryItem(long inventoryItemId, ScanType type) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<String> checkGrnImeiStatus(List<String> imeiNos) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<InvAgeConsiderItems> getInventoryAgeConsideredItems(long itemId) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<InventoryMovement> getCompleteMovementForThirdPartyWarehouse(long startDate, long endDate) throws org.apache.thrift.TException;

    public List<DoaOutInventoryItem> getAllDoaOutInventoryItems() throws WarehouseServiceException, org.apache.thrift.TException;

    public List<RemovalStockShipmentReference> getAllUnCompletedStockShipments(String source) throws WarehouseServiceException, org.apache.thrift.TException;

    public RemovalStockShipmentReference getRemovalStockShipmentReferenceById(long id) throws WarehouseServiceException, org.apache.thrift.TException;

    public long createRemovalStockShipmentReference(RemovalStockShipmentReference removalStockShipmentReference) throws WarehouseServiceException, org.apache.thrift.TException;

    public void updateShipmentReferenceTransferLot(long transferLotId, long shipmentReferenceId) throws WarehouseServiceException, org.apache.thrift.TException;

    /**
     * Returns the shipment references and the count of scans against on a given day.
     * 
     * @param date
     */
    public List<TransferInvoiceScan> fetchScansPerTransferInvoiceNumber(long date) throws org.apache.thrift.TException;

    public List<InventoryItem> getInventoryItems(List<String> serialNumbers) throws WarehouseServiceException, org.apache.thrift.TException;

    public List<InventoryItem> getInventoryItemsBySerailNumbers(List<String> serialNumbers) throws WarehouseServiceException, org.apache.thrift.TException;

    public void scanPurchaseBulk(List<InventoryItem> inventoryItems) throws WarehouseServiceException, org.apache.thrift.TException;

  }

  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {

    public void getInventoryItem(String serialNumber, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryItem_call> resultHandler) throws org.apache.thrift.TException;

    public void getNonSeralizedInventoryItem(String itemNumber, long itemId, long fulfilmentWarehouseId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getNonSeralizedInventoryItem_call> resultHandler) throws org.apache.thrift.TException;

    public void scan(InventoryItem inventoryItem, ScanType type, long quantity, long billingWarehouseId, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scan_call> resultHandler) throws org.apache.thrift.TException;

    public void genericScan(InventoryItem inventoryItem, Scan scan, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.genericScan_call> resultHandler) throws org.apache.thrift.TException;

    public void scanSerializedItemForOrder(String serialNumber, ScanType type, long orderId, long fulfilmentWarehouseId, double quantity, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanSerializedItemForOrder_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForOrder(InventoryItem inventoryItem, ScanType type, long quantity, long orderId, long fulfilmentWarehouseId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForOrder_call> resultHandler) throws org.apache.thrift.TException;

    public void createItemNumberMapping(String itemNumber, long itemId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createItemNumberMapping_call> resultHandler) throws org.apache.thrift.TException;

    public void getItemNumbers(long itemId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemNumbers_call> resultHandler) throws org.apache.thrift.TException;

    public void getItemIds(String itemNumber, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemIds_call> resultHandler) throws org.apache.thrift.TException;

    public void getInventoryItemsFromLastScanType(ScanType lastScanType, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryItemsFromLastScanType_call> resultHandler) throws org.apache.thrift.TException;

    public void getInventoryItemFromId(long inventoryItemId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryItemFromId_call> resultHandler) throws org.apache.thrift.TException;

    public void getPurchaseScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPurchaseScans_call> resultHandler) throws org.apache.thrift.TException;

    public void getPurchaseScansByGrnDate(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPurchaseScansByGrnDate_call> resultHandler) throws org.apache.thrift.TException;

    public void getEmptyGrnsByDate(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getEmptyGrnsByDate_call> resultHandler) throws org.apache.thrift.TException;

    public void fetchScansPerInvoiceNumber(long date, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.fetchScansPerInvoiceNumber_call> resultHandler) throws org.apache.thrift.TException;

    public void getInventoryItemFromOrder(long orderId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryItemFromOrder_call> resultHandler) throws org.apache.thrift.TException;

    public void getInventoryAge(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryAge_call> resultHandler) throws org.apache.thrift.TException;

    public void getInventoryScansForItem(long itemId, long fromDate, long toDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryScansForItem_call> resultHandler) throws org.apache.thrift.TException;

    public void getScanRecordsForSerialNumber(String serialNumber, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getScanRecordsForSerialNumber_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForPurchaseReturn_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForLostItem(List<InventoryItem> lostItems, long vendorId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForLostItem_call> resultHandler) throws org.apache.thrift.TException;

    public void getCurrentSerializedInventoryByScans(long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCurrentSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void getCurrentNonSerializedInventoryByScans(long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCurrentNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void getHistoricSerializedInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getHistoricSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void getHistoricNonSerializedInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getHistoricNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void getOurHistoricSerializedInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getOurHistoricSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void getOurHistoricNonSerializedInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getOurHistoricNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForOursExternalSale(long itemId, String serialNumber, String itemNumber, String invoiceNumber, long warehouseId, double unitPrice, double nlc, long orderId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForOursExternalSale_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForOursExternalSaleReturn(long orderId, double unitPrice, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForOursExternalSaleReturn_call> resultHandler) throws org.apache.thrift.TException;

    public void getMovementNonSerializedInventoryByScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getMovementNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void getMovementSerializedInventoryByScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getMovementSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void getCompleteMovementSerializedInventoryByScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCompleteMovementSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void getCompleteMovementNonSerializedInventoryByScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCompleteMovementNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void scanfreebie(long orderId, long freebieItemId, long freebieWarehouseId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanfreebie_call> resultHandler) throws org.apache.thrift.TException;

    public void reshipfreebie(long oldOrderId, long newOrderId, long freebieItemId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.reshipfreebie_call> resultHandler) throws org.apache.thrift.TException;

    public void isItemTransferAllowed(long warehouseId, long transferWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isItemTransferAllowed_call> resultHandler) throws org.apache.thrift.TException;

    public void createTransferLot(long originWarehouseId, long destWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createTransferLot_call> resultHandler) throws org.apache.thrift.TException;

    public void getTransferLot(long transferLotId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getTransferLot_call> resultHandler) throws org.apache.thrift.TException;

    public void markTransferLotAsReceived(long id, String remoteTransferRefNumber, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markTransferLotAsReceived_call> resultHandler) throws org.apache.thrift.TException;

    public void getTransferLotsByDate(long fromDate, long toDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getTransferLotsByDate_call> resultHandler) throws org.apache.thrift.TException;

    public void getAllowedDestinationWarehousesForTransfer(long warehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllowedDestinationWarehousesForTransfer_call> resultHandler) throws org.apache.thrift.TException;

    public void getItemsInTransferLot(long transferLotId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemsInTransferLot_call> resultHandler) throws org.apache.thrift.TException;

    public void markItemsAsReceivedForTransferLot(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markItemsAsReceivedForTransferLot_call> resultHandler) throws org.apache.thrift.TException;

    public void updateTransferLotAfterItemReceive(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.updateTransferLotAfterItemReceive_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForTransferOut(List<InventoryItem> inventoryItems, ScanType type, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForTransferOut_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForTransferIn(List<InventoryItem> inventoryItems, ScanType type, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForTransferIn_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForOursThirdPartyReceive(List<InventoryItem> inventoryItems, long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForOursThirdPartyReceive_call> resultHandler) throws org.apache.thrift.TException;

    public void getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse(long itemId, long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_call> resultHandler) throws org.apache.thrift.TException;

    public void getInTransitInventory(long originWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInTransitInventory_call> resultHandler) throws org.apache.thrift.TException;

    public void isItemAvailableForSale(long itemId, String serialNumber, long warehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isItemAvailableForSale_call> resultHandler) throws org.apache.thrift.TException;

    public void getHistoricBadInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getHistoricBadInventoryByScans_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForBadSale(String serialNumber, String itemNumber, long itemId, long orderId, long fulfilmentWarehouseId, long quantity, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForBadSale_call> resultHandler) throws org.apache.thrift.TException;

    public void getTransferLotItemsForMarkReceive(long transferLotId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getTransferLotItemsForMarkReceive_call> resultHandler) throws org.apache.thrift.TException;

    public void markItemsAsReceivedForTransferLotPartial(List<InventoryItem> inventoryItems, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markItemsAsReceivedForTransferLotPartial_call> resultHandler) throws org.apache.thrift.TException;

    public void markTransferLotAsReceivedPartial(long id, String remoteTransferRefNumber, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markTransferLotAsReceivedPartial_call> resultHandler) throws org.apache.thrift.TException;

    public void getInventoryItemScannedInForPO(long itemId, List<Long> purchaseIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryItemScannedInForPO_call> resultHandler) throws org.apache.thrift.TException;

    public void getAmazonTransferredSkuDetails(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAmazonTransferredSkuDetails_call> resultHandler) throws org.apache.thrift.TException;

    public void getScansforPurchase(long purchaseId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getScansforPurchase_call> resultHandler) throws org.apache.thrift.TException;

    public void getCurrentBadQuantityForItem(long itemId, long currentWarehouseId, long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCurrentBadQuantityForItem_call> resultHandler) throws org.apache.thrift.TException;

    public void scanForBadPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanForBadPurchaseReturn_call> resultHandler) throws org.apache.thrift.TException;

    public void getItemsInPurchaseReturn(long purchaseReturnId, ScanType type, String returnTime, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemsInPurchaseReturn_call> resultHandler) throws org.apache.thrift.TException;

    public void getScansForInventoryItem(long inventoryItemId, ScanType type, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getScansForInventoryItem_call> resultHandler) throws org.apache.thrift.TException;

    public void checkGrnImeiStatus(List<String> imeiNos, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.checkGrnImeiStatus_call> resultHandler) throws org.apache.thrift.TException;

    public void getInventoryAgeConsideredItems(long itemId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryAgeConsideredItems_call> resultHandler) throws org.apache.thrift.TException;

    public void getCompleteMovementForThirdPartyWarehouse(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCompleteMovementForThirdPartyWarehouse_call> resultHandler) throws org.apache.thrift.TException;

    public void getAllDoaOutInventoryItems(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllDoaOutInventoryItems_call> resultHandler) throws org.apache.thrift.TException;

    public void getAllUnCompletedStockShipments(String source, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllUnCompletedStockShipments_call> resultHandler) throws org.apache.thrift.TException;

    public void getRemovalStockShipmentReferenceById(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRemovalStockShipmentReferenceById_call> resultHandler) throws org.apache.thrift.TException;

    public void createRemovalStockShipmentReference(RemovalStockShipmentReference removalStockShipmentReference, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createRemovalStockShipmentReference_call> resultHandler) throws org.apache.thrift.TException;

    public void updateShipmentReferenceTransferLot(long transferLotId, long shipmentReferenceId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.updateShipmentReferenceTransferLot_call> resultHandler) throws org.apache.thrift.TException;

    public void fetchScansPerTransferInvoiceNumber(long date, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.fetchScansPerTransferInvoiceNumber_call> resultHandler) throws org.apache.thrift.TException;

    public void getInventoryItems(List<String> serialNumbers, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryItems_call> resultHandler) throws org.apache.thrift.TException;

    public void getInventoryItemsBySerailNumbers(List<String> serialNumbers, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInventoryItemsBySerailNumbers_call> resultHandler) throws org.apache.thrift.TException;

    public void scanPurchaseBulk(List<InventoryItem> inventoryItems, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.scanPurchaseBulk_call> resultHandler) throws org.apache.thrift.TException;

  }

  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
      public Factory() {}
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
        return new Client(prot);
      }
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
        return new Client(iprot, oprot);
      }
    }

    public Client(org.apache.thrift.protocol.TProtocol prot)
    {
      super(prot, prot);
    }

    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
      super(iprot, oprot);
    }

    public InventoryItem getInventoryItem(String serialNumber) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getInventoryItem(serialNumber);
      return recv_getInventoryItem();
    }

    public void send_getInventoryItem(String serialNumber) throws org.apache.thrift.TException
    {
      getInventoryItem_args args = new getInventoryItem_args();
      args.setSerialNumber(serialNumber);
      sendBase("getInventoryItem", args);
    }

    public InventoryItem recv_getInventoryItem() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getInventoryItem_result result = new getInventoryItem_result();
      receiveBase(result, "getInventoryItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryItem failed: unknown result");
    }

    public InventoryItem getNonSeralizedInventoryItem(String itemNumber, long itemId, long fulfilmentWarehouseId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getNonSeralizedInventoryItem(itemNumber, itemId, fulfilmentWarehouseId, billingWarehouseId);
      return recv_getNonSeralizedInventoryItem();
    }

    public void send_getNonSeralizedInventoryItem(String itemNumber, long itemId, long fulfilmentWarehouseId, long billingWarehouseId) throws org.apache.thrift.TException
    {
      getNonSeralizedInventoryItem_args args = new getNonSeralizedInventoryItem_args();
      args.setItemNumber(itemNumber);
      args.setItemId(itemId);
      args.setFulfilmentWarehouseId(fulfilmentWarehouseId);
      args.setBillingWarehouseId(billingWarehouseId);
      sendBase("getNonSeralizedInventoryItem", args);
    }

    public InventoryItem recv_getNonSeralizedInventoryItem() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getNonSeralizedInventoryItem_result result = new getNonSeralizedInventoryItem_result();
      receiveBase(result, "getNonSeralizedInventoryItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNonSeralizedInventoryItem failed: unknown result");
    }

    public void scan(InventoryItem inventoryItem, ScanType type, long quantity, long billingWarehouseId, long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scan(inventoryItem, type, quantity, billingWarehouseId, transferLotId);
      recv_scan();
    }

    public void send_scan(InventoryItem inventoryItem, ScanType type, long quantity, long billingWarehouseId, long transferLotId) throws org.apache.thrift.TException
    {
      scan_args args = new scan_args();
      args.setInventoryItem(inventoryItem);
      args.setType(type);
      args.setQuantity(quantity);
      args.setBillingWarehouseId(billingWarehouseId);
      args.setTransferLotId(transferLotId);
      sendBase("scan", args);
    }

    public void recv_scan() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scan_result result = new scan_result();
      receiveBase(result, "scan");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public void genericScan(InventoryItem inventoryItem, Scan scan) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_genericScan(inventoryItem, scan);
      recv_genericScan();
    }

    public void send_genericScan(InventoryItem inventoryItem, Scan scan) throws org.apache.thrift.TException
    {
      genericScan_args args = new genericScan_args();
      args.setInventoryItem(inventoryItem);
      args.setScan(scan);
      sendBase("genericScan", args);
    }

    public void recv_genericScan() throws WarehouseServiceException, org.apache.thrift.TException
    {
      genericScan_result result = new genericScan_result();
      receiveBase(result, "genericScan");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public InventoryItem scanSerializedItemForOrder(String serialNumber, ScanType type, long orderId, long fulfilmentWarehouseId, double quantity, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanSerializedItemForOrder(serialNumber, type, orderId, fulfilmentWarehouseId, quantity, billingWarehouseId);
      return recv_scanSerializedItemForOrder();
    }

    public void send_scanSerializedItemForOrder(String serialNumber, ScanType type, long orderId, long fulfilmentWarehouseId, double quantity, long billingWarehouseId) throws org.apache.thrift.TException
    {
      scanSerializedItemForOrder_args args = new scanSerializedItemForOrder_args();
      args.setSerialNumber(serialNumber);
      args.setType(type);
      args.setOrderId(orderId);
      args.setFulfilmentWarehouseId(fulfilmentWarehouseId);
      args.setQuantity(quantity);
      args.setBillingWarehouseId(billingWarehouseId);
      sendBase("scanSerializedItemForOrder", args);
    }

    public InventoryItem recv_scanSerializedItemForOrder() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanSerializedItemForOrder_result result = new scanSerializedItemForOrder_result();
      receiveBase(result, "scanSerializedItemForOrder");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scanSerializedItemForOrder failed: unknown result");
    }

    public InventoryItem scanForOrder(InventoryItem inventoryItem, ScanType type, long quantity, long orderId, long fulfilmentWarehouseId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForOrder(inventoryItem, type, quantity, orderId, fulfilmentWarehouseId, billingWarehouseId);
      return recv_scanForOrder();
    }

    public void send_scanForOrder(InventoryItem inventoryItem, ScanType type, long quantity, long orderId, long fulfilmentWarehouseId, long billingWarehouseId) throws org.apache.thrift.TException
    {
      scanForOrder_args args = new scanForOrder_args();
      args.setInventoryItem(inventoryItem);
      args.setType(type);
      args.setQuantity(quantity);
      args.setOrderId(orderId);
      args.setFulfilmentWarehouseId(fulfilmentWarehouseId);
      args.setBillingWarehouseId(billingWarehouseId);
      sendBase("scanForOrder", args);
    }

    public InventoryItem recv_scanForOrder() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForOrder_result result = new scanForOrder_result();
      receiveBase(result, "scanForOrder");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scanForOrder failed: unknown result");
    }

    public void createItemNumberMapping(String itemNumber, long itemId) throws org.apache.thrift.TException
    {
      send_createItemNumberMapping(itemNumber, itemId);
      recv_createItemNumberMapping();
    }

    public void send_createItemNumberMapping(String itemNumber, long itemId) throws org.apache.thrift.TException
    {
      createItemNumberMapping_args args = new createItemNumberMapping_args();
      args.setItemNumber(itemNumber);
      args.setItemId(itemId);
      sendBase("createItemNumberMapping", args);
    }

    public void recv_createItemNumberMapping() throws org.apache.thrift.TException
    {
      createItemNumberMapping_result result = new createItemNumberMapping_result();
      receiveBase(result, "createItemNumberMapping");
      return;
    }

    public List<String> getItemNumbers(long itemId) throws org.apache.thrift.TException
    {
      send_getItemNumbers(itemId);
      return recv_getItemNumbers();
    }

    public void send_getItemNumbers(long itemId) throws org.apache.thrift.TException
    {
      getItemNumbers_args args = new getItemNumbers_args();
      args.setItemId(itemId);
      sendBase("getItemNumbers", args);
    }

    public List<String> recv_getItemNumbers() throws org.apache.thrift.TException
    {
      getItemNumbers_result result = new getItemNumbers_result();
      receiveBase(result, "getItemNumbers");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemNumbers failed: unknown result");
    }

    public List<Long> getItemIds(String itemNumber) throws org.apache.thrift.TException
    {
      send_getItemIds(itemNumber);
      return recv_getItemIds();
    }

    public void send_getItemIds(String itemNumber) throws org.apache.thrift.TException
    {
      getItemIds_args args = new getItemIds_args();
      args.setItemNumber(itemNumber);
      sendBase("getItemIds", args);
    }

    public List<Long> recv_getItemIds() throws org.apache.thrift.TException
    {
      getItemIds_result result = new getItemIds_result();
      receiveBase(result, "getItemIds");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemIds failed: unknown result");
    }

    public List<InventoryItem> getInventoryItemsFromLastScanType(ScanType lastScanType) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getInventoryItemsFromLastScanType(lastScanType);
      return recv_getInventoryItemsFromLastScanType();
    }

    public void send_getInventoryItemsFromLastScanType(ScanType lastScanType) throws org.apache.thrift.TException
    {
      getInventoryItemsFromLastScanType_args args = new getInventoryItemsFromLastScanType_args();
      args.setLastScanType(lastScanType);
      sendBase("getInventoryItemsFromLastScanType", args);
    }

    public List<InventoryItem> recv_getInventoryItemsFromLastScanType() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getInventoryItemsFromLastScanType_result result = new getInventoryItemsFromLastScanType_result();
      receiveBase(result, "getInventoryItemsFromLastScanType");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryItemsFromLastScanType failed: unknown result");
    }

    public InventoryItem getInventoryItemFromId(long inventoryItemId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getInventoryItemFromId(inventoryItemId);
      return recv_getInventoryItemFromId();
    }

    public void send_getInventoryItemFromId(long inventoryItemId) throws org.apache.thrift.TException
    {
      getInventoryItemFromId_args args = new getInventoryItemFromId_args();
      args.setInventoryItemId(inventoryItemId);
      sendBase("getInventoryItemFromId", args);
    }

    public InventoryItem recv_getInventoryItemFromId() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getInventoryItemFromId_result result = new getInventoryItemFromId_result();
      receiveBase(result, "getInventoryItemFromId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryItemFromId failed: unknown result");
    }

    public List<DetailedPurchaseScan> getPurchaseScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      send_getPurchaseScans(startDate, endDate);
      return recv_getPurchaseScans();
    }

    public void send_getPurchaseScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      getPurchaseScans_args args = new getPurchaseScans_args();
      args.setStartDate(startDate);
      args.setEndDate(endDate);
      sendBase("getPurchaseScans", args);
    }

    public List<DetailedPurchaseScan> recv_getPurchaseScans() throws org.apache.thrift.TException
    {
      getPurchaseScans_result result = new getPurchaseScans_result();
      receiveBase(result, "getPurchaseScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPurchaseScans failed: unknown result");
    }

    public List<DetailedPurchaseScan> getPurchaseScansByGrnDate(long startDate, long endDate) throws org.apache.thrift.TException
    {
      send_getPurchaseScansByGrnDate(startDate, endDate);
      return recv_getPurchaseScansByGrnDate();
    }

    public void send_getPurchaseScansByGrnDate(long startDate, long endDate) throws org.apache.thrift.TException
    {
      getPurchaseScansByGrnDate_args args = new getPurchaseScansByGrnDate_args();
      args.setStartDate(startDate);
      args.setEndDate(endDate);
      sendBase("getPurchaseScansByGrnDate", args);
    }

    public List<DetailedPurchaseScan> recv_getPurchaseScansByGrnDate() throws org.apache.thrift.TException
    {
      getPurchaseScansByGrnDate_result result = new getPurchaseScansByGrnDate_result();
      receiveBase(result, "getPurchaseScansByGrnDate");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPurchaseScansByGrnDate failed: unknown result");
    }

    public List<Long> getEmptyGrnsByDate(long startDate, long endDate) throws org.apache.thrift.TException
    {
      send_getEmptyGrnsByDate(startDate, endDate);
      return recv_getEmptyGrnsByDate();
    }

    public void send_getEmptyGrnsByDate(long startDate, long endDate) throws org.apache.thrift.TException
    {
      getEmptyGrnsByDate_args args = new getEmptyGrnsByDate_args();
      args.setStartDate(startDate);
      args.setEndDate(endDate);
      sendBase("getEmptyGrnsByDate", args);
    }

    public List<Long> recv_getEmptyGrnsByDate() throws org.apache.thrift.TException
    {
      getEmptyGrnsByDate_result result = new getEmptyGrnsByDate_result();
      receiveBase(result, "getEmptyGrnsByDate");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEmptyGrnsByDate failed: unknown result");
    }

    public List<InvoiceScan> fetchScansPerInvoiceNumber(long date) throws org.apache.thrift.TException
    {
      send_fetchScansPerInvoiceNumber(date);
      return recv_fetchScansPerInvoiceNumber();
    }

    public void send_fetchScansPerInvoiceNumber(long date) throws org.apache.thrift.TException
    {
      fetchScansPerInvoiceNumber_args args = new fetchScansPerInvoiceNumber_args();
      args.setDate(date);
      sendBase("fetchScansPerInvoiceNumber", args);
    }

    public List<InvoiceScan> recv_fetchScansPerInvoiceNumber() throws org.apache.thrift.TException
    {
      fetchScansPerInvoiceNumber_result result = new fetchScansPerInvoiceNumber_result();
      receiveBase(result, "fetchScansPerInvoiceNumber");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchScansPerInvoiceNumber failed: unknown result");
    }

    public InventoryItem getInventoryItemFromOrder(long orderId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getInventoryItemFromOrder(orderId);
      return recv_getInventoryItemFromOrder();
    }

    public void send_getInventoryItemFromOrder(long orderId) throws org.apache.thrift.TException
    {
      getInventoryItemFromOrder_args args = new getInventoryItemFromOrder_args();
      args.setOrderId(orderId);
      sendBase("getInventoryItemFromOrder", args);
    }

    public InventoryItem recv_getInventoryItemFromOrder() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getInventoryItemFromOrder_result result = new getInventoryItemFromOrder_result();
      receiveBase(result, "getInventoryItemFromOrder");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.we != null) {
        throw result.we;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryItemFromOrder failed: unknown result");
    }

    public List<InventoryAge> getInventoryAge() throws org.apache.thrift.TException
    {
      send_getInventoryAge();
      return recv_getInventoryAge();
    }

    public void send_getInventoryAge() throws org.apache.thrift.TException
    {
      getInventoryAge_args args = new getInventoryAge_args();
      sendBase("getInventoryAge", args);
    }

    public List<InventoryAge> recv_getInventoryAge() throws org.apache.thrift.TException
    {
      getInventoryAge_result result = new getInventoryAge_result();
      receiveBase(result, "getInventoryAge");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryAge failed: unknown result");
    }

    public List<Scan> getInventoryScansForItem(long itemId, long fromDate, long toDate) throws org.apache.thrift.TException
    {
      send_getInventoryScansForItem(itemId, fromDate, toDate);
      return recv_getInventoryScansForItem();
    }

    public void send_getInventoryScansForItem(long itemId, long fromDate, long toDate) throws org.apache.thrift.TException
    {
      getInventoryScansForItem_args args = new getInventoryScansForItem_args();
      args.setItemId(itemId);
      args.setFromDate(fromDate);
      args.setToDate(toDate);
      sendBase("getInventoryScansForItem", args);
    }

    public List<Scan> recv_getInventoryScansForItem() throws org.apache.thrift.TException
    {
      getInventoryScansForItem_result result = new getInventoryScansForItem_result();
      receiveBase(result, "getInventoryScansForItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryScansForItem failed: unknown result");
    }

    public List<Scan> getScanRecordsForSerialNumber(String serialNumber) throws org.apache.thrift.TException
    {
      send_getScanRecordsForSerialNumber(serialNumber);
      return recv_getScanRecordsForSerialNumber();
    }

    public void send_getScanRecordsForSerialNumber(String serialNumber) throws org.apache.thrift.TException
    {
      getScanRecordsForSerialNumber_args args = new getScanRecordsForSerialNumber_args();
      args.setSerialNumber(serialNumber);
      sendBase("getScanRecordsForSerialNumber", args);
    }

    public List<Scan> recv_getScanRecordsForSerialNumber() throws org.apache.thrift.TException
    {
      getScanRecordsForSerialNumber_result result = new getScanRecordsForSerialNumber_result();
      receiveBase(result, "getScanRecordsForSerialNumber");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getScanRecordsForSerialNumber failed: unknown result");
    }

    public long scanForPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForPurchaseReturn(saleReturnItems, vendorId, billingWarehouseId);
      return recv_scanForPurchaseReturn();
    }

    public void send_scanForPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId) throws org.apache.thrift.TException
    {
      scanForPurchaseReturn_args args = new scanForPurchaseReturn_args();
      args.setSaleReturnItems(saleReturnItems);
      args.setVendorId(vendorId);
      args.setBillingWarehouseId(billingWarehouseId);
      sendBase("scanForPurchaseReturn", args);
    }

    public long recv_scanForPurchaseReturn() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForPurchaseReturn_result result = new scanForPurchaseReturn_result();
      receiveBase(result, "scanForPurchaseReturn");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scanForPurchaseReturn failed: unknown result");
    }

    public void scanForLostItem(List<InventoryItem> lostItems, long vendorId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForLostItem(lostItems, vendorId, billingWarehouseId);
      recv_scanForLostItem();
    }

    public void send_scanForLostItem(List<InventoryItem> lostItems, long vendorId, long billingWarehouseId) throws org.apache.thrift.TException
    {
      scanForLostItem_args args = new scanForLostItem_args();
      args.setLostItems(lostItems);
      args.setVendorId(vendorId);
      args.setBillingWarehouseId(billingWarehouseId);
      sendBase("scanForLostItem", args);
    }

    public void recv_scanForLostItem() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForLostItem_result result = new scanForLostItem_result();
      receiveBase(result, "scanForLostItem");
      if (result.ex != null) {
        throw result.ex;
      }
      return;
    }

    public List<InventoryAvailability> getCurrentSerializedInventoryByScans(long physicalWarehouseId) throws org.apache.thrift.TException
    {
      send_getCurrentSerializedInventoryByScans(physicalWarehouseId);
      return recv_getCurrentSerializedInventoryByScans();
    }

    public void send_getCurrentSerializedInventoryByScans(long physicalWarehouseId) throws org.apache.thrift.TException
    {
      getCurrentSerializedInventoryByScans_args args = new getCurrentSerializedInventoryByScans_args();
      args.setPhysicalWarehouseId(physicalWarehouseId);
      sendBase("getCurrentSerializedInventoryByScans", args);
    }

    public List<InventoryAvailability> recv_getCurrentSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getCurrentSerializedInventoryByScans_result result = new getCurrentSerializedInventoryByScans_result();
      receiveBase(result, "getCurrentSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCurrentSerializedInventoryByScans failed: unknown result");
    }

    public List<InventoryAvailability> getCurrentNonSerializedInventoryByScans(long physicalWarehouseId) throws org.apache.thrift.TException
    {
      send_getCurrentNonSerializedInventoryByScans(physicalWarehouseId);
      return recv_getCurrentNonSerializedInventoryByScans();
    }

    public void send_getCurrentNonSerializedInventoryByScans(long physicalWarehouseId) throws org.apache.thrift.TException
    {
      getCurrentNonSerializedInventoryByScans_args args = new getCurrentNonSerializedInventoryByScans_args();
      args.setPhysicalWarehouseId(physicalWarehouseId);
      sendBase("getCurrentNonSerializedInventoryByScans", args);
    }

    public List<InventoryAvailability> recv_getCurrentNonSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getCurrentNonSerializedInventoryByScans_result result = new getCurrentNonSerializedInventoryByScans_result();
      receiveBase(result, "getCurrentNonSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCurrentNonSerializedInventoryByScans failed: unknown result");
    }

    public List<InventoryAvailability> getHistoricSerializedInventoryByScans(long date) throws org.apache.thrift.TException
    {
      send_getHistoricSerializedInventoryByScans(date);
      return recv_getHistoricSerializedInventoryByScans();
    }

    public void send_getHistoricSerializedInventoryByScans(long date) throws org.apache.thrift.TException
    {
      getHistoricSerializedInventoryByScans_args args = new getHistoricSerializedInventoryByScans_args();
      args.setDate(date);
      sendBase("getHistoricSerializedInventoryByScans", args);
    }

    public List<InventoryAvailability> recv_getHistoricSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getHistoricSerializedInventoryByScans_result result = new getHistoricSerializedInventoryByScans_result();
      receiveBase(result, "getHistoricSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getHistoricSerializedInventoryByScans failed: unknown result");
    }

    public List<InventoryAvailability> getHistoricNonSerializedInventoryByScans(long date) throws org.apache.thrift.TException
    {
      send_getHistoricNonSerializedInventoryByScans(date);
      return recv_getHistoricNonSerializedInventoryByScans();
    }

    public void send_getHistoricNonSerializedInventoryByScans(long date) throws org.apache.thrift.TException
    {
      getHistoricNonSerializedInventoryByScans_args args = new getHistoricNonSerializedInventoryByScans_args();
      args.setDate(date);
      sendBase("getHistoricNonSerializedInventoryByScans", args);
    }

    public List<InventoryAvailability> recv_getHistoricNonSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getHistoricNonSerializedInventoryByScans_result result = new getHistoricNonSerializedInventoryByScans_result();
      receiveBase(result, "getHistoricNonSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getHistoricNonSerializedInventoryByScans failed: unknown result");
    }

    public List<InventoryAvailability> getOurHistoricSerializedInventoryByScans(long date) throws org.apache.thrift.TException
    {
      send_getOurHistoricSerializedInventoryByScans(date);
      return recv_getOurHistoricSerializedInventoryByScans();
    }

    public void send_getOurHistoricSerializedInventoryByScans(long date) throws org.apache.thrift.TException
    {
      getOurHistoricSerializedInventoryByScans_args args = new getOurHistoricSerializedInventoryByScans_args();
      args.setDate(date);
      sendBase("getOurHistoricSerializedInventoryByScans", args);
    }

    public List<InventoryAvailability> recv_getOurHistoricSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getOurHistoricSerializedInventoryByScans_result result = new getOurHistoricSerializedInventoryByScans_result();
      receiveBase(result, "getOurHistoricSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getOurHistoricSerializedInventoryByScans failed: unknown result");
    }

    public List<InventoryAvailability> getOurHistoricNonSerializedInventoryByScans(long date) throws org.apache.thrift.TException
    {
      send_getOurHistoricNonSerializedInventoryByScans(date);
      return recv_getOurHistoricNonSerializedInventoryByScans();
    }

    public void send_getOurHistoricNonSerializedInventoryByScans(long date) throws org.apache.thrift.TException
    {
      getOurHistoricNonSerializedInventoryByScans_args args = new getOurHistoricNonSerializedInventoryByScans_args();
      args.setDate(date);
      sendBase("getOurHistoricNonSerializedInventoryByScans", args);
    }

    public List<InventoryAvailability> recv_getOurHistoricNonSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getOurHistoricNonSerializedInventoryByScans_result result = new getOurHistoricNonSerializedInventoryByScans_result();
      receiveBase(result, "getOurHistoricNonSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getOurHistoricNonSerializedInventoryByScans failed: unknown result");
    }

    public InventoryItem scanForOursExternalSale(long itemId, String serialNumber, String itemNumber, String invoiceNumber, long warehouseId, double unitPrice, double nlc, long orderId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForOursExternalSale(itemId, serialNumber, itemNumber, invoiceNumber, warehouseId, unitPrice, nlc, orderId);
      return recv_scanForOursExternalSale();
    }

    public void send_scanForOursExternalSale(long itemId, String serialNumber, String itemNumber, String invoiceNumber, long warehouseId, double unitPrice, double nlc, long orderId) throws org.apache.thrift.TException
    {
      scanForOursExternalSale_args args = new scanForOursExternalSale_args();
      args.setItemId(itemId);
      args.setSerialNumber(serialNumber);
      args.setItemNumber(itemNumber);
      args.setInvoiceNumber(invoiceNumber);
      args.setWarehouseId(warehouseId);
      args.setUnitPrice(unitPrice);
      args.setNlc(nlc);
      args.setOrderId(orderId);
      sendBase("scanForOursExternalSale", args);
    }

    public InventoryItem recv_scanForOursExternalSale() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForOursExternalSale_result result = new scanForOursExternalSale_result();
      receiveBase(result, "scanForOursExternalSale");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scanForOursExternalSale failed: unknown result");
    }

    public void scanForOursExternalSaleReturn(long orderId, double unitPrice) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForOursExternalSaleReturn(orderId, unitPrice);
      recv_scanForOursExternalSaleReturn();
    }

    public void send_scanForOursExternalSaleReturn(long orderId, double unitPrice) throws org.apache.thrift.TException
    {
      scanForOursExternalSaleReturn_args args = new scanForOursExternalSaleReturn_args();
      args.setOrderId(orderId);
      args.setUnitPrice(unitPrice);
      sendBase("scanForOursExternalSaleReturn", args);
    }

    public void recv_scanForOursExternalSaleReturn() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForOursExternalSaleReturn_result result = new scanForOursExternalSaleReturn_result();
      receiveBase(result, "scanForOursExternalSaleReturn");
      if (result.ex != null) {
        throw result.ex;
      }
      return;
    }

    public List<InventoryMovement> getMovementNonSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      send_getMovementNonSerializedInventoryByScans(startDate, endDate);
      return recv_getMovementNonSerializedInventoryByScans();
    }

    public void send_getMovementNonSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      getMovementNonSerializedInventoryByScans_args args = new getMovementNonSerializedInventoryByScans_args();
      args.setStartDate(startDate);
      args.setEndDate(endDate);
      sendBase("getMovementNonSerializedInventoryByScans", args);
    }

    public List<InventoryMovement> recv_getMovementNonSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getMovementNonSerializedInventoryByScans_result result = new getMovementNonSerializedInventoryByScans_result();
      receiveBase(result, "getMovementNonSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getMovementNonSerializedInventoryByScans failed: unknown result");
    }

    public List<InventoryMovement> getMovementSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      send_getMovementSerializedInventoryByScans(startDate, endDate);
      return recv_getMovementSerializedInventoryByScans();
    }

    public void send_getMovementSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      getMovementSerializedInventoryByScans_args args = new getMovementSerializedInventoryByScans_args();
      args.setStartDate(startDate);
      args.setEndDate(endDate);
      sendBase("getMovementSerializedInventoryByScans", args);
    }

    public List<InventoryMovement> recv_getMovementSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getMovementSerializedInventoryByScans_result result = new getMovementSerializedInventoryByScans_result();
      receiveBase(result, "getMovementSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getMovementSerializedInventoryByScans failed: unknown result");
    }

    public List<InventoryMovement> getCompleteMovementSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      send_getCompleteMovementSerializedInventoryByScans(startDate, endDate);
      return recv_getCompleteMovementSerializedInventoryByScans();
    }

    public void send_getCompleteMovementSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      getCompleteMovementSerializedInventoryByScans_args args = new getCompleteMovementSerializedInventoryByScans_args();
      args.setStartDate(startDate);
      args.setEndDate(endDate);
      sendBase("getCompleteMovementSerializedInventoryByScans", args);
    }

    public List<InventoryMovement> recv_getCompleteMovementSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getCompleteMovementSerializedInventoryByScans_result result = new getCompleteMovementSerializedInventoryByScans_result();
      receiveBase(result, "getCompleteMovementSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCompleteMovementSerializedInventoryByScans failed: unknown result");
    }

    public List<InventoryMovement> getCompleteMovementNonSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      send_getCompleteMovementNonSerializedInventoryByScans(startDate, endDate);
      return recv_getCompleteMovementNonSerializedInventoryByScans();
    }

    public void send_getCompleteMovementNonSerializedInventoryByScans(long startDate, long endDate) throws org.apache.thrift.TException
    {
      getCompleteMovementNonSerializedInventoryByScans_args args = new getCompleteMovementNonSerializedInventoryByScans_args();
      args.setStartDate(startDate);
      args.setEndDate(endDate);
      sendBase("getCompleteMovementNonSerializedInventoryByScans", args);
    }

    public List<InventoryMovement> recv_getCompleteMovementNonSerializedInventoryByScans() throws org.apache.thrift.TException
    {
      getCompleteMovementNonSerializedInventoryByScans_result result = new getCompleteMovementNonSerializedInventoryByScans_result();
      receiveBase(result, "getCompleteMovementNonSerializedInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCompleteMovementNonSerializedInventoryByScans failed: unknown result");
    }

    public InventoryItem scanfreebie(long orderId, long freebieItemId, long freebieWarehouseId, ScanType scanType) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanfreebie(orderId, freebieItemId, freebieWarehouseId, scanType);
      return recv_scanfreebie();
    }

    public void send_scanfreebie(long orderId, long freebieItemId, long freebieWarehouseId, ScanType scanType) throws org.apache.thrift.TException
    {
      scanfreebie_args args = new scanfreebie_args();
      args.setOrderId(orderId);
      args.setFreebieItemId(freebieItemId);
      args.setFreebieWarehouseId(freebieWarehouseId);
      args.setScanType(scanType);
      sendBase("scanfreebie", args);
    }

    public InventoryItem recv_scanfreebie() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanfreebie_result result = new scanfreebie_result();
      receiveBase(result, "scanfreebie");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scanfreebie failed: unknown result");
    }

    public void reshipfreebie(long oldOrderId, long newOrderId, long freebieItemId, ScanType scanType) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_reshipfreebie(oldOrderId, newOrderId, freebieItemId, scanType);
      recv_reshipfreebie();
    }

    public void send_reshipfreebie(long oldOrderId, long newOrderId, long freebieItemId, ScanType scanType) throws org.apache.thrift.TException
    {
      reshipfreebie_args args = new reshipfreebie_args();
      args.setOldOrderId(oldOrderId);
      args.setNewOrderId(newOrderId);
      args.setFreebieItemId(freebieItemId);
      args.setScanType(scanType);
      sendBase("reshipfreebie", args);
    }

    public void recv_reshipfreebie() throws WarehouseServiceException, org.apache.thrift.TException
    {
      reshipfreebie_result result = new reshipfreebie_result();
      receiveBase(result, "reshipfreebie");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public boolean isItemTransferAllowed(long warehouseId, long transferWarehouseId) throws org.apache.thrift.TException
    {
      send_isItemTransferAllowed(warehouseId, transferWarehouseId);
      return recv_isItemTransferAllowed();
    }

    public void send_isItemTransferAllowed(long warehouseId, long transferWarehouseId) throws org.apache.thrift.TException
    {
      isItemTransferAllowed_args args = new isItemTransferAllowed_args();
      args.setWarehouseId(warehouseId);
      args.setTransferWarehouseId(transferWarehouseId);
      sendBase("isItemTransferAllowed", args);
    }

    public boolean recv_isItemTransferAllowed() throws org.apache.thrift.TException
    {
      isItemTransferAllowed_result result = new isItemTransferAllowed_result();
      receiveBase(result, "isItemTransferAllowed");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isItemTransferAllowed failed: unknown result");
    }

    public long createTransferLot(long originWarehouseId, long destWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_createTransferLot(originWarehouseId, destWarehouseId);
      return recv_createTransferLot();
    }

    public void send_createTransferLot(long originWarehouseId, long destWarehouseId) throws org.apache.thrift.TException
    {
      createTransferLot_args args = new createTransferLot_args();
      args.setOriginWarehouseId(originWarehouseId);
      args.setDestWarehouseId(destWarehouseId);
      sendBase("createTransferLot", args);
    }

    public long recv_createTransferLot() throws WarehouseServiceException, org.apache.thrift.TException
    {
      createTransferLot_result result = new createTransferLot_result();
      receiveBase(result, "createTransferLot");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createTransferLot failed: unknown result");
    }

    public TransferLot getTransferLot(long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getTransferLot(transferLotId);
      return recv_getTransferLot();
    }

    public void send_getTransferLot(long transferLotId) throws org.apache.thrift.TException
    {
      getTransferLot_args args = new getTransferLot_args();
      args.setTransferLotId(transferLotId);
      sendBase("getTransferLot", args);
    }

    public TransferLot recv_getTransferLot() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getTransferLot_result result = new getTransferLot_result();
      receiveBase(result, "getTransferLot");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTransferLot failed: unknown result");
    }

    public void markTransferLotAsReceived(long id, String remoteTransferRefNumber) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_markTransferLotAsReceived(id, remoteTransferRefNumber);
      recv_markTransferLotAsReceived();
    }

    public void send_markTransferLotAsReceived(long id, String remoteTransferRefNumber) throws org.apache.thrift.TException
    {
      markTransferLotAsReceived_args args = new markTransferLotAsReceived_args();
      args.setId(id);
      args.setRemoteTransferRefNumber(remoteTransferRefNumber);
      sendBase("markTransferLotAsReceived", args);
    }

    public void recv_markTransferLotAsReceived() throws WarehouseServiceException, org.apache.thrift.TException
    {
      markTransferLotAsReceived_result result = new markTransferLotAsReceived_result();
      receiveBase(result, "markTransferLotAsReceived");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public List<TransferLot> getTransferLotsByDate(long fromDate, long toDate) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getTransferLotsByDate(fromDate, toDate);
      return recv_getTransferLotsByDate();
    }

    public void send_getTransferLotsByDate(long fromDate, long toDate) throws org.apache.thrift.TException
    {
      getTransferLotsByDate_args args = new getTransferLotsByDate_args();
      args.setFromDate(fromDate);
      args.setToDate(toDate);
      sendBase("getTransferLotsByDate", args);
    }

    public List<TransferLot> recv_getTransferLotsByDate() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getTransferLotsByDate_result result = new getTransferLotsByDate_result();
      receiveBase(result, "getTransferLotsByDate");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTransferLotsByDate failed: unknown result");
    }

    public List<Long> getAllowedDestinationWarehousesForTransfer(long warehouseId) throws org.apache.thrift.TException
    {
      send_getAllowedDestinationWarehousesForTransfer(warehouseId);
      return recv_getAllowedDestinationWarehousesForTransfer();
    }

    public void send_getAllowedDestinationWarehousesForTransfer(long warehouseId) throws org.apache.thrift.TException
    {
      getAllowedDestinationWarehousesForTransfer_args args = new getAllowedDestinationWarehousesForTransfer_args();
      args.setWarehouseId(warehouseId);
      sendBase("getAllowedDestinationWarehousesForTransfer", args);
    }

    public List<Long> recv_getAllowedDestinationWarehousesForTransfer() throws org.apache.thrift.TException
    {
      getAllowedDestinationWarehousesForTransfer_result result = new getAllowedDestinationWarehousesForTransfer_result();
      receiveBase(result, "getAllowedDestinationWarehousesForTransfer");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllowedDestinationWarehousesForTransfer failed: unknown result");
    }

    public Map<Long,Long> getItemsInTransferLot(long transferLotId) throws org.apache.thrift.TException
    {
      send_getItemsInTransferLot(transferLotId);
      return recv_getItemsInTransferLot();
    }

    public void send_getItemsInTransferLot(long transferLotId) throws org.apache.thrift.TException
    {
      getItemsInTransferLot_args args = new getItemsInTransferLot_args();
      args.setTransferLotId(transferLotId);
      sendBase("getItemsInTransferLot", args);
    }

    public Map<Long,Long> recv_getItemsInTransferLot() throws org.apache.thrift.TException
    {
      getItemsInTransferLot_result result = new getItemsInTransferLot_result();
      receiveBase(result, "getItemsInTransferLot");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemsInTransferLot failed: unknown result");
    }

    public void markItemsAsReceivedForTransferLot(long id) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_markItemsAsReceivedForTransferLot(id);
      recv_markItemsAsReceivedForTransferLot();
    }

    public void send_markItemsAsReceivedForTransferLot(long id) throws org.apache.thrift.TException
    {
      markItemsAsReceivedForTransferLot_args args = new markItemsAsReceivedForTransferLot_args();
      args.setId(id);
      sendBase("markItemsAsReceivedForTransferLot", args);
    }

    public void recv_markItemsAsReceivedForTransferLot() throws WarehouseServiceException, org.apache.thrift.TException
    {
      markItemsAsReceivedForTransferLot_result result = new markItemsAsReceivedForTransferLot_result();
      receiveBase(result, "markItemsAsReceivedForTransferLot");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public TransferLotStatus updateTransferLotAfterItemReceive(long id) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_updateTransferLotAfterItemReceive(id);
      return recv_updateTransferLotAfterItemReceive();
    }

    public void send_updateTransferLotAfterItemReceive(long id) throws org.apache.thrift.TException
    {
      updateTransferLotAfterItemReceive_args args = new updateTransferLotAfterItemReceive_args();
      args.setId(id);
      sendBase("updateTransferLotAfterItemReceive", args);
    }

    public TransferLotStatus recv_updateTransferLotAfterItemReceive() throws WarehouseServiceException, org.apache.thrift.TException
    {
      updateTransferLotAfterItemReceive_result result = new updateTransferLotAfterItemReceive_result();
      receiveBase(result, "updateTransferLotAfterItemReceive");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateTransferLotAfterItemReceive failed: unknown result");
    }

    public void scanForTransferOut(List<InventoryItem> inventoryItems, ScanType type, long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForTransferOut(inventoryItems, type, transferLotId);
      recv_scanForTransferOut();
    }

    public void send_scanForTransferOut(List<InventoryItem> inventoryItems, ScanType type, long transferLotId) throws org.apache.thrift.TException
    {
      scanForTransferOut_args args = new scanForTransferOut_args();
      args.setInventoryItems(inventoryItems);
      args.setType(type);
      args.setTransferLotId(transferLotId);
      sendBase("scanForTransferOut", args);
    }

    public void recv_scanForTransferOut() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForTransferOut_result result = new scanForTransferOut_result();
      receiveBase(result, "scanForTransferOut");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public void scanForTransferIn(List<InventoryItem> inventoryItems, ScanType type, long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForTransferIn(inventoryItems, type, transferLotId);
      recv_scanForTransferIn();
    }

    public void send_scanForTransferIn(List<InventoryItem> inventoryItems, ScanType type, long transferLotId) throws org.apache.thrift.TException
    {
      scanForTransferIn_args args = new scanForTransferIn_args();
      args.setInventoryItems(inventoryItems);
      args.setType(type);
      args.setTransferLotId(transferLotId);
      sendBase("scanForTransferIn", args);
    }

    public void recv_scanForTransferIn() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForTransferIn_result result = new scanForTransferIn_result();
      receiveBase(result, "scanForTransferIn");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public void scanForOursThirdPartyReceive(List<InventoryItem> inventoryItems, long id) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForOursThirdPartyReceive(inventoryItems, id);
      recv_scanForOursThirdPartyReceive();
    }

    public void send_scanForOursThirdPartyReceive(List<InventoryItem> inventoryItems, long id) throws org.apache.thrift.TException
    {
      scanForOursThirdPartyReceive_args args = new scanForOursThirdPartyReceive_args();
      args.setInventoryItems(inventoryItems);
      args.setId(id);
      sendBase("scanForOursThirdPartyReceive", args);
    }

    public void recv_scanForOursThirdPartyReceive() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForOursThirdPartyReceive_result result = new scanForOursThirdPartyReceive_result();
      receiveBase(result, "scanForOursThirdPartyReceive");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public long getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse(long itemId, long physicalWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse(itemId, physicalWarehouseId);
      return recv_getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse();
    }

    public void send_getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse(long itemId, long physicalWarehouseId) throws org.apache.thrift.TException
    {
      getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args args = new getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args();
      args.setItemId(itemId);
      args.setPhysicalWarehouseId(physicalWarehouseId);
      sendBase("getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse", args);
    }

    public long recv_getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result result = new getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result();
      receiveBase(result, "getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse failed: unknown result");
    }

    public List<InTransitInventory> getInTransitInventory(long originWarehouseId) throws org.apache.thrift.TException
    {
      send_getInTransitInventory(originWarehouseId);
      return recv_getInTransitInventory();
    }

    public void send_getInTransitInventory(long originWarehouseId) throws org.apache.thrift.TException
    {
      getInTransitInventory_args args = new getInTransitInventory_args();
      args.setOriginWarehouseId(originWarehouseId);
      sendBase("getInTransitInventory", args);
    }

    public List<InTransitInventory> recv_getInTransitInventory() throws org.apache.thrift.TException
    {
      getInTransitInventory_result result = new getInTransitInventory_result();
      receiveBase(result, "getInTransitInventory");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInTransitInventory failed: unknown result");
    }

    public boolean isItemAvailableForSale(long itemId, String serialNumber, long warehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_isItemAvailableForSale(itemId, serialNumber, warehouseId);
      return recv_isItemAvailableForSale();
    }

    public void send_isItemAvailableForSale(long itemId, String serialNumber, long warehouseId) throws org.apache.thrift.TException
    {
      isItemAvailableForSale_args args = new isItemAvailableForSale_args();
      args.setItemId(itemId);
      args.setSerialNumber(serialNumber);
      args.setWarehouseId(warehouseId);
      sendBase("isItemAvailableForSale", args);
    }

    public boolean recv_isItemAvailableForSale() throws WarehouseServiceException, org.apache.thrift.TException
    {
      isItemAvailableForSale_result result = new isItemAvailableForSale_result();
      receiveBase(result, "isItemAvailableForSale");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isItemAvailableForSale failed: unknown result");
    }

    public List<InventoryAvailability> getHistoricBadInventoryByScans(long date) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getHistoricBadInventoryByScans(date);
      return recv_getHistoricBadInventoryByScans();
    }

    public void send_getHistoricBadInventoryByScans(long date) throws org.apache.thrift.TException
    {
      getHistoricBadInventoryByScans_args args = new getHistoricBadInventoryByScans_args();
      args.setDate(date);
      sendBase("getHistoricBadInventoryByScans", args);
    }

    public List<InventoryAvailability> recv_getHistoricBadInventoryByScans() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getHistoricBadInventoryByScans_result result = new getHistoricBadInventoryByScans_result();
      receiveBase(result, "getHistoricBadInventoryByScans");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getHistoricBadInventoryByScans failed: unknown result");
    }

    public InventoryItem scanForBadSale(String serialNumber, String itemNumber, long itemId, long orderId, long fulfilmentWarehouseId, long quantity, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForBadSale(serialNumber, itemNumber, itemId, orderId, fulfilmentWarehouseId, quantity, billingWarehouseId);
      return recv_scanForBadSale();
    }

    public void send_scanForBadSale(String serialNumber, String itemNumber, long itemId, long orderId, long fulfilmentWarehouseId, long quantity, long billingWarehouseId) throws org.apache.thrift.TException
    {
      scanForBadSale_args args = new scanForBadSale_args();
      args.setSerialNumber(serialNumber);
      args.setItemNumber(itemNumber);
      args.setItemId(itemId);
      args.setOrderId(orderId);
      args.setFulfilmentWarehouseId(fulfilmentWarehouseId);
      args.setQuantity(quantity);
      args.setBillingWarehouseId(billingWarehouseId);
      sendBase("scanForBadSale", args);
    }

    public InventoryItem recv_scanForBadSale() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForBadSale_result result = new scanForBadSale_result();
      receiveBase(result, "scanForBadSale");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scanForBadSale failed: unknown result");
    }

    public List<InventoryItem> getTransferLotItemsForMarkReceive(long transferLotId, ScanType scanType) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getTransferLotItemsForMarkReceive(transferLotId, scanType);
      return recv_getTransferLotItemsForMarkReceive();
    }

    public void send_getTransferLotItemsForMarkReceive(long transferLotId, ScanType scanType) throws org.apache.thrift.TException
    {
      getTransferLotItemsForMarkReceive_args args = new getTransferLotItemsForMarkReceive_args();
      args.setTransferLotId(transferLotId);
      args.setScanType(scanType);
      sendBase("getTransferLotItemsForMarkReceive", args);
    }

    public List<InventoryItem> recv_getTransferLotItemsForMarkReceive() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getTransferLotItemsForMarkReceive_result result = new getTransferLotItemsForMarkReceive_result();
      receiveBase(result, "getTransferLotItemsForMarkReceive");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTransferLotItemsForMarkReceive failed: unknown result");
    }

    public void markItemsAsReceivedForTransferLotPartial(List<InventoryItem> inventoryItems, long transferLotId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_markItemsAsReceivedForTransferLotPartial(inventoryItems, transferLotId);
      recv_markItemsAsReceivedForTransferLotPartial();
    }

    public void send_markItemsAsReceivedForTransferLotPartial(List<InventoryItem> inventoryItems, long transferLotId) throws org.apache.thrift.TException
    {
      markItemsAsReceivedForTransferLotPartial_args args = new markItemsAsReceivedForTransferLotPartial_args();
      args.setInventoryItems(inventoryItems);
      args.setTransferLotId(transferLotId);
      sendBase("markItemsAsReceivedForTransferLotPartial", args);
    }

    public void recv_markItemsAsReceivedForTransferLotPartial() throws WarehouseServiceException, org.apache.thrift.TException
    {
      markItemsAsReceivedForTransferLotPartial_result result = new markItemsAsReceivedForTransferLotPartial_result();
      receiveBase(result, "markItemsAsReceivedForTransferLotPartial");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public void markTransferLotAsReceivedPartial(long id, String remoteTransferRefNumber) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_markTransferLotAsReceivedPartial(id, remoteTransferRefNumber);
      recv_markTransferLotAsReceivedPartial();
    }

    public void send_markTransferLotAsReceivedPartial(long id, String remoteTransferRefNumber) throws org.apache.thrift.TException
    {
      markTransferLotAsReceivedPartial_args args = new markTransferLotAsReceivedPartial_args();
      args.setId(id);
      args.setRemoteTransferRefNumber(remoteTransferRefNumber);
      sendBase("markTransferLotAsReceivedPartial", args);
    }

    public void recv_markTransferLotAsReceivedPartial() throws WarehouseServiceException, org.apache.thrift.TException
    {
      markTransferLotAsReceivedPartial_result result = new markTransferLotAsReceivedPartial_result();
      receiveBase(result, "markTransferLotAsReceivedPartial");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

    public List<InventoryItem> getInventoryItemScannedInForPO(long itemId, List<Long> purchaseIds) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getInventoryItemScannedInForPO(itemId, purchaseIds);
      return recv_getInventoryItemScannedInForPO();
    }

    public void send_getInventoryItemScannedInForPO(long itemId, List<Long> purchaseIds) throws org.apache.thrift.TException
    {
      getInventoryItemScannedInForPO_args args = new getInventoryItemScannedInForPO_args();
      args.setItemId(itemId);
      args.setPurchaseIds(purchaseIds);
      sendBase("getInventoryItemScannedInForPO", args);
    }

    public List<InventoryItem> recv_getInventoryItemScannedInForPO() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getInventoryItemScannedInForPO_result result = new getInventoryItemScannedInForPO_result();
      receiveBase(result, "getInventoryItemScannedInForPO");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryItemScannedInForPO failed: unknown result");
    }

    public List<AmazonTransferredSkuDetail> getAmazonTransferredSkuDetails(List<Long> itemIds) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getAmazonTransferredSkuDetails(itemIds);
      return recv_getAmazonTransferredSkuDetails();
    }

    public void send_getAmazonTransferredSkuDetails(List<Long> itemIds) throws org.apache.thrift.TException
    {
      getAmazonTransferredSkuDetails_args args = new getAmazonTransferredSkuDetails_args();
      args.setItemIds(itemIds);
      sendBase("getAmazonTransferredSkuDetails", args);
    }

    public List<AmazonTransferredSkuDetail> recv_getAmazonTransferredSkuDetails() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getAmazonTransferredSkuDetails_result result = new getAmazonTransferredSkuDetails_result();
      receiveBase(result, "getAmazonTransferredSkuDetails");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAmazonTransferredSkuDetails failed: unknown result");
    }

    public List<Scan> getScansforPurchase(long purchaseId, ScanType scanType) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getScansforPurchase(purchaseId, scanType);
      return recv_getScansforPurchase();
    }

    public void send_getScansforPurchase(long purchaseId, ScanType scanType) throws org.apache.thrift.TException
    {
      getScansforPurchase_args args = new getScansforPurchase_args();
      args.setPurchaseId(purchaseId);
      args.setScanType(scanType);
      sendBase("getScansforPurchase", args);
    }

    public List<Scan> recv_getScansforPurchase() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getScansforPurchase_result result = new getScansforPurchase_result();
      receiveBase(result, "getScansforPurchase");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getScansforPurchase failed: unknown result");
    }

    public long getCurrentBadQuantityForItem(long itemId, long currentWarehouseId, long physicalWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getCurrentBadQuantityForItem(itemId, currentWarehouseId, physicalWarehouseId);
      return recv_getCurrentBadQuantityForItem();
    }

    public void send_getCurrentBadQuantityForItem(long itemId, long currentWarehouseId, long physicalWarehouseId) throws org.apache.thrift.TException
    {
      getCurrentBadQuantityForItem_args args = new getCurrentBadQuantityForItem_args();
      args.setItemId(itemId);
      args.setCurrentWarehouseId(currentWarehouseId);
      args.setPhysicalWarehouseId(physicalWarehouseId);
      sendBase("getCurrentBadQuantityForItem", args);
    }

    public long recv_getCurrentBadQuantityForItem() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getCurrentBadQuantityForItem_result result = new getCurrentBadQuantityForItem_result();
      receiveBase(result, "getCurrentBadQuantityForItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCurrentBadQuantityForItem failed: unknown result");
    }

    public long scanForBadPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForBadPurchaseReturn(saleReturnItems, vendorId, billingWarehouseId);
      return recv_scanForBadPurchaseReturn();
    }

    public void send_scanForBadPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId) throws org.apache.thrift.TException
    {
      scanForBadPurchaseReturn_args args = new scanForBadPurchaseReturn_args();
      args.setSaleReturnItems(saleReturnItems);
      args.setVendorId(vendorId);
      args.setBillingWarehouseId(billingWarehouseId);
      sendBase("scanForBadPurchaseReturn", args);
    }

    public long recv_scanForBadPurchaseReturn() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForBadPurchaseReturn_result result = new scanForBadPurchaseReturn_result();
      receiveBase(result, "scanForBadPurchaseReturn");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scanForBadPurchaseReturn failed: unknown result");
    }

    public Map<Long,Long> getItemsInPurchaseReturn(long purchaseReturnId, ScanType type, String returnTime) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getItemsInPurchaseReturn(purchaseReturnId, type, returnTime);
      return recv_getItemsInPurchaseReturn();
    }

    public void send_getItemsInPurchaseReturn(long purchaseReturnId, ScanType type, String returnTime) throws org.apache.thrift.TException
    {
      getItemsInPurchaseReturn_args args = new getItemsInPurchaseReturn_args();
      args.setPurchaseReturnId(purchaseReturnId);
      args.setType(type);
      args.setReturnTime(returnTime);
      sendBase("getItemsInPurchaseReturn", args);
    }

    public Map<Long,Long> recv_getItemsInPurchaseReturn() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getItemsInPurchaseReturn_result result = new getItemsInPurchaseReturn_result();
      receiveBase(result, "getItemsInPurchaseReturn");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemsInPurchaseReturn failed: unknown result");
    }

    public List<Scan> getScansForInventoryItem(long inventoryItemId, ScanType type) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getScansForInventoryItem(inventoryItemId, type);
      return recv_getScansForInventoryItem();
    }

    public void send_getScansForInventoryItem(long inventoryItemId, ScanType type) throws org.apache.thrift.TException
    {
      getScansForInventoryItem_args args = new getScansForInventoryItem_args();
      args.setInventoryItemId(inventoryItemId);
      args.setType(type);
      sendBase("getScansForInventoryItem", args);
    }

    public List<Scan> recv_getScansForInventoryItem() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getScansForInventoryItem_result result = new getScansForInventoryItem_result();
      receiveBase(result, "getScansForInventoryItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getScansForInventoryItem failed: unknown result");
    }

    public List<String> checkGrnImeiStatus(List<String> imeiNos) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_checkGrnImeiStatus(imeiNos);
      return recv_checkGrnImeiStatus();
    }

    public void send_checkGrnImeiStatus(List<String> imeiNos) throws org.apache.thrift.TException
    {
      checkGrnImeiStatus_args args = new checkGrnImeiStatus_args();
      args.setImeiNos(imeiNos);
      sendBase("checkGrnImeiStatus", args);
    }

    public List<String> recv_checkGrnImeiStatus() throws WarehouseServiceException, org.apache.thrift.TException
    {
      checkGrnImeiStatus_result result = new checkGrnImeiStatus_result();
      receiveBase(result, "checkGrnImeiStatus");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkGrnImeiStatus failed: unknown result");
    }

    public List<InvAgeConsiderItems> getInventoryAgeConsideredItems(long itemId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getInventoryAgeConsideredItems(itemId);
      return recv_getInventoryAgeConsideredItems();
    }

    public void send_getInventoryAgeConsideredItems(long itemId) throws org.apache.thrift.TException
    {
      getInventoryAgeConsideredItems_args args = new getInventoryAgeConsideredItems_args();
      args.setItemId(itemId);
      sendBase("getInventoryAgeConsideredItems", args);
    }

    public List<InvAgeConsiderItems> recv_getInventoryAgeConsideredItems() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getInventoryAgeConsideredItems_result result = new getInventoryAgeConsideredItems_result();
      receiveBase(result, "getInventoryAgeConsideredItems");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryAgeConsideredItems failed: unknown result");
    }

    public List<InventoryMovement> getCompleteMovementForThirdPartyWarehouse(long startDate, long endDate) throws org.apache.thrift.TException
    {
      send_getCompleteMovementForThirdPartyWarehouse(startDate, endDate);
      return recv_getCompleteMovementForThirdPartyWarehouse();
    }

    public void send_getCompleteMovementForThirdPartyWarehouse(long startDate, long endDate) throws org.apache.thrift.TException
    {
      getCompleteMovementForThirdPartyWarehouse_args args = new getCompleteMovementForThirdPartyWarehouse_args();
      args.setStartDate(startDate);
      args.setEndDate(endDate);
      sendBase("getCompleteMovementForThirdPartyWarehouse", args);
    }

    public List<InventoryMovement> recv_getCompleteMovementForThirdPartyWarehouse() throws org.apache.thrift.TException
    {
      getCompleteMovementForThirdPartyWarehouse_result result = new getCompleteMovementForThirdPartyWarehouse_result();
      receiveBase(result, "getCompleteMovementForThirdPartyWarehouse");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCompleteMovementForThirdPartyWarehouse failed: unknown result");
    }

    public List<DoaOutInventoryItem> getAllDoaOutInventoryItems() throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getAllDoaOutInventoryItems();
      return recv_getAllDoaOutInventoryItems();
    }

    public void send_getAllDoaOutInventoryItems() throws org.apache.thrift.TException
    {
      getAllDoaOutInventoryItems_args args = new getAllDoaOutInventoryItems_args();
      sendBase("getAllDoaOutInventoryItems", args);
    }

    public List<DoaOutInventoryItem> recv_getAllDoaOutInventoryItems() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getAllDoaOutInventoryItems_result result = new getAllDoaOutInventoryItems_result();
      receiveBase(result, "getAllDoaOutInventoryItems");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllDoaOutInventoryItems failed: unknown result");
    }

    public List<RemovalStockShipmentReference> getAllUnCompletedStockShipments(String source) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getAllUnCompletedStockShipments(source);
      return recv_getAllUnCompletedStockShipments();
    }

    public void send_getAllUnCompletedStockShipments(String source) throws org.apache.thrift.TException
    {
      getAllUnCompletedStockShipments_args args = new getAllUnCompletedStockShipments_args();
      args.setSource(source);
      sendBase("getAllUnCompletedStockShipments", args);
    }

    public List<RemovalStockShipmentReference> recv_getAllUnCompletedStockShipments() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getAllUnCompletedStockShipments_result result = new getAllUnCompletedStockShipments_result();
      receiveBase(result, "getAllUnCompletedStockShipments");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllUnCompletedStockShipments failed: unknown result");
    }

    public RemovalStockShipmentReference getRemovalStockShipmentReferenceById(long id) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getRemovalStockShipmentReferenceById(id);
      return recv_getRemovalStockShipmentReferenceById();
    }

    public void send_getRemovalStockShipmentReferenceById(long id) throws org.apache.thrift.TException
    {
      getRemovalStockShipmentReferenceById_args args = new getRemovalStockShipmentReferenceById_args();
      args.setId(id);
      sendBase("getRemovalStockShipmentReferenceById", args);
    }

    public RemovalStockShipmentReference recv_getRemovalStockShipmentReferenceById() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getRemovalStockShipmentReferenceById_result result = new getRemovalStockShipmentReferenceById_result();
      receiveBase(result, "getRemovalStockShipmentReferenceById");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRemovalStockShipmentReferenceById failed: unknown result");
    }

    public long createRemovalStockShipmentReference(RemovalStockShipmentReference removalStockShipmentReference) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_createRemovalStockShipmentReference(removalStockShipmentReference);
      return recv_createRemovalStockShipmentReference();
    }

    public void send_createRemovalStockShipmentReference(RemovalStockShipmentReference removalStockShipmentReference) throws org.apache.thrift.TException
    {
      createRemovalStockShipmentReference_args args = new createRemovalStockShipmentReference_args();
      args.setRemovalStockShipmentReference(removalStockShipmentReference);
      sendBase("createRemovalStockShipmentReference", args);
    }

    public long recv_createRemovalStockShipmentReference() throws WarehouseServiceException, org.apache.thrift.TException
    {
      createRemovalStockShipmentReference_result result = new createRemovalStockShipmentReference_result();
      receiveBase(result, "createRemovalStockShipmentReference");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createRemovalStockShipmentReference failed: unknown result");
    }

    public void updateShipmentReferenceTransferLot(long transferLotId, long shipmentReferenceId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_updateShipmentReferenceTransferLot(transferLotId, shipmentReferenceId);
      recv_updateShipmentReferenceTransferLot();
    }

    public void send_updateShipmentReferenceTransferLot(long transferLotId, long shipmentReferenceId) throws org.apache.thrift.TException
    {
      updateShipmentReferenceTransferLot_args args = new updateShipmentReferenceTransferLot_args();
      args.setTransferLotId(transferLotId);
      args.setShipmentReferenceId(shipmentReferenceId);
      sendBase("updateShipmentReferenceTransferLot", args);
    }

    public void recv_updateShipmentReferenceTransferLot() throws WarehouseServiceException, org.apache.thrift.TException
    {
      updateShipmentReferenceTransferLot_result result = new updateShipmentReferenceTransferLot_result();
      receiveBase(result, "updateShipmentReferenceTransferLot");
      if (result.ex != null) {
        throw result.ex;
      }
      return;
    }

    public List<TransferInvoiceScan> fetchScansPerTransferInvoiceNumber(long date) throws org.apache.thrift.TException
    {
      send_fetchScansPerTransferInvoiceNumber(date);
      return recv_fetchScansPerTransferInvoiceNumber();
    }

    public void send_fetchScansPerTransferInvoiceNumber(long date) throws org.apache.thrift.TException
    {
      fetchScansPerTransferInvoiceNumber_args args = new fetchScansPerTransferInvoiceNumber_args();
      args.setDate(date);
      sendBase("fetchScansPerTransferInvoiceNumber", args);
    }

    public List<TransferInvoiceScan> recv_fetchScansPerTransferInvoiceNumber() throws org.apache.thrift.TException
    {
      fetchScansPerTransferInvoiceNumber_result result = new fetchScansPerTransferInvoiceNumber_result();
      receiveBase(result, "fetchScansPerTransferInvoiceNumber");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchScansPerTransferInvoiceNumber failed: unknown result");
    }

    public List<InventoryItem> getInventoryItems(List<String> serialNumbers) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getInventoryItems(serialNumbers);
      return recv_getInventoryItems();
    }

    public void send_getInventoryItems(List<String> serialNumbers) throws org.apache.thrift.TException
    {
      getInventoryItems_args args = new getInventoryItems_args();
      args.setSerialNumbers(serialNumbers);
      sendBase("getInventoryItems", args);
    }

    public List<InventoryItem> recv_getInventoryItems() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getInventoryItems_result result = new getInventoryItems_result();
      receiveBase(result, "getInventoryItems");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryItems failed: unknown result");
    }

    public List<InventoryItem> getInventoryItemsBySerailNumbers(List<String> serialNumbers) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getInventoryItemsBySerailNumbers(serialNumbers);
      return recv_getInventoryItemsBySerailNumbers();
    }

    public void send_getInventoryItemsBySerailNumbers(List<String> serialNumbers) throws org.apache.thrift.TException
    {
      getInventoryItemsBySerailNumbers_args args = new getInventoryItemsBySerailNumbers_args();
      args.setSerialNumbers(serialNumbers);
      sendBase("getInventoryItemsBySerailNumbers", args);
    }

    public List<InventoryItem> recv_getInventoryItemsBySerailNumbers() throws WarehouseServiceException, org.apache.thrift.TException
    {
      getInventoryItemsBySerailNumbers_result result = new getInventoryItemsBySerailNumbers_result();
      receiveBase(result, "getInventoryItemsBySerailNumbers");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.wex != null) {
        throw result.wex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryItemsBySerailNumbers failed: unknown result");
    }

    public void scanPurchaseBulk(List<InventoryItem> inventoryItems) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanPurchaseBulk(inventoryItems);
      recv_scanPurchaseBulk();
    }

    public void send_scanPurchaseBulk(List<InventoryItem> inventoryItems) throws org.apache.thrift.TException
    {
      scanPurchaseBulk_args args = new scanPurchaseBulk_args();
      args.setInventoryItems(inventoryItems);
      sendBase("scanPurchaseBulk", args);
    }

    public void recv_scanPurchaseBulk() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanPurchaseBulk_result result = new scanPurchaseBulk_result();
      receiveBase(result, "scanPurchaseBulk");
      if (result.wex != null) {
        throw result.wex;
      }
      return;
    }

  }
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
      private org.apache.thrift.async.TAsyncClientManager clientManager;
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
        this.clientManager = clientManager;
        this.protocolFactory = protocolFactory;
      }
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
        return new AsyncClient(protocolFactory, clientManager, transport);
      }
    }

    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
      super(protocolFactory, clientManager, transport);
    }

    public void getInventoryItem(String serialNumber, org.apache.thrift.async.AsyncMethodCallback<getInventoryItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryItem_call method_call = new getInventoryItem_call(serialNumber, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String serialNumber;
      public getInventoryItem_call(String serialNumber, org.apache.thrift.async.AsyncMethodCallback<getInventoryItem_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.serialNumber = serialNumber;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryItem", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryItem_args args = new getInventoryItem_args();
        args.setSerialNumber(serialNumber);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryItem();
      }
    }

    public void getNonSeralizedInventoryItem(String itemNumber, long itemId, long fulfilmentWarehouseId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getNonSeralizedInventoryItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getNonSeralizedInventoryItem_call method_call = new getNonSeralizedInventoryItem_call(itemNumber, itemId, fulfilmentWarehouseId, billingWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getNonSeralizedInventoryItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String itemNumber;
      private long itemId;
      private long fulfilmentWarehouseId;
      private long billingWarehouseId;
      public getNonSeralizedInventoryItem_call(String itemNumber, long itemId, long fulfilmentWarehouseId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getNonSeralizedInventoryItem_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemNumber = itemNumber;
        this.itemId = itemId;
        this.fulfilmentWarehouseId = fulfilmentWarehouseId;
        this.billingWarehouseId = billingWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getNonSeralizedInventoryItem", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getNonSeralizedInventoryItem_args args = new getNonSeralizedInventoryItem_args();
        args.setItemNumber(itemNumber);
        args.setItemId(itemId);
        args.setFulfilmentWarehouseId(fulfilmentWarehouseId);
        args.setBillingWarehouseId(billingWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getNonSeralizedInventoryItem();
      }
    }

    public void scan(InventoryItem inventoryItem, ScanType type, long quantity, long billingWarehouseId, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<scan_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scan_call method_call = new scan_call(inventoryItem, type, quantity, billingWarehouseId, transferLotId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scan_call extends org.apache.thrift.async.TAsyncMethodCall {
      private InventoryItem inventoryItem;
      private ScanType type;
      private long quantity;
      private long billingWarehouseId;
      private long transferLotId;
      public scan_call(InventoryItem inventoryItem, ScanType type, long quantity, long billingWarehouseId, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<scan_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItem = inventoryItem;
        this.type = type;
        this.quantity = quantity;
        this.billingWarehouseId = billingWarehouseId;
        this.transferLotId = transferLotId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scan", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scan_args args = new scan_args();
        args.setInventoryItem(inventoryItem);
        args.setType(type);
        args.setQuantity(quantity);
        args.setBillingWarehouseId(billingWarehouseId);
        args.setTransferLotId(transferLotId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_scan();
      }
    }

    public void genericScan(InventoryItem inventoryItem, Scan scan, org.apache.thrift.async.AsyncMethodCallback<genericScan_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      genericScan_call method_call = new genericScan_call(inventoryItem, scan, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class genericScan_call extends org.apache.thrift.async.TAsyncMethodCall {
      private InventoryItem inventoryItem;
      private Scan scan;
      public genericScan_call(InventoryItem inventoryItem, Scan scan, org.apache.thrift.async.AsyncMethodCallback<genericScan_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItem = inventoryItem;
        this.scan = scan;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("genericScan", org.apache.thrift.protocol.TMessageType.CALL, 0));
        genericScan_args args = new genericScan_args();
        args.setInventoryItem(inventoryItem);
        args.setScan(scan);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_genericScan();
      }
    }

    public void scanSerializedItemForOrder(String serialNumber, ScanType type, long orderId, long fulfilmentWarehouseId, double quantity, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanSerializedItemForOrder_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanSerializedItemForOrder_call method_call = new scanSerializedItemForOrder_call(serialNumber, type, orderId, fulfilmentWarehouseId, quantity, billingWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanSerializedItemForOrder_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String serialNumber;
      private ScanType type;
      private long orderId;
      private long fulfilmentWarehouseId;
      private double quantity;
      private long billingWarehouseId;
      public scanSerializedItemForOrder_call(String serialNumber, ScanType type, long orderId, long fulfilmentWarehouseId, double quantity, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanSerializedItemForOrder_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.serialNumber = serialNumber;
        this.type = type;
        this.orderId = orderId;
        this.fulfilmentWarehouseId = fulfilmentWarehouseId;
        this.quantity = quantity;
        this.billingWarehouseId = billingWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanSerializedItemForOrder", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanSerializedItemForOrder_args args = new scanSerializedItemForOrder_args();
        args.setSerialNumber(serialNumber);
        args.setType(type);
        args.setOrderId(orderId);
        args.setFulfilmentWarehouseId(fulfilmentWarehouseId);
        args.setQuantity(quantity);
        args.setBillingWarehouseId(billingWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_scanSerializedItemForOrder();
      }
    }

    public void scanForOrder(InventoryItem inventoryItem, ScanType type, long quantity, long orderId, long fulfilmentWarehouseId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForOrder_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForOrder_call method_call = new scanForOrder_call(inventoryItem, type, quantity, orderId, fulfilmentWarehouseId, billingWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForOrder_call extends org.apache.thrift.async.TAsyncMethodCall {
      private InventoryItem inventoryItem;
      private ScanType type;
      private long quantity;
      private long orderId;
      private long fulfilmentWarehouseId;
      private long billingWarehouseId;
      public scanForOrder_call(InventoryItem inventoryItem, ScanType type, long quantity, long orderId, long fulfilmentWarehouseId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForOrder_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItem = inventoryItem;
        this.type = type;
        this.quantity = quantity;
        this.orderId = orderId;
        this.fulfilmentWarehouseId = fulfilmentWarehouseId;
        this.billingWarehouseId = billingWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForOrder", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForOrder_args args = new scanForOrder_args();
        args.setInventoryItem(inventoryItem);
        args.setType(type);
        args.setQuantity(quantity);
        args.setOrderId(orderId);
        args.setFulfilmentWarehouseId(fulfilmentWarehouseId);
        args.setBillingWarehouseId(billingWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_scanForOrder();
      }
    }

    public void createItemNumberMapping(String itemNumber, long itemId, org.apache.thrift.async.AsyncMethodCallback<createItemNumberMapping_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      createItemNumberMapping_call method_call = new createItemNumberMapping_call(itemNumber, itemId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class createItemNumberMapping_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String itemNumber;
      private long itemId;
      public createItemNumberMapping_call(String itemNumber, long itemId, org.apache.thrift.async.AsyncMethodCallback<createItemNumberMapping_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemNumber = itemNumber;
        this.itemId = itemId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createItemNumberMapping", org.apache.thrift.protocol.TMessageType.CALL, 0));
        createItemNumberMapping_args args = new createItemNumberMapping_args();
        args.setItemNumber(itemNumber);
        args.setItemId(itemId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_createItemNumberMapping();
      }
    }

    public void getItemNumbers(long itemId, org.apache.thrift.async.AsyncMethodCallback<getItemNumbers_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getItemNumbers_call method_call = new getItemNumbers_call(itemId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getItemNumbers_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      public getItemNumbers_call(long itemId, org.apache.thrift.async.AsyncMethodCallback<getItemNumbers_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemId = itemId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemNumbers", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemNumbers_args args = new getItemNumbers_args();
        args.setItemId(itemId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<String> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getItemNumbers();
      }
    }

    public void getItemIds(String itemNumber, org.apache.thrift.async.AsyncMethodCallback<getItemIds_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getItemIds_call method_call = new getItemIds_call(itemNumber, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getItemIds_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String itemNumber;
      public getItemIds_call(String itemNumber, org.apache.thrift.async.AsyncMethodCallback<getItemIds_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemNumber = itemNumber;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemIds", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemIds_args args = new getItemIds_args();
        args.setItemNumber(itemNumber);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Long> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getItemIds();
      }
    }

    public void getInventoryItemsFromLastScanType(ScanType lastScanType, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemsFromLastScanType_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryItemsFromLastScanType_call method_call = new getInventoryItemsFromLastScanType_call(lastScanType, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryItemsFromLastScanType_call extends org.apache.thrift.async.TAsyncMethodCall {
      private ScanType lastScanType;
      public getInventoryItemsFromLastScanType_call(ScanType lastScanType, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemsFromLastScanType_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.lastScanType = lastScanType;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryItemsFromLastScanType", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryItemsFromLastScanType_args args = new getInventoryItemsFromLastScanType_args();
        args.setLastScanType(lastScanType);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryItem> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryItemsFromLastScanType();
      }
    }

    public void getInventoryItemFromId(long inventoryItemId, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemFromId_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryItemFromId_call method_call = new getInventoryItemFromId_call(inventoryItemId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryItemFromId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long inventoryItemId;
      public getInventoryItemFromId_call(long inventoryItemId, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemFromId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItemId = inventoryItemId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryItemFromId", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryItemFromId_args args = new getInventoryItemFromId_args();
        args.setInventoryItemId(inventoryItemId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryItemFromId();
      }
    }

    public void getPurchaseScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getPurchaseScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPurchaseScans_call method_call = new getPurchaseScans_call(startDate, endDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPurchaseScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long startDate;
      private long endDate;
      public getPurchaseScans_call(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getPurchaseScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.startDate = startDate;
        this.endDate = endDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPurchaseScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPurchaseScans_args args = new getPurchaseScans_args();
        args.setStartDate(startDate);
        args.setEndDate(endDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<DetailedPurchaseScan> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPurchaseScans();
      }
    }

    public void getPurchaseScansByGrnDate(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getPurchaseScansByGrnDate_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPurchaseScansByGrnDate_call method_call = new getPurchaseScansByGrnDate_call(startDate, endDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPurchaseScansByGrnDate_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long startDate;
      private long endDate;
      public getPurchaseScansByGrnDate_call(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getPurchaseScansByGrnDate_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.startDate = startDate;
        this.endDate = endDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPurchaseScansByGrnDate", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPurchaseScansByGrnDate_args args = new getPurchaseScansByGrnDate_args();
        args.setStartDate(startDate);
        args.setEndDate(endDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<DetailedPurchaseScan> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPurchaseScansByGrnDate();
      }
    }

    public void getEmptyGrnsByDate(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getEmptyGrnsByDate_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getEmptyGrnsByDate_call method_call = new getEmptyGrnsByDate_call(startDate, endDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getEmptyGrnsByDate_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long startDate;
      private long endDate;
      public getEmptyGrnsByDate_call(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getEmptyGrnsByDate_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.startDate = startDate;
        this.endDate = endDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getEmptyGrnsByDate", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getEmptyGrnsByDate_args args = new getEmptyGrnsByDate_args();
        args.setStartDate(startDate);
        args.setEndDate(endDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Long> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getEmptyGrnsByDate();
      }
    }

    public void fetchScansPerInvoiceNumber(long date, org.apache.thrift.async.AsyncMethodCallback<fetchScansPerInvoiceNumber_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      fetchScansPerInvoiceNumber_call method_call = new fetchScansPerInvoiceNumber_call(date, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class fetchScansPerInvoiceNumber_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long date;
      public fetchScansPerInvoiceNumber_call(long date, org.apache.thrift.async.AsyncMethodCallback<fetchScansPerInvoiceNumber_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.date = date;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchScansPerInvoiceNumber", org.apache.thrift.protocol.TMessageType.CALL, 0));
        fetchScansPerInvoiceNumber_args args = new fetchScansPerInvoiceNumber_args();
        args.setDate(date);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InvoiceScan> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_fetchScansPerInvoiceNumber();
      }
    }

    public void getInventoryItemFromOrder(long orderId, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemFromOrder_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryItemFromOrder_call method_call = new getInventoryItemFromOrder_call(orderId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryItemFromOrder_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long orderId;
      public getInventoryItemFromOrder_call(long orderId, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemFromOrder_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.orderId = orderId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryItemFromOrder", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryItemFromOrder_args args = new getInventoryItemFromOrder_args();
        args.setOrderId(orderId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryItemFromOrder();
      }
    }

    public void getInventoryAge(org.apache.thrift.async.AsyncMethodCallback<getInventoryAge_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryAge_call method_call = new getInventoryAge_call(resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryAge_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getInventoryAge_call(org.apache.thrift.async.AsyncMethodCallback<getInventoryAge_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryAge", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryAge_args args = new getInventoryAge_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryAge> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryAge();
      }
    }

    public void getInventoryScansForItem(long itemId, long fromDate, long toDate, org.apache.thrift.async.AsyncMethodCallback<getInventoryScansForItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryScansForItem_call method_call = new getInventoryScansForItem_call(itemId, fromDate, toDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryScansForItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private long fromDate;
      private long toDate;
      public getInventoryScansForItem_call(long itemId, long fromDate, long toDate, org.apache.thrift.async.AsyncMethodCallback<getInventoryScansForItem_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemId = itemId;
        this.fromDate = fromDate;
        this.toDate = toDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryScansForItem", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryScansForItem_args args = new getInventoryScansForItem_args();
        args.setItemId(itemId);
        args.setFromDate(fromDate);
        args.setToDate(toDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Scan> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryScansForItem();
      }
    }

    public void getScanRecordsForSerialNumber(String serialNumber, org.apache.thrift.async.AsyncMethodCallback<getScanRecordsForSerialNumber_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getScanRecordsForSerialNumber_call method_call = new getScanRecordsForSerialNumber_call(serialNumber, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getScanRecordsForSerialNumber_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String serialNumber;
      public getScanRecordsForSerialNumber_call(String serialNumber, org.apache.thrift.async.AsyncMethodCallback<getScanRecordsForSerialNumber_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.serialNumber = serialNumber;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getScanRecordsForSerialNumber", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getScanRecordsForSerialNumber_args args = new getScanRecordsForSerialNumber_args();
        args.setSerialNumber(serialNumber);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Scan> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getScanRecordsForSerialNumber();
      }
    }

    public void scanForPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForPurchaseReturn_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForPurchaseReturn_call method_call = new scanForPurchaseReturn_call(saleReturnItems, vendorId, billingWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForPurchaseReturn_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<InventoryItem> saleReturnItems;
      private long vendorId;
      private long billingWarehouseId;
      public scanForPurchaseReturn_call(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForPurchaseReturn_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.saleReturnItems = saleReturnItems;
        this.vendorId = vendorId;
        this.billingWarehouseId = billingWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForPurchaseReturn", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForPurchaseReturn_args args = new scanForPurchaseReturn_args();
        args.setSaleReturnItems(saleReturnItems);
        args.setVendorId(vendorId);
        args.setBillingWarehouseId(billingWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_scanForPurchaseReturn();
      }
    }

    public void scanForLostItem(List<InventoryItem> lostItems, long vendorId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForLostItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForLostItem_call method_call = new scanForLostItem_call(lostItems, vendorId, billingWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForLostItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<InventoryItem> lostItems;
      private long vendorId;
      private long billingWarehouseId;
      public scanForLostItem_call(List<InventoryItem> lostItems, long vendorId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForLostItem_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.lostItems = lostItems;
        this.vendorId = vendorId;
        this.billingWarehouseId = billingWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForLostItem", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForLostItem_args args = new scanForLostItem_args();
        args.setLostItems(lostItems);
        args.setVendorId(vendorId);
        args.setBillingWarehouseId(billingWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_scanForLostItem();
      }
    }

    public void getCurrentSerializedInventoryByScans(long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getCurrentSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCurrentSerializedInventoryByScans_call method_call = new getCurrentSerializedInventoryByScans_call(physicalWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCurrentSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long physicalWarehouseId;
      public getCurrentSerializedInventoryByScans_call(long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getCurrentSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.physicalWarehouseId = physicalWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCurrentSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCurrentSerializedInventoryByScans_args args = new getCurrentSerializedInventoryByScans_args();
        args.setPhysicalWarehouseId(physicalWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryAvailability> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCurrentSerializedInventoryByScans();
      }
    }

    public void getCurrentNonSerializedInventoryByScans(long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getCurrentNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCurrentNonSerializedInventoryByScans_call method_call = new getCurrentNonSerializedInventoryByScans_call(physicalWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCurrentNonSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long physicalWarehouseId;
      public getCurrentNonSerializedInventoryByScans_call(long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getCurrentNonSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.physicalWarehouseId = physicalWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCurrentNonSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCurrentNonSerializedInventoryByScans_args args = new getCurrentNonSerializedInventoryByScans_args();
        args.setPhysicalWarehouseId(physicalWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryAvailability> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCurrentNonSerializedInventoryByScans();
      }
    }

    public void getHistoricSerializedInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<getHistoricSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getHistoricSerializedInventoryByScans_call method_call = new getHistoricSerializedInventoryByScans_call(date, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getHistoricSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long date;
      public getHistoricSerializedInventoryByScans_call(long date, org.apache.thrift.async.AsyncMethodCallback<getHistoricSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.date = date;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getHistoricSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getHistoricSerializedInventoryByScans_args args = new getHistoricSerializedInventoryByScans_args();
        args.setDate(date);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryAvailability> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getHistoricSerializedInventoryByScans();
      }
    }

    public void getHistoricNonSerializedInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<getHistoricNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getHistoricNonSerializedInventoryByScans_call method_call = new getHistoricNonSerializedInventoryByScans_call(date, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getHistoricNonSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long date;
      public getHistoricNonSerializedInventoryByScans_call(long date, org.apache.thrift.async.AsyncMethodCallback<getHistoricNonSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.date = date;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getHistoricNonSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getHistoricNonSerializedInventoryByScans_args args = new getHistoricNonSerializedInventoryByScans_args();
        args.setDate(date);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryAvailability> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getHistoricNonSerializedInventoryByScans();
      }
    }

    public void getOurHistoricSerializedInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<getOurHistoricSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getOurHistoricSerializedInventoryByScans_call method_call = new getOurHistoricSerializedInventoryByScans_call(date, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getOurHistoricSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long date;
      public getOurHistoricSerializedInventoryByScans_call(long date, org.apache.thrift.async.AsyncMethodCallback<getOurHistoricSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.date = date;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getOurHistoricSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getOurHistoricSerializedInventoryByScans_args args = new getOurHistoricSerializedInventoryByScans_args();
        args.setDate(date);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryAvailability> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getOurHistoricSerializedInventoryByScans();
      }
    }

    public void getOurHistoricNonSerializedInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<getOurHistoricNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getOurHistoricNonSerializedInventoryByScans_call method_call = new getOurHistoricNonSerializedInventoryByScans_call(date, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getOurHistoricNonSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long date;
      public getOurHistoricNonSerializedInventoryByScans_call(long date, org.apache.thrift.async.AsyncMethodCallback<getOurHistoricNonSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.date = date;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getOurHistoricNonSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getOurHistoricNonSerializedInventoryByScans_args args = new getOurHistoricNonSerializedInventoryByScans_args();
        args.setDate(date);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryAvailability> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getOurHistoricNonSerializedInventoryByScans();
      }
    }

    public void scanForOursExternalSale(long itemId, String serialNumber, String itemNumber, String invoiceNumber, long warehouseId, double unitPrice, double nlc, long orderId, org.apache.thrift.async.AsyncMethodCallback<scanForOursExternalSale_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForOursExternalSale_call method_call = new scanForOursExternalSale_call(itemId, serialNumber, itemNumber, invoiceNumber, warehouseId, unitPrice, nlc, orderId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForOursExternalSale_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private String serialNumber;
      private String itemNumber;
      private String invoiceNumber;
      private long warehouseId;
      private double unitPrice;
      private double nlc;
      private long orderId;
      public scanForOursExternalSale_call(long itemId, String serialNumber, String itemNumber, String invoiceNumber, long warehouseId, double unitPrice, double nlc, long orderId, org.apache.thrift.async.AsyncMethodCallback<scanForOursExternalSale_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemId = itemId;
        this.serialNumber = serialNumber;
        this.itemNumber = itemNumber;
        this.invoiceNumber = invoiceNumber;
        this.warehouseId = warehouseId;
        this.unitPrice = unitPrice;
        this.nlc = nlc;
        this.orderId = orderId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForOursExternalSale", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForOursExternalSale_args args = new scanForOursExternalSale_args();
        args.setItemId(itemId);
        args.setSerialNumber(serialNumber);
        args.setItemNumber(itemNumber);
        args.setInvoiceNumber(invoiceNumber);
        args.setWarehouseId(warehouseId);
        args.setUnitPrice(unitPrice);
        args.setNlc(nlc);
        args.setOrderId(orderId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_scanForOursExternalSale();
      }
    }

    public void scanForOursExternalSaleReturn(long orderId, double unitPrice, org.apache.thrift.async.AsyncMethodCallback<scanForOursExternalSaleReturn_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForOursExternalSaleReturn_call method_call = new scanForOursExternalSaleReturn_call(orderId, unitPrice, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForOursExternalSaleReturn_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long orderId;
      private double unitPrice;
      public scanForOursExternalSaleReturn_call(long orderId, double unitPrice, org.apache.thrift.async.AsyncMethodCallback<scanForOursExternalSaleReturn_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.orderId = orderId;
        this.unitPrice = unitPrice;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForOursExternalSaleReturn", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForOursExternalSaleReturn_args args = new scanForOursExternalSaleReturn_args();
        args.setOrderId(orderId);
        args.setUnitPrice(unitPrice);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_scanForOursExternalSaleReturn();
      }
    }

    public void getMovementNonSerializedInventoryByScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getMovementNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getMovementNonSerializedInventoryByScans_call method_call = new getMovementNonSerializedInventoryByScans_call(startDate, endDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getMovementNonSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long startDate;
      private long endDate;
      public getMovementNonSerializedInventoryByScans_call(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getMovementNonSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.startDate = startDate;
        this.endDate = endDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getMovementNonSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getMovementNonSerializedInventoryByScans_args args = new getMovementNonSerializedInventoryByScans_args();
        args.setStartDate(startDate);
        args.setEndDate(endDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryMovement> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getMovementNonSerializedInventoryByScans();
      }
    }

    public void getMovementSerializedInventoryByScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getMovementSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getMovementSerializedInventoryByScans_call method_call = new getMovementSerializedInventoryByScans_call(startDate, endDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getMovementSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long startDate;
      private long endDate;
      public getMovementSerializedInventoryByScans_call(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getMovementSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.startDate = startDate;
        this.endDate = endDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getMovementSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getMovementSerializedInventoryByScans_args args = new getMovementSerializedInventoryByScans_args();
        args.setStartDate(startDate);
        args.setEndDate(endDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryMovement> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getMovementSerializedInventoryByScans();
      }
    }

    public void getCompleteMovementSerializedInventoryByScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getCompleteMovementSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCompleteMovementSerializedInventoryByScans_call method_call = new getCompleteMovementSerializedInventoryByScans_call(startDate, endDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCompleteMovementSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long startDate;
      private long endDate;
      public getCompleteMovementSerializedInventoryByScans_call(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getCompleteMovementSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.startDate = startDate;
        this.endDate = endDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCompleteMovementSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCompleteMovementSerializedInventoryByScans_args args = new getCompleteMovementSerializedInventoryByScans_args();
        args.setStartDate(startDate);
        args.setEndDate(endDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryMovement> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCompleteMovementSerializedInventoryByScans();
      }
    }

    public void getCompleteMovementNonSerializedInventoryByScans(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getCompleteMovementNonSerializedInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCompleteMovementNonSerializedInventoryByScans_call method_call = new getCompleteMovementNonSerializedInventoryByScans_call(startDate, endDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCompleteMovementNonSerializedInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long startDate;
      private long endDate;
      public getCompleteMovementNonSerializedInventoryByScans_call(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getCompleteMovementNonSerializedInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.startDate = startDate;
        this.endDate = endDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCompleteMovementNonSerializedInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCompleteMovementNonSerializedInventoryByScans_args args = new getCompleteMovementNonSerializedInventoryByScans_args();
        args.setStartDate(startDate);
        args.setEndDate(endDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryMovement> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCompleteMovementNonSerializedInventoryByScans();
      }
    }

    public void scanfreebie(long orderId, long freebieItemId, long freebieWarehouseId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<scanfreebie_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanfreebie_call method_call = new scanfreebie_call(orderId, freebieItemId, freebieWarehouseId, scanType, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanfreebie_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long orderId;
      private long freebieItemId;
      private long freebieWarehouseId;
      private ScanType scanType;
      public scanfreebie_call(long orderId, long freebieItemId, long freebieWarehouseId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<scanfreebie_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.orderId = orderId;
        this.freebieItemId = freebieItemId;
        this.freebieWarehouseId = freebieWarehouseId;
        this.scanType = scanType;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanfreebie", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanfreebie_args args = new scanfreebie_args();
        args.setOrderId(orderId);
        args.setFreebieItemId(freebieItemId);
        args.setFreebieWarehouseId(freebieWarehouseId);
        args.setScanType(scanType);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_scanfreebie();
      }
    }

    public void reshipfreebie(long oldOrderId, long newOrderId, long freebieItemId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<reshipfreebie_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      reshipfreebie_call method_call = new reshipfreebie_call(oldOrderId, newOrderId, freebieItemId, scanType, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class reshipfreebie_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long oldOrderId;
      private long newOrderId;
      private long freebieItemId;
      private ScanType scanType;
      public reshipfreebie_call(long oldOrderId, long newOrderId, long freebieItemId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<reshipfreebie_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.oldOrderId = oldOrderId;
        this.newOrderId = newOrderId;
        this.freebieItemId = freebieItemId;
        this.scanType = scanType;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("reshipfreebie", org.apache.thrift.protocol.TMessageType.CALL, 0));
        reshipfreebie_args args = new reshipfreebie_args();
        args.setOldOrderId(oldOrderId);
        args.setNewOrderId(newOrderId);
        args.setFreebieItemId(freebieItemId);
        args.setScanType(scanType);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_reshipfreebie();
      }
    }

    public void isItemTransferAllowed(long warehouseId, long transferWarehouseId, org.apache.thrift.async.AsyncMethodCallback<isItemTransferAllowed_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      isItemTransferAllowed_call method_call = new isItemTransferAllowed_call(warehouseId, transferWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class isItemTransferAllowed_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long warehouseId;
      private long transferWarehouseId;
      public isItemTransferAllowed_call(long warehouseId, long transferWarehouseId, org.apache.thrift.async.AsyncMethodCallback<isItemTransferAllowed_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.warehouseId = warehouseId;
        this.transferWarehouseId = transferWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isItemTransferAllowed", org.apache.thrift.protocol.TMessageType.CALL, 0));
        isItemTransferAllowed_args args = new isItemTransferAllowed_args();
        args.setWarehouseId(warehouseId);
        args.setTransferWarehouseId(transferWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public boolean getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_isItemTransferAllowed();
      }
    }

    public void createTransferLot(long originWarehouseId, long destWarehouseId, org.apache.thrift.async.AsyncMethodCallback<createTransferLot_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      createTransferLot_call method_call = new createTransferLot_call(originWarehouseId, destWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class createTransferLot_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long originWarehouseId;
      private long destWarehouseId;
      public createTransferLot_call(long originWarehouseId, long destWarehouseId, org.apache.thrift.async.AsyncMethodCallback<createTransferLot_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.originWarehouseId = originWarehouseId;
        this.destWarehouseId = destWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createTransferLot", org.apache.thrift.protocol.TMessageType.CALL, 0));
        createTransferLot_args args = new createTransferLot_args();
        args.setOriginWarehouseId(originWarehouseId);
        args.setDestWarehouseId(destWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_createTransferLot();
      }
    }

    public void getTransferLot(long transferLotId, org.apache.thrift.async.AsyncMethodCallback<getTransferLot_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getTransferLot_call method_call = new getTransferLot_call(transferLotId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getTransferLot_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long transferLotId;
      public getTransferLot_call(long transferLotId, org.apache.thrift.async.AsyncMethodCallback<getTransferLot_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.transferLotId = transferLotId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTransferLot", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getTransferLot_args args = new getTransferLot_args();
        args.setTransferLotId(transferLotId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public TransferLot getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getTransferLot();
      }
    }

    public void markTransferLotAsReceived(long id, String remoteTransferRefNumber, org.apache.thrift.async.AsyncMethodCallback<markTransferLotAsReceived_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      markTransferLotAsReceived_call method_call = new markTransferLotAsReceived_call(id, remoteTransferRefNumber, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class markTransferLotAsReceived_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      private String remoteTransferRefNumber;
      public markTransferLotAsReceived_call(long id, String remoteTransferRefNumber, org.apache.thrift.async.AsyncMethodCallback<markTransferLotAsReceived_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.id = id;
        this.remoteTransferRefNumber = remoteTransferRefNumber;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markTransferLotAsReceived", org.apache.thrift.protocol.TMessageType.CALL, 0));
        markTransferLotAsReceived_args args = new markTransferLotAsReceived_args();
        args.setId(id);
        args.setRemoteTransferRefNumber(remoteTransferRefNumber);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_markTransferLotAsReceived();
      }
    }

    public void getTransferLotsByDate(long fromDate, long toDate, org.apache.thrift.async.AsyncMethodCallback<getTransferLotsByDate_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getTransferLotsByDate_call method_call = new getTransferLotsByDate_call(fromDate, toDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getTransferLotsByDate_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long fromDate;
      private long toDate;
      public getTransferLotsByDate_call(long fromDate, long toDate, org.apache.thrift.async.AsyncMethodCallback<getTransferLotsByDate_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.fromDate = fromDate;
        this.toDate = toDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTransferLotsByDate", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getTransferLotsByDate_args args = new getTransferLotsByDate_args();
        args.setFromDate(fromDate);
        args.setToDate(toDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<TransferLot> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getTransferLotsByDate();
      }
    }

    public void getAllowedDestinationWarehousesForTransfer(long warehouseId, org.apache.thrift.async.AsyncMethodCallback<getAllowedDestinationWarehousesForTransfer_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getAllowedDestinationWarehousesForTransfer_call method_call = new getAllowedDestinationWarehousesForTransfer_call(warehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getAllowedDestinationWarehousesForTransfer_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long warehouseId;
      public getAllowedDestinationWarehousesForTransfer_call(long warehouseId, org.apache.thrift.async.AsyncMethodCallback<getAllowedDestinationWarehousesForTransfer_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.warehouseId = warehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllowedDestinationWarehousesForTransfer", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllowedDestinationWarehousesForTransfer_args args = new getAllowedDestinationWarehousesForTransfer_args();
        args.setWarehouseId(warehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Long> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getAllowedDestinationWarehousesForTransfer();
      }
    }

    public void getItemsInTransferLot(long transferLotId, org.apache.thrift.async.AsyncMethodCallback<getItemsInTransferLot_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getItemsInTransferLot_call method_call = new getItemsInTransferLot_call(transferLotId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getItemsInTransferLot_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long transferLotId;
      public getItemsInTransferLot_call(long transferLotId, org.apache.thrift.async.AsyncMethodCallback<getItemsInTransferLot_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.transferLotId = transferLotId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemsInTransferLot", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemsInTransferLot_args args = new getItemsInTransferLot_args();
        args.setTransferLotId(transferLotId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Map<Long,Long> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getItemsInTransferLot();
      }
    }

    public void markItemsAsReceivedForTransferLot(long id, org.apache.thrift.async.AsyncMethodCallback<markItemsAsReceivedForTransferLot_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      markItemsAsReceivedForTransferLot_call method_call = new markItemsAsReceivedForTransferLot_call(id, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class markItemsAsReceivedForTransferLot_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      public markItemsAsReceivedForTransferLot_call(long id, org.apache.thrift.async.AsyncMethodCallback<markItemsAsReceivedForTransferLot_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.id = id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markItemsAsReceivedForTransferLot", org.apache.thrift.protocol.TMessageType.CALL, 0));
        markItemsAsReceivedForTransferLot_args args = new markItemsAsReceivedForTransferLot_args();
        args.setId(id);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_markItemsAsReceivedForTransferLot();
      }
    }

    public void updateTransferLotAfterItemReceive(long id, org.apache.thrift.async.AsyncMethodCallback<updateTransferLotAfterItemReceive_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      updateTransferLotAfterItemReceive_call method_call = new updateTransferLotAfterItemReceive_call(id, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class updateTransferLotAfterItemReceive_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      public updateTransferLotAfterItemReceive_call(long id, org.apache.thrift.async.AsyncMethodCallback<updateTransferLotAfterItemReceive_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.id = id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateTransferLotAfterItemReceive", org.apache.thrift.protocol.TMessageType.CALL, 0));
        updateTransferLotAfterItemReceive_args args = new updateTransferLotAfterItemReceive_args();
        args.setId(id);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public TransferLotStatus getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_updateTransferLotAfterItemReceive();
      }
    }

    public void scanForTransferOut(List<InventoryItem> inventoryItems, ScanType type, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<scanForTransferOut_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForTransferOut_call method_call = new scanForTransferOut_call(inventoryItems, type, transferLotId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForTransferOut_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<InventoryItem> inventoryItems;
      private ScanType type;
      private long transferLotId;
      public scanForTransferOut_call(List<InventoryItem> inventoryItems, ScanType type, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<scanForTransferOut_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItems = inventoryItems;
        this.type = type;
        this.transferLotId = transferLotId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForTransferOut", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForTransferOut_args args = new scanForTransferOut_args();
        args.setInventoryItems(inventoryItems);
        args.setType(type);
        args.setTransferLotId(transferLotId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_scanForTransferOut();
      }
    }

    public void scanForTransferIn(List<InventoryItem> inventoryItems, ScanType type, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<scanForTransferIn_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForTransferIn_call method_call = new scanForTransferIn_call(inventoryItems, type, transferLotId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForTransferIn_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<InventoryItem> inventoryItems;
      private ScanType type;
      private long transferLotId;
      public scanForTransferIn_call(List<InventoryItem> inventoryItems, ScanType type, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<scanForTransferIn_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItems = inventoryItems;
        this.type = type;
        this.transferLotId = transferLotId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForTransferIn", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForTransferIn_args args = new scanForTransferIn_args();
        args.setInventoryItems(inventoryItems);
        args.setType(type);
        args.setTransferLotId(transferLotId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_scanForTransferIn();
      }
    }

    public void scanForOursThirdPartyReceive(List<InventoryItem> inventoryItems, long id, org.apache.thrift.async.AsyncMethodCallback<scanForOursThirdPartyReceive_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForOursThirdPartyReceive_call method_call = new scanForOursThirdPartyReceive_call(inventoryItems, id, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForOursThirdPartyReceive_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<InventoryItem> inventoryItems;
      private long id;
      public scanForOursThirdPartyReceive_call(List<InventoryItem> inventoryItems, long id, org.apache.thrift.async.AsyncMethodCallback<scanForOursThirdPartyReceive_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItems = inventoryItems;
        this.id = id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForOursThirdPartyReceive", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForOursThirdPartyReceive_args args = new scanForOursThirdPartyReceive_args();
        args.setInventoryItems(inventoryItems);
        args.setId(id);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_scanForOursThirdPartyReceive();
      }
    }

    public void getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse(long itemId, long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_call method_call = new getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_call(itemId, physicalWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private long physicalWarehouseId;
      public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_call(long itemId, long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemId = itemId;
        this.physicalWarehouseId = physicalWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args args = new getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args();
        args.setItemId(itemId);
        args.setPhysicalWarehouseId(physicalWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse();
      }
    }

    public void getInTransitInventory(long originWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getInTransitInventory_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInTransitInventory_call method_call = new getInTransitInventory_call(originWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInTransitInventory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long originWarehouseId;
      public getInTransitInventory_call(long originWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getInTransitInventory_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.originWarehouseId = originWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInTransitInventory", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInTransitInventory_args args = new getInTransitInventory_args();
        args.setOriginWarehouseId(originWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InTransitInventory> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInTransitInventory();
      }
    }

    public void isItemAvailableForSale(long itemId, String serialNumber, long warehouseId, org.apache.thrift.async.AsyncMethodCallback<isItemAvailableForSale_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      isItemAvailableForSale_call method_call = new isItemAvailableForSale_call(itemId, serialNumber, warehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class isItemAvailableForSale_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private String serialNumber;
      private long warehouseId;
      public isItemAvailableForSale_call(long itemId, String serialNumber, long warehouseId, org.apache.thrift.async.AsyncMethodCallback<isItemAvailableForSale_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemId = itemId;
        this.serialNumber = serialNumber;
        this.warehouseId = warehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isItemAvailableForSale", org.apache.thrift.protocol.TMessageType.CALL, 0));
        isItemAvailableForSale_args args = new isItemAvailableForSale_args();
        args.setItemId(itemId);
        args.setSerialNumber(serialNumber);
        args.setWarehouseId(warehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public boolean getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_isItemAvailableForSale();
      }
    }

    public void getHistoricBadInventoryByScans(long date, org.apache.thrift.async.AsyncMethodCallback<getHistoricBadInventoryByScans_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getHistoricBadInventoryByScans_call method_call = new getHistoricBadInventoryByScans_call(date, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getHistoricBadInventoryByScans_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long date;
      public getHistoricBadInventoryByScans_call(long date, org.apache.thrift.async.AsyncMethodCallback<getHistoricBadInventoryByScans_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.date = date;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getHistoricBadInventoryByScans", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getHistoricBadInventoryByScans_args args = new getHistoricBadInventoryByScans_args();
        args.setDate(date);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryAvailability> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getHistoricBadInventoryByScans();
      }
    }

    public void scanForBadSale(String serialNumber, String itemNumber, long itemId, long orderId, long fulfilmentWarehouseId, long quantity, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForBadSale_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForBadSale_call method_call = new scanForBadSale_call(serialNumber, itemNumber, itemId, orderId, fulfilmentWarehouseId, quantity, billingWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForBadSale_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String serialNumber;
      private String itemNumber;
      private long itemId;
      private long orderId;
      private long fulfilmentWarehouseId;
      private long quantity;
      private long billingWarehouseId;
      public scanForBadSale_call(String serialNumber, String itemNumber, long itemId, long orderId, long fulfilmentWarehouseId, long quantity, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForBadSale_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.serialNumber = serialNumber;
        this.itemNumber = itemNumber;
        this.itemId = itemId;
        this.orderId = orderId;
        this.fulfilmentWarehouseId = fulfilmentWarehouseId;
        this.quantity = quantity;
        this.billingWarehouseId = billingWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForBadSale", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForBadSale_args args = new scanForBadSale_args();
        args.setSerialNumber(serialNumber);
        args.setItemNumber(itemNumber);
        args.setItemId(itemId);
        args.setOrderId(orderId);
        args.setFulfilmentWarehouseId(fulfilmentWarehouseId);
        args.setQuantity(quantity);
        args.setBillingWarehouseId(billingWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_scanForBadSale();
      }
    }

    public void getTransferLotItemsForMarkReceive(long transferLotId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<getTransferLotItemsForMarkReceive_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getTransferLotItemsForMarkReceive_call method_call = new getTransferLotItemsForMarkReceive_call(transferLotId, scanType, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getTransferLotItemsForMarkReceive_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long transferLotId;
      private ScanType scanType;
      public getTransferLotItemsForMarkReceive_call(long transferLotId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<getTransferLotItemsForMarkReceive_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.transferLotId = transferLotId;
        this.scanType = scanType;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTransferLotItemsForMarkReceive", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getTransferLotItemsForMarkReceive_args args = new getTransferLotItemsForMarkReceive_args();
        args.setTransferLotId(transferLotId);
        args.setScanType(scanType);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryItem> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getTransferLotItemsForMarkReceive();
      }
    }

    public void markItemsAsReceivedForTransferLotPartial(List<InventoryItem> inventoryItems, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<markItemsAsReceivedForTransferLotPartial_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      markItemsAsReceivedForTransferLotPartial_call method_call = new markItemsAsReceivedForTransferLotPartial_call(inventoryItems, transferLotId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class markItemsAsReceivedForTransferLotPartial_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<InventoryItem> inventoryItems;
      private long transferLotId;
      public markItemsAsReceivedForTransferLotPartial_call(List<InventoryItem> inventoryItems, long transferLotId, org.apache.thrift.async.AsyncMethodCallback<markItemsAsReceivedForTransferLotPartial_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItems = inventoryItems;
        this.transferLotId = transferLotId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markItemsAsReceivedForTransferLotPartial", org.apache.thrift.protocol.TMessageType.CALL, 0));
        markItemsAsReceivedForTransferLotPartial_args args = new markItemsAsReceivedForTransferLotPartial_args();
        args.setInventoryItems(inventoryItems);
        args.setTransferLotId(transferLotId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_markItemsAsReceivedForTransferLotPartial();
      }
    }

    public void markTransferLotAsReceivedPartial(long id, String remoteTransferRefNumber, org.apache.thrift.async.AsyncMethodCallback<markTransferLotAsReceivedPartial_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      markTransferLotAsReceivedPartial_call method_call = new markTransferLotAsReceivedPartial_call(id, remoteTransferRefNumber, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class markTransferLotAsReceivedPartial_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      private String remoteTransferRefNumber;
      public markTransferLotAsReceivedPartial_call(long id, String remoteTransferRefNumber, org.apache.thrift.async.AsyncMethodCallback<markTransferLotAsReceivedPartial_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.id = id;
        this.remoteTransferRefNumber = remoteTransferRefNumber;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markTransferLotAsReceivedPartial", org.apache.thrift.protocol.TMessageType.CALL, 0));
        markTransferLotAsReceivedPartial_args args = new markTransferLotAsReceivedPartial_args();
        args.setId(id);
        args.setRemoteTransferRefNumber(remoteTransferRefNumber);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_markTransferLotAsReceivedPartial();
      }
    }

    public void getInventoryItemScannedInForPO(long itemId, List<Long> purchaseIds, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemScannedInForPO_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryItemScannedInForPO_call method_call = new getInventoryItemScannedInForPO_call(itemId, purchaseIds, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryItemScannedInForPO_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private List<Long> purchaseIds;
      public getInventoryItemScannedInForPO_call(long itemId, List<Long> purchaseIds, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemScannedInForPO_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemId = itemId;
        this.purchaseIds = purchaseIds;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryItemScannedInForPO", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryItemScannedInForPO_args args = new getInventoryItemScannedInForPO_args();
        args.setItemId(itemId);
        args.setPurchaseIds(purchaseIds);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryItem> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryItemScannedInForPO();
      }
    }

    public void getAmazonTransferredSkuDetails(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getAmazonTransferredSkuDetails_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getAmazonTransferredSkuDetails_call method_call = new getAmazonTransferredSkuDetails_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getAmazonTransferredSkuDetails_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<Long> itemIds;
      public getAmazonTransferredSkuDetails_call(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getAmazonTransferredSkuDetails_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemIds = itemIds;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAmazonTransferredSkuDetails", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAmazonTransferredSkuDetails_args args = new getAmazonTransferredSkuDetails_args();
        args.setItemIds(itemIds);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<AmazonTransferredSkuDetail> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getAmazonTransferredSkuDetails();
      }
    }

    public void getScansforPurchase(long purchaseId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<getScansforPurchase_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getScansforPurchase_call method_call = new getScansforPurchase_call(purchaseId, scanType, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getScansforPurchase_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long purchaseId;
      private ScanType scanType;
      public getScansforPurchase_call(long purchaseId, ScanType scanType, org.apache.thrift.async.AsyncMethodCallback<getScansforPurchase_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.purchaseId = purchaseId;
        this.scanType = scanType;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getScansforPurchase", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getScansforPurchase_args args = new getScansforPurchase_args();
        args.setPurchaseId(purchaseId);
        args.setScanType(scanType);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Scan> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getScansforPurchase();
      }
    }

    public void getCurrentBadQuantityForItem(long itemId, long currentWarehouseId, long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getCurrentBadQuantityForItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCurrentBadQuantityForItem_call method_call = new getCurrentBadQuantityForItem_call(itemId, currentWarehouseId, physicalWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCurrentBadQuantityForItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private long currentWarehouseId;
      private long physicalWarehouseId;
      public getCurrentBadQuantityForItem_call(long itemId, long currentWarehouseId, long physicalWarehouseId, org.apache.thrift.async.AsyncMethodCallback<getCurrentBadQuantityForItem_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemId = itemId;
        this.currentWarehouseId = currentWarehouseId;
        this.physicalWarehouseId = physicalWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCurrentBadQuantityForItem", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCurrentBadQuantityForItem_args args = new getCurrentBadQuantityForItem_args();
        args.setItemId(itemId);
        args.setCurrentWarehouseId(currentWarehouseId);
        args.setPhysicalWarehouseId(physicalWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCurrentBadQuantityForItem();
      }
    }

    public void scanForBadPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForBadPurchaseReturn_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanForBadPurchaseReturn_call method_call = new scanForBadPurchaseReturn_call(saleReturnItems, vendorId, billingWarehouseId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanForBadPurchaseReturn_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<InventoryItem> saleReturnItems;
      private long vendorId;
      private long billingWarehouseId;
      public scanForBadPurchaseReturn_call(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId, org.apache.thrift.async.AsyncMethodCallback<scanForBadPurchaseReturn_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.saleReturnItems = saleReturnItems;
        this.vendorId = vendorId;
        this.billingWarehouseId = billingWarehouseId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanForBadPurchaseReturn", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanForBadPurchaseReturn_args args = new scanForBadPurchaseReturn_args();
        args.setSaleReturnItems(saleReturnItems);
        args.setVendorId(vendorId);
        args.setBillingWarehouseId(billingWarehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_scanForBadPurchaseReturn();
      }
    }

    public void getItemsInPurchaseReturn(long purchaseReturnId, ScanType type, String returnTime, org.apache.thrift.async.AsyncMethodCallback<getItemsInPurchaseReturn_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getItemsInPurchaseReturn_call method_call = new getItemsInPurchaseReturn_call(purchaseReturnId, type, returnTime, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getItemsInPurchaseReturn_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long purchaseReturnId;
      private ScanType type;
      private String returnTime;
      public getItemsInPurchaseReturn_call(long purchaseReturnId, ScanType type, String returnTime, org.apache.thrift.async.AsyncMethodCallback<getItemsInPurchaseReturn_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.purchaseReturnId = purchaseReturnId;
        this.type = type;
        this.returnTime = returnTime;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemsInPurchaseReturn", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemsInPurchaseReturn_args args = new getItemsInPurchaseReturn_args();
        args.setPurchaseReturnId(purchaseReturnId);
        args.setType(type);
        args.setReturnTime(returnTime);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Map<Long,Long> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getItemsInPurchaseReturn();
      }
    }

    public void getScansForInventoryItem(long inventoryItemId, ScanType type, org.apache.thrift.async.AsyncMethodCallback<getScansForInventoryItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getScansForInventoryItem_call method_call = new getScansForInventoryItem_call(inventoryItemId, type, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getScansForInventoryItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long inventoryItemId;
      private ScanType type;
      public getScansForInventoryItem_call(long inventoryItemId, ScanType type, org.apache.thrift.async.AsyncMethodCallback<getScansForInventoryItem_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItemId = inventoryItemId;
        this.type = type;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getScansForInventoryItem", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getScansForInventoryItem_args args = new getScansForInventoryItem_args();
        args.setInventoryItemId(inventoryItemId);
        args.setType(type);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Scan> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getScansForInventoryItem();
      }
    }

    public void checkGrnImeiStatus(List<String> imeiNos, org.apache.thrift.async.AsyncMethodCallback<checkGrnImeiStatus_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      checkGrnImeiStatus_call method_call = new checkGrnImeiStatus_call(imeiNos, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class checkGrnImeiStatus_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<String> imeiNos;
      public checkGrnImeiStatus_call(List<String> imeiNos, org.apache.thrift.async.AsyncMethodCallback<checkGrnImeiStatus_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.imeiNos = imeiNos;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkGrnImeiStatus", org.apache.thrift.protocol.TMessageType.CALL, 0));
        checkGrnImeiStatus_args args = new checkGrnImeiStatus_args();
        args.setImeiNos(imeiNos);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<String> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_checkGrnImeiStatus();
      }
    }

    public void getInventoryAgeConsideredItems(long itemId, org.apache.thrift.async.AsyncMethodCallback<getInventoryAgeConsideredItems_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryAgeConsideredItems_call method_call = new getInventoryAgeConsideredItems_call(itemId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryAgeConsideredItems_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      public getInventoryAgeConsideredItems_call(long itemId, org.apache.thrift.async.AsyncMethodCallback<getInventoryAgeConsideredItems_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.itemId = itemId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryAgeConsideredItems", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryAgeConsideredItems_args args = new getInventoryAgeConsideredItems_args();
        args.setItemId(itemId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InvAgeConsiderItems> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryAgeConsideredItems();
      }
    }

    public void getCompleteMovementForThirdPartyWarehouse(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getCompleteMovementForThirdPartyWarehouse_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCompleteMovementForThirdPartyWarehouse_call method_call = new getCompleteMovementForThirdPartyWarehouse_call(startDate, endDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCompleteMovementForThirdPartyWarehouse_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long startDate;
      private long endDate;
      public getCompleteMovementForThirdPartyWarehouse_call(long startDate, long endDate, org.apache.thrift.async.AsyncMethodCallback<getCompleteMovementForThirdPartyWarehouse_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.startDate = startDate;
        this.endDate = endDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCompleteMovementForThirdPartyWarehouse", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCompleteMovementForThirdPartyWarehouse_args args = new getCompleteMovementForThirdPartyWarehouse_args();
        args.setStartDate(startDate);
        args.setEndDate(endDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryMovement> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCompleteMovementForThirdPartyWarehouse();
      }
    }

    public void getAllDoaOutInventoryItems(org.apache.thrift.async.AsyncMethodCallback<getAllDoaOutInventoryItems_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getAllDoaOutInventoryItems_call method_call = new getAllDoaOutInventoryItems_call(resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getAllDoaOutInventoryItems_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getAllDoaOutInventoryItems_call(org.apache.thrift.async.AsyncMethodCallback<getAllDoaOutInventoryItems_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllDoaOutInventoryItems", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllDoaOutInventoryItems_args args = new getAllDoaOutInventoryItems_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<DoaOutInventoryItem> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getAllDoaOutInventoryItems();
      }
    }

    public void getAllUnCompletedStockShipments(String source, org.apache.thrift.async.AsyncMethodCallback<getAllUnCompletedStockShipments_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getAllUnCompletedStockShipments_call method_call = new getAllUnCompletedStockShipments_call(source, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getAllUnCompletedStockShipments_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String source;
      public getAllUnCompletedStockShipments_call(String source, org.apache.thrift.async.AsyncMethodCallback<getAllUnCompletedStockShipments_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.source = source;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllUnCompletedStockShipments", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllUnCompletedStockShipments_args args = new getAllUnCompletedStockShipments_args();
        args.setSource(source);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<RemovalStockShipmentReference> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getAllUnCompletedStockShipments();
      }
    }

    public void getRemovalStockShipmentReferenceById(long id, org.apache.thrift.async.AsyncMethodCallback<getRemovalStockShipmentReferenceById_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getRemovalStockShipmentReferenceById_call method_call = new getRemovalStockShipmentReferenceById_call(id, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getRemovalStockShipmentReferenceById_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      public getRemovalStockShipmentReferenceById_call(long id, org.apache.thrift.async.AsyncMethodCallback<getRemovalStockShipmentReferenceById_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.id = id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRemovalStockShipmentReferenceById", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getRemovalStockShipmentReferenceById_args args = new getRemovalStockShipmentReferenceById_args();
        args.setId(id);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public RemovalStockShipmentReference getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getRemovalStockShipmentReferenceById();
      }
    }

    public void createRemovalStockShipmentReference(RemovalStockShipmentReference removalStockShipmentReference, org.apache.thrift.async.AsyncMethodCallback<createRemovalStockShipmentReference_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      createRemovalStockShipmentReference_call method_call = new createRemovalStockShipmentReference_call(removalStockShipmentReference, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class createRemovalStockShipmentReference_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RemovalStockShipmentReference removalStockShipmentReference;
      public createRemovalStockShipmentReference_call(RemovalStockShipmentReference removalStockShipmentReference, org.apache.thrift.async.AsyncMethodCallback<createRemovalStockShipmentReference_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.removalStockShipmentReference = removalStockShipmentReference;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createRemovalStockShipmentReference", org.apache.thrift.protocol.TMessageType.CALL, 0));
        createRemovalStockShipmentReference_args args = new createRemovalStockShipmentReference_args();
        args.setRemovalStockShipmentReference(removalStockShipmentReference);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_createRemovalStockShipmentReference();
      }
    }

    public void updateShipmentReferenceTransferLot(long transferLotId, long shipmentReferenceId, org.apache.thrift.async.AsyncMethodCallback<updateShipmentReferenceTransferLot_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      updateShipmentReferenceTransferLot_call method_call = new updateShipmentReferenceTransferLot_call(transferLotId, shipmentReferenceId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class updateShipmentReferenceTransferLot_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long transferLotId;
      private long shipmentReferenceId;
      public updateShipmentReferenceTransferLot_call(long transferLotId, long shipmentReferenceId, org.apache.thrift.async.AsyncMethodCallback<updateShipmentReferenceTransferLot_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.transferLotId = transferLotId;
        this.shipmentReferenceId = shipmentReferenceId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateShipmentReferenceTransferLot", org.apache.thrift.protocol.TMessageType.CALL, 0));
        updateShipmentReferenceTransferLot_args args = new updateShipmentReferenceTransferLot_args();
        args.setTransferLotId(transferLotId);
        args.setShipmentReferenceId(shipmentReferenceId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_updateShipmentReferenceTransferLot();
      }
    }

    public void fetchScansPerTransferInvoiceNumber(long date, org.apache.thrift.async.AsyncMethodCallback<fetchScansPerTransferInvoiceNumber_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      fetchScansPerTransferInvoiceNumber_call method_call = new fetchScansPerTransferInvoiceNumber_call(date, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class fetchScansPerTransferInvoiceNumber_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long date;
      public fetchScansPerTransferInvoiceNumber_call(long date, org.apache.thrift.async.AsyncMethodCallback<fetchScansPerTransferInvoiceNumber_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.date = date;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchScansPerTransferInvoiceNumber", org.apache.thrift.protocol.TMessageType.CALL, 0));
        fetchScansPerTransferInvoiceNumber_args args = new fetchScansPerTransferInvoiceNumber_args();
        args.setDate(date);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<TransferInvoiceScan> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_fetchScansPerTransferInvoiceNumber();
      }
    }

    public void getInventoryItems(List<String> serialNumbers, org.apache.thrift.async.AsyncMethodCallback<getInventoryItems_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryItems_call method_call = new getInventoryItems_call(serialNumbers, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryItems_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<String> serialNumbers;
      public getInventoryItems_call(List<String> serialNumbers, org.apache.thrift.async.AsyncMethodCallback<getInventoryItems_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.serialNumbers = serialNumbers;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryItems", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryItems_args args = new getInventoryItems_args();
        args.setSerialNumbers(serialNumbers);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryItem> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryItems();
      }
    }

    public void getInventoryItemsBySerailNumbers(List<String> serialNumbers, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemsBySerailNumbers_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getInventoryItemsBySerailNumbers_call method_call = new getInventoryItemsBySerailNumbers_call(serialNumbers, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getInventoryItemsBySerailNumbers_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<String> serialNumbers;
      public getInventoryItemsBySerailNumbers_call(List<String> serialNumbers, org.apache.thrift.async.AsyncMethodCallback<getInventoryItemsBySerailNumbers_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.serialNumbers = serialNumbers;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInventoryItemsBySerailNumbers", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getInventoryItemsBySerailNumbers_args args = new getInventoryItemsBySerailNumbers_args();
        args.setSerialNumbers(serialNumbers);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<InventoryItem> getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getInventoryItemsBySerailNumbers();
      }
    }

    public void scanPurchaseBulk(List<InventoryItem> inventoryItems, org.apache.thrift.async.AsyncMethodCallback<scanPurchaseBulk_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      scanPurchaseBulk_call method_call = new scanPurchaseBulk_call(inventoryItems, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class scanPurchaseBulk_call extends org.apache.thrift.async.TAsyncMethodCall {
      private List<InventoryItem> inventoryItems;
      public scanPurchaseBulk_call(List<InventoryItem> inventoryItems, org.apache.thrift.async.AsyncMethodCallback<scanPurchaseBulk_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.inventoryItems = inventoryItems;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scanPurchaseBulk", org.apache.thrift.protocol.TMessageType.CALL, 0));
        scanPurchaseBulk_args args = new scanPurchaseBulk_args();
        args.setInventoryItems(inventoryItems);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws WarehouseServiceException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_scanPurchaseBulk();
      }
    }

  }

  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(I iface) {
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
    }

    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      processMap.put("getInventoryItem", new getInventoryItem());
      processMap.put("getNonSeralizedInventoryItem", new getNonSeralizedInventoryItem());
      processMap.put("scan", new scan());
      processMap.put("genericScan", new genericScan());
      processMap.put("scanSerializedItemForOrder", new scanSerializedItemForOrder());
      processMap.put("scanForOrder", new scanForOrder());
      processMap.put("createItemNumberMapping", new createItemNumberMapping());
      processMap.put("getItemNumbers", new getItemNumbers());
      processMap.put("getItemIds", new getItemIds());
      processMap.put("getInventoryItemsFromLastScanType", new getInventoryItemsFromLastScanType());
      processMap.put("getInventoryItemFromId", new getInventoryItemFromId());
      processMap.put("getPurchaseScans", new getPurchaseScans());
      processMap.put("getPurchaseScansByGrnDate", new getPurchaseScansByGrnDate());
      processMap.put("getEmptyGrnsByDate", new getEmptyGrnsByDate());
      processMap.put("fetchScansPerInvoiceNumber", new fetchScansPerInvoiceNumber());
      processMap.put("getInventoryItemFromOrder", new getInventoryItemFromOrder());
      processMap.put("getInventoryAge", new getInventoryAge());
      processMap.put("getInventoryScansForItem", new getInventoryScansForItem());
      processMap.put("getScanRecordsForSerialNumber", new getScanRecordsForSerialNumber());
      processMap.put("scanForPurchaseReturn", new scanForPurchaseReturn());
      processMap.put("scanForLostItem", new scanForLostItem());
      processMap.put("getCurrentSerializedInventoryByScans", new getCurrentSerializedInventoryByScans());
      processMap.put("getCurrentNonSerializedInventoryByScans", new getCurrentNonSerializedInventoryByScans());
      processMap.put("getHistoricSerializedInventoryByScans", new getHistoricSerializedInventoryByScans());
      processMap.put("getHistoricNonSerializedInventoryByScans", new getHistoricNonSerializedInventoryByScans());
      processMap.put("getOurHistoricSerializedInventoryByScans", new getOurHistoricSerializedInventoryByScans());
      processMap.put("getOurHistoricNonSerializedInventoryByScans", new getOurHistoricNonSerializedInventoryByScans());
      processMap.put("scanForOursExternalSale", new scanForOursExternalSale());
      processMap.put("scanForOursExternalSaleReturn", new scanForOursExternalSaleReturn());
      processMap.put("getMovementNonSerializedInventoryByScans", new getMovementNonSerializedInventoryByScans());
      processMap.put("getMovementSerializedInventoryByScans", new getMovementSerializedInventoryByScans());
      processMap.put("getCompleteMovementSerializedInventoryByScans", new getCompleteMovementSerializedInventoryByScans());
      processMap.put("getCompleteMovementNonSerializedInventoryByScans", new getCompleteMovementNonSerializedInventoryByScans());
      processMap.put("scanfreebie", new scanfreebie());
      processMap.put("reshipfreebie", new reshipfreebie());
      processMap.put("isItemTransferAllowed", new isItemTransferAllowed());
      processMap.put("createTransferLot", new createTransferLot());
      processMap.put("getTransferLot", new getTransferLot());
      processMap.put("markTransferLotAsReceived", new markTransferLotAsReceived());
      processMap.put("getTransferLotsByDate", new getTransferLotsByDate());
      processMap.put("getAllowedDestinationWarehousesForTransfer", new getAllowedDestinationWarehousesForTransfer());
      processMap.put("getItemsInTransferLot", new getItemsInTransferLot());
      processMap.put("markItemsAsReceivedForTransferLot", new markItemsAsReceivedForTransferLot());
      processMap.put("updateTransferLotAfterItemReceive", new updateTransferLotAfterItemReceive());
      processMap.put("scanForTransferOut", new scanForTransferOut());
      processMap.put("scanForTransferIn", new scanForTransferIn());
      processMap.put("scanForOursThirdPartyReceive", new scanForOursThirdPartyReceive());
      processMap.put("getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse", new getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse());
      processMap.put("getInTransitInventory", new getInTransitInventory());
      processMap.put("isItemAvailableForSale", new isItemAvailableForSale());
      processMap.put("getHistoricBadInventoryByScans", new getHistoricBadInventoryByScans());
      processMap.put("scanForBadSale", new scanForBadSale());
      processMap.put("getTransferLotItemsForMarkReceive", new getTransferLotItemsForMarkReceive());
      processMap.put("markItemsAsReceivedForTransferLotPartial", new markItemsAsReceivedForTransferLotPartial());
      processMap.put("markTransferLotAsReceivedPartial", new markTransferLotAsReceivedPartial());
      processMap.put("getInventoryItemScannedInForPO", new getInventoryItemScannedInForPO());
      processMap.put("getAmazonTransferredSkuDetails", new getAmazonTransferredSkuDetails());
      processMap.put("getScansforPurchase", new getScansforPurchase());
      processMap.put("getCurrentBadQuantityForItem", new getCurrentBadQuantityForItem());
      processMap.put("scanForBadPurchaseReturn", new scanForBadPurchaseReturn());
      processMap.put("getItemsInPurchaseReturn", new getItemsInPurchaseReturn());
      processMap.put("getScansForInventoryItem", new getScansForInventoryItem());
      processMap.put("checkGrnImeiStatus", new checkGrnImeiStatus());
      processMap.put("getInventoryAgeConsideredItems", new getInventoryAgeConsideredItems());
      processMap.put("getCompleteMovementForThirdPartyWarehouse", new getCompleteMovementForThirdPartyWarehouse());
      processMap.put("getAllDoaOutInventoryItems", new getAllDoaOutInventoryItems());
      processMap.put("getAllUnCompletedStockShipments", new getAllUnCompletedStockShipments());
      processMap.put("getRemovalStockShipmentReferenceById", new getRemovalStockShipmentReferenceById());
      processMap.put("createRemovalStockShipmentReference", new createRemovalStockShipmentReference());
      processMap.put("updateShipmentReferenceTransferLot", new updateShipmentReferenceTransferLot());
      processMap.put("fetchScansPerTransferInvoiceNumber", new fetchScansPerTransferInvoiceNumber());
      processMap.put("getInventoryItems", new getInventoryItems());
      processMap.put("getInventoryItemsBySerailNumbers", new getInventoryItemsBySerailNumbers());
      processMap.put("scanPurchaseBulk", new scanPurchaseBulk());
      return processMap;
    }

    private static class getInventoryItem<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryItem_args> {
      public getInventoryItem() {
        super("getInventoryItem");
      }

      protected getInventoryItem_args getEmptyArgsInstance() {
        return new getInventoryItem_args();
      }

      protected getInventoryItem_result getResult(I iface, getInventoryItem_args args) throws org.apache.thrift.TException {
        getInventoryItem_result result = new getInventoryItem_result();
        try {
          result.success = iface.getInventoryItem(args.serialNumber);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getNonSeralizedInventoryItem<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getNonSeralizedInventoryItem_args> {
      public getNonSeralizedInventoryItem() {
        super("getNonSeralizedInventoryItem");
      }

      protected getNonSeralizedInventoryItem_args getEmptyArgsInstance() {
        return new getNonSeralizedInventoryItem_args();
      }

      protected getNonSeralizedInventoryItem_result getResult(I iface, getNonSeralizedInventoryItem_args args) throws org.apache.thrift.TException {
        getNonSeralizedInventoryItem_result result = new getNonSeralizedInventoryItem_result();
        try {
          result.success = iface.getNonSeralizedInventoryItem(args.itemNumber, args.itemId, args.fulfilmentWarehouseId, args.billingWarehouseId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class scan<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scan_args> {
      public scan() {
        super("scan");
      }

      protected scan_args getEmptyArgsInstance() {
        return new scan_args();
      }

      protected scan_result getResult(I iface, scan_args args) throws org.apache.thrift.TException {
        scan_result result = new scan_result();
        try {
          iface.scan(args.inventoryItem, args.type, args.quantity, args.billingWarehouseId, args.transferLotId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class genericScan<I extends Iface> extends org.apache.thrift.ProcessFunction<I, genericScan_args> {
      public genericScan() {
        super("genericScan");
      }

      protected genericScan_args getEmptyArgsInstance() {
        return new genericScan_args();
      }

      protected genericScan_result getResult(I iface, genericScan_args args) throws org.apache.thrift.TException {
        genericScan_result result = new genericScan_result();
        try {
          iface.genericScan(args.inventoryItem, args.scan);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class scanSerializedItemForOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanSerializedItemForOrder_args> {
      public scanSerializedItemForOrder() {
        super("scanSerializedItemForOrder");
      }

      protected scanSerializedItemForOrder_args getEmptyArgsInstance() {
        return new scanSerializedItemForOrder_args();
      }

      protected scanSerializedItemForOrder_result getResult(I iface, scanSerializedItemForOrder_args args) throws org.apache.thrift.TException {
        scanSerializedItemForOrder_result result = new scanSerializedItemForOrder_result();
        try {
          result.success = iface.scanSerializedItemForOrder(args.serialNumber, args.type, args.orderId, args.fulfilmentWarehouseId, args.quantity, args.billingWarehouseId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class scanForOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForOrder_args> {
      public scanForOrder() {
        super("scanForOrder");
      }

      protected scanForOrder_args getEmptyArgsInstance() {
        return new scanForOrder_args();
      }

      protected scanForOrder_result getResult(I iface, scanForOrder_args args) throws org.apache.thrift.TException {
        scanForOrder_result result = new scanForOrder_result();
        try {
          result.success = iface.scanForOrder(args.inventoryItem, args.type, args.quantity, args.orderId, args.fulfilmentWarehouseId, args.billingWarehouseId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class createItemNumberMapping<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createItemNumberMapping_args> {
      public createItemNumberMapping() {
        super("createItemNumberMapping");
      }

      protected createItemNumberMapping_args getEmptyArgsInstance() {
        return new createItemNumberMapping_args();
      }

      protected createItemNumberMapping_result getResult(I iface, createItemNumberMapping_args args) throws org.apache.thrift.TException {
        createItemNumberMapping_result result = new createItemNumberMapping_result();
        iface.createItemNumberMapping(args.itemNumber, args.itemId);
        return result;
      }
    }

    private static class getItemNumbers<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemNumbers_args> {
      public getItemNumbers() {
        super("getItemNumbers");
      }

      protected getItemNumbers_args getEmptyArgsInstance() {
        return new getItemNumbers_args();
      }

      protected getItemNumbers_result getResult(I iface, getItemNumbers_args args) throws org.apache.thrift.TException {
        getItemNumbers_result result = new getItemNumbers_result();
        result.success = iface.getItemNumbers(args.itemId);
        return result;
      }
    }

    private static class getItemIds<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemIds_args> {
      public getItemIds() {
        super("getItemIds");
      }

      protected getItemIds_args getEmptyArgsInstance() {
        return new getItemIds_args();
      }

      protected getItemIds_result getResult(I iface, getItemIds_args args) throws org.apache.thrift.TException {
        getItemIds_result result = new getItemIds_result();
        result.success = iface.getItemIds(args.itemNumber);
        return result;
      }
    }

    private static class getInventoryItemsFromLastScanType<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryItemsFromLastScanType_args> {
      public getInventoryItemsFromLastScanType() {
        super("getInventoryItemsFromLastScanType");
      }

      protected getInventoryItemsFromLastScanType_args getEmptyArgsInstance() {
        return new getInventoryItemsFromLastScanType_args();
      }

      protected getInventoryItemsFromLastScanType_result getResult(I iface, getInventoryItemsFromLastScanType_args args) throws org.apache.thrift.TException {
        getInventoryItemsFromLastScanType_result result = new getInventoryItemsFromLastScanType_result();
        try {
          result.success = iface.getInventoryItemsFromLastScanType(args.lastScanType);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getInventoryItemFromId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryItemFromId_args> {
      public getInventoryItemFromId() {
        super("getInventoryItemFromId");
      }

      protected getInventoryItemFromId_args getEmptyArgsInstance() {
        return new getInventoryItemFromId_args();
      }

      protected getInventoryItemFromId_result getResult(I iface, getInventoryItemFromId_args args) throws org.apache.thrift.TException {
        getInventoryItemFromId_result result = new getInventoryItemFromId_result();
        try {
          result.success = iface.getInventoryItemFromId(args.inventoryItemId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getPurchaseScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPurchaseScans_args> {
      public getPurchaseScans() {
        super("getPurchaseScans");
      }

      protected getPurchaseScans_args getEmptyArgsInstance() {
        return new getPurchaseScans_args();
      }

      protected getPurchaseScans_result getResult(I iface, getPurchaseScans_args args) throws org.apache.thrift.TException {
        getPurchaseScans_result result = new getPurchaseScans_result();
        result.success = iface.getPurchaseScans(args.startDate, args.endDate);
        return result;
      }
    }

    private static class getPurchaseScansByGrnDate<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPurchaseScansByGrnDate_args> {
      public getPurchaseScansByGrnDate() {
        super("getPurchaseScansByGrnDate");
      }

      protected getPurchaseScansByGrnDate_args getEmptyArgsInstance() {
        return new getPurchaseScansByGrnDate_args();
      }

      protected getPurchaseScansByGrnDate_result getResult(I iface, getPurchaseScansByGrnDate_args args) throws org.apache.thrift.TException {
        getPurchaseScansByGrnDate_result result = new getPurchaseScansByGrnDate_result();
        result.success = iface.getPurchaseScansByGrnDate(args.startDate, args.endDate);
        return result;
      }
    }

    private static class getEmptyGrnsByDate<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getEmptyGrnsByDate_args> {
      public getEmptyGrnsByDate() {
        super("getEmptyGrnsByDate");
      }

      protected getEmptyGrnsByDate_args getEmptyArgsInstance() {
        return new getEmptyGrnsByDate_args();
      }

      protected getEmptyGrnsByDate_result getResult(I iface, getEmptyGrnsByDate_args args) throws org.apache.thrift.TException {
        getEmptyGrnsByDate_result result = new getEmptyGrnsByDate_result();
        result.success = iface.getEmptyGrnsByDate(args.startDate, args.endDate);
        return result;
      }
    }

    private static class fetchScansPerInvoiceNumber<I extends Iface> extends org.apache.thrift.ProcessFunction<I, fetchScansPerInvoiceNumber_args> {
      public fetchScansPerInvoiceNumber() {
        super("fetchScansPerInvoiceNumber");
      }

      protected fetchScansPerInvoiceNumber_args getEmptyArgsInstance() {
        return new fetchScansPerInvoiceNumber_args();
      }

      protected fetchScansPerInvoiceNumber_result getResult(I iface, fetchScansPerInvoiceNumber_args args) throws org.apache.thrift.TException {
        fetchScansPerInvoiceNumber_result result = new fetchScansPerInvoiceNumber_result();
        result.success = iface.fetchScansPerInvoiceNumber(args.date);
        return result;
      }
    }

    private static class getInventoryItemFromOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryItemFromOrder_args> {
      public getInventoryItemFromOrder() {
        super("getInventoryItemFromOrder");
      }

      protected getInventoryItemFromOrder_args getEmptyArgsInstance() {
        return new getInventoryItemFromOrder_args();
      }

      protected getInventoryItemFromOrder_result getResult(I iface, getInventoryItemFromOrder_args args) throws org.apache.thrift.TException {
        getInventoryItemFromOrder_result result = new getInventoryItemFromOrder_result();
        try {
          result.success = iface.getInventoryItemFromOrder(args.orderId);
        } catch (WarehouseServiceException we) {
          result.we = we;
        }
        return result;
      }
    }

    private static class getInventoryAge<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryAge_args> {
      public getInventoryAge() {
        super("getInventoryAge");
      }

      protected getInventoryAge_args getEmptyArgsInstance() {
        return new getInventoryAge_args();
      }

      protected getInventoryAge_result getResult(I iface, getInventoryAge_args args) throws org.apache.thrift.TException {
        getInventoryAge_result result = new getInventoryAge_result();
        result.success = iface.getInventoryAge();
        return result;
      }
    }

    private static class getInventoryScansForItem<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryScansForItem_args> {
      public getInventoryScansForItem() {
        super("getInventoryScansForItem");
      }

      protected getInventoryScansForItem_args getEmptyArgsInstance() {
        return new getInventoryScansForItem_args();
      }

      protected getInventoryScansForItem_result getResult(I iface, getInventoryScansForItem_args args) throws org.apache.thrift.TException {
        getInventoryScansForItem_result result = new getInventoryScansForItem_result();
        result.success = iface.getInventoryScansForItem(args.itemId, args.fromDate, args.toDate);
        return result;
      }
    }

    private static class getScanRecordsForSerialNumber<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getScanRecordsForSerialNumber_args> {
      public getScanRecordsForSerialNumber() {
        super("getScanRecordsForSerialNumber");
      }

      protected getScanRecordsForSerialNumber_args getEmptyArgsInstance() {
        return new getScanRecordsForSerialNumber_args();
      }

      protected getScanRecordsForSerialNumber_result getResult(I iface, getScanRecordsForSerialNumber_args args) throws org.apache.thrift.TException {
        getScanRecordsForSerialNumber_result result = new getScanRecordsForSerialNumber_result();
        result.success = iface.getScanRecordsForSerialNumber(args.serialNumber);
        return result;
      }
    }

    private static class scanForPurchaseReturn<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForPurchaseReturn_args> {
      public scanForPurchaseReturn() {
        super("scanForPurchaseReturn");
      }

      protected scanForPurchaseReturn_args getEmptyArgsInstance() {
        return new scanForPurchaseReturn_args();
      }

      protected scanForPurchaseReturn_result getResult(I iface, scanForPurchaseReturn_args args) throws org.apache.thrift.TException {
        scanForPurchaseReturn_result result = new scanForPurchaseReturn_result();
        try {
          result.success = iface.scanForPurchaseReturn(args.saleReturnItems, args.vendorId, args.billingWarehouseId);
          result.setSuccessIsSet(true);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class scanForLostItem<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForLostItem_args> {
      public scanForLostItem() {
        super("scanForLostItem");
      }

      protected scanForLostItem_args getEmptyArgsInstance() {
        return new scanForLostItem_args();
      }

      protected scanForLostItem_result getResult(I iface, scanForLostItem_args args) throws org.apache.thrift.TException {
        scanForLostItem_result result = new scanForLostItem_result();
        try {
          iface.scanForLostItem(args.lostItems, args.vendorId, args.billingWarehouseId);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class getCurrentSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCurrentSerializedInventoryByScans_args> {
      public getCurrentSerializedInventoryByScans() {
        super("getCurrentSerializedInventoryByScans");
      }

      protected getCurrentSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getCurrentSerializedInventoryByScans_args();
      }

      protected getCurrentSerializedInventoryByScans_result getResult(I iface, getCurrentSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getCurrentSerializedInventoryByScans_result result = new getCurrentSerializedInventoryByScans_result();
        result.success = iface.getCurrentSerializedInventoryByScans(args.physicalWarehouseId);
        return result;
      }
    }

    private static class getCurrentNonSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCurrentNonSerializedInventoryByScans_args> {
      public getCurrentNonSerializedInventoryByScans() {
        super("getCurrentNonSerializedInventoryByScans");
      }

      protected getCurrentNonSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getCurrentNonSerializedInventoryByScans_args();
      }

      protected getCurrentNonSerializedInventoryByScans_result getResult(I iface, getCurrentNonSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getCurrentNonSerializedInventoryByScans_result result = new getCurrentNonSerializedInventoryByScans_result();
        result.success = iface.getCurrentNonSerializedInventoryByScans(args.physicalWarehouseId);
        return result;
      }
    }

    private static class getHistoricSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getHistoricSerializedInventoryByScans_args> {
      public getHistoricSerializedInventoryByScans() {
        super("getHistoricSerializedInventoryByScans");
      }

      protected getHistoricSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getHistoricSerializedInventoryByScans_args();
      }

      protected getHistoricSerializedInventoryByScans_result getResult(I iface, getHistoricSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getHistoricSerializedInventoryByScans_result result = new getHistoricSerializedInventoryByScans_result();
        result.success = iface.getHistoricSerializedInventoryByScans(args.date);
        return result;
      }
    }

    private static class getHistoricNonSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getHistoricNonSerializedInventoryByScans_args> {
      public getHistoricNonSerializedInventoryByScans() {
        super("getHistoricNonSerializedInventoryByScans");
      }

      protected getHistoricNonSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getHistoricNonSerializedInventoryByScans_args();
      }

      protected getHistoricNonSerializedInventoryByScans_result getResult(I iface, getHistoricNonSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getHistoricNonSerializedInventoryByScans_result result = new getHistoricNonSerializedInventoryByScans_result();
        result.success = iface.getHistoricNonSerializedInventoryByScans(args.date);
        return result;
      }
    }

    private static class getOurHistoricSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getOurHistoricSerializedInventoryByScans_args> {
      public getOurHistoricSerializedInventoryByScans() {
        super("getOurHistoricSerializedInventoryByScans");
      }

      protected getOurHistoricSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getOurHistoricSerializedInventoryByScans_args();
      }

      protected getOurHistoricSerializedInventoryByScans_result getResult(I iface, getOurHistoricSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getOurHistoricSerializedInventoryByScans_result result = new getOurHistoricSerializedInventoryByScans_result();
        result.success = iface.getOurHistoricSerializedInventoryByScans(args.date);
        return result;
      }
    }

    private static class getOurHistoricNonSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getOurHistoricNonSerializedInventoryByScans_args> {
      public getOurHistoricNonSerializedInventoryByScans() {
        super("getOurHistoricNonSerializedInventoryByScans");
      }

      protected getOurHistoricNonSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getOurHistoricNonSerializedInventoryByScans_args();
      }

      protected getOurHistoricNonSerializedInventoryByScans_result getResult(I iface, getOurHistoricNonSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getOurHistoricNonSerializedInventoryByScans_result result = new getOurHistoricNonSerializedInventoryByScans_result();
        result.success = iface.getOurHistoricNonSerializedInventoryByScans(args.date);
        return result;
      }
    }

    private static class scanForOursExternalSale<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForOursExternalSale_args> {
      public scanForOursExternalSale() {
        super("scanForOursExternalSale");
      }

      protected scanForOursExternalSale_args getEmptyArgsInstance() {
        return new scanForOursExternalSale_args();
      }

      protected scanForOursExternalSale_result getResult(I iface, scanForOursExternalSale_args args) throws org.apache.thrift.TException {
        scanForOursExternalSale_result result = new scanForOursExternalSale_result();
        try {
          result.success = iface.scanForOursExternalSale(args.itemId, args.serialNumber, args.itemNumber, args.invoiceNumber, args.warehouseId, args.unitPrice, args.nlc, args.orderId);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class scanForOursExternalSaleReturn<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForOursExternalSaleReturn_args> {
      public scanForOursExternalSaleReturn() {
        super("scanForOursExternalSaleReturn");
      }

      protected scanForOursExternalSaleReturn_args getEmptyArgsInstance() {
        return new scanForOursExternalSaleReturn_args();
      }

      protected scanForOursExternalSaleReturn_result getResult(I iface, scanForOursExternalSaleReturn_args args) throws org.apache.thrift.TException {
        scanForOursExternalSaleReturn_result result = new scanForOursExternalSaleReturn_result();
        try {
          iface.scanForOursExternalSaleReturn(args.orderId, args.unitPrice);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class getMovementNonSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getMovementNonSerializedInventoryByScans_args> {
      public getMovementNonSerializedInventoryByScans() {
        super("getMovementNonSerializedInventoryByScans");
      }

      protected getMovementNonSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getMovementNonSerializedInventoryByScans_args();
      }

      protected getMovementNonSerializedInventoryByScans_result getResult(I iface, getMovementNonSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getMovementNonSerializedInventoryByScans_result result = new getMovementNonSerializedInventoryByScans_result();
        result.success = iface.getMovementNonSerializedInventoryByScans(args.startDate, args.endDate);
        return result;
      }
    }

    private static class getMovementSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getMovementSerializedInventoryByScans_args> {
      public getMovementSerializedInventoryByScans() {
        super("getMovementSerializedInventoryByScans");
      }

      protected getMovementSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getMovementSerializedInventoryByScans_args();
      }

      protected getMovementSerializedInventoryByScans_result getResult(I iface, getMovementSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getMovementSerializedInventoryByScans_result result = new getMovementSerializedInventoryByScans_result();
        result.success = iface.getMovementSerializedInventoryByScans(args.startDate, args.endDate);
        return result;
      }
    }

    private static class getCompleteMovementSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCompleteMovementSerializedInventoryByScans_args> {
      public getCompleteMovementSerializedInventoryByScans() {
        super("getCompleteMovementSerializedInventoryByScans");
      }

      protected getCompleteMovementSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getCompleteMovementSerializedInventoryByScans_args();
      }

      protected getCompleteMovementSerializedInventoryByScans_result getResult(I iface, getCompleteMovementSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getCompleteMovementSerializedInventoryByScans_result result = new getCompleteMovementSerializedInventoryByScans_result();
        result.success = iface.getCompleteMovementSerializedInventoryByScans(args.startDate, args.endDate);
        return result;
      }
    }

    private static class getCompleteMovementNonSerializedInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCompleteMovementNonSerializedInventoryByScans_args> {
      public getCompleteMovementNonSerializedInventoryByScans() {
        super("getCompleteMovementNonSerializedInventoryByScans");
      }

      protected getCompleteMovementNonSerializedInventoryByScans_args getEmptyArgsInstance() {
        return new getCompleteMovementNonSerializedInventoryByScans_args();
      }

      protected getCompleteMovementNonSerializedInventoryByScans_result getResult(I iface, getCompleteMovementNonSerializedInventoryByScans_args args) throws org.apache.thrift.TException {
        getCompleteMovementNonSerializedInventoryByScans_result result = new getCompleteMovementNonSerializedInventoryByScans_result();
        result.success = iface.getCompleteMovementNonSerializedInventoryByScans(args.startDate, args.endDate);
        return result;
      }
    }

    private static class scanfreebie<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanfreebie_args> {
      public scanfreebie() {
        super("scanfreebie");
      }

      protected scanfreebie_args getEmptyArgsInstance() {
        return new scanfreebie_args();
      }

      protected scanfreebie_result getResult(I iface, scanfreebie_args args) throws org.apache.thrift.TException {
        scanfreebie_result result = new scanfreebie_result();
        try {
          result.success = iface.scanfreebie(args.orderId, args.freebieItemId, args.freebieWarehouseId, args.scanType);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class reshipfreebie<I extends Iface> extends org.apache.thrift.ProcessFunction<I, reshipfreebie_args> {
      public reshipfreebie() {
        super("reshipfreebie");
      }

      protected reshipfreebie_args getEmptyArgsInstance() {
        return new reshipfreebie_args();
      }

      protected reshipfreebie_result getResult(I iface, reshipfreebie_args args) throws org.apache.thrift.TException {
        reshipfreebie_result result = new reshipfreebie_result();
        try {
          iface.reshipfreebie(args.oldOrderId, args.newOrderId, args.freebieItemId, args.scanType);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class isItemTransferAllowed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isItemTransferAllowed_args> {
      public isItemTransferAllowed() {
        super("isItemTransferAllowed");
      }

      protected isItemTransferAllowed_args getEmptyArgsInstance() {
        return new isItemTransferAllowed_args();
      }

      protected isItemTransferAllowed_result getResult(I iface, isItemTransferAllowed_args args) throws org.apache.thrift.TException {
        isItemTransferAllowed_result result = new isItemTransferAllowed_result();
        result.success = iface.isItemTransferAllowed(args.warehouseId, args.transferWarehouseId);
        result.setSuccessIsSet(true);
        return result;
      }
    }

    private static class createTransferLot<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createTransferLot_args> {
      public createTransferLot() {
        super("createTransferLot");
      }

      protected createTransferLot_args getEmptyArgsInstance() {
        return new createTransferLot_args();
      }

      protected createTransferLot_result getResult(I iface, createTransferLot_args args) throws org.apache.thrift.TException {
        createTransferLot_result result = new createTransferLot_result();
        try {
          result.success = iface.createTransferLot(args.originWarehouseId, args.destWarehouseId);
          result.setSuccessIsSet(true);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getTransferLot<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getTransferLot_args> {
      public getTransferLot() {
        super("getTransferLot");
      }

      protected getTransferLot_args getEmptyArgsInstance() {
        return new getTransferLot_args();
      }

      protected getTransferLot_result getResult(I iface, getTransferLot_args args) throws org.apache.thrift.TException {
        getTransferLot_result result = new getTransferLot_result();
        try {
          result.success = iface.getTransferLot(args.transferLotId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class markTransferLotAsReceived<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markTransferLotAsReceived_args> {
      public markTransferLotAsReceived() {
        super("markTransferLotAsReceived");
      }

      protected markTransferLotAsReceived_args getEmptyArgsInstance() {
        return new markTransferLotAsReceived_args();
      }

      protected markTransferLotAsReceived_result getResult(I iface, markTransferLotAsReceived_args args) throws org.apache.thrift.TException {
        markTransferLotAsReceived_result result = new markTransferLotAsReceived_result();
        try {
          iface.markTransferLotAsReceived(args.id, args.remoteTransferRefNumber);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getTransferLotsByDate<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getTransferLotsByDate_args> {
      public getTransferLotsByDate() {
        super("getTransferLotsByDate");
      }

      protected getTransferLotsByDate_args getEmptyArgsInstance() {
        return new getTransferLotsByDate_args();
      }

      protected getTransferLotsByDate_result getResult(I iface, getTransferLotsByDate_args args) throws org.apache.thrift.TException {
        getTransferLotsByDate_result result = new getTransferLotsByDate_result();
        try {
          result.success = iface.getTransferLotsByDate(args.fromDate, args.toDate);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getAllowedDestinationWarehousesForTransfer<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllowedDestinationWarehousesForTransfer_args> {
      public getAllowedDestinationWarehousesForTransfer() {
        super("getAllowedDestinationWarehousesForTransfer");
      }

      protected getAllowedDestinationWarehousesForTransfer_args getEmptyArgsInstance() {
        return new getAllowedDestinationWarehousesForTransfer_args();
      }

      protected getAllowedDestinationWarehousesForTransfer_result getResult(I iface, getAllowedDestinationWarehousesForTransfer_args args) throws org.apache.thrift.TException {
        getAllowedDestinationWarehousesForTransfer_result result = new getAllowedDestinationWarehousesForTransfer_result();
        result.success = iface.getAllowedDestinationWarehousesForTransfer(args.warehouseId);
        return result;
      }
    }

    private static class getItemsInTransferLot<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemsInTransferLot_args> {
      public getItemsInTransferLot() {
        super("getItemsInTransferLot");
      }

      protected getItemsInTransferLot_args getEmptyArgsInstance() {
        return new getItemsInTransferLot_args();
      }

      protected getItemsInTransferLot_result getResult(I iface, getItemsInTransferLot_args args) throws org.apache.thrift.TException {
        getItemsInTransferLot_result result = new getItemsInTransferLot_result();
        result.success = iface.getItemsInTransferLot(args.transferLotId);
        return result;
      }
    }

    private static class markItemsAsReceivedForTransferLot<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markItemsAsReceivedForTransferLot_args> {
      public markItemsAsReceivedForTransferLot() {
        super("markItemsAsReceivedForTransferLot");
      }

      protected markItemsAsReceivedForTransferLot_args getEmptyArgsInstance() {
        return new markItemsAsReceivedForTransferLot_args();
      }

      protected markItemsAsReceivedForTransferLot_result getResult(I iface, markItemsAsReceivedForTransferLot_args args) throws org.apache.thrift.TException {
        markItemsAsReceivedForTransferLot_result result = new markItemsAsReceivedForTransferLot_result();
        try {
          iface.markItemsAsReceivedForTransferLot(args.id);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class updateTransferLotAfterItemReceive<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateTransferLotAfterItemReceive_args> {
      public updateTransferLotAfterItemReceive() {
        super("updateTransferLotAfterItemReceive");
      }

      protected updateTransferLotAfterItemReceive_args getEmptyArgsInstance() {
        return new updateTransferLotAfterItemReceive_args();
      }

      protected updateTransferLotAfterItemReceive_result getResult(I iface, updateTransferLotAfterItemReceive_args args) throws org.apache.thrift.TException {
        updateTransferLotAfterItemReceive_result result = new updateTransferLotAfterItemReceive_result();
        try {
          result.success = iface.updateTransferLotAfterItemReceive(args.id);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class scanForTransferOut<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForTransferOut_args> {
      public scanForTransferOut() {
        super("scanForTransferOut");
      }

      protected scanForTransferOut_args getEmptyArgsInstance() {
        return new scanForTransferOut_args();
      }

      protected scanForTransferOut_result getResult(I iface, scanForTransferOut_args args) throws org.apache.thrift.TException {
        scanForTransferOut_result result = new scanForTransferOut_result();
        try {
          iface.scanForTransferOut(args.inventoryItems, args.type, args.transferLotId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class scanForTransferIn<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForTransferIn_args> {
      public scanForTransferIn() {
        super("scanForTransferIn");
      }

      protected scanForTransferIn_args getEmptyArgsInstance() {
        return new scanForTransferIn_args();
      }

      protected scanForTransferIn_result getResult(I iface, scanForTransferIn_args args) throws org.apache.thrift.TException {
        scanForTransferIn_result result = new scanForTransferIn_result();
        try {
          iface.scanForTransferIn(args.inventoryItems, args.type, args.transferLotId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class scanForOursThirdPartyReceive<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForOursThirdPartyReceive_args> {
      public scanForOursThirdPartyReceive() {
        super("scanForOursThirdPartyReceive");
      }

      protected scanForOursThirdPartyReceive_args getEmptyArgsInstance() {
        return new scanForOursThirdPartyReceive_args();
      }

      protected scanForOursThirdPartyReceive_result getResult(I iface, scanForOursThirdPartyReceive_args args) throws org.apache.thrift.TException {
        scanForOursThirdPartyReceive_result result = new scanForOursThirdPartyReceive_result();
        try {
          iface.scanForOursThirdPartyReceive(args.inventoryItems, args.id);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args> {
      public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse() {
        super("getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse");
      }

      protected getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args getEmptyArgsInstance() {
        return new getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args();
      }

      protected getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result getResult(I iface, getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args args) throws org.apache.thrift.TException {
        getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result result = new getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result();
        try {
          result.success = iface.getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse(args.itemId, args.physicalWarehouseId);
          result.setSuccessIsSet(true);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getInTransitInventory<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInTransitInventory_args> {
      public getInTransitInventory() {
        super("getInTransitInventory");
      }

      protected getInTransitInventory_args getEmptyArgsInstance() {
        return new getInTransitInventory_args();
      }

      protected getInTransitInventory_result getResult(I iface, getInTransitInventory_args args) throws org.apache.thrift.TException {
        getInTransitInventory_result result = new getInTransitInventory_result();
        result.success = iface.getInTransitInventory(args.originWarehouseId);
        return result;
      }
    }

    private static class isItemAvailableForSale<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isItemAvailableForSale_args> {
      public isItemAvailableForSale() {
        super("isItemAvailableForSale");
      }

      protected isItemAvailableForSale_args getEmptyArgsInstance() {
        return new isItemAvailableForSale_args();
      }

      protected isItemAvailableForSale_result getResult(I iface, isItemAvailableForSale_args args) throws org.apache.thrift.TException {
        isItemAvailableForSale_result result = new isItemAvailableForSale_result();
        try {
          result.success = iface.isItemAvailableForSale(args.itemId, args.serialNumber, args.warehouseId);
          result.setSuccessIsSet(true);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getHistoricBadInventoryByScans<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getHistoricBadInventoryByScans_args> {
      public getHistoricBadInventoryByScans() {
        super("getHistoricBadInventoryByScans");
      }

      protected getHistoricBadInventoryByScans_args getEmptyArgsInstance() {
        return new getHistoricBadInventoryByScans_args();
      }

      protected getHistoricBadInventoryByScans_result getResult(I iface, getHistoricBadInventoryByScans_args args) throws org.apache.thrift.TException {
        getHistoricBadInventoryByScans_result result = new getHistoricBadInventoryByScans_result();
        try {
          result.success = iface.getHistoricBadInventoryByScans(args.date);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class scanForBadSale<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForBadSale_args> {
      public scanForBadSale() {
        super("scanForBadSale");
      }

      protected scanForBadSale_args getEmptyArgsInstance() {
        return new scanForBadSale_args();
      }

      protected scanForBadSale_result getResult(I iface, scanForBadSale_args args) throws org.apache.thrift.TException {
        scanForBadSale_result result = new scanForBadSale_result();
        try {
          result.success = iface.scanForBadSale(args.serialNumber, args.itemNumber, args.itemId, args.orderId, args.fulfilmentWarehouseId, args.quantity, args.billingWarehouseId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getTransferLotItemsForMarkReceive<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getTransferLotItemsForMarkReceive_args> {
      public getTransferLotItemsForMarkReceive() {
        super("getTransferLotItemsForMarkReceive");
      }

      protected getTransferLotItemsForMarkReceive_args getEmptyArgsInstance() {
        return new getTransferLotItemsForMarkReceive_args();
      }

      protected getTransferLotItemsForMarkReceive_result getResult(I iface, getTransferLotItemsForMarkReceive_args args) throws org.apache.thrift.TException {
        getTransferLotItemsForMarkReceive_result result = new getTransferLotItemsForMarkReceive_result();
        try {
          result.success = iface.getTransferLotItemsForMarkReceive(args.transferLotId, args.scanType);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class markItemsAsReceivedForTransferLotPartial<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markItemsAsReceivedForTransferLotPartial_args> {
      public markItemsAsReceivedForTransferLotPartial() {
        super("markItemsAsReceivedForTransferLotPartial");
      }

      protected markItemsAsReceivedForTransferLotPartial_args getEmptyArgsInstance() {
        return new markItemsAsReceivedForTransferLotPartial_args();
      }

      protected markItemsAsReceivedForTransferLotPartial_result getResult(I iface, markItemsAsReceivedForTransferLotPartial_args args) throws org.apache.thrift.TException {
        markItemsAsReceivedForTransferLotPartial_result result = new markItemsAsReceivedForTransferLotPartial_result();
        try {
          iface.markItemsAsReceivedForTransferLotPartial(args.inventoryItems, args.transferLotId);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class markTransferLotAsReceivedPartial<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markTransferLotAsReceivedPartial_args> {
      public markTransferLotAsReceivedPartial() {
        super("markTransferLotAsReceivedPartial");
      }

      protected markTransferLotAsReceivedPartial_args getEmptyArgsInstance() {
        return new markTransferLotAsReceivedPartial_args();
      }

      protected markTransferLotAsReceivedPartial_result getResult(I iface, markTransferLotAsReceivedPartial_args args) throws org.apache.thrift.TException {
        markTransferLotAsReceivedPartial_result result = new markTransferLotAsReceivedPartial_result();
        try {
          iface.markTransferLotAsReceivedPartial(args.id, args.remoteTransferRefNumber);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getInventoryItemScannedInForPO<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryItemScannedInForPO_args> {
      public getInventoryItemScannedInForPO() {
        super("getInventoryItemScannedInForPO");
      }

      protected getInventoryItemScannedInForPO_args getEmptyArgsInstance() {
        return new getInventoryItemScannedInForPO_args();
      }

      protected getInventoryItemScannedInForPO_result getResult(I iface, getInventoryItemScannedInForPO_args args) throws org.apache.thrift.TException {
        getInventoryItemScannedInForPO_result result = new getInventoryItemScannedInForPO_result();
        try {
          result.success = iface.getInventoryItemScannedInForPO(args.itemId, args.purchaseIds);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getAmazonTransferredSkuDetails<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAmazonTransferredSkuDetails_args> {
      public getAmazonTransferredSkuDetails() {
        super("getAmazonTransferredSkuDetails");
      }

      protected getAmazonTransferredSkuDetails_args getEmptyArgsInstance() {
        return new getAmazonTransferredSkuDetails_args();
      }

      protected getAmazonTransferredSkuDetails_result getResult(I iface, getAmazonTransferredSkuDetails_args args) throws org.apache.thrift.TException {
        getAmazonTransferredSkuDetails_result result = new getAmazonTransferredSkuDetails_result();
        try {
          result.success = iface.getAmazonTransferredSkuDetails(args.itemIds);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getScansforPurchase<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getScansforPurchase_args> {
      public getScansforPurchase() {
        super("getScansforPurchase");
      }

      protected getScansforPurchase_args getEmptyArgsInstance() {
        return new getScansforPurchase_args();
      }

      protected getScansforPurchase_result getResult(I iface, getScansforPurchase_args args) throws org.apache.thrift.TException {
        getScansforPurchase_result result = new getScansforPurchase_result();
        try {
          result.success = iface.getScansforPurchase(args.purchaseId, args.scanType);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getCurrentBadQuantityForItem<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCurrentBadQuantityForItem_args> {
      public getCurrentBadQuantityForItem() {
        super("getCurrentBadQuantityForItem");
      }

      protected getCurrentBadQuantityForItem_args getEmptyArgsInstance() {
        return new getCurrentBadQuantityForItem_args();
      }

      protected getCurrentBadQuantityForItem_result getResult(I iface, getCurrentBadQuantityForItem_args args) throws org.apache.thrift.TException {
        getCurrentBadQuantityForItem_result result = new getCurrentBadQuantityForItem_result();
        try {
          result.success = iface.getCurrentBadQuantityForItem(args.itemId, args.currentWarehouseId, args.physicalWarehouseId);
          result.setSuccessIsSet(true);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class scanForBadPurchaseReturn<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanForBadPurchaseReturn_args> {
      public scanForBadPurchaseReturn() {
        super("scanForBadPurchaseReturn");
      }

      protected scanForBadPurchaseReturn_args getEmptyArgsInstance() {
        return new scanForBadPurchaseReturn_args();
      }

      protected scanForBadPurchaseReturn_result getResult(I iface, scanForBadPurchaseReturn_args args) throws org.apache.thrift.TException {
        scanForBadPurchaseReturn_result result = new scanForBadPurchaseReturn_result();
        try {
          result.success = iface.scanForBadPurchaseReturn(args.saleReturnItems, args.vendorId, args.billingWarehouseId);
          result.setSuccessIsSet(true);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class getItemsInPurchaseReturn<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemsInPurchaseReturn_args> {
      public getItemsInPurchaseReturn() {
        super("getItemsInPurchaseReturn");
      }

      protected getItemsInPurchaseReturn_args getEmptyArgsInstance() {
        return new getItemsInPurchaseReturn_args();
      }

      protected getItemsInPurchaseReturn_result getResult(I iface, getItemsInPurchaseReturn_args args) throws org.apache.thrift.TException {
        getItemsInPurchaseReturn_result result = new getItemsInPurchaseReturn_result();
        try {
          result.success = iface.getItemsInPurchaseReturn(args.purchaseReturnId, args.type, args.returnTime);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class getScansForInventoryItem<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getScansForInventoryItem_args> {
      public getScansForInventoryItem() {
        super("getScansForInventoryItem");
      }

      protected getScansForInventoryItem_args getEmptyArgsInstance() {
        return new getScansForInventoryItem_args();
      }

      protected getScansForInventoryItem_result getResult(I iface, getScansForInventoryItem_args args) throws org.apache.thrift.TException {
        getScansForInventoryItem_result result = new getScansForInventoryItem_result();
        try {
          result.success = iface.getScansForInventoryItem(args.inventoryItemId, args.type);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class checkGrnImeiStatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, checkGrnImeiStatus_args> {
      public checkGrnImeiStatus() {
        super("checkGrnImeiStatus");
      }

      protected checkGrnImeiStatus_args getEmptyArgsInstance() {
        return new checkGrnImeiStatus_args();
      }

      protected checkGrnImeiStatus_result getResult(I iface, checkGrnImeiStatus_args args) throws org.apache.thrift.TException {
        checkGrnImeiStatus_result result = new checkGrnImeiStatus_result();
        try {
          result.success = iface.checkGrnImeiStatus(args.imeiNos);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class getInventoryAgeConsideredItems<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryAgeConsideredItems_args> {
      public getInventoryAgeConsideredItems() {
        super("getInventoryAgeConsideredItems");
      }

      protected getInventoryAgeConsideredItems_args getEmptyArgsInstance() {
        return new getInventoryAgeConsideredItems_args();
      }

      protected getInventoryAgeConsideredItems_result getResult(I iface, getInventoryAgeConsideredItems_args args) throws org.apache.thrift.TException {
        getInventoryAgeConsideredItems_result result = new getInventoryAgeConsideredItems_result();
        try {
          result.success = iface.getInventoryAgeConsideredItems(args.itemId);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class getCompleteMovementForThirdPartyWarehouse<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCompleteMovementForThirdPartyWarehouse_args> {
      public getCompleteMovementForThirdPartyWarehouse() {
        super("getCompleteMovementForThirdPartyWarehouse");
      }

      protected getCompleteMovementForThirdPartyWarehouse_args getEmptyArgsInstance() {
        return new getCompleteMovementForThirdPartyWarehouse_args();
      }

      protected getCompleteMovementForThirdPartyWarehouse_result getResult(I iface, getCompleteMovementForThirdPartyWarehouse_args args) throws org.apache.thrift.TException {
        getCompleteMovementForThirdPartyWarehouse_result result = new getCompleteMovementForThirdPartyWarehouse_result();
        result.success = iface.getCompleteMovementForThirdPartyWarehouse(args.startDate, args.endDate);
        return result;
      }
    }

    private static class getAllDoaOutInventoryItems<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllDoaOutInventoryItems_args> {
      public getAllDoaOutInventoryItems() {
        super("getAllDoaOutInventoryItems");
      }

      protected getAllDoaOutInventoryItems_args getEmptyArgsInstance() {
        return new getAllDoaOutInventoryItems_args();
      }

      protected getAllDoaOutInventoryItems_result getResult(I iface, getAllDoaOutInventoryItems_args args) throws org.apache.thrift.TException {
        getAllDoaOutInventoryItems_result result = new getAllDoaOutInventoryItems_result();
        try {
          result.success = iface.getAllDoaOutInventoryItems();
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class getAllUnCompletedStockShipments<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllUnCompletedStockShipments_args> {
      public getAllUnCompletedStockShipments() {
        super("getAllUnCompletedStockShipments");
      }

      protected getAllUnCompletedStockShipments_args getEmptyArgsInstance() {
        return new getAllUnCompletedStockShipments_args();
      }

      protected getAllUnCompletedStockShipments_result getResult(I iface, getAllUnCompletedStockShipments_args args) throws org.apache.thrift.TException {
        getAllUnCompletedStockShipments_result result = new getAllUnCompletedStockShipments_result();
        try {
          result.success = iface.getAllUnCompletedStockShipments(args.source);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class getRemovalStockShipmentReferenceById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRemovalStockShipmentReferenceById_args> {
      public getRemovalStockShipmentReferenceById() {
        super("getRemovalStockShipmentReferenceById");
      }

      protected getRemovalStockShipmentReferenceById_args getEmptyArgsInstance() {
        return new getRemovalStockShipmentReferenceById_args();
      }

      protected getRemovalStockShipmentReferenceById_result getResult(I iface, getRemovalStockShipmentReferenceById_args args) throws org.apache.thrift.TException {
        getRemovalStockShipmentReferenceById_result result = new getRemovalStockShipmentReferenceById_result();
        try {
          result.success = iface.getRemovalStockShipmentReferenceById(args.id);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class createRemovalStockShipmentReference<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createRemovalStockShipmentReference_args> {
      public createRemovalStockShipmentReference() {
        super("createRemovalStockShipmentReference");
      }

      protected createRemovalStockShipmentReference_args getEmptyArgsInstance() {
        return new createRemovalStockShipmentReference_args();
      }

      protected createRemovalStockShipmentReference_result getResult(I iface, createRemovalStockShipmentReference_args args) throws org.apache.thrift.TException {
        createRemovalStockShipmentReference_result result = new createRemovalStockShipmentReference_result();
        try {
          result.success = iface.createRemovalStockShipmentReference(args.removalStockShipmentReference);
          result.setSuccessIsSet(true);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class updateShipmentReferenceTransferLot<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateShipmentReferenceTransferLot_args> {
      public updateShipmentReferenceTransferLot() {
        super("updateShipmentReferenceTransferLot");
      }

      protected updateShipmentReferenceTransferLot_args getEmptyArgsInstance() {
        return new updateShipmentReferenceTransferLot_args();
      }

      protected updateShipmentReferenceTransferLot_result getResult(I iface, updateShipmentReferenceTransferLot_args args) throws org.apache.thrift.TException {
        updateShipmentReferenceTransferLot_result result = new updateShipmentReferenceTransferLot_result();
        try {
          iface.updateShipmentReferenceTransferLot(args.transferLotId, args.shipmentReferenceId);
        } catch (WarehouseServiceException ex) {
          result.ex = ex;
        }
        return result;
      }
    }

    private static class fetchScansPerTransferInvoiceNumber<I extends Iface> extends org.apache.thrift.ProcessFunction<I, fetchScansPerTransferInvoiceNumber_args> {
      public fetchScansPerTransferInvoiceNumber() {
        super("fetchScansPerTransferInvoiceNumber");
      }

      protected fetchScansPerTransferInvoiceNumber_args getEmptyArgsInstance() {
        return new fetchScansPerTransferInvoiceNumber_args();
      }

      protected fetchScansPerTransferInvoiceNumber_result getResult(I iface, fetchScansPerTransferInvoiceNumber_args args) throws org.apache.thrift.TException {
        fetchScansPerTransferInvoiceNumber_result result = new fetchScansPerTransferInvoiceNumber_result();
        result.success = iface.fetchScansPerTransferInvoiceNumber(args.date);
        return result;
      }
    }

    private static class getInventoryItems<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryItems_args> {
      public getInventoryItems() {
        super("getInventoryItems");
      }

      protected getInventoryItems_args getEmptyArgsInstance() {
        return new getInventoryItems_args();
      }

      protected getInventoryItems_result getResult(I iface, getInventoryItems_args args) throws org.apache.thrift.TException {
        getInventoryItems_result result = new getInventoryItems_result();
        try {
          result.success = iface.getInventoryItems(args.serialNumbers);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class getInventoryItemsBySerailNumbers<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInventoryItemsBySerailNumbers_args> {
      public getInventoryItemsBySerailNumbers() {
        super("getInventoryItemsBySerailNumbers");
      }

      protected getInventoryItemsBySerailNumbers_args getEmptyArgsInstance() {
        return new getInventoryItemsBySerailNumbers_args();
      }

      protected getInventoryItemsBySerailNumbers_result getResult(I iface, getInventoryItemsBySerailNumbers_args args) throws org.apache.thrift.TException {
        getInventoryItemsBySerailNumbers_result result = new getInventoryItemsBySerailNumbers_result();
        try {
          result.success = iface.getInventoryItemsBySerailNumbers(args.serialNumbers);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

    private static class scanPurchaseBulk<I extends Iface> extends org.apache.thrift.ProcessFunction<I, scanPurchaseBulk_args> {
      public scanPurchaseBulk() {
        super("scanPurchaseBulk");
      }

      protected scanPurchaseBulk_args getEmptyArgsInstance() {
        return new scanPurchaseBulk_args();
      }

      protected scanPurchaseBulk_result getResult(I iface, scanPurchaseBulk_args args) throws org.apache.thrift.TException {
        scanPurchaseBulk_result result = new scanPurchaseBulk_result();
        try {
          iface.scanPurchaseBulk(args.inventoryItems);
        } catch (WarehouseServiceException wex) {
          result.wex = wex;
        }
        return result;
      }
    }

  }

  public static class getInventoryItem_args implements org.apache.thrift.TBase<getInventoryItem_args, getInventoryItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItem_args");

    private static final org.apache.thrift.protocol.TField SERIAL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("serialNumber", org.apache.thrift.protocol.TType.STRING, (short)1);

    private String serialNumber; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SERIAL_NUMBER((short)1, "serialNumber");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SERIAL_NUMBER
            return SERIAL_NUMBER;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SERIAL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("serialNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItem_args.class, metaDataMap);
    }

    public getInventoryItem_args() {
    }

    public getInventoryItem_args(
      String serialNumber)
    {
      this();
      this.serialNumber = serialNumber;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItem_args(getInventoryItem_args other) {
      if (other.isSetSerialNumber()) {
        this.serialNumber = other.serialNumber;
      }
    }

    public getInventoryItem_args deepCopy() {
      return new getInventoryItem_args(this);
    }

    @Override
    public void clear() {
      this.serialNumber = null;
    }

    public String getSerialNumber() {
      return this.serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
      this.serialNumber = serialNumber;
    }

    public void unsetSerialNumber() {
      this.serialNumber = null;
    }

    /** Returns true if field serialNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetSerialNumber() {
      return this.serialNumber != null;
    }

    public void setSerialNumberIsSet(boolean value) {
      if (!value) {
        this.serialNumber = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SERIAL_NUMBER:
        if (value == null) {
          unsetSerialNumber();
        } else {
          setSerialNumber((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SERIAL_NUMBER:
        return getSerialNumber();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SERIAL_NUMBER:
        return isSetSerialNumber();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItem_args)
        return this.equals((getInventoryItem_args)that);
      return false;
    }

    public boolean equals(getInventoryItem_args that) {
      if (that == null)
        return false;

      boolean this_present_serialNumber = true && this.isSetSerialNumber();
      boolean that_present_serialNumber = true && that.isSetSerialNumber();
      if (this_present_serialNumber || that_present_serialNumber) {
        if (!(this_present_serialNumber && that_present_serialNumber))
          return false;
        if (!this.serialNumber.equals(that.serialNumber))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItem_args typedOther = (getInventoryItem_args)other;

      lastComparison = Boolean.valueOf(isSetSerialNumber()).compareTo(typedOther.isSetSerialNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSerialNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialNumber, typedOther.serialNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SERIAL_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.serialNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.serialNumber != null) {
        oprot.writeFieldBegin(SERIAL_NUMBER_FIELD_DESC);
        oprot.writeString(this.serialNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItem_args(");
      boolean first = true;

      sb.append("serialNumber:");
      if (this.serialNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.serialNumber);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItem_result implements org.apache.thrift.TBase<getInventoryItem_result, getInventoryItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItem_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryItem success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItem_result.class, metaDataMap);
    }

    public getInventoryItem_result() {
    }

    public getInventoryItem_result(
      InventoryItem success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItem_result(getInventoryItem_result other) {
      if (other.isSetSuccess()) {
        this.success = new InventoryItem(other.success);
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getInventoryItem_result deepCopy() {
      return new getInventoryItem_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public InventoryItem getSuccess() {
      return this.success;
    }

    public void setSuccess(InventoryItem success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((InventoryItem)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItem_result)
        return this.equals((getInventoryItem_result)that);
      return false;
    }

    public boolean equals(getInventoryItem_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItem_result typedOther = (getInventoryItem_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new InventoryItem();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItem_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getNonSeralizedInventoryItem_args implements org.apache.thrift.TBase<getNonSeralizedInventoryItem_args, getNonSeralizedInventoryItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getNonSeralizedInventoryItem_args");

    private static final org.apache.thrift.protocol.TField ITEM_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("itemNumber", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField FULFILMENT_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fulfilmentWarehouseId", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField BILLING_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("billingWarehouseId", org.apache.thrift.protocol.TType.I64, (short)4);

    private String itemNumber; // required
    private long itemId; // required
    private long fulfilmentWarehouseId; // required
    private long billingWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_NUMBER((short)1, "itemNumber"),
      ITEM_ID((short)2, "itemId"),
      FULFILMENT_WAREHOUSE_ID((short)3, "fulfilmentWarehouseId"),
      BILLING_WAREHOUSE_ID((short)4, "billingWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_NUMBER
            return ITEM_NUMBER;
          case 2: // ITEM_ID
            return ITEM_ID;
          case 3: // FULFILMENT_WAREHOUSE_ID
            return FULFILMENT_WAREHOUSE_ID;
          case 4: // BILLING_WAREHOUSE_ID
            return BILLING_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private static final int __FULFILMENTWAREHOUSEID_ISSET_ID = 1;
    private static final int __BILLINGWAREHOUSEID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("itemNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FULFILMENT_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("fulfilmentWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BILLING_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("billingWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNonSeralizedInventoryItem_args.class, metaDataMap);
    }

    public getNonSeralizedInventoryItem_args() {
    }

    public getNonSeralizedInventoryItem_args(
      String itemNumber,
      long itemId,
      long fulfilmentWarehouseId,
      long billingWarehouseId)
    {
      this();
      this.itemNumber = itemNumber;
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.fulfilmentWarehouseId = fulfilmentWarehouseId;
      setFulfilmentWarehouseIdIsSet(true);
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getNonSeralizedInventoryItem_args(getNonSeralizedInventoryItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetItemNumber()) {
        this.itemNumber = other.itemNumber;
      }
      this.itemId = other.itemId;
      this.fulfilmentWarehouseId = other.fulfilmentWarehouseId;
      this.billingWarehouseId = other.billingWarehouseId;
    }

    public getNonSeralizedInventoryItem_args deepCopy() {
      return new getNonSeralizedInventoryItem_args(this);
    }

    @Override
    public void clear() {
      this.itemNumber = null;
      setItemIdIsSet(false);
      this.itemId = 0;
      setFulfilmentWarehouseIdIsSet(false);
      this.fulfilmentWarehouseId = 0;
      setBillingWarehouseIdIsSet(false);
      this.billingWarehouseId = 0;
    }

    public String getItemNumber() {
      return this.itemNumber;
    }

    public void setItemNumber(String itemNumber) {
      this.itemNumber = itemNumber;
    }

    public void unsetItemNumber() {
      this.itemNumber = null;
    }

    /** Returns true if field itemNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetItemNumber() {
      return this.itemNumber != null;
    }

    public void setItemNumberIsSet(boolean value) {
      if (!value) {
        this.itemNumber = null;
      }
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public long getFulfilmentWarehouseId() {
      return this.fulfilmentWarehouseId;
    }

    public void setFulfilmentWarehouseId(long fulfilmentWarehouseId) {
      this.fulfilmentWarehouseId = fulfilmentWarehouseId;
      setFulfilmentWarehouseIdIsSet(true);
    }

    public void unsetFulfilmentWarehouseId() {
      __isset_bit_vector.clear(__FULFILMENTWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field fulfilmentWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetFulfilmentWarehouseId() {
      return __isset_bit_vector.get(__FULFILMENTWAREHOUSEID_ISSET_ID);
    }

    public void setFulfilmentWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__FULFILMENTWAREHOUSEID_ISSET_ID, value);
    }

    public long getBillingWarehouseId() {
      return this.billingWarehouseId;
    }

    public void setBillingWarehouseId(long billingWarehouseId) {
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    public void unsetBillingWarehouseId() {
      __isset_bit_vector.clear(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field billingWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetBillingWarehouseId() {
      return __isset_bit_vector.get(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    public void setBillingWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__BILLINGWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_NUMBER:
        if (value == null) {
          unsetItemNumber();
        } else {
          setItemNumber((String)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case FULFILMENT_WAREHOUSE_ID:
        if (value == null) {
          unsetFulfilmentWarehouseId();
        } else {
          setFulfilmentWarehouseId((Long)value);
        }
        break;

      case BILLING_WAREHOUSE_ID:
        if (value == null) {
          unsetBillingWarehouseId();
        } else {
          setBillingWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_NUMBER:
        return getItemNumber();

      case ITEM_ID:
        return Long.valueOf(getItemId());

      case FULFILMENT_WAREHOUSE_ID:
        return Long.valueOf(getFulfilmentWarehouseId());

      case BILLING_WAREHOUSE_ID:
        return Long.valueOf(getBillingWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_NUMBER:
        return isSetItemNumber();
      case ITEM_ID:
        return isSetItemId();
      case FULFILMENT_WAREHOUSE_ID:
        return isSetFulfilmentWarehouseId();
      case BILLING_WAREHOUSE_ID:
        return isSetBillingWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getNonSeralizedInventoryItem_args)
        return this.equals((getNonSeralizedInventoryItem_args)that);
      return false;
    }

    public boolean equals(getNonSeralizedInventoryItem_args that) {
      if (that == null)
        return false;

      boolean this_present_itemNumber = true && this.isSetItemNumber();
      boolean that_present_itemNumber = true && that.isSetItemNumber();
      if (this_present_itemNumber || that_present_itemNumber) {
        if (!(this_present_itemNumber && that_present_itemNumber))
          return false;
        if (!this.itemNumber.equals(that.itemNumber))
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      boolean this_present_fulfilmentWarehouseId = true;
      boolean that_present_fulfilmentWarehouseId = true;
      if (this_present_fulfilmentWarehouseId || that_present_fulfilmentWarehouseId) {
        if (!(this_present_fulfilmentWarehouseId && that_present_fulfilmentWarehouseId))
          return false;
        if (this.fulfilmentWarehouseId != that.fulfilmentWarehouseId)
          return false;
      }

      boolean this_present_billingWarehouseId = true;
      boolean that_present_billingWarehouseId = true;
      if (this_present_billingWarehouseId || that_present_billingWarehouseId) {
        if (!(this_present_billingWarehouseId && that_present_billingWarehouseId))
          return false;
        if (this.billingWarehouseId != that.billingWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getNonSeralizedInventoryItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getNonSeralizedInventoryItem_args typedOther = (getNonSeralizedInventoryItem_args)other;

      lastComparison = Boolean.valueOf(isSetItemNumber()).compareTo(typedOther.isSetItemNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemNumber, typedOther.itemNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFulfilmentWarehouseId()).compareTo(typedOther.isSetFulfilmentWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFulfilmentWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fulfilmentWarehouseId, typedOther.fulfilmentWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBillingWarehouseId()).compareTo(typedOther.isSetBillingWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBillingWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.billingWarehouseId, typedOther.billingWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.itemNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // FULFILMENT_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.fulfilmentWarehouseId = iprot.readI64();
              setFulfilmentWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // BILLING_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.billingWarehouseId = iprot.readI64();
              setBillingWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.itemNumber != null) {
        oprot.writeFieldBegin(ITEM_NUMBER_FIELD_DESC);
        oprot.writeString(this.itemNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FULFILMENT_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.fulfilmentWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BILLING_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.billingWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getNonSeralizedInventoryItem_args(");
      boolean first = true;

      sb.append("itemNumber:");
      if (this.itemNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.itemNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("fulfilmentWarehouseId:");
      sb.append(this.fulfilmentWarehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("billingWarehouseId:");
      sb.append(this.billingWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getNonSeralizedInventoryItem_result implements org.apache.thrift.TBase<getNonSeralizedInventoryItem_result, getNonSeralizedInventoryItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getNonSeralizedInventoryItem_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryItem success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNonSeralizedInventoryItem_result.class, metaDataMap);
    }

    public getNonSeralizedInventoryItem_result() {
    }

    public getNonSeralizedInventoryItem_result(
      InventoryItem success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getNonSeralizedInventoryItem_result(getNonSeralizedInventoryItem_result other) {
      if (other.isSetSuccess()) {
        this.success = new InventoryItem(other.success);
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getNonSeralizedInventoryItem_result deepCopy() {
      return new getNonSeralizedInventoryItem_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public InventoryItem getSuccess() {
      return this.success;
    }

    public void setSuccess(InventoryItem success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((InventoryItem)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getNonSeralizedInventoryItem_result)
        return this.equals((getNonSeralizedInventoryItem_result)that);
      return false;
    }

    public boolean equals(getNonSeralizedInventoryItem_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getNonSeralizedInventoryItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getNonSeralizedInventoryItem_result typedOther = (getNonSeralizedInventoryItem_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new InventoryItem();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getNonSeralizedInventoryItem_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scan_args implements org.apache.thrift.TBase<scan_args, scan_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scan_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEM_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItem", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField BILLING_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("billingWarehouseId", org.apache.thrift.protocol.TType.I64, (short)4);
    private static final org.apache.thrift.protocol.TField TRANSFER_LOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transferLotId", org.apache.thrift.protocol.TType.I64, (short)5);

    private InventoryItem inventoryItem; // required
    private ScanType type; // required
    private long quantity; // required
    private long billingWarehouseId; // required
    private long transferLotId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEM((short)1, "inventoryItem"),
      /**
       * 
       * @see ScanType
       */
      TYPE((short)2, "type"),
      QUANTITY((short)3, "quantity"),
      BILLING_WAREHOUSE_ID((short)4, "billingWarehouseId"),
      TRANSFER_LOT_ID((short)5, "transferLotId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEM
            return INVENTORY_ITEM;
          case 2: // TYPE
            return TYPE;
          case 3: // QUANTITY
            return QUANTITY;
          case 4: // BILLING_WAREHOUSE_ID
            return BILLING_WAREHOUSE_ID;
          case 5: // TRANSFER_LOT_ID
            return TRANSFER_LOT_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __QUANTITY_ISSET_ID = 0;
    private static final int __BILLINGWAREHOUSEID_ISSET_ID = 1;
    private static final int __TRANSFERLOTID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEM, new org.apache.thrift.meta_data.FieldMetaData("inventoryItem", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BILLING_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("billingWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TRANSFER_LOT_ID, new org.apache.thrift.meta_data.FieldMetaData("transferLotId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scan_args.class, metaDataMap);
    }

    public scan_args() {
    }

    public scan_args(
      InventoryItem inventoryItem,
      ScanType type,
      long quantity,
      long billingWarehouseId,
      long transferLotId)
    {
      this();
      this.inventoryItem = inventoryItem;
      this.type = type;
      this.quantity = quantity;
      setQuantityIsSet(true);
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scan_args(scan_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetInventoryItem()) {
        this.inventoryItem = new InventoryItem(other.inventoryItem);
      }
      if (other.isSetType()) {
        this.type = other.type;
      }
      this.quantity = other.quantity;
      this.billingWarehouseId = other.billingWarehouseId;
      this.transferLotId = other.transferLotId;
    }

    public scan_args deepCopy() {
      return new scan_args(this);
    }

    @Override
    public void clear() {
      this.inventoryItem = null;
      this.type = null;
      setQuantityIsSet(false);
      this.quantity = 0;
      setBillingWarehouseIdIsSet(false);
      this.billingWarehouseId = 0;
      setTransferLotIdIsSet(false);
      this.transferLotId = 0;
    }

    public InventoryItem getInventoryItem() {
      return this.inventoryItem;
    }

    public void setInventoryItem(InventoryItem inventoryItem) {
      this.inventoryItem = inventoryItem;
    }

    public void unsetInventoryItem() {
      this.inventoryItem = null;
    }

    /** Returns true if field inventoryItem is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItem() {
      return this.inventoryItem != null;
    }

    public void setInventoryItemIsSet(boolean value) {
      if (!value) {
        this.inventoryItem = null;
      }
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getType() {
      return this.type;
    }

    /**
     * 
     * @see ScanType
     */
    public void setType(ScanType type) {
      this.type = type;
    }

    public void unsetType() {
      this.type = null;
    }

    /** Returns true if field type is set (has been assigned a value) and false otherwise */
    public boolean isSetType() {
      return this.type != null;
    }

    public void setTypeIsSet(boolean value) {
      if (!value) {
        this.type = null;
      }
    }

    public long getQuantity() {
      return this.quantity;
    }

    public void setQuantity(long quantity) {
      this.quantity = quantity;
      setQuantityIsSet(true);
    }

    public void unsetQuantity() {
      __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
    }

    /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
    public boolean isSetQuantity() {
      return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
    }

    public void setQuantityIsSet(boolean value) {
      __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
    }

    public long getBillingWarehouseId() {
      return this.billingWarehouseId;
    }

    public void setBillingWarehouseId(long billingWarehouseId) {
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    public void unsetBillingWarehouseId() {
      __isset_bit_vector.clear(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field billingWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetBillingWarehouseId() {
      return __isset_bit_vector.get(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    public void setBillingWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__BILLINGWAREHOUSEID_ISSET_ID, value);
    }

    public long getTransferLotId() {
      return this.transferLotId;
    }

    public void setTransferLotId(long transferLotId) {
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    public void unsetTransferLotId() {
      __isset_bit_vector.clear(__TRANSFERLOTID_ISSET_ID);
    }

    /** Returns true if field transferLotId is set (has been assigned a value) and false otherwise */
    public boolean isSetTransferLotId() {
      return __isset_bit_vector.get(__TRANSFERLOTID_ISSET_ID);
    }

    public void setTransferLotIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSFERLOTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEM:
        if (value == null) {
          unsetInventoryItem();
        } else {
          setInventoryItem((InventoryItem)value);
        }
        break;

      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((ScanType)value);
        }
        break;

      case QUANTITY:
        if (value == null) {
          unsetQuantity();
        } else {
          setQuantity((Long)value);
        }
        break;

      case BILLING_WAREHOUSE_ID:
        if (value == null) {
          unsetBillingWarehouseId();
        } else {
          setBillingWarehouseId((Long)value);
        }
        break;

      case TRANSFER_LOT_ID:
        if (value == null) {
          unsetTransferLotId();
        } else {
          setTransferLotId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEM:
        return getInventoryItem();

      case TYPE:
        return getType();

      case QUANTITY:
        return Long.valueOf(getQuantity());

      case BILLING_WAREHOUSE_ID:
        return Long.valueOf(getBillingWarehouseId());

      case TRANSFER_LOT_ID:
        return Long.valueOf(getTransferLotId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEM:
        return isSetInventoryItem();
      case TYPE:
        return isSetType();
      case QUANTITY:
        return isSetQuantity();
      case BILLING_WAREHOUSE_ID:
        return isSetBillingWarehouseId();
      case TRANSFER_LOT_ID:
        return isSetTransferLotId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scan_args)
        return this.equals((scan_args)that);
      return false;
    }

    public boolean equals(scan_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItem = true && this.isSetInventoryItem();
      boolean that_present_inventoryItem = true && that.isSetInventoryItem();
      if (this_present_inventoryItem || that_present_inventoryItem) {
        if (!(this_present_inventoryItem && that_present_inventoryItem))
          return false;
        if (!this.inventoryItem.equals(that.inventoryItem))
          return false;
      }

      boolean this_present_type = true && this.isSetType();
      boolean that_present_type = true && that.isSetType();
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (!this.type.equals(that.type))
          return false;
      }

      boolean this_present_quantity = true;
      boolean that_present_quantity = true;
      if (this_present_quantity || that_present_quantity) {
        if (!(this_present_quantity && that_present_quantity))
          return false;
        if (this.quantity != that.quantity)
          return false;
      }

      boolean this_present_billingWarehouseId = true;
      boolean that_present_billingWarehouseId = true;
      if (this_present_billingWarehouseId || that_present_billingWarehouseId) {
        if (!(this_present_billingWarehouseId && that_present_billingWarehouseId))
          return false;
        if (this.billingWarehouseId != that.billingWarehouseId)
          return false;
      }

      boolean this_present_transferLotId = true;
      boolean that_present_transferLotId = true;
      if (this_present_transferLotId || that_present_transferLotId) {
        if (!(this_present_transferLotId && that_present_transferLotId))
          return false;
        if (this.transferLotId != that.transferLotId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scan_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scan_args typedOther = (scan_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItem()).compareTo(typedOther.isSetInventoryItem());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItem()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItem, typedOther.inventoryItem);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetQuantity()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBillingWarehouseId()).compareTo(typedOther.isSetBillingWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBillingWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.billingWarehouseId, typedOther.billingWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTransferLotId()).compareTo(typedOther.isSetTransferLotId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTransferLotId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferLotId, typedOther.transferLotId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEM
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.inventoryItem = new InventoryItem();
              this.inventoryItem.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.type = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // QUANTITY
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.quantity = iprot.readI64();
              setQuantityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // BILLING_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.billingWarehouseId = iprot.readI64();
              setBillingWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // TRANSFER_LOT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.transferLotId = iprot.readI64();
              setTransferLotIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.inventoryItem != null) {
        oprot.writeFieldBegin(INVENTORY_ITEM_FIELD_DESC);
        this.inventoryItem.write(oprot);
        oprot.writeFieldEnd();
      }
      if (this.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(this.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
      oprot.writeI64(this.quantity);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BILLING_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.billingWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TRANSFER_LOT_ID_FIELD_DESC);
      oprot.writeI64(this.transferLotId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scan_args(");
      boolean first = true;

      sb.append("inventoryItem:");
      if (this.inventoryItem == null) {
        sb.append("null");
      } else {
        sb.append(this.inventoryItem);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        sb.append(this.type);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("quantity:");
      sb.append(this.quantity);
      first = false;
      if (!first) sb.append(", ");
      sb.append("billingWarehouseId:");
      sb.append(this.billingWarehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("transferLotId:");
      sb.append(this.transferLotId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scan_result implements org.apache.thrift.TBase<scan_result, scan_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scan_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scan_result.class, metaDataMap);
    }

    public scan_result() {
    }

    public scan_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scan_result(scan_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public scan_result deepCopy() {
      return new scan_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scan_result)
        return this.equals((scan_result)that);
      return false;
    }

    public boolean equals(scan_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scan_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scan_result typedOther = (scan_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scan_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class genericScan_args implements org.apache.thrift.TBase<genericScan_args, genericScan_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("genericScan_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEM_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItem", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField SCAN_FIELD_DESC = new org.apache.thrift.protocol.TField("scan", org.apache.thrift.protocol.TType.STRUCT, (short)2);

    private InventoryItem inventoryItem; // required
    private Scan scan; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEM((short)1, "inventoryItem"),
      SCAN((short)2, "scan");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEM
            return INVENTORY_ITEM;
          case 2: // SCAN
            return SCAN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEM, new org.apache.thrift.meta_data.FieldMetaData("inventoryItem", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.SCAN, new org.apache.thrift.meta_data.FieldMetaData("scan", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Scan.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(genericScan_args.class, metaDataMap);
    }

    public genericScan_args() {
    }

    public genericScan_args(
      InventoryItem inventoryItem,
      Scan scan)
    {
      this();
      this.inventoryItem = inventoryItem;
      this.scan = scan;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public genericScan_args(genericScan_args other) {
      if (other.isSetInventoryItem()) {
        this.inventoryItem = new InventoryItem(other.inventoryItem);
      }
      if (other.isSetScan()) {
        this.scan = new Scan(other.scan);
      }
    }

    public genericScan_args deepCopy() {
      return new genericScan_args(this);
    }

    @Override
    public void clear() {
      this.inventoryItem = null;
      this.scan = null;
    }

    public InventoryItem getInventoryItem() {
      return this.inventoryItem;
    }

    public void setInventoryItem(InventoryItem inventoryItem) {
      this.inventoryItem = inventoryItem;
    }

    public void unsetInventoryItem() {
      this.inventoryItem = null;
    }

    /** Returns true if field inventoryItem is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItem() {
      return this.inventoryItem != null;
    }

    public void setInventoryItemIsSet(boolean value) {
      if (!value) {
        this.inventoryItem = null;
      }
    }

    public Scan getScan() {
      return this.scan;
    }

    public void setScan(Scan scan) {
      this.scan = scan;
    }

    public void unsetScan() {
      this.scan = null;
    }

    /** Returns true if field scan is set (has been assigned a value) and false otherwise */
    public boolean isSetScan() {
      return this.scan != null;
    }

    public void setScanIsSet(boolean value) {
      if (!value) {
        this.scan = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEM:
        if (value == null) {
          unsetInventoryItem();
        } else {
          setInventoryItem((InventoryItem)value);
        }
        break;

      case SCAN:
        if (value == null) {
          unsetScan();
        } else {
          setScan((Scan)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEM:
        return getInventoryItem();

      case SCAN:
        return getScan();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEM:
        return isSetInventoryItem();
      case SCAN:
        return isSetScan();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof genericScan_args)
        return this.equals((genericScan_args)that);
      return false;
    }

    public boolean equals(genericScan_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItem = true && this.isSetInventoryItem();
      boolean that_present_inventoryItem = true && that.isSetInventoryItem();
      if (this_present_inventoryItem || that_present_inventoryItem) {
        if (!(this_present_inventoryItem && that_present_inventoryItem))
          return false;
        if (!this.inventoryItem.equals(that.inventoryItem))
          return false;
      }

      boolean this_present_scan = true && this.isSetScan();
      boolean that_present_scan = true && that.isSetScan();
      if (this_present_scan || that_present_scan) {
        if (!(this_present_scan && that_present_scan))
          return false;
        if (!this.scan.equals(that.scan))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(genericScan_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      genericScan_args typedOther = (genericScan_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItem()).compareTo(typedOther.isSetInventoryItem());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItem()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItem, typedOther.inventoryItem);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetScan()).compareTo(typedOther.isSetScan());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetScan()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scan, typedOther.scan);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEM
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.inventoryItem = new InventoryItem();
              this.inventoryItem.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // SCAN
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.scan = new Scan();
              this.scan.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.inventoryItem != null) {
        oprot.writeFieldBegin(INVENTORY_ITEM_FIELD_DESC);
        this.inventoryItem.write(oprot);
        oprot.writeFieldEnd();
      }
      if (this.scan != null) {
        oprot.writeFieldBegin(SCAN_FIELD_DESC);
        this.scan.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("genericScan_args(");
      boolean first = true;

      sb.append("inventoryItem:");
      if (this.inventoryItem == null) {
        sb.append("null");
      } else {
        sb.append(this.inventoryItem);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("scan:");
      if (this.scan == null) {
        sb.append("null");
      } else {
        sb.append(this.scan);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class genericScan_result implements org.apache.thrift.TBase<genericScan_result, genericScan_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("genericScan_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(genericScan_result.class, metaDataMap);
    }

    public genericScan_result() {
    }

    public genericScan_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public genericScan_result(genericScan_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public genericScan_result deepCopy() {
      return new genericScan_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof genericScan_result)
        return this.equals((genericScan_result)that);
      return false;
    }

    public boolean equals(genericScan_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(genericScan_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      genericScan_result typedOther = (genericScan_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("genericScan_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanSerializedItemForOrder_args implements org.apache.thrift.TBase<scanSerializedItemForOrder_args, scanSerializedItemForOrder_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanSerializedItemForOrder_args");

    private static final org.apache.thrift.protocol.TField SERIAL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("serialNumber", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField FULFILMENT_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fulfilmentWarehouseId", org.apache.thrift.protocol.TType.I64, (short)4);
    private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
    private static final org.apache.thrift.protocol.TField BILLING_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("billingWarehouseId", org.apache.thrift.protocol.TType.I64, (short)6);

    private String serialNumber; // required
    private ScanType type; // required
    private long orderId; // required
    private long fulfilmentWarehouseId; // required
    private double quantity; // required
    private long billingWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SERIAL_NUMBER((short)1, "serialNumber"),
      /**
       * 
       * @see ScanType
       */
      TYPE((short)2, "type"),
      ORDER_ID((short)3, "orderId"),
      FULFILMENT_WAREHOUSE_ID((short)4, "fulfilmentWarehouseId"),
      QUANTITY((short)5, "quantity"),
      BILLING_WAREHOUSE_ID((short)6, "billingWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SERIAL_NUMBER
            return SERIAL_NUMBER;
          case 2: // TYPE
            return TYPE;
          case 3: // ORDER_ID
            return ORDER_ID;
          case 4: // FULFILMENT_WAREHOUSE_ID
            return FULFILMENT_WAREHOUSE_ID;
          case 5: // QUANTITY
            return QUANTITY;
          case 6: // BILLING_WAREHOUSE_ID
            return BILLING_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private static final int __FULFILMENTWAREHOUSEID_ISSET_ID = 1;
    private static final int __QUANTITY_ISSET_ID = 2;
    private static final int __BILLINGWAREHOUSEID_ISSET_ID = 3;
    private BitSet __isset_bit_vector = new BitSet(4);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SERIAL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("serialNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FULFILMENT_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("fulfilmentWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      tmpMap.put(_Fields.BILLING_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("billingWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanSerializedItemForOrder_args.class, metaDataMap);
    }

    public scanSerializedItemForOrder_args() {
    }

    public scanSerializedItemForOrder_args(
      String serialNumber,
      ScanType type,
      long orderId,
      long fulfilmentWarehouseId,
      double quantity,
      long billingWarehouseId)
    {
      this();
      this.serialNumber = serialNumber;
      this.type = type;
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.fulfilmentWarehouseId = fulfilmentWarehouseId;
      setFulfilmentWarehouseIdIsSet(true);
      this.quantity = quantity;
      setQuantityIsSet(true);
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanSerializedItemForOrder_args(scanSerializedItemForOrder_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetSerialNumber()) {
        this.serialNumber = other.serialNumber;
      }
      if (other.isSetType()) {
        this.type = other.type;
      }
      this.orderId = other.orderId;
      this.fulfilmentWarehouseId = other.fulfilmentWarehouseId;
      this.quantity = other.quantity;
      this.billingWarehouseId = other.billingWarehouseId;
    }

    public scanSerializedItemForOrder_args deepCopy() {
      return new scanSerializedItemForOrder_args(this);
    }

    @Override
    public void clear() {
      this.serialNumber = null;
      this.type = null;
      setOrderIdIsSet(false);
      this.orderId = 0;
      setFulfilmentWarehouseIdIsSet(false);
      this.fulfilmentWarehouseId = 0;
      setQuantityIsSet(false);
      this.quantity = 0.0;
      setBillingWarehouseIdIsSet(false);
      this.billingWarehouseId = 0;
    }

    public String getSerialNumber() {
      return this.serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
      this.serialNumber = serialNumber;
    }

    public void unsetSerialNumber() {
      this.serialNumber = null;
    }

    /** Returns true if field serialNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetSerialNumber() {
      return this.serialNumber != null;
    }

    public void setSerialNumberIsSet(boolean value) {
      if (!value) {
        this.serialNumber = null;
      }
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getType() {
      return this.type;
    }

    /**
     * 
     * @see ScanType
     */
    public void setType(ScanType type) {
      this.type = type;
    }

    public void unsetType() {
      this.type = null;
    }

    /** Returns true if field type is set (has been assigned a value) and false otherwise */
    public boolean isSetType() {
      return this.type != null;
    }

    public void setTypeIsSet(boolean value) {
      if (!value) {
        this.type = null;
      }
    }

    public long getOrderId() {
      return this.orderId;
    }

    public void setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public long getFulfilmentWarehouseId() {
      return this.fulfilmentWarehouseId;
    }

    public void setFulfilmentWarehouseId(long fulfilmentWarehouseId) {
      this.fulfilmentWarehouseId = fulfilmentWarehouseId;
      setFulfilmentWarehouseIdIsSet(true);
    }

    public void unsetFulfilmentWarehouseId() {
      __isset_bit_vector.clear(__FULFILMENTWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field fulfilmentWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetFulfilmentWarehouseId() {
      return __isset_bit_vector.get(__FULFILMENTWAREHOUSEID_ISSET_ID);
    }

    public void setFulfilmentWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__FULFILMENTWAREHOUSEID_ISSET_ID, value);
    }

    public double getQuantity() {
      return this.quantity;
    }

    public void setQuantity(double quantity) {
      this.quantity = quantity;
      setQuantityIsSet(true);
    }

    public void unsetQuantity() {
      __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
    }

    /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
    public boolean isSetQuantity() {
      return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
    }

    public void setQuantityIsSet(boolean value) {
      __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
    }

    public long getBillingWarehouseId() {
      return this.billingWarehouseId;
    }

    public void setBillingWarehouseId(long billingWarehouseId) {
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    public void unsetBillingWarehouseId() {
      __isset_bit_vector.clear(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field billingWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetBillingWarehouseId() {
      return __isset_bit_vector.get(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    public void setBillingWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__BILLINGWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SERIAL_NUMBER:
        if (value == null) {
          unsetSerialNumber();
        } else {
          setSerialNumber((String)value);
        }
        break;

      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((ScanType)value);
        }
        break;

      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case FULFILMENT_WAREHOUSE_ID:
        if (value == null) {
          unsetFulfilmentWarehouseId();
        } else {
          setFulfilmentWarehouseId((Long)value);
        }
        break;

      case QUANTITY:
        if (value == null) {
          unsetQuantity();
        } else {
          setQuantity((Double)value);
        }
        break;

      case BILLING_WAREHOUSE_ID:
        if (value == null) {
          unsetBillingWarehouseId();
        } else {
          setBillingWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SERIAL_NUMBER:
        return getSerialNumber();

      case TYPE:
        return getType();

      case ORDER_ID:
        return Long.valueOf(getOrderId());

      case FULFILMENT_WAREHOUSE_ID:
        return Long.valueOf(getFulfilmentWarehouseId());

      case QUANTITY:
        return Double.valueOf(getQuantity());

      case BILLING_WAREHOUSE_ID:
        return Long.valueOf(getBillingWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SERIAL_NUMBER:
        return isSetSerialNumber();
      case TYPE:
        return isSetType();
      case ORDER_ID:
        return isSetOrderId();
      case FULFILMENT_WAREHOUSE_ID:
        return isSetFulfilmentWarehouseId();
      case QUANTITY:
        return isSetQuantity();
      case BILLING_WAREHOUSE_ID:
        return isSetBillingWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanSerializedItemForOrder_args)
        return this.equals((scanSerializedItemForOrder_args)that);
      return false;
    }

    public boolean equals(scanSerializedItemForOrder_args that) {
      if (that == null)
        return false;

      boolean this_present_serialNumber = true && this.isSetSerialNumber();
      boolean that_present_serialNumber = true && that.isSetSerialNumber();
      if (this_present_serialNumber || that_present_serialNumber) {
        if (!(this_present_serialNumber && that_present_serialNumber))
          return false;
        if (!this.serialNumber.equals(that.serialNumber))
          return false;
      }

      boolean this_present_type = true && this.isSetType();
      boolean that_present_type = true && that.isSetType();
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (!this.type.equals(that.type))
          return false;
      }

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_fulfilmentWarehouseId = true;
      boolean that_present_fulfilmentWarehouseId = true;
      if (this_present_fulfilmentWarehouseId || that_present_fulfilmentWarehouseId) {
        if (!(this_present_fulfilmentWarehouseId && that_present_fulfilmentWarehouseId))
          return false;
        if (this.fulfilmentWarehouseId != that.fulfilmentWarehouseId)
          return false;
      }

      boolean this_present_quantity = true;
      boolean that_present_quantity = true;
      if (this_present_quantity || that_present_quantity) {
        if (!(this_present_quantity && that_present_quantity))
          return false;
        if (this.quantity != that.quantity)
          return false;
      }

      boolean this_present_billingWarehouseId = true;
      boolean that_present_billingWarehouseId = true;
      if (this_present_billingWarehouseId || that_present_billingWarehouseId) {
        if (!(this_present_billingWarehouseId && that_present_billingWarehouseId))
          return false;
        if (this.billingWarehouseId != that.billingWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanSerializedItemForOrder_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanSerializedItemForOrder_args typedOther = (scanSerializedItemForOrder_args)other;

      lastComparison = Boolean.valueOf(isSetSerialNumber()).compareTo(typedOther.isSetSerialNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSerialNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialNumber, typedOther.serialNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFulfilmentWarehouseId()).compareTo(typedOther.isSetFulfilmentWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFulfilmentWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fulfilmentWarehouseId, typedOther.fulfilmentWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetQuantity()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBillingWarehouseId()).compareTo(typedOther.isSetBillingWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBillingWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.billingWarehouseId, typedOther.billingWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SERIAL_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.serialNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.type = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.orderId = iprot.readI64();
              setOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // FULFILMENT_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.fulfilmentWarehouseId = iprot.readI64();
              setFulfilmentWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // QUANTITY
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
              this.quantity = iprot.readDouble();
              setQuantityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 6: // BILLING_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.billingWarehouseId = iprot.readI64();
              setBillingWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.serialNumber != null) {
        oprot.writeFieldBegin(SERIAL_NUMBER_FIELD_DESC);
        oprot.writeString(this.serialNumber);
        oprot.writeFieldEnd();
      }
      if (this.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(this.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FULFILMENT_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.fulfilmentWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
      oprot.writeDouble(this.quantity);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BILLING_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.billingWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanSerializedItemForOrder_args(");
      boolean first = true;

      sb.append("serialNumber:");
      if (this.serialNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.serialNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        sb.append(this.type);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("fulfilmentWarehouseId:");
      sb.append(this.fulfilmentWarehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("quantity:");
      sb.append(this.quantity);
      first = false;
      if (!first) sb.append(", ");
      sb.append("billingWarehouseId:");
      sb.append(this.billingWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanSerializedItemForOrder_result implements org.apache.thrift.TBase<scanSerializedItemForOrder_result, scanSerializedItemForOrder_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanSerializedItemForOrder_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryItem success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanSerializedItemForOrder_result.class, metaDataMap);
    }

    public scanSerializedItemForOrder_result() {
    }

    public scanSerializedItemForOrder_result(
      InventoryItem success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanSerializedItemForOrder_result(scanSerializedItemForOrder_result other) {
      if (other.isSetSuccess()) {
        this.success = new InventoryItem(other.success);
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public scanSerializedItemForOrder_result deepCopy() {
      return new scanSerializedItemForOrder_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public InventoryItem getSuccess() {
      return this.success;
    }

    public void setSuccess(InventoryItem success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((InventoryItem)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanSerializedItemForOrder_result)
        return this.equals((scanSerializedItemForOrder_result)that);
      return false;
    }

    public boolean equals(scanSerializedItemForOrder_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanSerializedItemForOrder_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanSerializedItemForOrder_result typedOther = (scanSerializedItemForOrder_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new InventoryItem();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanSerializedItemForOrder_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForOrder_args implements org.apache.thrift.TBase<scanForOrder_args, scanForOrder_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForOrder_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEM_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItem", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)4);
    private static final org.apache.thrift.protocol.TField FULFILMENT_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fulfilmentWarehouseId", org.apache.thrift.protocol.TType.I64, (short)5);
    private static final org.apache.thrift.protocol.TField BILLING_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("billingWarehouseId", org.apache.thrift.protocol.TType.I64, (short)6);

    private InventoryItem inventoryItem; // required
    private ScanType type; // required
    private long quantity; // required
    private long orderId; // required
    private long fulfilmentWarehouseId; // required
    private long billingWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEM((short)1, "inventoryItem"),
      /**
       * 
       * @see ScanType
       */
      TYPE((short)2, "type"),
      QUANTITY((short)3, "quantity"),
      ORDER_ID((short)4, "orderId"),
      FULFILMENT_WAREHOUSE_ID((short)5, "fulfilmentWarehouseId"),
      BILLING_WAREHOUSE_ID((short)6, "billingWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEM
            return INVENTORY_ITEM;
          case 2: // TYPE
            return TYPE;
          case 3: // QUANTITY
            return QUANTITY;
          case 4: // ORDER_ID
            return ORDER_ID;
          case 5: // FULFILMENT_WAREHOUSE_ID
            return FULFILMENT_WAREHOUSE_ID;
          case 6: // BILLING_WAREHOUSE_ID
            return BILLING_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __QUANTITY_ISSET_ID = 0;
    private static final int __ORDERID_ISSET_ID = 1;
    private static final int __FULFILMENTWAREHOUSEID_ISSET_ID = 2;
    private static final int __BILLINGWAREHOUSEID_ISSET_ID = 3;
    private BitSet __isset_bit_vector = new BitSet(4);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEM, new org.apache.thrift.meta_data.FieldMetaData("inventoryItem", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FULFILMENT_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("fulfilmentWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BILLING_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("billingWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForOrder_args.class, metaDataMap);
    }

    public scanForOrder_args() {
    }

    public scanForOrder_args(
      InventoryItem inventoryItem,
      ScanType type,
      long quantity,
      long orderId,
      long fulfilmentWarehouseId,
      long billingWarehouseId)
    {
      this();
      this.inventoryItem = inventoryItem;
      this.type = type;
      this.quantity = quantity;
      setQuantityIsSet(true);
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.fulfilmentWarehouseId = fulfilmentWarehouseId;
      setFulfilmentWarehouseIdIsSet(true);
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForOrder_args(scanForOrder_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetInventoryItem()) {
        this.inventoryItem = new InventoryItem(other.inventoryItem);
      }
      if (other.isSetType()) {
        this.type = other.type;
      }
      this.quantity = other.quantity;
      this.orderId = other.orderId;
      this.fulfilmentWarehouseId = other.fulfilmentWarehouseId;
      this.billingWarehouseId = other.billingWarehouseId;
    }

    public scanForOrder_args deepCopy() {
      return new scanForOrder_args(this);
    }

    @Override
    public void clear() {
      this.inventoryItem = null;
      this.type = null;
      setQuantityIsSet(false);
      this.quantity = 0;
      setOrderIdIsSet(false);
      this.orderId = 0;
      setFulfilmentWarehouseIdIsSet(false);
      this.fulfilmentWarehouseId = 0;
      setBillingWarehouseIdIsSet(false);
      this.billingWarehouseId = 0;
    }

    public InventoryItem getInventoryItem() {
      return this.inventoryItem;
    }

    public void setInventoryItem(InventoryItem inventoryItem) {
      this.inventoryItem = inventoryItem;
    }

    public void unsetInventoryItem() {
      this.inventoryItem = null;
    }

    /** Returns true if field inventoryItem is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItem() {
      return this.inventoryItem != null;
    }

    public void setInventoryItemIsSet(boolean value) {
      if (!value) {
        this.inventoryItem = null;
      }
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getType() {
      return this.type;
    }

    /**
     * 
     * @see ScanType
     */
    public void setType(ScanType type) {
      this.type = type;
    }

    public void unsetType() {
      this.type = null;
    }

    /** Returns true if field type is set (has been assigned a value) and false otherwise */
    public boolean isSetType() {
      return this.type != null;
    }

    public void setTypeIsSet(boolean value) {
      if (!value) {
        this.type = null;
      }
    }

    public long getQuantity() {
      return this.quantity;
    }

    public void setQuantity(long quantity) {
      this.quantity = quantity;
      setQuantityIsSet(true);
    }

    public void unsetQuantity() {
      __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
    }

    /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
    public boolean isSetQuantity() {
      return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
    }

    public void setQuantityIsSet(boolean value) {
      __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public void setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public long getFulfilmentWarehouseId() {
      return this.fulfilmentWarehouseId;
    }

    public void setFulfilmentWarehouseId(long fulfilmentWarehouseId) {
      this.fulfilmentWarehouseId = fulfilmentWarehouseId;
      setFulfilmentWarehouseIdIsSet(true);
    }

    public void unsetFulfilmentWarehouseId() {
      __isset_bit_vector.clear(__FULFILMENTWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field fulfilmentWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetFulfilmentWarehouseId() {
      return __isset_bit_vector.get(__FULFILMENTWAREHOUSEID_ISSET_ID);
    }

    public void setFulfilmentWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__FULFILMENTWAREHOUSEID_ISSET_ID, value);
    }

    public long getBillingWarehouseId() {
      return this.billingWarehouseId;
    }

    public void setBillingWarehouseId(long billingWarehouseId) {
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    public void unsetBillingWarehouseId() {
      __isset_bit_vector.clear(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field billingWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetBillingWarehouseId() {
      return __isset_bit_vector.get(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    public void setBillingWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__BILLINGWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEM:
        if (value == null) {
          unsetInventoryItem();
        } else {
          setInventoryItem((InventoryItem)value);
        }
        break;

      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((ScanType)value);
        }
        break;

      case QUANTITY:
        if (value == null) {
          unsetQuantity();
        } else {
          setQuantity((Long)value);
        }
        break;

      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case FULFILMENT_WAREHOUSE_ID:
        if (value == null) {
          unsetFulfilmentWarehouseId();
        } else {
          setFulfilmentWarehouseId((Long)value);
        }
        break;

      case BILLING_WAREHOUSE_ID:
        if (value == null) {
          unsetBillingWarehouseId();
        } else {
          setBillingWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEM:
        return getInventoryItem();

      case TYPE:
        return getType();

      case QUANTITY:
        return Long.valueOf(getQuantity());

      case ORDER_ID:
        return Long.valueOf(getOrderId());

      case FULFILMENT_WAREHOUSE_ID:
        return Long.valueOf(getFulfilmentWarehouseId());

      case BILLING_WAREHOUSE_ID:
        return Long.valueOf(getBillingWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEM:
        return isSetInventoryItem();
      case TYPE:
        return isSetType();
      case QUANTITY:
        return isSetQuantity();
      case ORDER_ID:
        return isSetOrderId();
      case FULFILMENT_WAREHOUSE_ID:
        return isSetFulfilmentWarehouseId();
      case BILLING_WAREHOUSE_ID:
        return isSetBillingWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForOrder_args)
        return this.equals((scanForOrder_args)that);
      return false;
    }

    public boolean equals(scanForOrder_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItem = true && this.isSetInventoryItem();
      boolean that_present_inventoryItem = true && that.isSetInventoryItem();
      if (this_present_inventoryItem || that_present_inventoryItem) {
        if (!(this_present_inventoryItem && that_present_inventoryItem))
          return false;
        if (!this.inventoryItem.equals(that.inventoryItem))
          return false;
      }

      boolean this_present_type = true && this.isSetType();
      boolean that_present_type = true && that.isSetType();
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (!this.type.equals(that.type))
          return false;
      }

      boolean this_present_quantity = true;
      boolean that_present_quantity = true;
      if (this_present_quantity || that_present_quantity) {
        if (!(this_present_quantity && that_present_quantity))
          return false;
        if (this.quantity != that.quantity)
          return false;
      }

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_fulfilmentWarehouseId = true;
      boolean that_present_fulfilmentWarehouseId = true;
      if (this_present_fulfilmentWarehouseId || that_present_fulfilmentWarehouseId) {
        if (!(this_present_fulfilmentWarehouseId && that_present_fulfilmentWarehouseId))
          return false;
        if (this.fulfilmentWarehouseId != that.fulfilmentWarehouseId)
          return false;
      }

      boolean this_present_billingWarehouseId = true;
      boolean that_present_billingWarehouseId = true;
      if (this_present_billingWarehouseId || that_present_billingWarehouseId) {
        if (!(this_present_billingWarehouseId && that_present_billingWarehouseId))
          return false;
        if (this.billingWarehouseId != that.billingWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForOrder_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForOrder_args typedOther = (scanForOrder_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItem()).compareTo(typedOther.isSetInventoryItem());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItem()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItem, typedOther.inventoryItem);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetQuantity()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFulfilmentWarehouseId()).compareTo(typedOther.isSetFulfilmentWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFulfilmentWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fulfilmentWarehouseId, typedOther.fulfilmentWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBillingWarehouseId()).compareTo(typedOther.isSetBillingWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBillingWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.billingWarehouseId, typedOther.billingWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEM
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.inventoryItem = new InventoryItem();
              this.inventoryItem.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.type = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // QUANTITY
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.quantity = iprot.readI64();
              setQuantityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.orderId = iprot.readI64();
              setOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // FULFILMENT_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.fulfilmentWarehouseId = iprot.readI64();
              setFulfilmentWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 6: // BILLING_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.billingWarehouseId = iprot.readI64();
              setBillingWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.inventoryItem != null) {
        oprot.writeFieldBegin(INVENTORY_ITEM_FIELD_DESC);
        this.inventoryItem.write(oprot);
        oprot.writeFieldEnd();
      }
      if (this.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(this.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
      oprot.writeI64(this.quantity);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FULFILMENT_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.fulfilmentWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BILLING_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.billingWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForOrder_args(");
      boolean first = true;

      sb.append("inventoryItem:");
      if (this.inventoryItem == null) {
        sb.append("null");
      } else {
        sb.append(this.inventoryItem);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        sb.append(this.type);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("quantity:");
      sb.append(this.quantity);
      first = false;
      if (!first) sb.append(", ");
      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("fulfilmentWarehouseId:");
      sb.append(this.fulfilmentWarehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("billingWarehouseId:");
      sb.append(this.billingWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForOrder_result implements org.apache.thrift.TBase<scanForOrder_result, scanForOrder_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForOrder_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryItem success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForOrder_result.class, metaDataMap);
    }

    public scanForOrder_result() {
    }

    public scanForOrder_result(
      InventoryItem success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForOrder_result(scanForOrder_result other) {
      if (other.isSetSuccess()) {
        this.success = new InventoryItem(other.success);
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public scanForOrder_result deepCopy() {
      return new scanForOrder_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public InventoryItem getSuccess() {
      return this.success;
    }

    public void setSuccess(InventoryItem success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((InventoryItem)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForOrder_result)
        return this.equals((scanForOrder_result)that);
      return false;
    }

    public boolean equals(scanForOrder_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForOrder_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForOrder_result typedOther = (scanForOrder_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new InventoryItem();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForOrder_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class createItemNumberMapping_args implements org.apache.thrift.TBase<createItemNumberMapping_args, createItemNumberMapping_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createItemNumberMapping_args");

    private static final org.apache.thrift.protocol.TField ITEM_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("itemNumber", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)2);

    private String itemNumber; // required
    private long itemId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_NUMBER((short)1, "itemNumber"),
      ITEM_ID((short)2, "itemId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_NUMBER
            return ITEM_NUMBER;
          case 2: // ITEM_ID
            return ITEM_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("itemNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createItemNumberMapping_args.class, metaDataMap);
    }

    public createItemNumberMapping_args() {
    }

    public createItemNumberMapping_args(
      String itemNumber,
      long itemId)
    {
      this();
      this.itemNumber = itemNumber;
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createItemNumberMapping_args(createItemNumberMapping_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetItemNumber()) {
        this.itemNumber = other.itemNumber;
      }
      this.itemId = other.itemId;
    }

    public createItemNumberMapping_args deepCopy() {
      return new createItemNumberMapping_args(this);
    }

    @Override
    public void clear() {
      this.itemNumber = null;
      setItemIdIsSet(false);
      this.itemId = 0;
    }

    public String getItemNumber() {
      return this.itemNumber;
    }

    public void setItemNumber(String itemNumber) {
      this.itemNumber = itemNumber;
    }

    public void unsetItemNumber() {
      this.itemNumber = null;
    }

    /** Returns true if field itemNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetItemNumber() {
      return this.itemNumber != null;
    }

    public void setItemNumberIsSet(boolean value) {
      if (!value) {
        this.itemNumber = null;
      }
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_NUMBER:
        if (value == null) {
          unsetItemNumber();
        } else {
          setItemNumber((String)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_NUMBER:
        return getItemNumber();

      case ITEM_ID:
        return Long.valueOf(getItemId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_NUMBER:
        return isSetItemNumber();
      case ITEM_ID:
        return isSetItemId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createItemNumberMapping_args)
        return this.equals((createItemNumberMapping_args)that);
      return false;
    }

    public boolean equals(createItemNumberMapping_args that) {
      if (that == null)
        return false;

      boolean this_present_itemNumber = true && this.isSetItemNumber();
      boolean that_present_itemNumber = true && that.isSetItemNumber();
      if (this_present_itemNumber || that_present_itemNumber) {
        if (!(this_present_itemNumber && that_present_itemNumber))
          return false;
        if (!this.itemNumber.equals(that.itemNumber))
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createItemNumberMapping_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createItemNumberMapping_args typedOther = (createItemNumberMapping_args)other;

      lastComparison = Boolean.valueOf(isSetItemNumber()).compareTo(typedOther.isSetItemNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemNumber, typedOther.itemNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.itemNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.itemNumber != null) {
        oprot.writeFieldBegin(ITEM_NUMBER_FIELD_DESC);
        oprot.writeString(this.itemNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createItemNumberMapping_args(");
      boolean first = true;

      sb.append("itemNumber:");
      if (this.itemNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.itemNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class createItemNumberMapping_result implements org.apache.thrift.TBase<createItemNumberMapping_result, createItemNumberMapping_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createItemNumberMapping_result");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createItemNumberMapping_result.class, metaDataMap);
    }

    public createItemNumberMapping_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createItemNumberMapping_result(createItemNumberMapping_result other) {
    }

    public createItemNumberMapping_result deepCopy() {
      return new createItemNumberMapping_result(this);
    }

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createItemNumberMapping_result)
        return this.equals((createItemNumberMapping_result)that);
      return false;
    }

    public boolean equals(createItemNumberMapping_result that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createItemNumberMapping_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createItemNumberMapping_result typedOther = (createItemNumberMapping_result)other;

      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createItemNumberMapping_result(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getItemNumbers_args implements org.apache.thrift.TBase<getItemNumbers_args, getItemNumbers_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemNumbers_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long itemId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_ID((short)1, "itemId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_ID
            return ITEM_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemNumbers_args.class, metaDataMap);
    }

    public getItemNumbers_args() {
    }

    public getItemNumbers_args(
      long itemId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemNumbers_args(getItemNumbers_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
    }

    public getItemNumbers_args deepCopy() {
      return new getItemNumbers_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_ID:
        return isSetItemId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemNumbers_args)
        return this.equals((getItemNumbers_args)that);
      return false;
    }

    public boolean equals(getItemNumbers_args that) {
      if (that == null)
        return false;

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemNumbers_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemNumbers_args typedOther = (getItemNumbers_args)other;

      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemNumbers_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getItemNumbers_result implements org.apache.thrift.TBase<getItemNumbers_result, getItemNumbers_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemNumbers_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<String> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemNumbers_result.class, metaDataMap);
    }

    public getItemNumbers_result() {
    }

    public getItemNumbers_result(
      List<String> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemNumbers_result(getItemNumbers_result other) {
      if (other.isSetSuccess()) {
        List<String> __this__success = new ArrayList<String>();
        for (String other_element : other.success) {
          __this__success.add(other_element);
        }
        this.success = __this__success;
      }
    }

    public getItemNumbers_result deepCopy() {
      return new getItemNumbers_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<String> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(String elem) {
      if (this.success == null) {
        this.success = new ArrayList<String>();
      }
      this.success.add(elem);
    }

    public List<String> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<String> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<String>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemNumbers_result)
        return this.equals((getItemNumbers_result)that);
      return false;
    }

    public boolean equals(getItemNumbers_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemNumbers_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemNumbers_result typedOther = (getItemNumbers_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                this.success = new ArrayList<String>(_list0.size);
                for (int _i1 = 0; _i1 < _list0.size; ++_i1)
                {
                  String _elem2; // required
                  _elem2 = iprot.readString();
                  this.success.add(_elem2);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.success.size()));
          for (String _iter3 : this.success)
          {
            oprot.writeString(_iter3);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemNumbers_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getItemIds_args implements org.apache.thrift.TBase<getItemIds_args, getItemIds_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemIds_args");

    private static final org.apache.thrift.protocol.TField ITEM_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("itemNumber", org.apache.thrift.protocol.TType.STRING, (short)1);

    private String itemNumber; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_NUMBER((short)1, "itemNumber");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_NUMBER
            return ITEM_NUMBER;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("itemNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemIds_args.class, metaDataMap);
    }

    public getItemIds_args() {
    }

    public getItemIds_args(
      String itemNumber)
    {
      this();
      this.itemNumber = itemNumber;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemIds_args(getItemIds_args other) {
      if (other.isSetItemNumber()) {
        this.itemNumber = other.itemNumber;
      }
    }

    public getItemIds_args deepCopy() {
      return new getItemIds_args(this);
    }

    @Override
    public void clear() {
      this.itemNumber = null;
    }

    public String getItemNumber() {
      return this.itemNumber;
    }

    public void setItemNumber(String itemNumber) {
      this.itemNumber = itemNumber;
    }

    public void unsetItemNumber() {
      this.itemNumber = null;
    }

    /** Returns true if field itemNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetItemNumber() {
      return this.itemNumber != null;
    }

    public void setItemNumberIsSet(boolean value) {
      if (!value) {
        this.itemNumber = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_NUMBER:
        if (value == null) {
          unsetItemNumber();
        } else {
          setItemNumber((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_NUMBER:
        return getItemNumber();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_NUMBER:
        return isSetItemNumber();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemIds_args)
        return this.equals((getItemIds_args)that);
      return false;
    }

    public boolean equals(getItemIds_args that) {
      if (that == null)
        return false;

      boolean this_present_itemNumber = true && this.isSetItemNumber();
      boolean that_present_itemNumber = true && that.isSetItemNumber();
      if (this_present_itemNumber || that_present_itemNumber) {
        if (!(this_present_itemNumber && that_present_itemNumber))
          return false;
        if (!this.itemNumber.equals(that.itemNumber))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemIds_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemIds_args typedOther = (getItemIds_args)other;

      lastComparison = Boolean.valueOf(isSetItemNumber()).compareTo(typedOther.isSetItemNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemNumber, typedOther.itemNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.itemNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.itemNumber != null) {
        oprot.writeFieldBegin(ITEM_NUMBER_FIELD_DESC);
        oprot.writeString(this.itemNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemIds_args(");
      boolean first = true;

      sb.append("itemNumber:");
      if (this.itemNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.itemNumber);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getItemIds_result implements org.apache.thrift.TBase<getItemIds_result, getItemIds_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemIds_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<Long> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemIds_result.class, metaDataMap);
    }

    public getItemIds_result() {
    }

    public getItemIds_result(
      List<Long> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemIds_result(getItemIds_result other) {
      if (other.isSetSuccess()) {
        List<Long> __this__success = new ArrayList<Long>();
        for (Long other_element : other.success) {
          __this__success.add(other_element);
        }
        this.success = __this__success;
      }
    }

    public getItemIds_result deepCopy() {
      return new getItemIds_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Long> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(long elem) {
      if (this.success == null) {
        this.success = new ArrayList<Long>();
      }
      this.success.add(elem);
    }

    public List<Long> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Long> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemIds_result)
        return this.equals((getItemIds_result)that);
      return false;
    }

    public boolean equals(getItemIds_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemIds_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemIds_result typedOther = (getItemIds_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
                this.success = new ArrayList<Long>(_list4.size);
                for (int _i5 = 0; _i5 < _list4.size; ++_i5)
                {
                  long _elem6; // required
                  _elem6 = iprot.readI64();
                  this.success.add(_elem6);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.success.size()));
          for (long _iter7 : this.success)
          {
            oprot.writeI64(_iter7);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemIds_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemsFromLastScanType_args implements org.apache.thrift.TBase<getInventoryItemsFromLastScanType_args, getInventoryItemsFromLastScanType_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemsFromLastScanType_args");

    private static final org.apache.thrift.protocol.TField LAST_SCAN_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("lastScanType", org.apache.thrift.protocol.TType.I32, (short)1);

    private ScanType lastScanType; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      /**
       * 
       * @see ScanType
       */
      LAST_SCAN_TYPE((short)1, "lastScanType");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // LAST_SCAN_TYPE
            return LAST_SCAN_TYPE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.LAST_SCAN_TYPE, new org.apache.thrift.meta_data.FieldMetaData("lastScanType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemsFromLastScanType_args.class, metaDataMap);
    }

    public getInventoryItemsFromLastScanType_args() {
    }

    public getInventoryItemsFromLastScanType_args(
      ScanType lastScanType)
    {
      this();
      this.lastScanType = lastScanType;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemsFromLastScanType_args(getInventoryItemsFromLastScanType_args other) {
      if (other.isSetLastScanType()) {
        this.lastScanType = other.lastScanType;
      }
    }

    public getInventoryItemsFromLastScanType_args deepCopy() {
      return new getInventoryItemsFromLastScanType_args(this);
    }

    @Override
    public void clear() {
      this.lastScanType = null;
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getLastScanType() {
      return this.lastScanType;
    }

    /**
     * 
     * @see ScanType
     */
    public void setLastScanType(ScanType lastScanType) {
      this.lastScanType = lastScanType;
    }

    public void unsetLastScanType() {
      this.lastScanType = null;
    }

    /** Returns true if field lastScanType is set (has been assigned a value) and false otherwise */
    public boolean isSetLastScanType() {
      return this.lastScanType != null;
    }

    public void setLastScanTypeIsSet(boolean value) {
      if (!value) {
        this.lastScanType = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case LAST_SCAN_TYPE:
        if (value == null) {
          unsetLastScanType();
        } else {
          setLastScanType((ScanType)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case LAST_SCAN_TYPE:
        return getLastScanType();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case LAST_SCAN_TYPE:
        return isSetLastScanType();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemsFromLastScanType_args)
        return this.equals((getInventoryItemsFromLastScanType_args)that);
      return false;
    }

    public boolean equals(getInventoryItemsFromLastScanType_args that) {
      if (that == null)
        return false;

      boolean this_present_lastScanType = true && this.isSetLastScanType();
      boolean that_present_lastScanType = true && that.isSetLastScanType();
      if (this_present_lastScanType || that_present_lastScanType) {
        if (!(this_present_lastScanType && that_present_lastScanType))
          return false;
        if (!this.lastScanType.equals(that.lastScanType))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemsFromLastScanType_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemsFromLastScanType_args typedOther = (getInventoryItemsFromLastScanType_args)other;

      lastComparison = Boolean.valueOf(isSetLastScanType()).compareTo(typedOther.isSetLastScanType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLastScanType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastScanType, typedOther.lastScanType);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // LAST_SCAN_TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.lastScanType = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.lastScanType != null) {
        oprot.writeFieldBegin(LAST_SCAN_TYPE_FIELD_DESC);
        oprot.writeI32(this.lastScanType.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemsFromLastScanType_args(");
      boolean first = true;

      sb.append("lastScanType:");
      if (this.lastScanType == null) {
        sb.append("null");
      } else {
        sb.append(this.lastScanType);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemsFromLastScanType_result implements org.apache.thrift.TBase<getInventoryItemsFromLastScanType_result, getInventoryItemsFromLastScanType_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemsFromLastScanType_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<InventoryItem> success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemsFromLastScanType_result.class, metaDataMap);
    }

    public getInventoryItemsFromLastScanType_result() {
    }

    public getInventoryItemsFromLastScanType_result(
      List<InventoryItem> success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemsFromLastScanType_result(getInventoryItemsFromLastScanType_result other) {
      if (other.isSetSuccess()) {
        List<InventoryItem> __this__success = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.success) {
          __this__success.add(new InventoryItem(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getInventoryItemsFromLastScanType_result deepCopy() {
      return new getInventoryItemsFromLastScanType_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryItem> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryItem elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryItem>();
      }
      this.success.add(elem);
    }

    public List<InventoryItem> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryItem> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryItem>)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemsFromLastScanType_result)
        return this.equals((getInventoryItemsFromLastScanType_result)that);
      return false;
    }

    public boolean equals(getInventoryItemsFromLastScanType_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemsFromLastScanType_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemsFromLastScanType_result typedOther = (getInventoryItemsFromLastScanType_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
                this.success = new ArrayList<InventoryItem>(_list8.size);
                for (int _i9 = 0; _i9 < _list8.size; ++_i9)
                {
                  InventoryItem _elem10; // required
                  _elem10 = new InventoryItem();
                  _elem10.read(iprot);
                  this.success.add(_elem10);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryItem _iter11 : this.success)
          {
            _iter11.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemsFromLastScanType_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemFromId_args implements org.apache.thrift.TBase<getInventoryItemFromId_args, getInventoryItemFromId_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemFromId_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItemId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long inventoryItemId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEM_ID((short)1, "inventoryItemId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEM_ID
            return INVENTORY_ITEM_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __INVENTORYITEMID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("inventoryItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemFromId_args.class, metaDataMap);
    }

    public getInventoryItemFromId_args() {
    }

    public getInventoryItemFromId_args(
      long inventoryItemId)
    {
      this();
      this.inventoryItemId = inventoryItemId;
      setInventoryItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemFromId_args(getInventoryItemFromId_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.inventoryItemId = other.inventoryItemId;
    }

    public getInventoryItemFromId_args deepCopy() {
      return new getInventoryItemFromId_args(this);
    }

    @Override
    public void clear() {
      setInventoryItemIdIsSet(false);
      this.inventoryItemId = 0;
    }

    public long getInventoryItemId() {
      return this.inventoryItemId;
    }

    public void setInventoryItemId(long inventoryItemId) {
      this.inventoryItemId = inventoryItemId;
      setInventoryItemIdIsSet(true);
    }

    public void unsetInventoryItemId() {
      __isset_bit_vector.clear(__INVENTORYITEMID_ISSET_ID);
    }

    /** Returns true if field inventoryItemId is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItemId() {
      return __isset_bit_vector.get(__INVENTORYITEMID_ISSET_ID);
    }

    public void setInventoryItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__INVENTORYITEMID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEM_ID:
        if (value == null) {
          unsetInventoryItemId();
        } else {
          setInventoryItemId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEM_ID:
        return Long.valueOf(getInventoryItemId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEM_ID:
        return isSetInventoryItemId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemFromId_args)
        return this.equals((getInventoryItemFromId_args)that);
      return false;
    }

    public boolean equals(getInventoryItemFromId_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItemId = true;
      boolean that_present_inventoryItemId = true;
      if (this_present_inventoryItemId || that_present_inventoryItemId) {
        if (!(this_present_inventoryItemId && that_present_inventoryItemId))
          return false;
        if (this.inventoryItemId != that.inventoryItemId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemFromId_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemFromId_args typedOther = (getInventoryItemFromId_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItemId()).compareTo(typedOther.isSetInventoryItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItemId, typedOther.inventoryItemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.inventoryItemId = iprot.readI64();
              setInventoryItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(INVENTORY_ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.inventoryItemId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemFromId_args(");
      boolean first = true;

      sb.append("inventoryItemId:");
      sb.append(this.inventoryItemId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemFromId_result implements org.apache.thrift.TBase<getInventoryItemFromId_result, getInventoryItemFromId_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemFromId_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryItem success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemFromId_result.class, metaDataMap);
    }

    public getInventoryItemFromId_result() {
    }

    public getInventoryItemFromId_result(
      InventoryItem success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemFromId_result(getInventoryItemFromId_result other) {
      if (other.isSetSuccess()) {
        this.success = new InventoryItem(other.success);
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getInventoryItemFromId_result deepCopy() {
      return new getInventoryItemFromId_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public InventoryItem getSuccess() {
      return this.success;
    }

    public void setSuccess(InventoryItem success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((InventoryItem)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemFromId_result)
        return this.equals((getInventoryItemFromId_result)that);
      return false;
    }

    public boolean equals(getInventoryItemFromId_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemFromId_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemFromId_result typedOther = (getInventoryItemFromId_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new InventoryItem();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemFromId_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPurchaseScans_args implements org.apache.thrift.TBase<getPurchaseScans_args, getPurchaseScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseScans_args");

    private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)2);

    private long startDate; // required
    private long endDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      START_DATE((short)1, "startDate"),
      END_DATE((short)2, "endDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // START_DATE
            return START_DATE;
          case 2: // END_DATE
            return END_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STARTDATE_ISSET_ID = 0;
    private static final int __ENDDATE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseScans_args.class, metaDataMap);
    }

    public getPurchaseScans_args() {
    }

    public getPurchaseScans_args(
      long startDate,
      long endDate)
    {
      this();
      this.startDate = startDate;
      setStartDateIsSet(true);
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPurchaseScans_args(getPurchaseScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.startDate = other.startDate;
      this.endDate = other.endDate;
    }

    public getPurchaseScans_args deepCopy() {
      return new getPurchaseScans_args(this);
    }

    @Override
    public void clear() {
      setStartDateIsSet(false);
      this.startDate = 0;
      setEndDateIsSet(false);
      this.endDate = 0;
    }

    public long getStartDate() {
      return this.startDate;
    }

    public void setStartDate(long startDate) {
      this.startDate = startDate;
      setStartDateIsSet(true);
    }

    public void unsetStartDate() {
      __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
    }

    /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
    public boolean isSetStartDate() {
      return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
    }

    public void setStartDateIsSet(boolean value) {
      __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
    }

    public long getEndDate() {
      return this.endDate;
    }

    public void setEndDate(long endDate) {
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    public void unsetEndDate() {
      __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
    }

    /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
    public boolean isSetEndDate() {
      return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
    }

    public void setEndDateIsSet(boolean value) {
      __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case START_DATE:
        if (value == null) {
          unsetStartDate();
        } else {
          setStartDate((Long)value);
        }
        break;

      case END_DATE:
        if (value == null) {
          unsetEndDate();
        } else {
          setEndDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case START_DATE:
        return Long.valueOf(getStartDate());

      case END_DATE:
        return Long.valueOf(getEndDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case START_DATE:
        return isSetStartDate();
      case END_DATE:
        return isSetEndDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPurchaseScans_args)
        return this.equals((getPurchaseScans_args)that);
      return false;
    }

    public boolean equals(getPurchaseScans_args that) {
      if (that == null)
        return false;

      boolean this_present_startDate = true;
      boolean that_present_startDate = true;
      if (this_present_startDate || that_present_startDate) {
        if (!(this_present_startDate && that_present_startDate))
          return false;
        if (this.startDate != that.startDate)
          return false;
      }

      boolean this_present_endDate = true;
      boolean that_present_endDate = true;
      if (this_present_endDate || that_present_endDate) {
        if (!(this_present_endDate && that_present_endDate))
          return false;
        if (this.endDate != that.endDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPurchaseScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPurchaseScans_args typedOther = (getPurchaseScans_args)other;

      lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // START_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.startDate = iprot.readI64();
              setStartDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // END_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.endDate = iprot.readI64();
              setEndDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
      oprot.writeI64(this.startDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
      oprot.writeI64(this.endDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPurchaseScans_args(");
      boolean first = true;

      sb.append("startDate:");
      sb.append(this.startDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endDate:");
      sb.append(this.endDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPurchaseScans_result implements org.apache.thrift.TBase<getPurchaseScans_result, getPurchaseScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<DetailedPurchaseScan> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DetailedPurchaseScan.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseScans_result.class, metaDataMap);
    }

    public getPurchaseScans_result() {
    }

    public getPurchaseScans_result(
      List<DetailedPurchaseScan> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPurchaseScans_result(getPurchaseScans_result other) {
      if (other.isSetSuccess()) {
        List<DetailedPurchaseScan> __this__success = new ArrayList<DetailedPurchaseScan>();
        for (DetailedPurchaseScan other_element : other.success) {
          __this__success.add(new DetailedPurchaseScan(other_element));
        }
        this.success = __this__success;
      }
    }

    public getPurchaseScans_result deepCopy() {
      return new getPurchaseScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<DetailedPurchaseScan> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(DetailedPurchaseScan elem) {
      if (this.success == null) {
        this.success = new ArrayList<DetailedPurchaseScan>();
      }
      this.success.add(elem);
    }

    public List<DetailedPurchaseScan> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<DetailedPurchaseScan> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<DetailedPurchaseScan>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPurchaseScans_result)
        return this.equals((getPurchaseScans_result)that);
      return false;
    }

    public boolean equals(getPurchaseScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPurchaseScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPurchaseScans_result typedOther = (getPurchaseScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
                this.success = new ArrayList<DetailedPurchaseScan>(_list12.size);
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
                {
                  DetailedPurchaseScan _elem14; // required
                  _elem14 = new DetailedPurchaseScan();
                  _elem14.read(iprot);
                  this.success.add(_elem14);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (DetailedPurchaseScan _iter15 : this.success)
          {
            _iter15.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPurchaseScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPurchaseScansByGrnDate_args implements org.apache.thrift.TBase<getPurchaseScansByGrnDate_args, getPurchaseScansByGrnDate_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseScansByGrnDate_args");

    private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)2);

    private long startDate; // required
    private long endDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      START_DATE((short)1, "startDate"),
      END_DATE((short)2, "endDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // START_DATE
            return START_DATE;
          case 2: // END_DATE
            return END_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STARTDATE_ISSET_ID = 0;
    private static final int __ENDDATE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseScansByGrnDate_args.class, metaDataMap);
    }

    public getPurchaseScansByGrnDate_args() {
    }

    public getPurchaseScansByGrnDate_args(
      long startDate,
      long endDate)
    {
      this();
      this.startDate = startDate;
      setStartDateIsSet(true);
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPurchaseScansByGrnDate_args(getPurchaseScansByGrnDate_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.startDate = other.startDate;
      this.endDate = other.endDate;
    }

    public getPurchaseScansByGrnDate_args deepCopy() {
      return new getPurchaseScansByGrnDate_args(this);
    }

    @Override
    public void clear() {
      setStartDateIsSet(false);
      this.startDate = 0;
      setEndDateIsSet(false);
      this.endDate = 0;
    }

    public long getStartDate() {
      return this.startDate;
    }

    public void setStartDate(long startDate) {
      this.startDate = startDate;
      setStartDateIsSet(true);
    }

    public void unsetStartDate() {
      __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
    }

    /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
    public boolean isSetStartDate() {
      return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
    }

    public void setStartDateIsSet(boolean value) {
      __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
    }

    public long getEndDate() {
      return this.endDate;
    }

    public void setEndDate(long endDate) {
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    public void unsetEndDate() {
      __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
    }

    /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
    public boolean isSetEndDate() {
      return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
    }

    public void setEndDateIsSet(boolean value) {
      __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case START_DATE:
        if (value == null) {
          unsetStartDate();
        } else {
          setStartDate((Long)value);
        }
        break;

      case END_DATE:
        if (value == null) {
          unsetEndDate();
        } else {
          setEndDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case START_DATE:
        return Long.valueOf(getStartDate());

      case END_DATE:
        return Long.valueOf(getEndDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case START_DATE:
        return isSetStartDate();
      case END_DATE:
        return isSetEndDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPurchaseScansByGrnDate_args)
        return this.equals((getPurchaseScansByGrnDate_args)that);
      return false;
    }

    public boolean equals(getPurchaseScansByGrnDate_args that) {
      if (that == null)
        return false;

      boolean this_present_startDate = true;
      boolean that_present_startDate = true;
      if (this_present_startDate || that_present_startDate) {
        if (!(this_present_startDate && that_present_startDate))
          return false;
        if (this.startDate != that.startDate)
          return false;
      }

      boolean this_present_endDate = true;
      boolean that_present_endDate = true;
      if (this_present_endDate || that_present_endDate) {
        if (!(this_present_endDate && that_present_endDate))
          return false;
        if (this.endDate != that.endDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPurchaseScansByGrnDate_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPurchaseScansByGrnDate_args typedOther = (getPurchaseScansByGrnDate_args)other;

      lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // START_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.startDate = iprot.readI64();
              setStartDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // END_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.endDate = iprot.readI64();
              setEndDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
      oprot.writeI64(this.startDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
      oprot.writeI64(this.endDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPurchaseScansByGrnDate_args(");
      boolean first = true;

      sb.append("startDate:");
      sb.append(this.startDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endDate:");
      sb.append(this.endDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPurchaseScansByGrnDate_result implements org.apache.thrift.TBase<getPurchaseScansByGrnDate_result, getPurchaseScansByGrnDate_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseScansByGrnDate_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<DetailedPurchaseScan> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DetailedPurchaseScan.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseScansByGrnDate_result.class, metaDataMap);
    }

    public getPurchaseScansByGrnDate_result() {
    }

    public getPurchaseScansByGrnDate_result(
      List<DetailedPurchaseScan> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPurchaseScansByGrnDate_result(getPurchaseScansByGrnDate_result other) {
      if (other.isSetSuccess()) {
        List<DetailedPurchaseScan> __this__success = new ArrayList<DetailedPurchaseScan>();
        for (DetailedPurchaseScan other_element : other.success) {
          __this__success.add(new DetailedPurchaseScan(other_element));
        }
        this.success = __this__success;
      }
    }

    public getPurchaseScansByGrnDate_result deepCopy() {
      return new getPurchaseScansByGrnDate_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<DetailedPurchaseScan> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(DetailedPurchaseScan elem) {
      if (this.success == null) {
        this.success = new ArrayList<DetailedPurchaseScan>();
      }
      this.success.add(elem);
    }

    public List<DetailedPurchaseScan> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<DetailedPurchaseScan> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<DetailedPurchaseScan>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPurchaseScansByGrnDate_result)
        return this.equals((getPurchaseScansByGrnDate_result)that);
      return false;
    }

    public boolean equals(getPurchaseScansByGrnDate_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPurchaseScansByGrnDate_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPurchaseScansByGrnDate_result typedOther = (getPurchaseScansByGrnDate_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
                this.success = new ArrayList<DetailedPurchaseScan>(_list16.size);
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
                {
                  DetailedPurchaseScan _elem18; // required
                  _elem18 = new DetailedPurchaseScan();
                  _elem18.read(iprot);
                  this.success.add(_elem18);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (DetailedPurchaseScan _iter19 : this.success)
          {
            _iter19.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPurchaseScansByGrnDate_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getEmptyGrnsByDate_args implements org.apache.thrift.TBase<getEmptyGrnsByDate_args, getEmptyGrnsByDate_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmptyGrnsByDate_args");

    private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)2);

    private long startDate; // required
    private long endDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      START_DATE((short)1, "startDate"),
      END_DATE((short)2, "endDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // START_DATE
            return START_DATE;
          case 2: // END_DATE
            return END_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STARTDATE_ISSET_ID = 0;
    private static final int __ENDDATE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmptyGrnsByDate_args.class, metaDataMap);
    }

    public getEmptyGrnsByDate_args() {
    }

    public getEmptyGrnsByDate_args(
      long startDate,
      long endDate)
    {
      this();
      this.startDate = startDate;
      setStartDateIsSet(true);
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getEmptyGrnsByDate_args(getEmptyGrnsByDate_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.startDate = other.startDate;
      this.endDate = other.endDate;
    }

    public getEmptyGrnsByDate_args deepCopy() {
      return new getEmptyGrnsByDate_args(this);
    }

    @Override
    public void clear() {
      setStartDateIsSet(false);
      this.startDate = 0;
      setEndDateIsSet(false);
      this.endDate = 0;
    }

    public long getStartDate() {
      return this.startDate;
    }

    public void setStartDate(long startDate) {
      this.startDate = startDate;
      setStartDateIsSet(true);
    }

    public void unsetStartDate() {
      __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
    }

    /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
    public boolean isSetStartDate() {
      return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
    }

    public void setStartDateIsSet(boolean value) {
      __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
    }

    public long getEndDate() {
      return this.endDate;
    }

    public void setEndDate(long endDate) {
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    public void unsetEndDate() {
      __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
    }

    /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
    public boolean isSetEndDate() {
      return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
    }

    public void setEndDateIsSet(boolean value) {
      __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case START_DATE:
        if (value == null) {
          unsetStartDate();
        } else {
          setStartDate((Long)value);
        }
        break;

      case END_DATE:
        if (value == null) {
          unsetEndDate();
        } else {
          setEndDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case START_DATE:
        return Long.valueOf(getStartDate());

      case END_DATE:
        return Long.valueOf(getEndDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case START_DATE:
        return isSetStartDate();
      case END_DATE:
        return isSetEndDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getEmptyGrnsByDate_args)
        return this.equals((getEmptyGrnsByDate_args)that);
      return false;
    }

    public boolean equals(getEmptyGrnsByDate_args that) {
      if (that == null)
        return false;

      boolean this_present_startDate = true;
      boolean that_present_startDate = true;
      if (this_present_startDate || that_present_startDate) {
        if (!(this_present_startDate && that_present_startDate))
          return false;
        if (this.startDate != that.startDate)
          return false;
      }

      boolean this_present_endDate = true;
      boolean that_present_endDate = true;
      if (this_present_endDate || that_present_endDate) {
        if (!(this_present_endDate && that_present_endDate))
          return false;
        if (this.endDate != that.endDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getEmptyGrnsByDate_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getEmptyGrnsByDate_args typedOther = (getEmptyGrnsByDate_args)other;

      lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // START_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.startDate = iprot.readI64();
              setStartDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // END_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.endDate = iprot.readI64();
              setEndDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
      oprot.writeI64(this.startDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
      oprot.writeI64(this.endDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getEmptyGrnsByDate_args(");
      boolean first = true;

      sb.append("startDate:");
      sb.append(this.startDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endDate:");
      sb.append(this.endDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getEmptyGrnsByDate_result implements org.apache.thrift.TBase<getEmptyGrnsByDate_result, getEmptyGrnsByDate_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmptyGrnsByDate_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<Long> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmptyGrnsByDate_result.class, metaDataMap);
    }

    public getEmptyGrnsByDate_result() {
    }

    public getEmptyGrnsByDate_result(
      List<Long> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getEmptyGrnsByDate_result(getEmptyGrnsByDate_result other) {
      if (other.isSetSuccess()) {
        List<Long> __this__success = new ArrayList<Long>();
        for (Long other_element : other.success) {
          __this__success.add(other_element);
        }
        this.success = __this__success;
      }
    }

    public getEmptyGrnsByDate_result deepCopy() {
      return new getEmptyGrnsByDate_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Long> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(long elem) {
      if (this.success == null) {
        this.success = new ArrayList<Long>();
      }
      this.success.add(elem);
    }

    public List<Long> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Long> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getEmptyGrnsByDate_result)
        return this.equals((getEmptyGrnsByDate_result)that);
      return false;
    }

    public boolean equals(getEmptyGrnsByDate_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getEmptyGrnsByDate_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getEmptyGrnsByDate_result typedOther = (getEmptyGrnsByDate_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
                this.success = new ArrayList<Long>(_list20.size);
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
                {
                  long _elem22; // required
                  _elem22 = iprot.readI64();
                  this.success.add(_elem22);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.success.size()));
          for (long _iter23 : this.success)
          {
            oprot.writeI64(_iter23);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getEmptyGrnsByDate_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class fetchScansPerInvoiceNumber_args implements org.apache.thrift.TBase<fetchScansPerInvoiceNumber_args, fetchScansPerInvoiceNumber_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchScansPerInvoiceNumber_args");

    private static final org.apache.thrift.protocol.TField DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("date", org.apache.thrift.protocol.TType.I64, (short)1);

    private long date; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      DATE((short)1, "date");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DATE
            return DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __DATE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DATE, new org.apache.thrift.meta_data.FieldMetaData("date", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchScansPerInvoiceNumber_args.class, metaDataMap);
    }

    public fetchScansPerInvoiceNumber_args() {
    }

    public fetchScansPerInvoiceNumber_args(
      long date)
    {
      this();
      this.date = date;
      setDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public fetchScansPerInvoiceNumber_args(fetchScansPerInvoiceNumber_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.date = other.date;
    }

    public fetchScansPerInvoiceNumber_args deepCopy() {
      return new fetchScansPerInvoiceNumber_args(this);
    }

    @Override
    public void clear() {
      setDateIsSet(false);
      this.date = 0;
    }

    public long getDate() {
      return this.date;
    }

    public void setDate(long date) {
      this.date = date;
      setDateIsSet(true);
    }

    public void unsetDate() {
      __isset_bit_vector.clear(__DATE_ISSET_ID);
    }

    /** Returns true if field date is set (has been assigned a value) and false otherwise */
    public boolean isSetDate() {
      return __isset_bit_vector.get(__DATE_ISSET_ID);
    }

    public void setDateIsSet(boolean value) {
      __isset_bit_vector.set(__DATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DATE:
        if (value == null) {
          unsetDate();
        } else {
          setDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DATE:
        return Long.valueOf(getDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DATE:
        return isSetDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof fetchScansPerInvoiceNumber_args)
        return this.equals((fetchScansPerInvoiceNumber_args)that);
      return false;
    }

    public boolean equals(fetchScansPerInvoiceNumber_args that) {
      if (that == null)
        return false;

      boolean this_present_date = true;
      boolean that_present_date = true;
      if (this_present_date || that_present_date) {
        if (!(this_present_date && that_present_date))
          return false;
        if (this.date != that.date)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(fetchScansPerInvoiceNumber_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      fetchScansPerInvoiceNumber_args typedOther = (fetchScansPerInvoiceNumber_args)other;

      lastComparison = Boolean.valueOf(isSetDate()).compareTo(typedOther.isSetDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.date, typedOther.date);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.date = iprot.readI64();
              setDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(DATE_FIELD_DESC);
      oprot.writeI64(this.date);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("fetchScansPerInvoiceNumber_args(");
      boolean first = true;

      sb.append("date:");
      sb.append(this.date);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class fetchScansPerInvoiceNumber_result implements org.apache.thrift.TBase<fetchScansPerInvoiceNumber_result, fetchScansPerInvoiceNumber_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchScansPerInvoiceNumber_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InvoiceScan> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InvoiceScan.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchScansPerInvoiceNumber_result.class, metaDataMap);
    }

    public fetchScansPerInvoiceNumber_result() {
    }

    public fetchScansPerInvoiceNumber_result(
      List<InvoiceScan> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public fetchScansPerInvoiceNumber_result(fetchScansPerInvoiceNumber_result other) {
      if (other.isSetSuccess()) {
        List<InvoiceScan> __this__success = new ArrayList<InvoiceScan>();
        for (InvoiceScan other_element : other.success) {
          __this__success.add(new InvoiceScan(other_element));
        }
        this.success = __this__success;
      }
    }

    public fetchScansPerInvoiceNumber_result deepCopy() {
      return new fetchScansPerInvoiceNumber_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InvoiceScan> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InvoiceScan elem) {
      if (this.success == null) {
        this.success = new ArrayList<InvoiceScan>();
      }
      this.success.add(elem);
    }

    public List<InvoiceScan> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InvoiceScan> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InvoiceScan>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof fetchScansPerInvoiceNumber_result)
        return this.equals((fetchScansPerInvoiceNumber_result)that);
      return false;
    }

    public boolean equals(fetchScansPerInvoiceNumber_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(fetchScansPerInvoiceNumber_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      fetchScansPerInvoiceNumber_result typedOther = (fetchScansPerInvoiceNumber_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
                this.success = new ArrayList<InvoiceScan>(_list24.size);
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
                {
                  InvoiceScan _elem26; // required
                  _elem26 = new InvoiceScan();
                  _elem26.read(iprot);
                  this.success.add(_elem26);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InvoiceScan _iter27 : this.success)
          {
            _iter27.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("fetchScansPerInvoiceNumber_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemFromOrder_args implements org.apache.thrift.TBase<getInventoryItemFromOrder_args, getInventoryItemFromOrder_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemFromOrder_args");

    private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long orderId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ORDER_ID((short)1, "orderId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ORDER_ID
            return ORDER_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemFromOrder_args.class, metaDataMap);
    }

    public getInventoryItemFromOrder_args() {
    }

    public getInventoryItemFromOrder_args(
      long orderId)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemFromOrder_args(getInventoryItemFromOrder_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
    }

    public getInventoryItemFromOrder_args deepCopy() {
      return new getInventoryItemFromOrder_args(this);
    }

    @Override
    public void clear() {
      setOrderIdIsSet(false);
      this.orderId = 0;
    }

    public long getOrderId() {
      return this.orderId;
    }

    public void setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return Long.valueOf(getOrderId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemFromOrder_args)
        return this.equals((getInventoryItemFromOrder_args)that);
      return false;
    }

    public boolean equals(getInventoryItemFromOrder_args that) {
      if (that == null)
        return false;

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemFromOrder_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemFromOrder_args typedOther = (getInventoryItemFromOrder_args)other;

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.orderId = iprot.readI64();
              setOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemFromOrder_args(");
      boolean first = true;

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemFromOrder_result implements org.apache.thrift.TBase<getInventoryItemFromOrder_result, getInventoryItemFromOrder_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemFromOrder_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField WE_FIELD_DESC = new org.apache.thrift.protocol.TField("we", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryItem success; // required
    private WarehouseServiceException we; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WE((short)1, "we");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WE
            return WE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.WE, new org.apache.thrift.meta_data.FieldMetaData("we", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemFromOrder_result.class, metaDataMap);
    }

    public getInventoryItemFromOrder_result() {
    }

    public getInventoryItemFromOrder_result(
      InventoryItem success,
      WarehouseServiceException we)
    {
      this();
      this.success = success;
      this.we = we;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemFromOrder_result(getInventoryItemFromOrder_result other) {
      if (other.isSetSuccess()) {
        this.success = new InventoryItem(other.success);
      }
      if (other.isSetWe()) {
        this.we = new WarehouseServiceException(other.we);
      }
    }

    public getInventoryItemFromOrder_result deepCopy() {
      return new getInventoryItemFromOrder_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.we = null;
    }

    public InventoryItem getSuccess() {
      return this.success;
    }

    public void setSuccess(InventoryItem success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWe() {
      return this.we;
    }

    public void setWe(WarehouseServiceException we) {
      this.we = we;
    }

    public void unsetWe() {
      this.we = null;
    }

    /** Returns true if field we is set (has been assigned a value) and false otherwise */
    public boolean isSetWe() {
      return this.we != null;
    }

    public void setWeIsSet(boolean value) {
      if (!value) {
        this.we = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((InventoryItem)value);
        }
        break;

      case WE:
        if (value == null) {
          unsetWe();
        } else {
          setWe((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WE:
        return getWe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WE:
        return isSetWe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemFromOrder_result)
        return this.equals((getInventoryItemFromOrder_result)that);
      return false;
    }

    public boolean equals(getInventoryItemFromOrder_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_we = true && this.isSetWe();
      boolean that_present_we = true && that.isSetWe();
      if (this_present_we || that_present_we) {
        if (!(this_present_we && that_present_we))
          return false;
        if (!this.we.equals(that.we))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemFromOrder_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemFromOrder_result typedOther = (getInventoryItemFromOrder_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWe()).compareTo(typedOther.isSetWe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.we, typedOther.we);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new InventoryItem();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.we = new WarehouseServiceException();
              this.we.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetWe()) {
        oprot.writeFieldBegin(WE_FIELD_DESC);
        this.we.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemFromOrder_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("we:");
      if (this.we == null) {
        sb.append("null");
      } else {
        sb.append(this.we);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryAge_args implements org.apache.thrift.TBase<getInventoryAge_args, getInventoryAge_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryAge_args");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryAge_args.class, metaDataMap);
    }

    public getInventoryAge_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryAge_args(getInventoryAge_args other) {
    }

    public getInventoryAge_args deepCopy() {
      return new getInventoryAge_args(this);
    }

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryAge_args)
        return this.equals((getInventoryAge_args)that);
      return false;
    }

    public boolean equals(getInventoryAge_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryAge_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryAge_args typedOther = (getInventoryAge_args)other;

      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryAge_args(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryAge_result implements org.apache.thrift.TBase<getInventoryAge_result, getInventoryAge_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryAge_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryAge> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryAge.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryAge_result.class, metaDataMap);
    }

    public getInventoryAge_result() {
    }

    public getInventoryAge_result(
      List<InventoryAge> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryAge_result(getInventoryAge_result other) {
      if (other.isSetSuccess()) {
        List<InventoryAge> __this__success = new ArrayList<InventoryAge>();
        for (InventoryAge other_element : other.success) {
          __this__success.add(new InventoryAge(other_element));
        }
        this.success = __this__success;
      }
    }

    public getInventoryAge_result deepCopy() {
      return new getInventoryAge_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryAge> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryAge elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryAge>();
      }
      this.success.add(elem);
    }

    public List<InventoryAge> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryAge> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryAge>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryAge_result)
        return this.equals((getInventoryAge_result)that);
      return false;
    }

    public boolean equals(getInventoryAge_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryAge_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryAge_result typedOther = (getInventoryAge_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list28 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAge>(_list28.size);
                for (int _i29 = 0; _i29 < _list28.size; ++_i29)
                {
                  InventoryAge _elem30; // required
                  _elem30 = new InventoryAge();
                  _elem30.read(iprot);
                  this.success.add(_elem30);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryAge _iter31 : this.success)
          {
            _iter31.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryAge_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryScansForItem_args implements org.apache.thrift.TBase<getInventoryScansForItem_args, getInventoryScansForItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryScansForItem_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField FROM_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("fromDate", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField TO_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("toDate", org.apache.thrift.protocol.TType.I64, (short)3);

    private long itemId; // required
    private long fromDate; // required
    private long toDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_ID((short)1, "itemId"),
      FROM_DATE((short)2, "fromDate"),
      TO_DATE((short)3, "toDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_ID
            return ITEM_ID;
          case 2: // FROM_DATE
            return FROM_DATE;
          case 3: // TO_DATE
            return TO_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private static final int __FROMDATE_ISSET_ID = 1;
    private static final int __TODATE_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FROM_DATE, new org.apache.thrift.meta_data.FieldMetaData("fromDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TO_DATE, new org.apache.thrift.meta_data.FieldMetaData("toDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryScansForItem_args.class, metaDataMap);
    }

    public getInventoryScansForItem_args() {
    }

    public getInventoryScansForItem_args(
      long itemId,
      long fromDate,
      long toDate)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.fromDate = fromDate;
      setFromDateIsSet(true);
      this.toDate = toDate;
      setToDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryScansForItem_args(getInventoryScansForItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      this.fromDate = other.fromDate;
      this.toDate = other.toDate;
    }

    public getInventoryScansForItem_args deepCopy() {
      return new getInventoryScansForItem_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      setFromDateIsSet(false);
      this.fromDate = 0;
      setToDateIsSet(false);
      this.toDate = 0;
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public long getFromDate() {
      return this.fromDate;
    }

    public void setFromDate(long fromDate) {
      this.fromDate = fromDate;
      setFromDateIsSet(true);
    }

    public void unsetFromDate() {
      __isset_bit_vector.clear(__FROMDATE_ISSET_ID);
    }

    /** Returns true if field fromDate is set (has been assigned a value) and false otherwise */
    public boolean isSetFromDate() {
      return __isset_bit_vector.get(__FROMDATE_ISSET_ID);
    }

    public void setFromDateIsSet(boolean value) {
      __isset_bit_vector.set(__FROMDATE_ISSET_ID, value);
    }

    public long getToDate() {
      return this.toDate;
    }

    public void setToDate(long toDate) {
      this.toDate = toDate;
      setToDateIsSet(true);
    }

    public void unsetToDate() {
      __isset_bit_vector.clear(__TODATE_ISSET_ID);
    }

    /** Returns true if field toDate is set (has been assigned a value) and false otherwise */
    public boolean isSetToDate() {
      return __isset_bit_vector.get(__TODATE_ISSET_ID);
    }

    public void setToDateIsSet(boolean value) {
      __isset_bit_vector.set(__TODATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case FROM_DATE:
        if (value == null) {
          unsetFromDate();
        } else {
          setFromDate((Long)value);
        }
        break;

      case TO_DATE:
        if (value == null) {
          unsetToDate();
        } else {
          setToDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case FROM_DATE:
        return Long.valueOf(getFromDate());

      case TO_DATE:
        return Long.valueOf(getToDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_ID:
        return isSetItemId();
      case FROM_DATE:
        return isSetFromDate();
      case TO_DATE:
        return isSetToDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryScansForItem_args)
        return this.equals((getInventoryScansForItem_args)that);
      return false;
    }

    public boolean equals(getInventoryScansForItem_args that) {
      if (that == null)
        return false;

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      boolean this_present_fromDate = true;
      boolean that_present_fromDate = true;
      if (this_present_fromDate || that_present_fromDate) {
        if (!(this_present_fromDate && that_present_fromDate))
          return false;
        if (this.fromDate != that.fromDate)
          return false;
      }

      boolean this_present_toDate = true;
      boolean that_present_toDate = true;
      if (this_present_toDate || that_present_toDate) {
        if (!(this_present_toDate && that_present_toDate))
          return false;
        if (this.toDate != that.toDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryScansForItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryScansForItem_args typedOther = (getInventoryScansForItem_args)other;

      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFromDate()).compareTo(typedOther.isSetFromDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFromDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fromDate, typedOther.fromDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToDate()).compareTo(typedOther.isSetToDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.toDate, typedOther.toDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // FROM_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.fromDate = iprot.readI64();
              setFromDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // TO_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.toDate = iprot.readI64();
              setToDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FROM_DATE_FIELD_DESC);
      oprot.writeI64(this.fromDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_DATE_FIELD_DESC);
      oprot.writeI64(this.toDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryScansForItem_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("fromDate:");
      sb.append(this.fromDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("toDate:");
      sb.append(this.toDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryScansForItem_result implements org.apache.thrift.TBase<getInventoryScansForItem_result, getInventoryScansForItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryScansForItem_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<Scan> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Scan.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryScansForItem_result.class, metaDataMap);
    }

    public getInventoryScansForItem_result() {
    }

    public getInventoryScansForItem_result(
      List<Scan> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryScansForItem_result(getInventoryScansForItem_result other) {
      if (other.isSetSuccess()) {
        List<Scan> __this__success = new ArrayList<Scan>();
        for (Scan other_element : other.success) {
          __this__success.add(new Scan(other_element));
        }
        this.success = __this__success;
      }
    }

    public getInventoryScansForItem_result deepCopy() {
      return new getInventoryScansForItem_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Scan> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Scan elem) {
      if (this.success == null) {
        this.success = new ArrayList<Scan>();
      }
      this.success.add(elem);
    }

    public List<Scan> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Scan> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Scan>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryScansForItem_result)
        return this.equals((getInventoryScansForItem_result)that);
      return false;
    }

    public boolean equals(getInventoryScansForItem_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryScansForItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryScansForItem_result typedOther = (getInventoryScansForItem_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
                this.success = new ArrayList<Scan>(_list32.size);
                for (int _i33 = 0; _i33 < _list32.size; ++_i33)
                {
                  Scan _elem34; // required
                  _elem34 = new Scan();
                  _elem34.read(iprot);
                  this.success.add(_elem34);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Scan _iter35 : this.success)
          {
            _iter35.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryScansForItem_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getScanRecordsForSerialNumber_args implements org.apache.thrift.TBase<getScanRecordsForSerialNumber_args, getScanRecordsForSerialNumber_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScanRecordsForSerialNumber_args");

    private static final org.apache.thrift.protocol.TField SERIAL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("serialNumber", org.apache.thrift.protocol.TType.STRING, (short)1);

    private String serialNumber; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SERIAL_NUMBER((short)1, "serialNumber");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SERIAL_NUMBER
            return SERIAL_NUMBER;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SERIAL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("serialNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScanRecordsForSerialNumber_args.class, metaDataMap);
    }

    public getScanRecordsForSerialNumber_args() {
    }

    public getScanRecordsForSerialNumber_args(
      String serialNumber)
    {
      this();
      this.serialNumber = serialNumber;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getScanRecordsForSerialNumber_args(getScanRecordsForSerialNumber_args other) {
      if (other.isSetSerialNumber()) {
        this.serialNumber = other.serialNumber;
      }
    }

    public getScanRecordsForSerialNumber_args deepCopy() {
      return new getScanRecordsForSerialNumber_args(this);
    }

    @Override
    public void clear() {
      this.serialNumber = null;
    }

    public String getSerialNumber() {
      return this.serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
      this.serialNumber = serialNumber;
    }

    public void unsetSerialNumber() {
      this.serialNumber = null;
    }

    /** Returns true if field serialNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetSerialNumber() {
      return this.serialNumber != null;
    }

    public void setSerialNumberIsSet(boolean value) {
      if (!value) {
        this.serialNumber = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SERIAL_NUMBER:
        if (value == null) {
          unsetSerialNumber();
        } else {
          setSerialNumber((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SERIAL_NUMBER:
        return getSerialNumber();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SERIAL_NUMBER:
        return isSetSerialNumber();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getScanRecordsForSerialNumber_args)
        return this.equals((getScanRecordsForSerialNumber_args)that);
      return false;
    }

    public boolean equals(getScanRecordsForSerialNumber_args that) {
      if (that == null)
        return false;

      boolean this_present_serialNumber = true && this.isSetSerialNumber();
      boolean that_present_serialNumber = true && that.isSetSerialNumber();
      if (this_present_serialNumber || that_present_serialNumber) {
        if (!(this_present_serialNumber && that_present_serialNumber))
          return false;
        if (!this.serialNumber.equals(that.serialNumber))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getScanRecordsForSerialNumber_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getScanRecordsForSerialNumber_args typedOther = (getScanRecordsForSerialNumber_args)other;

      lastComparison = Boolean.valueOf(isSetSerialNumber()).compareTo(typedOther.isSetSerialNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSerialNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialNumber, typedOther.serialNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SERIAL_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.serialNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.serialNumber != null) {
        oprot.writeFieldBegin(SERIAL_NUMBER_FIELD_DESC);
        oprot.writeString(this.serialNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getScanRecordsForSerialNumber_args(");
      boolean first = true;

      sb.append("serialNumber:");
      if (this.serialNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.serialNumber);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getScanRecordsForSerialNumber_result implements org.apache.thrift.TBase<getScanRecordsForSerialNumber_result, getScanRecordsForSerialNumber_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScanRecordsForSerialNumber_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<Scan> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Scan.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScanRecordsForSerialNumber_result.class, metaDataMap);
    }

    public getScanRecordsForSerialNumber_result() {
    }

    public getScanRecordsForSerialNumber_result(
      List<Scan> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getScanRecordsForSerialNumber_result(getScanRecordsForSerialNumber_result other) {
      if (other.isSetSuccess()) {
        List<Scan> __this__success = new ArrayList<Scan>();
        for (Scan other_element : other.success) {
          __this__success.add(new Scan(other_element));
        }
        this.success = __this__success;
      }
    }

    public getScanRecordsForSerialNumber_result deepCopy() {
      return new getScanRecordsForSerialNumber_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Scan> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Scan elem) {
      if (this.success == null) {
        this.success = new ArrayList<Scan>();
      }
      this.success.add(elem);
    }

    public List<Scan> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Scan> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Scan>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getScanRecordsForSerialNumber_result)
        return this.equals((getScanRecordsForSerialNumber_result)that);
      return false;
    }

    public boolean equals(getScanRecordsForSerialNumber_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getScanRecordsForSerialNumber_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getScanRecordsForSerialNumber_result typedOther = (getScanRecordsForSerialNumber_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list36 = iprot.readListBegin();
                this.success = new ArrayList<Scan>(_list36.size);
                for (int _i37 = 0; _i37 < _list36.size; ++_i37)
                {
                  Scan _elem38; // required
                  _elem38 = new Scan();
                  _elem38.read(iprot);
                  this.success.add(_elem38);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Scan _iter39 : this.success)
          {
            _iter39.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getScanRecordsForSerialNumber_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForPurchaseReturn_args implements org.apache.thrift.TBase<scanForPurchaseReturn_args, scanForPurchaseReturn_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForPurchaseReturn_args");

    private static final org.apache.thrift.protocol.TField SALE_RETURN_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("saleReturnItems", org.apache.thrift.protocol.TType.LIST, (short)1);
    private static final org.apache.thrift.protocol.TField VENDOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField BILLING_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("billingWarehouseId", org.apache.thrift.protocol.TType.I64, (short)3);

    private List<InventoryItem> saleReturnItems; // required
    private long vendorId; // required
    private long billingWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SALE_RETURN_ITEMS((short)1, "saleReturnItems"),
      VENDOR_ID((short)2, "vendorId"),
      BILLING_WAREHOUSE_ID((short)3, "billingWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SALE_RETURN_ITEMS
            return SALE_RETURN_ITEMS;
          case 2: // VENDOR_ID
            return VENDOR_ID;
          case 3: // BILLING_WAREHOUSE_ID
            return BILLING_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __VENDORID_ISSET_ID = 0;
    private static final int __BILLINGWAREHOUSEID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SALE_RETURN_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("saleReturnItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.VENDOR_ID, new org.apache.thrift.meta_data.FieldMetaData("vendorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BILLING_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("billingWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForPurchaseReturn_args.class, metaDataMap);
    }

    public scanForPurchaseReturn_args() {
    }

    public scanForPurchaseReturn_args(
      List<InventoryItem> saleReturnItems,
      long vendorId,
      long billingWarehouseId)
    {
      this();
      this.saleReturnItems = saleReturnItems;
      this.vendorId = vendorId;
      setVendorIdIsSet(true);
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForPurchaseReturn_args(scanForPurchaseReturn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetSaleReturnItems()) {
        List<InventoryItem> __this__saleReturnItems = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.saleReturnItems) {
          __this__saleReturnItems.add(new InventoryItem(other_element));
        }
        this.saleReturnItems = __this__saleReturnItems;
      }
      this.vendorId = other.vendorId;
      this.billingWarehouseId = other.billingWarehouseId;
    }

    public scanForPurchaseReturn_args deepCopy() {
      return new scanForPurchaseReturn_args(this);
    }

    @Override
    public void clear() {
      this.saleReturnItems = null;
      setVendorIdIsSet(false);
      this.vendorId = 0;
      setBillingWarehouseIdIsSet(false);
      this.billingWarehouseId = 0;
    }

    public int getSaleReturnItemsSize() {
      return (this.saleReturnItems == null) ? 0 : this.saleReturnItems.size();
    }

    public java.util.Iterator<InventoryItem> getSaleReturnItemsIterator() {
      return (this.saleReturnItems == null) ? null : this.saleReturnItems.iterator();
    }

    public void addToSaleReturnItems(InventoryItem elem) {
      if (this.saleReturnItems == null) {
        this.saleReturnItems = new ArrayList<InventoryItem>();
      }
      this.saleReturnItems.add(elem);
    }

    public List<InventoryItem> getSaleReturnItems() {
      return this.saleReturnItems;
    }

    public void setSaleReturnItems(List<InventoryItem> saleReturnItems) {
      this.saleReturnItems = saleReturnItems;
    }

    public void unsetSaleReturnItems() {
      this.saleReturnItems = null;
    }

    /** Returns true if field saleReturnItems is set (has been assigned a value) and false otherwise */
    public boolean isSetSaleReturnItems() {
      return this.saleReturnItems != null;
    }

    public void setSaleReturnItemsIsSet(boolean value) {
      if (!value) {
        this.saleReturnItems = null;
      }
    }

    public long getVendorId() {
      return this.vendorId;
    }

    public void setVendorId(long vendorId) {
      this.vendorId = vendorId;
      setVendorIdIsSet(true);
    }

    public void unsetVendorId() {
      __isset_bit_vector.clear(__VENDORID_ISSET_ID);
    }

    /** Returns true if field vendorId is set (has been assigned a value) and false otherwise */
    public boolean isSetVendorId() {
      return __isset_bit_vector.get(__VENDORID_ISSET_ID);
    }

    public void setVendorIdIsSet(boolean value) {
      __isset_bit_vector.set(__VENDORID_ISSET_ID, value);
    }

    public long getBillingWarehouseId() {
      return this.billingWarehouseId;
    }

    public void setBillingWarehouseId(long billingWarehouseId) {
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    public void unsetBillingWarehouseId() {
      __isset_bit_vector.clear(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field billingWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetBillingWarehouseId() {
      return __isset_bit_vector.get(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    public void setBillingWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__BILLINGWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SALE_RETURN_ITEMS:
        if (value == null) {
          unsetSaleReturnItems();
        } else {
          setSaleReturnItems((List<InventoryItem>)value);
        }
        break;

      case VENDOR_ID:
        if (value == null) {
          unsetVendorId();
        } else {
          setVendorId((Long)value);
        }
        break;

      case BILLING_WAREHOUSE_ID:
        if (value == null) {
          unsetBillingWarehouseId();
        } else {
          setBillingWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SALE_RETURN_ITEMS:
        return getSaleReturnItems();

      case VENDOR_ID:
        return Long.valueOf(getVendorId());

      case BILLING_WAREHOUSE_ID:
        return Long.valueOf(getBillingWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SALE_RETURN_ITEMS:
        return isSetSaleReturnItems();
      case VENDOR_ID:
        return isSetVendorId();
      case BILLING_WAREHOUSE_ID:
        return isSetBillingWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForPurchaseReturn_args)
        return this.equals((scanForPurchaseReturn_args)that);
      return false;
    }

    public boolean equals(scanForPurchaseReturn_args that) {
      if (that == null)
        return false;

      boolean this_present_saleReturnItems = true && this.isSetSaleReturnItems();
      boolean that_present_saleReturnItems = true && that.isSetSaleReturnItems();
      if (this_present_saleReturnItems || that_present_saleReturnItems) {
        if (!(this_present_saleReturnItems && that_present_saleReturnItems))
          return false;
        if (!this.saleReturnItems.equals(that.saleReturnItems))
          return false;
      }

      boolean this_present_vendorId = true;
      boolean that_present_vendorId = true;
      if (this_present_vendorId || that_present_vendorId) {
        if (!(this_present_vendorId && that_present_vendorId))
          return false;
        if (this.vendorId != that.vendorId)
          return false;
      }

      boolean this_present_billingWarehouseId = true;
      boolean that_present_billingWarehouseId = true;
      if (this_present_billingWarehouseId || that_present_billingWarehouseId) {
        if (!(this_present_billingWarehouseId && that_present_billingWarehouseId))
          return false;
        if (this.billingWarehouseId != that.billingWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForPurchaseReturn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForPurchaseReturn_args typedOther = (scanForPurchaseReturn_args)other;

      lastComparison = Boolean.valueOf(isSetSaleReturnItems()).compareTo(typedOther.isSetSaleReturnItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSaleReturnItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.saleReturnItems, typedOther.saleReturnItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetVendorId()).compareTo(typedOther.isSetVendorId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetVendorId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vendorId, typedOther.vendorId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBillingWarehouseId()).compareTo(typedOther.isSetBillingWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBillingWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.billingWarehouseId, typedOther.billingWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SALE_RETURN_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list40 = iprot.readListBegin();
                this.saleReturnItems = new ArrayList<InventoryItem>(_list40.size);
                for (int _i41 = 0; _i41 < _list40.size; ++_i41)
                {
                  InventoryItem _elem42; // required
                  _elem42 = new InventoryItem();
                  _elem42.read(iprot);
                  this.saleReturnItems.add(_elem42);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // VENDOR_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.vendorId = iprot.readI64();
              setVendorIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // BILLING_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.billingWarehouseId = iprot.readI64();
              setBillingWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.saleReturnItems != null) {
        oprot.writeFieldBegin(SALE_RETURN_ITEMS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.saleReturnItems.size()));
          for (InventoryItem _iter43 : this.saleReturnItems)
          {
            _iter43.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(VENDOR_ID_FIELD_DESC);
      oprot.writeI64(this.vendorId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BILLING_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.billingWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForPurchaseReturn_args(");
      boolean first = true;

      sb.append("saleReturnItems:");
      if (this.saleReturnItems == null) {
        sb.append("null");
      } else {
        sb.append(this.saleReturnItems);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("vendorId:");
      sb.append(this.vendorId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("billingWarehouseId:");
      sb.append(this.billingWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForPurchaseReturn_result implements org.apache.thrift.TBase<scanForPurchaseReturn_result, scanForPurchaseReturn_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForPurchaseReturn_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForPurchaseReturn_result.class, metaDataMap);
    }

    public scanForPurchaseReturn_result() {
    }

    public scanForPurchaseReturn_result(
      long success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForPurchaseReturn_result(scanForPurchaseReturn_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public scanForPurchaseReturn_result deepCopy() {
      return new scanForPurchaseReturn_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.ex = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public void setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForPurchaseReturn_result)
        return this.equals((scanForPurchaseReturn_result)that);
      return false;
    }

    public boolean equals(scanForPurchaseReturn_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForPurchaseReturn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForPurchaseReturn_result typedOther = (scanForPurchaseReturn_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.success = iprot.readI64();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForPurchaseReturn_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForLostItem_args implements org.apache.thrift.TBase<scanForLostItem_args, scanForLostItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForLostItem_args");

    private static final org.apache.thrift.protocol.TField LOST_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("lostItems", org.apache.thrift.protocol.TType.LIST, (short)1);
    private static final org.apache.thrift.protocol.TField VENDOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField BILLING_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("billingWarehouseId", org.apache.thrift.protocol.TType.I64, (short)3);

    private List<InventoryItem> lostItems; // required
    private long vendorId; // required
    private long billingWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      LOST_ITEMS((short)1, "lostItems"),
      VENDOR_ID((short)2, "vendorId"),
      BILLING_WAREHOUSE_ID((short)3, "billingWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // LOST_ITEMS
            return LOST_ITEMS;
          case 2: // VENDOR_ID
            return VENDOR_ID;
          case 3: // BILLING_WAREHOUSE_ID
            return BILLING_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __VENDORID_ISSET_ID = 0;
    private static final int __BILLINGWAREHOUSEID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.LOST_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("lostItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.VENDOR_ID, new org.apache.thrift.meta_data.FieldMetaData("vendorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BILLING_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("billingWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForLostItem_args.class, metaDataMap);
    }

    public scanForLostItem_args() {
    }

    public scanForLostItem_args(
      List<InventoryItem> lostItems,
      long vendorId,
      long billingWarehouseId)
    {
      this();
      this.lostItems = lostItems;
      this.vendorId = vendorId;
      setVendorIdIsSet(true);
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForLostItem_args(scanForLostItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetLostItems()) {
        List<InventoryItem> __this__lostItems = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.lostItems) {
          __this__lostItems.add(new InventoryItem(other_element));
        }
        this.lostItems = __this__lostItems;
      }
      this.vendorId = other.vendorId;
      this.billingWarehouseId = other.billingWarehouseId;
    }

    public scanForLostItem_args deepCopy() {
      return new scanForLostItem_args(this);
    }

    @Override
    public void clear() {
      this.lostItems = null;
      setVendorIdIsSet(false);
      this.vendorId = 0;
      setBillingWarehouseIdIsSet(false);
      this.billingWarehouseId = 0;
    }

    public int getLostItemsSize() {
      return (this.lostItems == null) ? 0 : this.lostItems.size();
    }

    public java.util.Iterator<InventoryItem> getLostItemsIterator() {
      return (this.lostItems == null) ? null : this.lostItems.iterator();
    }

    public void addToLostItems(InventoryItem elem) {
      if (this.lostItems == null) {
        this.lostItems = new ArrayList<InventoryItem>();
      }
      this.lostItems.add(elem);
    }

    public List<InventoryItem> getLostItems() {
      return this.lostItems;
    }

    public void setLostItems(List<InventoryItem> lostItems) {
      this.lostItems = lostItems;
    }

    public void unsetLostItems() {
      this.lostItems = null;
    }

    /** Returns true if field lostItems is set (has been assigned a value) and false otherwise */
    public boolean isSetLostItems() {
      return this.lostItems != null;
    }

    public void setLostItemsIsSet(boolean value) {
      if (!value) {
        this.lostItems = null;
      }
    }

    public long getVendorId() {
      return this.vendorId;
    }

    public void setVendorId(long vendorId) {
      this.vendorId = vendorId;
      setVendorIdIsSet(true);
    }

    public void unsetVendorId() {
      __isset_bit_vector.clear(__VENDORID_ISSET_ID);
    }

    /** Returns true if field vendorId is set (has been assigned a value) and false otherwise */
    public boolean isSetVendorId() {
      return __isset_bit_vector.get(__VENDORID_ISSET_ID);
    }

    public void setVendorIdIsSet(boolean value) {
      __isset_bit_vector.set(__VENDORID_ISSET_ID, value);
    }

    public long getBillingWarehouseId() {
      return this.billingWarehouseId;
    }

    public void setBillingWarehouseId(long billingWarehouseId) {
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    public void unsetBillingWarehouseId() {
      __isset_bit_vector.clear(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field billingWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetBillingWarehouseId() {
      return __isset_bit_vector.get(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    public void setBillingWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__BILLINGWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case LOST_ITEMS:
        if (value == null) {
          unsetLostItems();
        } else {
          setLostItems((List<InventoryItem>)value);
        }
        break;

      case VENDOR_ID:
        if (value == null) {
          unsetVendorId();
        } else {
          setVendorId((Long)value);
        }
        break;

      case BILLING_WAREHOUSE_ID:
        if (value == null) {
          unsetBillingWarehouseId();
        } else {
          setBillingWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case LOST_ITEMS:
        return getLostItems();

      case VENDOR_ID:
        return Long.valueOf(getVendorId());

      case BILLING_WAREHOUSE_ID:
        return Long.valueOf(getBillingWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case LOST_ITEMS:
        return isSetLostItems();
      case VENDOR_ID:
        return isSetVendorId();
      case BILLING_WAREHOUSE_ID:
        return isSetBillingWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForLostItem_args)
        return this.equals((scanForLostItem_args)that);
      return false;
    }

    public boolean equals(scanForLostItem_args that) {
      if (that == null)
        return false;

      boolean this_present_lostItems = true && this.isSetLostItems();
      boolean that_present_lostItems = true && that.isSetLostItems();
      if (this_present_lostItems || that_present_lostItems) {
        if (!(this_present_lostItems && that_present_lostItems))
          return false;
        if (!this.lostItems.equals(that.lostItems))
          return false;
      }

      boolean this_present_vendorId = true;
      boolean that_present_vendorId = true;
      if (this_present_vendorId || that_present_vendorId) {
        if (!(this_present_vendorId && that_present_vendorId))
          return false;
        if (this.vendorId != that.vendorId)
          return false;
      }

      boolean this_present_billingWarehouseId = true;
      boolean that_present_billingWarehouseId = true;
      if (this_present_billingWarehouseId || that_present_billingWarehouseId) {
        if (!(this_present_billingWarehouseId && that_present_billingWarehouseId))
          return false;
        if (this.billingWarehouseId != that.billingWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForLostItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForLostItem_args typedOther = (scanForLostItem_args)other;

      lastComparison = Boolean.valueOf(isSetLostItems()).compareTo(typedOther.isSetLostItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLostItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lostItems, typedOther.lostItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetVendorId()).compareTo(typedOther.isSetVendorId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetVendorId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vendorId, typedOther.vendorId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBillingWarehouseId()).compareTo(typedOther.isSetBillingWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBillingWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.billingWarehouseId, typedOther.billingWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // LOST_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list44 = iprot.readListBegin();
                this.lostItems = new ArrayList<InventoryItem>(_list44.size);
                for (int _i45 = 0; _i45 < _list44.size; ++_i45)
                {
                  InventoryItem _elem46; // required
                  _elem46 = new InventoryItem();
                  _elem46.read(iprot);
                  this.lostItems.add(_elem46);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // VENDOR_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.vendorId = iprot.readI64();
              setVendorIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // BILLING_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.billingWarehouseId = iprot.readI64();
              setBillingWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.lostItems != null) {
        oprot.writeFieldBegin(LOST_ITEMS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.lostItems.size()));
          for (InventoryItem _iter47 : this.lostItems)
          {
            _iter47.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(VENDOR_ID_FIELD_DESC);
      oprot.writeI64(this.vendorId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BILLING_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.billingWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForLostItem_args(");
      boolean first = true;

      sb.append("lostItems:");
      if (this.lostItems == null) {
        sb.append("null");
      } else {
        sb.append(this.lostItems);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("vendorId:");
      sb.append(this.vendorId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("billingWarehouseId:");
      sb.append(this.billingWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForLostItem_result implements org.apache.thrift.TBase<scanForLostItem_result, scanForLostItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForLostItem_result");

    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForLostItem_result.class, metaDataMap);
    }

    public scanForLostItem_result() {
    }

    public scanForLostItem_result(
      WarehouseServiceException ex)
    {
      this();
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForLostItem_result(scanForLostItem_result other) {
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public scanForLostItem_result deepCopy() {
      return new scanForLostItem_result(this);
    }

    @Override
    public void clear() {
      this.ex = null;
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForLostItem_result)
        return this.equals((scanForLostItem_result)that);
      return false;
    }

    public boolean equals(scanForLostItem_result that) {
      if (that == null)
        return false;

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForLostItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForLostItem_result typedOther = (scanForLostItem_result)other;

      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForLostItem_result(");
      boolean first = true;

      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCurrentSerializedInventoryByScans_args implements org.apache.thrift.TBase<getCurrentSerializedInventoryByScans_args, getCurrentSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCurrentSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField PHYSICAL_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("physicalWarehouseId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long physicalWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      PHYSICAL_WAREHOUSE_ID((short)1, "physicalWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // PHYSICAL_WAREHOUSE_ID
            return PHYSICAL_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __PHYSICALWAREHOUSEID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.PHYSICAL_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("physicalWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getCurrentSerializedInventoryByScans_args() {
    }

    public getCurrentSerializedInventoryByScans_args(
      long physicalWarehouseId)
    {
      this();
      this.physicalWarehouseId = physicalWarehouseId;
      setPhysicalWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCurrentSerializedInventoryByScans_args(getCurrentSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.physicalWarehouseId = other.physicalWarehouseId;
    }

    public getCurrentSerializedInventoryByScans_args deepCopy() {
      return new getCurrentSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setPhysicalWarehouseIdIsSet(false);
      this.physicalWarehouseId = 0;
    }

    public long getPhysicalWarehouseId() {
      return this.physicalWarehouseId;
    }

    public void setPhysicalWarehouseId(long physicalWarehouseId) {
      this.physicalWarehouseId = physicalWarehouseId;
      setPhysicalWarehouseIdIsSet(true);
    }

    public void unsetPhysicalWarehouseId() {
      __isset_bit_vector.clear(__PHYSICALWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field physicalWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetPhysicalWarehouseId() {
      return __isset_bit_vector.get(__PHYSICALWAREHOUSEID_ISSET_ID);
    }

    public void setPhysicalWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__PHYSICALWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PHYSICAL_WAREHOUSE_ID:
        if (value == null) {
          unsetPhysicalWarehouseId();
        } else {
          setPhysicalWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PHYSICAL_WAREHOUSE_ID:
        return Long.valueOf(getPhysicalWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case PHYSICAL_WAREHOUSE_ID:
        return isSetPhysicalWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCurrentSerializedInventoryByScans_args)
        return this.equals((getCurrentSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getCurrentSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_physicalWarehouseId = true;
      boolean that_present_physicalWarehouseId = true;
      if (this_present_physicalWarehouseId || that_present_physicalWarehouseId) {
        if (!(this_present_physicalWarehouseId && that_present_physicalWarehouseId))
          return false;
        if (this.physicalWarehouseId != that.physicalWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCurrentSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCurrentSerializedInventoryByScans_args typedOther = (getCurrentSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetPhysicalWarehouseId()).compareTo(typedOther.isSetPhysicalWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPhysicalWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.physicalWarehouseId, typedOther.physicalWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // PHYSICAL_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.physicalWarehouseId = iprot.readI64();
              setPhysicalWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PHYSICAL_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.physicalWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCurrentSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("physicalWarehouseId:");
      sb.append(this.physicalWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCurrentSerializedInventoryByScans_result implements org.apache.thrift.TBase<getCurrentSerializedInventoryByScans_result, getCurrentSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCurrentSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryAvailability> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryAvailability.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getCurrentSerializedInventoryByScans_result() {
    }

    public getCurrentSerializedInventoryByScans_result(
      List<InventoryAvailability> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCurrentSerializedInventoryByScans_result(getCurrentSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryAvailability> __this__success = new ArrayList<InventoryAvailability>();
        for (InventoryAvailability other_element : other.success) {
          __this__success.add(new InventoryAvailability(other_element));
        }
        this.success = __this__success;
      }
    }

    public getCurrentSerializedInventoryByScans_result deepCopy() {
      return new getCurrentSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryAvailability> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryAvailability elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryAvailability>();
      }
      this.success.add(elem);
    }

    public List<InventoryAvailability> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryAvailability> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryAvailability>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCurrentSerializedInventoryByScans_result)
        return this.equals((getCurrentSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getCurrentSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCurrentSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCurrentSerializedInventoryByScans_result typedOther = (getCurrentSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list48 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAvailability>(_list48.size);
                for (int _i49 = 0; _i49 < _list48.size; ++_i49)
                {
                  InventoryAvailability _elem50; // required
                  _elem50 = new InventoryAvailability();
                  _elem50.read(iprot);
                  this.success.add(_elem50);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryAvailability _iter51 : this.success)
          {
            _iter51.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCurrentSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCurrentNonSerializedInventoryByScans_args implements org.apache.thrift.TBase<getCurrentNonSerializedInventoryByScans_args, getCurrentNonSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCurrentNonSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField PHYSICAL_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("physicalWarehouseId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long physicalWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      PHYSICAL_WAREHOUSE_ID((short)1, "physicalWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // PHYSICAL_WAREHOUSE_ID
            return PHYSICAL_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __PHYSICALWAREHOUSEID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.PHYSICAL_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("physicalWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentNonSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getCurrentNonSerializedInventoryByScans_args() {
    }

    public getCurrentNonSerializedInventoryByScans_args(
      long physicalWarehouseId)
    {
      this();
      this.physicalWarehouseId = physicalWarehouseId;
      setPhysicalWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCurrentNonSerializedInventoryByScans_args(getCurrentNonSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.physicalWarehouseId = other.physicalWarehouseId;
    }

    public getCurrentNonSerializedInventoryByScans_args deepCopy() {
      return new getCurrentNonSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setPhysicalWarehouseIdIsSet(false);
      this.physicalWarehouseId = 0;
    }

    public long getPhysicalWarehouseId() {
      return this.physicalWarehouseId;
    }

    public void setPhysicalWarehouseId(long physicalWarehouseId) {
      this.physicalWarehouseId = physicalWarehouseId;
      setPhysicalWarehouseIdIsSet(true);
    }

    public void unsetPhysicalWarehouseId() {
      __isset_bit_vector.clear(__PHYSICALWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field physicalWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetPhysicalWarehouseId() {
      return __isset_bit_vector.get(__PHYSICALWAREHOUSEID_ISSET_ID);
    }

    public void setPhysicalWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__PHYSICALWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PHYSICAL_WAREHOUSE_ID:
        if (value == null) {
          unsetPhysicalWarehouseId();
        } else {
          setPhysicalWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PHYSICAL_WAREHOUSE_ID:
        return Long.valueOf(getPhysicalWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case PHYSICAL_WAREHOUSE_ID:
        return isSetPhysicalWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCurrentNonSerializedInventoryByScans_args)
        return this.equals((getCurrentNonSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getCurrentNonSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_physicalWarehouseId = true;
      boolean that_present_physicalWarehouseId = true;
      if (this_present_physicalWarehouseId || that_present_physicalWarehouseId) {
        if (!(this_present_physicalWarehouseId && that_present_physicalWarehouseId))
          return false;
        if (this.physicalWarehouseId != that.physicalWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCurrentNonSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCurrentNonSerializedInventoryByScans_args typedOther = (getCurrentNonSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetPhysicalWarehouseId()).compareTo(typedOther.isSetPhysicalWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPhysicalWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.physicalWarehouseId, typedOther.physicalWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // PHYSICAL_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.physicalWarehouseId = iprot.readI64();
              setPhysicalWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PHYSICAL_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.physicalWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCurrentNonSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("physicalWarehouseId:");
      sb.append(this.physicalWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCurrentNonSerializedInventoryByScans_result implements org.apache.thrift.TBase<getCurrentNonSerializedInventoryByScans_result, getCurrentNonSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCurrentNonSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryAvailability> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryAvailability.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentNonSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getCurrentNonSerializedInventoryByScans_result() {
    }

    public getCurrentNonSerializedInventoryByScans_result(
      List<InventoryAvailability> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCurrentNonSerializedInventoryByScans_result(getCurrentNonSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryAvailability> __this__success = new ArrayList<InventoryAvailability>();
        for (InventoryAvailability other_element : other.success) {
          __this__success.add(new InventoryAvailability(other_element));
        }
        this.success = __this__success;
      }
    }

    public getCurrentNonSerializedInventoryByScans_result deepCopy() {
      return new getCurrentNonSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryAvailability> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryAvailability elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryAvailability>();
      }
      this.success.add(elem);
    }

    public List<InventoryAvailability> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryAvailability> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryAvailability>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCurrentNonSerializedInventoryByScans_result)
        return this.equals((getCurrentNonSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getCurrentNonSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCurrentNonSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCurrentNonSerializedInventoryByScans_result typedOther = (getCurrentNonSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list52 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAvailability>(_list52.size);
                for (int _i53 = 0; _i53 < _list52.size; ++_i53)
                {
                  InventoryAvailability _elem54; // required
                  _elem54 = new InventoryAvailability();
                  _elem54.read(iprot);
                  this.success.add(_elem54);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryAvailability _iter55 : this.success)
          {
            _iter55.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCurrentNonSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getHistoricSerializedInventoryByScans_args implements org.apache.thrift.TBase<getHistoricSerializedInventoryByScans_args, getHistoricSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getHistoricSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("date", org.apache.thrift.protocol.TType.I64, (short)1);

    private long date; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      DATE((short)1, "date");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DATE
            return DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __DATE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DATE, new org.apache.thrift.meta_data.FieldMetaData("date", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getHistoricSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getHistoricSerializedInventoryByScans_args() {
    }

    public getHistoricSerializedInventoryByScans_args(
      long date)
    {
      this();
      this.date = date;
      setDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getHistoricSerializedInventoryByScans_args(getHistoricSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.date = other.date;
    }

    public getHistoricSerializedInventoryByScans_args deepCopy() {
      return new getHistoricSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setDateIsSet(false);
      this.date = 0;
    }

    public long getDate() {
      return this.date;
    }

    public void setDate(long date) {
      this.date = date;
      setDateIsSet(true);
    }

    public void unsetDate() {
      __isset_bit_vector.clear(__DATE_ISSET_ID);
    }

    /** Returns true if field date is set (has been assigned a value) and false otherwise */
    public boolean isSetDate() {
      return __isset_bit_vector.get(__DATE_ISSET_ID);
    }

    public void setDateIsSet(boolean value) {
      __isset_bit_vector.set(__DATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DATE:
        if (value == null) {
          unsetDate();
        } else {
          setDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DATE:
        return Long.valueOf(getDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DATE:
        return isSetDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getHistoricSerializedInventoryByScans_args)
        return this.equals((getHistoricSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getHistoricSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_date = true;
      boolean that_present_date = true;
      if (this_present_date || that_present_date) {
        if (!(this_present_date && that_present_date))
          return false;
        if (this.date != that.date)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getHistoricSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getHistoricSerializedInventoryByScans_args typedOther = (getHistoricSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetDate()).compareTo(typedOther.isSetDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.date, typedOther.date);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.date = iprot.readI64();
              setDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(DATE_FIELD_DESC);
      oprot.writeI64(this.date);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getHistoricSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("date:");
      sb.append(this.date);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getHistoricSerializedInventoryByScans_result implements org.apache.thrift.TBase<getHistoricSerializedInventoryByScans_result, getHistoricSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getHistoricSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryAvailability> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryAvailability.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getHistoricSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getHistoricSerializedInventoryByScans_result() {
    }

    public getHistoricSerializedInventoryByScans_result(
      List<InventoryAvailability> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getHistoricSerializedInventoryByScans_result(getHistoricSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryAvailability> __this__success = new ArrayList<InventoryAvailability>();
        for (InventoryAvailability other_element : other.success) {
          __this__success.add(new InventoryAvailability(other_element));
        }
        this.success = __this__success;
      }
    }

    public getHistoricSerializedInventoryByScans_result deepCopy() {
      return new getHistoricSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryAvailability> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryAvailability elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryAvailability>();
      }
      this.success.add(elem);
    }

    public List<InventoryAvailability> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryAvailability> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryAvailability>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getHistoricSerializedInventoryByScans_result)
        return this.equals((getHistoricSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getHistoricSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getHistoricSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getHistoricSerializedInventoryByScans_result typedOther = (getHistoricSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list56 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAvailability>(_list56.size);
                for (int _i57 = 0; _i57 < _list56.size; ++_i57)
                {
                  InventoryAvailability _elem58; // required
                  _elem58 = new InventoryAvailability();
                  _elem58.read(iprot);
                  this.success.add(_elem58);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryAvailability _iter59 : this.success)
          {
            _iter59.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getHistoricSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getHistoricNonSerializedInventoryByScans_args implements org.apache.thrift.TBase<getHistoricNonSerializedInventoryByScans_args, getHistoricNonSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getHistoricNonSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("date", org.apache.thrift.protocol.TType.I64, (short)1);

    private long date; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      DATE((short)1, "date");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DATE
            return DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __DATE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DATE, new org.apache.thrift.meta_data.FieldMetaData("date", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getHistoricNonSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getHistoricNonSerializedInventoryByScans_args() {
    }

    public getHistoricNonSerializedInventoryByScans_args(
      long date)
    {
      this();
      this.date = date;
      setDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getHistoricNonSerializedInventoryByScans_args(getHistoricNonSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.date = other.date;
    }

    public getHistoricNonSerializedInventoryByScans_args deepCopy() {
      return new getHistoricNonSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setDateIsSet(false);
      this.date = 0;
    }

    public long getDate() {
      return this.date;
    }

    public void setDate(long date) {
      this.date = date;
      setDateIsSet(true);
    }

    public void unsetDate() {
      __isset_bit_vector.clear(__DATE_ISSET_ID);
    }

    /** Returns true if field date is set (has been assigned a value) and false otherwise */
    public boolean isSetDate() {
      return __isset_bit_vector.get(__DATE_ISSET_ID);
    }

    public void setDateIsSet(boolean value) {
      __isset_bit_vector.set(__DATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DATE:
        if (value == null) {
          unsetDate();
        } else {
          setDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DATE:
        return Long.valueOf(getDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DATE:
        return isSetDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getHistoricNonSerializedInventoryByScans_args)
        return this.equals((getHistoricNonSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getHistoricNonSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_date = true;
      boolean that_present_date = true;
      if (this_present_date || that_present_date) {
        if (!(this_present_date && that_present_date))
          return false;
        if (this.date != that.date)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getHistoricNonSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getHistoricNonSerializedInventoryByScans_args typedOther = (getHistoricNonSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetDate()).compareTo(typedOther.isSetDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.date, typedOther.date);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.date = iprot.readI64();
              setDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(DATE_FIELD_DESC);
      oprot.writeI64(this.date);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getHistoricNonSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("date:");
      sb.append(this.date);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getHistoricNonSerializedInventoryByScans_result implements org.apache.thrift.TBase<getHistoricNonSerializedInventoryByScans_result, getHistoricNonSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getHistoricNonSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryAvailability> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryAvailability.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getHistoricNonSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getHistoricNonSerializedInventoryByScans_result() {
    }

    public getHistoricNonSerializedInventoryByScans_result(
      List<InventoryAvailability> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getHistoricNonSerializedInventoryByScans_result(getHistoricNonSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryAvailability> __this__success = new ArrayList<InventoryAvailability>();
        for (InventoryAvailability other_element : other.success) {
          __this__success.add(new InventoryAvailability(other_element));
        }
        this.success = __this__success;
      }
    }

    public getHistoricNonSerializedInventoryByScans_result deepCopy() {
      return new getHistoricNonSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryAvailability> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryAvailability elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryAvailability>();
      }
      this.success.add(elem);
    }

    public List<InventoryAvailability> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryAvailability> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryAvailability>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getHistoricNonSerializedInventoryByScans_result)
        return this.equals((getHistoricNonSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getHistoricNonSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getHistoricNonSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getHistoricNonSerializedInventoryByScans_result typedOther = (getHistoricNonSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list60 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAvailability>(_list60.size);
                for (int _i61 = 0; _i61 < _list60.size; ++_i61)
                {
                  InventoryAvailability _elem62; // required
                  _elem62 = new InventoryAvailability();
                  _elem62.read(iprot);
                  this.success.add(_elem62);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryAvailability _iter63 : this.success)
          {
            _iter63.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getHistoricNonSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getOurHistoricSerializedInventoryByScans_args implements org.apache.thrift.TBase<getOurHistoricSerializedInventoryByScans_args, getOurHistoricSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOurHistoricSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("date", org.apache.thrift.protocol.TType.I64, (short)1);

    private long date; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      DATE((short)1, "date");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DATE
            return DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __DATE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DATE, new org.apache.thrift.meta_data.FieldMetaData("date", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOurHistoricSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getOurHistoricSerializedInventoryByScans_args() {
    }

    public getOurHistoricSerializedInventoryByScans_args(
      long date)
    {
      this();
      this.date = date;
      setDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOurHistoricSerializedInventoryByScans_args(getOurHistoricSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.date = other.date;
    }

    public getOurHistoricSerializedInventoryByScans_args deepCopy() {
      return new getOurHistoricSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setDateIsSet(false);
      this.date = 0;
    }

    public long getDate() {
      return this.date;
    }

    public void setDate(long date) {
      this.date = date;
      setDateIsSet(true);
    }

    public void unsetDate() {
      __isset_bit_vector.clear(__DATE_ISSET_ID);
    }

    /** Returns true if field date is set (has been assigned a value) and false otherwise */
    public boolean isSetDate() {
      return __isset_bit_vector.get(__DATE_ISSET_ID);
    }

    public void setDateIsSet(boolean value) {
      __isset_bit_vector.set(__DATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DATE:
        if (value == null) {
          unsetDate();
        } else {
          setDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DATE:
        return Long.valueOf(getDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DATE:
        return isSetDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getOurHistoricSerializedInventoryByScans_args)
        return this.equals((getOurHistoricSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getOurHistoricSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_date = true;
      boolean that_present_date = true;
      if (this_present_date || that_present_date) {
        if (!(this_present_date && that_present_date))
          return false;
        if (this.date != that.date)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getOurHistoricSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getOurHistoricSerializedInventoryByScans_args typedOther = (getOurHistoricSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetDate()).compareTo(typedOther.isSetDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.date, typedOther.date);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.date = iprot.readI64();
              setDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(DATE_FIELD_DESC);
      oprot.writeI64(this.date);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getOurHistoricSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("date:");
      sb.append(this.date);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getOurHistoricSerializedInventoryByScans_result implements org.apache.thrift.TBase<getOurHistoricSerializedInventoryByScans_result, getOurHistoricSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOurHistoricSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryAvailability> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryAvailability.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOurHistoricSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getOurHistoricSerializedInventoryByScans_result() {
    }

    public getOurHistoricSerializedInventoryByScans_result(
      List<InventoryAvailability> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOurHistoricSerializedInventoryByScans_result(getOurHistoricSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryAvailability> __this__success = new ArrayList<InventoryAvailability>();
        for (InventoryAvailability other_element : other.success) {
          __this__success.add(new InventoryAvailability(other_element));
        }
        this.success = __this__success;
      }
    }

    public getOurHistoricSerializedInventoryByScans_result deepCopy() {
      return new getOurHistoricSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryAvailability> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryAvailability elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryAvailability>();
      }
      this.success.add(elem);
    }

    public List<InventoryAvailability> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryAvailability> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryAvailability>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getOurHistoricSerializedInventoryByScans_result)
        return this.equals((getOurHistoricSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getOurHistoricSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getOurHistoricSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getOurHistoricSerializedInventoryByScans_result typedOther = (getOurHistoricSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list64 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAvailability>(_list64.size);
                for (int _i65 = 0; _i65 < _list64.size; ++_i65)
                {
                  InventoryAvailability _elem66; // required
                  _elem66 = new InventoryAvailability();
                  _elem66.read(iprot);
                  this.success.add(_elem66);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryAvailability _iter67 : this.success)
          {
            _iter67.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getOurHistoricSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getOurHistoricNonSerializedInventoryByScans_args implements org.apache.thrift.TBase<getOurHistoricNonSerializedInventoryByScans_args, getOurHistoricNonSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOurHistoricNonSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("date", org.apache.thrift.protocol.TType.I64, (short)1);

    private long date; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      DATE((short)1, "date");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DATE
            return DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __DATE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DATE, new org.apache.thrift.meta_data.FieldMetaData("date", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOurHistoricNonSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getOurHistoricNonSerializedInventoryByScans_args() {
    }

    public getOurHistoricNonSerializedInventoryByScans_args(
      long date)
    {
      this();
      this.date = date;
      setDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOurHistoricNonSerializedInventoryByScans_args(getOurHistoricNonSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.date = other.date;
    }

    public getOurHistoricNonSerializedInventoryByScans_args deepCopy() {
      return new getOurHistoricNonSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setDateIsSet(false);
      this.date = 0;
    }

    public long getDate() {
      return this.date;
    }

    public void setDate(long date) {
      this.date = date;
      setDateIsSet(true);
    }

    public void unsetDate() {
      __isset_bit_vector.clear(__DATE_ISSET_ID);
    }

    /** Returns true if field date is set (has been assigned a value) and false otherwise */
    public boolean isSetDate() {
      return __isset_bit_vector.get(__DATE_ISSET_ID);
    }

    public void setDateIsSet(boolean value) {
      __isset_bit_vector.set(__DATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DATE:
        if (value == null) {
          unsetDate();
        } else {
          setDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DATE:
        return Long.valueOf(getDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DATE:
        return isSetDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getOurHistoricNonSerializedInventoryByScans_args)
        return this.equals((getOurHistoricNonSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getOurHistoricNonSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_date = true;
      boolean that_present_date = true;
      if (this_present_date || that_present_date) {
        if (!(this_present_date && that_present_date))
          return false;
        if (this.date != that.date)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getOurHistoricNonSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getOurHistoricNonSerializedInventoryByScans_args typedOther = (getOurHistoricNonSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetDate()).compareTo(typedOther.isSetDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.date, typedOther.date);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.date = iprot.readI64();
              setDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(DATE_FIELD_DESC);
      oprot.writeI64(this.date);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getOurHistoricNonSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("date:");
      sb.append(this.date);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getOurHistoricNonSerializedInventoryByScans_result implements org.apache.thrift.TBase<getOurHistoricNonSerializedInventoryByScans_result, getOurHistoricNonSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOurHistoricNonSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryAvailability> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryAvailability.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOurHistoricNonSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getOurHistoricNonSerializedInventoryByScans_result() {
    }

    public getOurHistoricNonSerializedInventoryByScans_result(
      List<InventoryAvailability> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOurHistoricNonSerializedInventoryByScans_result(getOurHistoricNonSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryAvailability> __this__success = new ArrayList<InventoryAvailability>();
        for (InventoryAvailability other_element : other.success) {
          __this__success.add(new InventoryAvailability(other_element));
        }
        this.success = __this__success;
      }
    }

    public getOurHistoricNonSerializedInventoryByScans_result deepCopy() {
      return new getOurHistoricNonSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryAvailability> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryAvailability elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryAvailability>();
      }
      this.success.add(elem);
    }

    public List<InventoryAvailability> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryAvailability> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryAvailability>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getOurHistoricNonSerializedInventoryByScans_result)
        return this.equals((getOurHistoricNonSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getOurHistoricNonSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getOurHistoricNonSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getOurHistoricNonSerializedInventoryByScans_result typedOther = (getOurHistoricNonSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list68 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAvailability>(_list68.size);
                for (int _i69 = 0; _i69 < _list68.size; ++_i69)
                {
                  InventoryAvailability _elem70; // required
                  _elem70 = new InventoryAvailability();
                  _elem70.read(iprot);
                  this.success.add(_elem70);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryAvailability _iter71 : this.success)
          {
            _iter71.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getOurHistoricNonSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForOursExternalSale_args implements org.apache.thrift.TBase<scanForOursExternalSale_args, scanForOursExternalSale_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForOursExternalSale_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SERIAL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("serialNumber", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField ITEM_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("itemNumber", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField INVOICE_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("invoiceNumber", org.apache.thrift.protocol.TType.STRING, (short)4);
    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)5);
    private static final org.apache.thrift.protocol.TField UNIT_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("unitPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
    private static final org.apache.thrift.protocol.TField NLC_FIELD_DESC = new org.apache.thrift.protocol.TField("nlc", org.apache.thrift.protocol.TType.DOUBLE, (short)7);
    private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)8);

    private long itemId; // required
    private String serialNumber; // required
    private String itemNumber; // required
    private String invoiceNumber; // required
    private long warehouseId; // required
    private double unitPrice; // required
    private double nlc; // required
    private long orderId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_ID((short)1, "itemId"),
      SERIAL_NUMBER((short)2, "serialNumber"),
      ITEM_NUMBER((short)3, "itemNumber"),
      INVOICE_NUMBER((short)4, "invoiceNumber"),
      WAREHOUSE_ID((short)5, "warehouseId"),
      UNIT_PRICE((short)6, "unitPrice"),
      NLC((short)7, "nlc"),
      ORDER_ID((short)8, "orderId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_ID
            return ITEM_ID;
          case 2: // SERIAL_NUMBER
            return SERIAL_NUMBER;
          case 3: // ITEM_NUMBER
            return ITEM_NUMBER;
          case 4: // INVOICE_NUMBER
            return INVOICE_NUMBER;
          case 5: // WAREHOUSE_ID
            return WAREHOUSE_ID;
          case 6: // UNIT_PRICE
            return UNIT_PRICE;
          case 7: // NLC
            return NLC;
          case 8: // ORDER_ID
            return ORDER_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private static final int __WAREHOUSEID_ISSET_ID = 1;
    private static final int __UNITPRICE_ISSET_ID = 2;
    private static final int __NLC_ISSET_ID = 3;
    private static final int __ORDERID_ISSET_ID = 4;
    private BitSet __isset_bit_vector = new BitSet(5);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SERIAL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("serialNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.ITEM_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("itemNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.INVOICE_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("invoiceNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.UNIT_PRICE, new org.apache.thrift.meta_data.FieldMetaData("unitPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      tmpMap.put(_Fields.NLC, new org.apache.thrift.meta_data.FieldMetaData("nlc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForOursExternalSale_args.class, metaDataMap);
    }

    public scanForOursExternalSale_args() {
    }

    public scanForOursExternalSale_args(
      long itemId,
      String serialNumber,
      String itemNumber,
      String invoiceNumber,
      long warehouseId,
      double unitPrice,
      double nlc,
      long orderId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.serialNumber = serialNumber;
      this.itemNumber = itemNumber;
      this.invoiceNumber = invoiceNumber;
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
      this.unitPrice = unitPrice;
      setUnitPriceIsSet(true);
      this.nlc = nlc;
      setNlcIsSet(true);
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForOursExternalSale_args(scanForOursExternalSale_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      if (other.isSetSerialNumber()) {
        this.serialNumber = other.serialNumber;
      }
      if (other.isSetItemNumber()) {
        this.itemNumber = other.itemNumber;
      }
      if (other.isSetInvoiceNumber()) {
        this.invoiceNumber = other.invoiceNumber;
      }
      this.warehouseId = other.warehouseId;
      this.unitPrice = other.unitPrice;
      this.nlc = other.nlc;
      this.orderId = other.orderId;
    }

    public scanForOursExternalSale_args deepCopy() {
      return new scanForOursExternalSale_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      this.serialNumber = null;
      this.itemNumber = null;
      this.invoiceNumber = null;
      setWarehouseIdIsSet(false);
      this.warehouseId = 0;
      setUnitPriceIsSet(false);
      this.unitPrice = 0.0;
      setNlcIsSet(false);
      this.nlc = 0.0;
      setOrderIdIsSet(false);
      this.orderId = 0;
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public String getSerialNumber() {
      return this.serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
      this.serialNumber = serialNumber;
    }

    public void unsetSerialNumber() {
      this.serialNumber = null;
    }

    /** Returns true if field serialNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetSerialNumber() {
      return this.serialNumber != null;
    }

    public void setSerialNumberIsSet(boolean value) {
      if (!value) {
        this.serialNumber = null;
      }
    }

    public String getItemNumber() {
      return this.itemNumber;
    }

    public void setItemNumber(String itemNumber) {
      this.itemNumber = itemNumber;
    }

    public void unsetItemNumber() {
      this.itemNumber = null;
    }

    /** Returns true if field itemNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetItemNumber() {
      return this.itemNumber != null;
    }

    public void setItemNumberIsSet(boolean value) {
      if (!value) {
        this.itemNumber = null;
      }
    }

    public String getInvoiceNumber() {
      return this.invoiceNumber;
    }

    public void setInvoiceNumber(String invoiceNumber) {
      this.invoiceNumber = invoiceNumber;
    }

    public void unsetInvoiceNumber() {
      this.invoiceNumber = null;
    }

    /** Returns true if field invoiceNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetInvoiceNumber() {
      return this.invoiceNumber != null;
    }

    public void setInvoiceNumberIsSet(boolean value) {
      if (!value) {
        this.invoiceNumber = null;
      }
    }

    public long getWarehouseId() {
      return this.warehouseId;
    }

    public void setWarehouseId(long warehouseId) {
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
    }

    public void unsetWarehouseId() {
      __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field warehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouseId() {
      return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
    }

    public void setWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
    }

    public double getUnitPrice() {
      return this.unitPrice;
    }

    public void setUnitPrice(double unitPrice) {
      this.unitPrice = unitPrice;
      setUnitPriceIsSet(true);
    }

    public void unsetUnitPrice() {
      __isset_bit_vector.clear(__UNITPRICE_ISSET_ID);
    }

    /** Returns true if field unitPrice is set (has been assigned a value) and false otherwise */
    public boolean isSetUnitPrice() {
      return __isset_bit_vector.get(__UNITPRICE_ISSET_ID);
    }

    public void setUnitPriceIsSet(boolean value) {
      __isset_bit_vector.set(__UNITPRICE_ISSET_ID, value);
    }

    public double getNlc() {
      return this.nlc;
    }

    public void setNlc(double nlc) {
      this.nlc = nlc;
      setNlcIsSet(true);
    }

    public void unsetNlc() {
      __isset_bit_vector.clear(__NLC_ISSET_ID);
    }

    /** Returns true if field nlc is set (has been assigned a value) and false otherwise */
    public boolean isSetNlc() {
      return __isset_bit_vector.get(__NLC_ISSET_ID);
    }

    public void setNlcIsSet(boolean value) {
      __isset_bit_vector.set(__NLC_ISSET_ID, value);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public void setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case SERIAL_NUMBER:
        if (value == null) {
          unsetSerialNumber();
        } else {
          setSerialNumber((String)value);
        }
        break;

      case ITEM_NUMBER:
        if (value == null) {
          unsetItemNumber();
        } else {
          setItemNumber((String)value);
        }
        break;

      case INVOICE_NUMBER:
        if (value == null) {
          unsetInvoiceNumber();
        } else {
          setInvoiceNumber((String)value);
        }
        break;

      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouseId();
        } else {
          setWarehouseId((Long)value);
        }
        break;

      case UNIT_PRICE:
        if (value == null) {
          unsetUnitPrice();
        } else {
          setUnitPrice((Double)value);
        }
        break;

      case NLC:
        if (value == null) {
          unsetNlc();
        } else {
          setNlc((Double)value);
        }
        break;

      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case SERIAL_NUMBER:
        return getSerialNumber();

      case ITEM_NUMBER:
        return getItemNumber();

      case INVOICE_NUMBER:
        return getInvoiceNumber();

      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouseId());

      case UNIT_PRICE:
        return Double.valueOf(getUnitPrice());

      case NLC:
        return Double.valueOf(getNlc());

      case ORDER_ID:
        return Long.valueOf(getOrderId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_ID:
        return isSetItemId();
      case SERIAL_NUMBER:
        return isSetSerialNumber();
      case ITEM_NUMBER:
        return isSetItemNumber();
      case INVOICE_NUMBER:
        return isSetInvoiceNumber();
      case WAREHOUSE_ID:
        return isSetWarehouseId();
      case UNIT_PRICE:
        return isSetUnitPrice();
      case NLC:
        return isSetNlc();
      case ORDER_ID:
        return isSetOrderId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForOursExternalSale_args)
        return this.equals((scanForOursExternalSale_args)that);
      return false;
    }

    public boolean equals(scanForOursExternalSale_args that) {
      if (that == null)
        return false;

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      boolean this_present_serialNumber = true && this.isSetSerialNumber();
      boolean that_present_serialNumber = true && that.isSetSerialNumber();
      if (this_present_serialNumber || that_present_serialNumber) {
        if (!(this_present_serialNumber && that_present_serialNumber))
          return false;
        if (!this.serialNumber.equals(that.serialNumber))
          return false;
      }

      boolean this_present_itemNumber = true && this.isSetItemNumber();
      boolean that_present_itemNumber = true && that.isSetItemNumber();
      if (this_present_itemNumber || that_present_itemNumber) {
        if (!(this_present_itemNumber && that_present_itemNumber))
          return false;
        if (!this.itemNumber.equals(that.itemNumber))
          return false;
      }

      boolean this_present_invoiceNumber = true && this.isSetInvoiceNumber();
      boolean that_present_invoiceNumber = true && that.isSetInvoiceNumber();
      if (this_present_invoiceNumber || that_present_invoiceNumber) {
        if (!(this_present_invoiceNumber && that_present_invoiceNumber))
          return false;
        if (!this.invoiceNumber.equals(that.invoiceNumber))
          return false;
      }

      boolean this_present_warehouseId = true;
      boolean that_present_warehouseId = true;
      if (this_present_warehouseId || that_present_warehouseId) {
        if (!(this_present_warehouseId && that_present_warehouseId))
          return false;
        if (this.warehouseId != that.warehouseId)
          return false;
      }

      boolean this_present_unitPrice = true;
      boolean that_present_unitPrice = true;
      if (this_present_unitPrice || that_present_unitPrice) {
        if (!(this_present_unitPrice && that_present_unitPrice))
          return false;
        if (this.unitPrice != that.unitPrice)
          return false;
      }

      boolean this_present_nlc = true;
      boolean that_present_nlc = true;
      if (this_present_nlc || that_present_nlc) {
        if (!(this_present_nlc && that_present_nlc))
          return false;
        if (this.nlc != that.nlc)
          return false;
      }

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForOursExternalSale_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForOursExternalSale_args typedOther = (scanForOursExternalSale_args)other;

      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSerialNumber()).compareTo(typedOther.isSetSerialNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSerialNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialNumber, typedOther.serialNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetItemNumber()).compareTo(typedOther.isSetItemNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemNumber, typedOther.itemNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInvoiceNumber()).compareTo(typedOther.isSetInvoiceNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInvoiceNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invoiceNumber, typedOther.invoiceNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(typedOther.isSetWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetUnitPrice()).compareTo(typedOther.isSetUnitPrice());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUnitPrice()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unitPrice, typedOther.unitPrice);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetNlc()).compareTo(typedOther.isSetNlc());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetNlc()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nlc, typedOther.nlc);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // SERIAL_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.serialNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // ITEM_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.itemNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // INVOICE_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.invoiceNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.warehouseId = iprot.readI64();
              setWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 6: // UNIT_PRICE
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
              this.unitPrice = iprot.readDouble();
              setUnitPriceIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 7: // NLC
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
              this.nlc = iprot.readDouble();
              setNlcIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 8: // ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.orderId = iprot.readI64();
              setOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      if (this.serialNumber != null) {
        oprot.writeFieldBegin(SERIAL_NUMBER_FIELD_DESC);
        oprot.writeString(this.serialNumber);
        oprot.writeFieldEnd();
      }
      if (this.itemNumber != null) {
        oprot.writeFieldBegin(ITEM_NUMBER_FIELD_DESC);
        oprot.writeString(this.itemNumber);
        oprot.writeFieldEnd();
      }
      if (this.invoiceNumber != null) {
        oprot.writeFieldBegin(INVOICE_NUMBER_FIELD_DESC);
        oprot.writeString(this.invoiceNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(UNIT_PRICE_FIELD_DESC);
      oprot.writeDouble(this.unitPrice);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(NLC_FIELD_DESC);
      oprot.writeDouble(this.nlc);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForOursExternalSale_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("serialNumber:");
      if (this.serialNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.serialNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemNumber:");
      if (this.itemNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.itemNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("invoiceNumber:");
      if (this.invoiceNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.invoiceNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("warehouseId:");
      sb.append(this.warehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("unitPrice:");
      sb.append(this.unitPrice);
      first = false;
      if (!first) sb.append(", ");
      sb.append("nlc:");
      sb.append(this.nlc);
      first = false;
      if (!first) sb.append(", ");
      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForOursExternalSale_result implements org.apache.thrift.TBase<scanForOursExternalSale_result, scanForOursExternalSale_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForOursExternalSale_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryItem success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForOursExternalSale_result.class, metaDataMap);
    }

    public scanForOursExternalSale_result() {
    }

    public scanForOursExternalSale_result(
      InventoryItem success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForOursExternalSale_result(scanForOursExternalSale_result other) {
      if (other.isSetSuccess()) {
        this.success = new InventoryItem(other.success);
      }
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public scanForOursExternalSale_result deepCopy() {
      return new scanForOursExternalSale_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.ex = null;
    }

    public InventoryItem getSuccess() {
      return this.success;
    }

    public void setSuccess(InventoryItem success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((InventoryItem)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForOursExternalSale_result)
        return this.equals((scanForOursExternalSale_result)that);
      return false;
    }

    public boolean equals(scanForOursExternalSale_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForOursExternalSale_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForOursExternalSale_result typedOther = (scanForOursExternalSale_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new InventoryItem();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForOursExternalSale_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForOursExternalSaleReturn_args implements org.apache.thrift.TBase<scanForOursExternalSaleReturn_args, scanForOursExternalSaleReturn_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForOursExternalSaleReturn_args");

    private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField UNIT_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("unitPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)2);

    private long orderId; // required
    private double unitPrice; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ORDER_ID((short)1, "orderId"),
      UNIT_PRICE((short)2, "unitPrice");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ORDER_ID
            return ORDER_ID;
          case 2: // UNIT_PRICE
            return UNIT_PRICE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private static final int __UNITPRICE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.UNIT_PRICE, new org.apache.thrift.meta_data.FieldMetaData("unitPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForOursExternalSaleReturn_args.class, metaDataMap);
    }

    public scanForOursExternalSaleReturn_args() {
    }

    public scanForOursExternalSaleReturn_args(
      long orderId,
      double unitPrice)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.unitPrice = unitPrice;
      setUnitPriceIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForOursExternalSaleReturn_args(scanForOursExternalSaleReturn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
      this.unitPrice = other.unitPrice;
    }

    public scanForOursExternalSaleReturn_args deepCopy() {
      return new scanForOursExternalSaleReturn_args(this);
    }

    @Override
    public void clear() {
      setOrderIdIsSet(false);
      this.orderId = 0;
      setUnitPriceIsSet(false);
      this.unitPrice = 0.0;
    }

    public long getOrderId() {
      return this.orderId;
    }

    public void setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public double getUnitPrice() {
      return this.unitPrice;
    }

    public void setUnitPrice(double unitPrice) {
      this.unitPrice = unitPrice;
      setUnitPriceIsSet(true);
    }

    public void unsetUnitPrice() {
      __isset_bit_vector.clear(__UNITPRICE_ISSET_ID);
    }

    /** Returns true if field unitPrice is set (has been assigned a value) and false otherwise */
    public boolean isSetUnitPrice() {
      return __isset_bit_vector.get(__UNITPRICE_ISSET_ID);
    }

    public void setUnitPriceIsSet(boolean value) {
      __isset_bit_vector.set(__UNITPRICE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case UNIT_PRICE:
        if (value == null) {
          unsetUnitPrice();
        } else {
          setUnitPrice((Double)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return Long.valueOf(getOrderId());

      case UNIT_PRICE:
        return Double.valueOf(getUnitPrice());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      case UNIT_PRICE:
        return isSetUnitPrice();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForOursExternalSaleReturn_args)
        return this.equals((scanForOursExternalSaleReturn_args)that);
      return false;
    }

    public boolean equals(scanForOursExternalSaleReturn_args that) {
      if (that == null)
        return false;

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_unitPrice = true;
      boolean that_present_unitPrice = true;
      if (this_present_unitPrice || that_present_unitPrice) {
        if (!(this_present_unitPrice && that_present_unitPrice))
          return false;
        if (this.unitPrice != that.unitPrice)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForOursExternalSaleReturn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForOursExternalSaleReturn_args typedOther = (scanForOursExternalSaleReturn_args)other;

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetUnitPrice()).compareTo(typedOther.isSetUnitPrice());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUnitPrice()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unitPrice, typedOther.unitPrice);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.orderId = iprot.readI64();
              setOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // UNIT_PRICE
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
              this.unitPrice = iprot.readDouble();
              setUnitPriceIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(UNIT_PRICE_FIELD_DESC);
      oprot.writeDouble(this.unitPrice);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForOursExternalSaleReturn_args(");
      boolean first = true;

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("unitPrice:");
      sb.append(this.unitPrice);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForOursExternalSaleReturn_result implements org.apache.thrift.TBase<scanForOursExternalSaleReturn_result, scanForOursExternalSaleReturn_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForOursExternalSaleReturn_result");

    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForOursExternalSaleReturn_result.class, metaDataMap);
    }

    public scanForOursExternalSaleReturn_result() {
    }

    public scanForOursExternalSaleReturn_result(
      WarehouseServiceException ex)
    {
      this();
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForOursExternalSaleReturn_result(scanForOursExternalSaleReturn_result other) {
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public scanForOursExternalSaleReturn_result deepCopy() {
      return new scanForOursExternalSaleReturn_result(this);
    }

    @Override
    public void clear() {
      this.ex = null;
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForOursExternalSaleReturn_result)
        return this.equals((scanForOursExternalSaleReturn_result)that);
      return false;
    }

    public boolean equals(scanForOursExternalSaleReturn_result that) {
      if (that == null)
        return false;

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForOursExternalSaleReturn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForOursExternalSaleReturn_result typedOther = (scanForOursExternalSaleReturn_result)other;

      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForOursExternalSaleReturn_result(");
      boolean first = true;

      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getMovementNonSerializedInventoryByScans_args implements org.apache.thrift.TBase<getMovementNonSerializedInventoryByScans_args, getMovementNonSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMovementNonSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)2);

    private long startDate; // required
    private long endDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      START_DATE((short)1, "startDate"),
      END_DATE((short)2, "endDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // START_DATE
            return START_DATE;
          case 2: // END_DATE
            return END_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STARTDATE_ISSET_ID = 0;
    private static final int __ENDDATE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMovementNonSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getMovementNonSerializedInventoryByScans_args() {
    }

    public getMovementNonSerializedInventoryByScans_args(
      long startDate,
      long endDate)
    {
      this();
      this.startDate = startDate;
      setStartDateIsSet(true);
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getMovementNonSerializedInventoryByScans_args(getMovementNonSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.startDate = other.startDate;
      this.endDate = other.endDate;
    }

    public getMovementNonSerializedInventoryByScans_args deepCopy() {
      return new getMovementNonSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setStartDateIsSet(false);
      this.startDate = 0;
      setEndDateIsSet(false);
      this.endDate = 0;
    }

    public long getStartDate() {
      return this.startDate;
    }

    public void setStartDate(long startDate) {
      this.startDate = startDate;
      setStartDateIsSet(true);
    }

    public void unsetStartDate() {
      __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
    }

    /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
    public boolean isSetStartDate() {
      return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
    }

    public void setStartDateIsSet(boolean value) {
      __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
    }

    public long getEndDate() {
      return this.endDate;
    }

    public void setEndDate(long endDate) {
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    public void unsetEndDate() {
      __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
    }

    /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
    public boolean isSetEndDate() {
      return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
    }

    public void setEndDateIsSet(boolean value) {
      __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case START_DATE:
        if (value == null) {
          unsetStartDate();
        } else {
          setStartDate((Long)value);
        }
        break;

      case END_DATE:
        if (value == null) {
          unsetEndDate();
        } else {
          setEndDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case START_DATE:
        return Long.valueOf(getStartDate());

      case END_DATE:
        return Long.valueOf(getEndDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case START_DATE:
        return isSetStartDate();
      case END_DATE:
        return isSetEndDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getMovementNonSerializedInventoryByScans_args)
        return this.equals((getMovementNonSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getMovementNonSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_startDate = true;
      boolean that_present_startDate = true;
      if (this_present_startDate || that_present_startDate) {
        if (!(this_present_startDate && that_present_startDate))
          return false;
        if (this.startDate != that.startDate)
          return false;
      }

      boolean this_present_endDate = true;
      boolean that_present_endDate = true;
      if (this_present_endDate || that_present_endDate) {
        if (!(this_present_endDate && that_present_endDate))
          return false;
        if (this.endDate != that.endDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getMovementNonSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getMovementNonSerializedInventoryByScans_args typedOther = (getMovementNonSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // START_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.startDate = iprot.readI64();
              setStartDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // END_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.endDate = iprot.readI64();
              setEndDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
      oprot.writeI64(this.startDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
      oprot.writeI64(this.endDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getMovementNonSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("startDate:");
      sb.append(this.startDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endDate:");
      sb.append(this.endDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getMovementNonSerializedInventoryByScans_result implements org.apache.thrift.TBase<getMovementNonSerializedInventoryByScans_result, getMovementNonSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMovementNonSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryMovement> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryMovement.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMovementNonSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getMovementNonSerializedInventoryByScans_result() {
    }

    public getMovementNonSerializedInventoryByScans_result(
      List<InventoryMovement> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getMovementNonSerializedInventoryByScans_result(getMovementNonSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryMovement> __this__success = new ArrayList<InventoryMovement>();
        for (InventoryMovement other_element : other.success) {
          __this__success.add(new InventoryMovement(other_element));
        }
        this.success = __this__success;
      }
    }

    public getMovementNonSerializedInventoryByScans_result deepCopy() {
      return new getMovementNonSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryMovement> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryMovement elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryMovement>();
      }
      this.success.add(elem);
    }

    public List<InventoryMovement> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryMovement> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryMovement>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getMovementNonSerializedInventoryByScans_result)
        return this.equals((getMovementNonSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getMovementNonSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getMovementNonSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getMovementNonSerializedInventoryByScans_result typedOther = (getMovementNonSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list72 = iprot.readListBegin();
                this.success = new ArrayList<InventoryMovement>(_list72.size);
                for (int _i73 = 0; _i73 < _list72.size; ++_i73)
                {
                  InventoryMovement _elem74; // required
                  _elem74 = new InventoryMovement();
                  _elem74.read(iprot);
                  this.success.add(_elem74);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryMovement _iter75 : this.success)
          {
            _iter75.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getMovementNonSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getMovementSerializedInventoryByScans_args implements org.apache.thrift.TBase<getMovementSerializedInventoryByScans_args, getMovementSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMovementSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)2);

    private long startDate; // required
    private long endDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      START_DATE((short)1, "startDate"),
      END_DATE((short)2, "endDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // START_DATE
            return START_DATE;
          case 2: // END_DATE
            return END_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STARTDATE_ISSET_ID = 0;
    private static final int __ENDDATE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMovementSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getMovementSerializedInventoryByScans_args() {
    }

    public getMovementSerializedInventoryByScans_args(
      long startDate,
      long endDate)
    {
      this();
      this.startDate = startDate;
      setStartDateIsSet(true);
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getMovementSerializedInventoryByScans_args(getMovementSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.startDate = other.startDate;
      this.endDate = other.endDate;
    }

    public getMovementSerializedInventoryByScans_args deepCopy() {
      return new getMovementSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setStartDateIsSet(false);
      this.startDate = 0;
      setEndDateIsSet(false);
      this.endDate = 0;
    }

    public long getStartDate() {
      return this.startDate;
    }

    public void setStartDate(long startDate) {
      this.startDate = startDate;
      setStartDateIsSet(true);
    }

    public void unsetStartDate() {
      __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
    }

    /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
    public boolean isSetStartDate() {
      return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
    }

    public void setStartDateIsSet(boolean value) {
      __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
    }

    public long getEndDate() {
      return this.endDate;
    }

    public void setEndDate(long endDate) {
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    public void unsetEndDate() {
      __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
    }

    /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
    public boolean isSetEndDate() {
      return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
    }

    public void setEndDateIsSet(boolean value) {
      __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case START_DATE:
        if (value == null) {
          unsetStartDate();
        } else {
          setStartDate((Long)value);
        }
        break;

      case END_DATE:
        if (value == null) {
          unsetEndDate();
        } else {
          setEndDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case START_DATE:
        return Long.valueOf(getStartDate());

      case END_DATE:
        return Long.valueOf(getEndDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case START_DATE:
        return isSetStartDate();
      case END_DATE:
        return isSetEndDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getMovementSerializedInventoryByScans_args)
        return this.equals((getMovementSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getMovementSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_startDate = true;
      boolean that_present_startDate = true;
      if (this_present_startDate || that_present_startDate) {
        if (!(this_present_startDate && that_present_startDate))
          return false;
        if (this.startDate != that.startDate)
          return false;
      }

      boolean this_present_endDate = true;
      boolean that_present_endDate = true;
      if (this_present_endDate || that_present_endDate) {
        if (!(this_present_endDate && that_present_endDate))
          return false;
        if (this.endDate != that.endDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getMovementSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getMovementSerializedInventoryByScans_args typedOther = (getMovementSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // START_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.startDate = iprot.readI64();
              setStartDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // END_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.endDate = iprot.readI64();
              setEndDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
      oprot.writeI64(this.startDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
      oprot.writeI64(this.endDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getMovementSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("startDate:");
      sb.append(this.startDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endDate:");
      sb.append(this.endDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getMovementSerializedInventoryByScans_result implements org.apache.thrift.TBase<getMovementSerializedInventoryByScans_result, getMovementSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMovementSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryMovement> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryMovement.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMovementSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getMovementSerializedInventoryByScans_result() {
    }

    public getMovementSerializedInventoryByScans_result(
      List<InventoryMovement> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getMovementSerializedInventoryByScans_result(getMovementSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryMovement> __this__success = new ArrayList<InventoryMovement>();
        for (InventoryMovement other_element : other.success) {
          __this__success.add(new InventoryMovement(other_element));
        }
        this.success = __this__success;
      }
    }

    public getMovementSerializedInventoryByScans_result deepCopy() {
      return new getMovementSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryMovement> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryMovement elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryMovement>();
      }
      this.success.add(elem);
    }

    public List<InventoryMovement> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryMovement> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryMovement>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getMovementSerializedInventoryByScans_result)
        return this.equals((getMovementSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getMovementSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getMovementSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getMovementSerializedInventoryByScans_result typedOther = (getMovementSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list76 = iprot.readListBegin();
                this.success = new ArrayList<InventoryMovement>(_list76.size);
                for (int _i77 = 0; _i77 < _list76.size; ++_i77)
                {
                  InventoryMovement _elem78; // required
                  _elem78 = new InventoryMovement();
                  _elem78.read(iprot);
                  this.success.add(_elem78);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryMovement _iter79 : this.success)
          {
            _iter79.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getMovementSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCompleteMovementSerializedInventoryByScans_args implements org.apache.thrift.TBase<getCompleteMovementSerializedInventoryByScans_args, getCompleteMovementSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCompleteMovementSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)2);

    private long startDate; // required
    private long endDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      START_DATE((short)1, "startDate"),
      END_DATE((short)2, "endDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // START_DATE
            return START_DATE;
          case 2: // END_DATE
            return END_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STARTDATE_ISSET_ID = 0;
    private static final int __ENDDATE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCompleteMovementSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getCompleteMovementSerializedInventoryByScans_args() {
    }

    public getCompleteMovementSerializedInventoryByScans_args(
      long startDate,
      long endDate)
    {
      this();
      this.startDate = startDate;
      setStartDateIsSet(true);
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCompleteMovementSerializedInventoryByScans_args(getCompleteMovementSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.startDate = other.startDate;
      this.endDate = other.endDate;
    }

    public getCompleteMovementSerializedInventoryByScans_args deepCopy() {
      return new getCompleteMovementSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setStartDateIsSet(false);
      this.startDate = 0;
      setEndDateIsSet(false);
      this.endDate = 0;
    }

    public long getStartDate() {
      return this.startDate;
    }

    public void setStartDate(long startDate) {
      this.startDate = startDate;
      setStartDateIsSet(true);
    }

    public void unsetStartDate() {
      __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
    }

    /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
    public boolean isSetStartDate() {
      return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
    }

    public void setStartDateIsSet(boolean value) {
      __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
    }

    public long getEndDate() {
      return this.endDate;
    }

    public void setEndDate(long endDate) {
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    public void unsetEndDate() {
      __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
    }

    /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
    public boolean isSetEndDate() {
      return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
    }

    public void setEndDateIsSet(boolean value) {
      __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case START_DATE:
        if (value == null) {
          unsetStartDate();
        } else {
          setStartDate((Long)value);
        }
        break;

      case END_DATE:
        if (value == null) {
          unsetEndDate();
        } else {
          setEndDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case START_DATE:
        return Long.valueOf(getStartDate());

      case END_DATE:
        return Long.valueOf(getEndDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case START_DATE:
        return isSetStartDate();
      case END_DATE:
        return isSetEndDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCompleteMovementSerializedInventoryByScans_args)
        return this.equals((getCompleteMovementSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getCompleteMovementSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_startDate = true;
      boolean that_present_startDate = true;
      if (this_present_startDate || that_present_startDate) {
        if (!(this_present_startDate && that_present_startDate))
          return false;
        if (this.startDate != that.startDate)
          return false;
      }

      boolean this_present_endDate = true;
      boolean that_present_endDate = true;
      if (this_present_endDate || that_present_endDate) {
        if (!(this_present_endDate && that_present_endDate))
          return false;
        if (this.endDate != that.endDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCompleteMovementSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCompleteMovementSerializedInventoryByScans_args typedOther = (getCompleteMovementSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // START_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.startDate = iprot.readI64();
              setStartDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // END_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.endDate = iprot.readI64();
              setEndDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
      oprot.writeI64(this.startDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
      oprot.writeI64(this.endDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCompleteMovementSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("startDate:");
      sb.append(this.startDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endDate:");
      sb.append(this.endDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCompleteMovementSerializedInventoryByScans_result implements org.apache.thrift.TBase<getCompleteMovementSerializedInventoryByScans_result, getCompleteMovementSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCompleteMovementSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryMovement> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryMovement.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCompleteMovementSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getCompleteMovementSerializedInventoryByScans_result() {
    }

    public getCompleteMovementSerializedInventoryByScans_result(
      List<InventoryMovement> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCompleteMovementSerializedInventoryByScans_result(getCompleteMovementSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryMovement> __this__success = new ArrayList<InventoryMovement>();
        for (InventoryMovement other_element : other.success) {
          __this__success.add(new InventoryMovement(other_element));
        }
        this.success = __this__success;
      }
    }

    public getCompleteMovementSerializedInventoryByScans_result deepCopy() {
      return new getCompleteMovementSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryMovement> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryMovement elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryMovement>();
      }
      this.success.add(elem);
    }

    public List<InventoryMovement> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryMovement> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryMovement>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCompleteMovementSerializedInventoryByScans_result)
        return this.equals((getCompleteMovementSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getCompleteMovementSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCompleteMovementSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCompleteMovementSerializedInventoryByScans_result typedOther = (getCompleteMovementSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list80 = iprot.readListBegin();
                this.success = new ArrayList<InventoryMovement>(_list80.size);
                for (int _i81 = 0; _i81 < _list80.size; ++_i81)
                {
                  InventoryMovement _elem82; // required
                  _elem82 = new InventoryMovement();
                  _elem82.read(iprot);
                  this.success.add(_elem82);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryMovement _iter83 : this.success)
          {
            _iter83.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCompleteMovementSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCompleteMovementNonSerializedInventoryByScans_args implements org.apache.thrift.TBase<getCompleteMovementNonSerializedInventoryByScans_args, getCompleteMovementNonSerializedInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCompleteMovementNonSerializedInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)2);

    private long startDate; // required
    private long endDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      START_DATE((short)1, "startDate"),
      END_DATE((short)2, "endDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // START_DATE
            return START_DATE;
          case 2: // END_DATE
            return END_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STARTDATE_ISSET_ID = 0;
    private static final int __ENDDATE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCompleteMovementNonSerializedInventoryByScans_args.class, metaDataMap);
    }

    public getCompleteMovementNonSerializedInventoryByScans_args() {
    }

    public getCompleteMovementNonSerializedInventoryByScans_args(
      long startDate,
      long endDate)
    {
      this();
      this.startDate = startDate;
      setStartDateIsSet(true);
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCompleteMovementNonSerializedInventoryByScans_args(getCompleteMovementNonSerializedInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.startDate = other.startDate;
      this.endDate = other.endDate;
    }

    public getCompleteMovementNonSerializedInventoryByScans_args deepCopy() {
      return new getCompleteMovementNonSerializedInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setStartDateIsSet(false);
      this.startDate = 0;
      setEndDateIsSet(false);
      this.endDate = 0;
    }

    public long getStartDate() {
      return this.startDate;
    }

    public void setStartDate(long startDate) {
      this.startDate = startDate;
      setStartDateIsSet(true);
    }

    public void unsetStartDate() {
      __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
    }

    /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
    public boolean isSetStartDate() {
      return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
    }

    public void setStartDateIsSet(boolean value) {
      __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
    }

    public long getEndDate() {
      return this.endDate;
    }

    public void setEndDate(long endDate) {
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    public void unsetEndDate() {
      __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
    }

    /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
    public boolean isSetEndDate() {
      return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
    }

    public void setEndDateIsSet(boolean value) {
      __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case START_DATE:
        if (value == null) {
          unsetStartDate();
        } else {
          setStartDate((Long)value);
        }
        break;

      case END_DATE:
        if (value == null) {
          unsetEndDate();
        } else {
          setEndDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case START_DATE:
        return Long.valueOf(getStartDate());

      case END_DATE:
        return Long.valueOf(getEndDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case START_DATE:
        return isSetStartDate();
      case END_DATE:
        return isSetEndDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCompleteMovementNonSerializedInventoryByScans_args)
        return this.equals((getCompleteMovementNonSerializedInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getCompleteMovementNonSerializedInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_startDate = true;
      boolean that_present_startDate = true;
      if (this_present_startDate || that_present_startDate) {
        if (!(this_present_startDate && that_present_startDate))
          return false;
        if (this.startDate != that.startDate)
          return false;
      }

      boolean this_present_endDate = true;
      boolean that_present_endDate = true;
      if (this_present_endDate || that_present_endDate) {
        if (!(this_present_endDate && that_present_endDate))
          return false;
        if (this.endDate != that.endDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCompleteMovementNonSerializedInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCompleteMovementNonSerializedInventoryByScans_args typedOther = (getCompleteMovementNonSerializedInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // START_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.startDate = iprot.readI64();
              setStartDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // END_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.endDate = iprot.readI64();
              setEndDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
      oprot.writeI64(this.startDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
      oprot.writeI64(this.endDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCompleteMovementNonSerializedInventoryByScans_args(");
      boolean first = true;

      sb.append("startDate:");
      sb.append(this.startDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endDate:");
      sb.append(this.endDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCompleteMovementNonSerializedInventoryByScans_result implements org.apache.thrift.TBase<getCompleteMovementNonSerializedInventoryByScans_result, getCompleteMovementNonSerializedInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCompleteMovementNonSerializedInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryMovement> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryMovement.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCompleteMovementNonSerializedInventoryByScans_result.class, metaDataMap);
    }

    public getCompleteMovementNonSerializedInventoryByScans_result() {
    }

    public getCompleteMovementNonSerializedInventoryByScans_result(
      List<InventoryMovement> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCompleteMovementNonSerializedInventoryByScans_result(getCompleteMovementNonSerializedInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryMovement> __this__success = new ArrayList<InventoryMovement>();
        for (InventoryMovement other_element : other.success) {
          __this__success.add(new InventoryMovement(other_element));
        }
        this.success = __this__success;
      }
    }

    public getCompleteMovementNonSerializedInventoryByScans_result deepCopy() {
      return new getCompleteMovementNonSerializedInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryMovement> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryMovement elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryMovement>();
      }
      this.success.add(elem);
    }

    public List<InventoryMovement> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryMovement> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryMovement>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCompleteMovementNonSerializedInventoryByScans_result)
        return this.equals((getCompleteMovementNonSerializedInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getCompleteMovementNonSerializedInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCompleteMovementNonSerializedInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCompleteMovementNonSerializedInventoryByScans_result typedOther = (getCompleteMovementNonSerializedInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list84 = iprot.readListBegin();
                this.success = new ArrayList<InventoryMovement>(_list84.size);
                for (int _i85 = 0; _i85 < _list84.size; ++_i85)
                {
                  InventoryMovement _elem86; // required
                  _elem86 = new InventoryMovement();
                  _elem86.read(iprot);
                  this.success.add(_elem86);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryMovement _iter87 : this.success)
          {
            _iter87.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCompleteMovementNonSerializedInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanfreebie_args implements org.apache.thrift.TBase<scanfreebie_args, scanfreebie_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanfreebie_args");

    private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField FREEBIE_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("freebieItemId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField FREEBIE_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("freebieWarehouseId", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField SCAN_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scanType", org.apache.thrift.protocol.TType.I32, (short)4);

    private long orderId; // required
    private long freebieItemId; // required
    private long freebieWarehouseId; // required
    private ScanType scanType; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ORDER_ID((short)1, "orderId"),
      FREEBIE_ITEM_ID((short)2, "freebieItemId"),
      FREEBIE_WAREHOUSE_ID((short)3, "freebieWarehouseId"),
      /**
       * 
       * @see ScanType
       */
      SCAN_TYPE((short)4, "scanType");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ORDER_ID
            return ORDER_ID;
          case 2: // FREEBIE_ITEM_ID
            return FREEBIE_ITEM_ID;
          case 3: // FREEBIE_WAREHOUSE_ID
            return FREEBIE_WAREHOUSE_ID;
          case 4: // SCAN_TYPE
            return SCAN_TYPE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private static final int __FREEBIEITEMID_ISSET_ID = 1;
    private static final int __FREEBIEWAREHOUSEID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FREEBIE_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("freebieItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FREEBIE_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("freebieWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SCAN_TYPE, new org.apache.thrift.meta_data.FieldMetaData("scanType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanfreebie_args.class, metaDataMap);
    }

    public scanfreebie_args() {
    }

    public scanfreebie_args(
      long orderId,
      long freebieItemId,
      long freebieWarehouseId,
      ScanType scanType)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.freebieItemId = freebieItemId;
      setFreebieItemIdIsSet(true);
      this.freebieWarehouseId = freebieWarehouseId;
      setFreebieWarehouseIdIsSet(true);
      this.scanType = scanType;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanfreebie_args(scanfreebie_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
      this.freebieItemId = other.freebieItemId;
      this.freebieWarehouseId = other.freebieWarehouseId;
      if (other.isSetScanType()) {
        this.scanType = other.scanType;
      }
    }

    public scanfreebie_args deepCopy() {
      return new scanfreebie_args(this);
    }

    @Override
    public void clear() {
      setOrderIdIsSet(false);
      this.orderId = 0;
      setFreebieItemIdIsSet(false);
      this.freebieItemId = 0;
      setFreebieWarehouseIdIsSet(false);
      this.freebieWarehouseId = 0;
      this.scanType = null;
    }

    public long getOrderId() {
      return this.orderId;
    }

    public void setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public long getFreebieItemId() {
      return this.freebieItemId;
    }

    public void setFreebieItemId(long freebieItemId) {
      this.freebieItemId = freebieItemId;
      setFreebieItemIdIsSet(true);
    }

    public void unsetFreebieItemId() {
      __isset_bit_vector.clear(__FREEBIEITEMID_ISSET_ID);
    }

    /** Returns true if field freebieItemId is set (has been assigned a value) and false otherwise */
    public boolean isSetFreebieItemId() {
      return __isset_bit_vector.get(__FREEBIEITEMID_ISSET_ID);
    }

    public void setFreebieItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__FREEBIEITEMID_ISSET_ID, value);
    }

    public long getFreebieWarehouseId() {
      return this.freebieWarehouseId;
    }

    public void setFreebieWarehouseId(long freebieWarehouseId) {
      this.freebieWarehouseId = freebieWarehouseId;
      setFreebieWarehouseIdIsSet(true);
    }

    public void unsetFreebieWarehouseId() {
      __isset_bit_vector.clear(__FREEBIEWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field freebieWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetFreebieWarehouseId() {
      return __isset_bit_vector.get(__FREEBIEWAREHOUSEID_ISSET_ID);
    }

    public void setFreebieWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__FREEBIEWAREHOUSEID_ISSET_ID, value);
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getScanType() {
      return this.scanType;
    }

    /**
     * 
     * @see ScanType
     */
    public void setScanType(ScanType scanType) {
      this.scanType = scanType;
    }

    public void unsetScanType() {
      this.scanType = null;
    }

    /** Returns true if field scanType is set (has been assigned a value) and false otherwise */
    public boolean isSetScanType() {
      return this.scanType != null;
    }

    public void setScanTypeIsSet(boolean value) {
      if (!value) {
        this.scanType = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case FREEBIE_ITEM_ID:
        if (value == null) {
          unsetFreebieItemId();
        } else {
          setFreebieItemId((Long)value);
        }
        break;

      case FREEBIE_WAREHOUSE_ID:
        if (value == null) {
          unsetFreebieWarehouseId();
        } else {
          setFreebieWarehouseId((Long)value);
        }
        break;

      case SCAN_TYPE:
        if (value == null) {
          unsetScanType();
        } else {
          setScanType((ScanType)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return Long.valueOf(getOrderId());

      case FREEBIE_ITEM_ID:
        return Long.valueOf(getFreebieItemId());

      case FREEBIE_WAREHOUSE_ID:
        return Long.valueOf(getFreebieWarehouseId());

      case SCAN_TYPE:
        return getScanType();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      case FREEBIE_ITEM_ID:
        return isSetFreebieItemId();
      case FREEBIE_WAREHOUSE_ID:
        return isSetFreebieWarehouseId();
      case SCAN_TYPE:
        return isSetScanType();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanfreebie_args)
        return this.equals((scanfreebie_args)that);
      return false;
    }

    public boolean equals(scanfreebie_args that) {
      if (that == null)
        return false;

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_freebieItemId = true;
      boolean that_present_freebieItemId = true;
      if (this_present_freebieItemId || that_present_freebieItemId) {
        if (!(this_present_freebieItemId && that_present_freebieItemId))
          return false;
        if (this.freebieItemId != that.freebieItemId)
          return false;
      }

      boolean this_present_freebieWarehouseId = true;
      boolean that_present_freebieWarehouseId = true;
      if (this_present_freebieWarehouseId || that_present_freebieWarehouseId) {
        if (!(this_present_freebieWarehouseId && that_present_freebieWarehouseId))
          return false;
        if (this.freebieWarehouseId != that.freebieWarehouseId)
          return false;
      }

      boolean this_present_scanType = true && this.isSetScanType();
      boolean that_present_scanType = true && that.isSetScanType();
      if (this_present_scanType || that_present_scanType) {
        if (!(this_present_scanType && that_present_scanType))
          return false;
        if (!this.scanType.equals(that.scanType))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanfreebie_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanfreebie_args typedOther = (scanfreebie_args)other;

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFreebieItemId()).compareTo(typedOther.isSetFreebieItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFreebieItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freebieItemId, typedOther.freebieItemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFreebieWarehouseId()).compareTo(typedOther.isSetFreebieWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFreebieWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freebieWarehouseId, typedOther.freebieWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetScanType()).compareTo(typedOther.isSetScanType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetScanType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scanType, typedOther.scanType);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.orderId = iprot.readI64();
              setOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // FREEBIE_ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.freebieItemId = iprot.readI64();
              setFreebieItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // FREEBIE_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.freebieWarehouseId = iprot.readI64();
              setFreebieWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // SCAN_TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.scanType = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FREEBIE_ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.freebieItemId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FREEBIE_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.freebieWarehouseId);
      oprot.writeFieldEnd();
      if (this.scanType != null) {
        oprot.writeFieldBegin(SCAN_TYPE_FIELD_DESC);
        oprot.writeI32(this.scanType.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanfreebie_args(");
      boolean first = true;

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("freebieItemId:");
      sb.append(this.freebieItemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("freebieWarehouseId:");
      sb.append(this.freebieWarehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("scanType:");
      if (this.scanType == null) {
        sb.append("null");
      } else {
        sb.append(this.scanType);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanfreebie_result implements org.apache.thrift.TBase<scanfreebie_result, scanfreebie_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanfreebie_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryItem success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanfreebie_result.class, metaDataMap);
    }

    public scanfreebie_result() {
    }

    public scanfreebie_result(
      InventoryItem success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanfreebie_result(scanfreebie_result other) {
      if (other.isSetSuccess()) {
        this.success = new InventoryItem(other.success);
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public scanfreebie_result deepCopy() {
      return new scanfreebie_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public InventoryItem getSuccess() {
      return this.success;
    }

    public void setSuccess(InventoryItem success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((InventoryItem)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanfreebie_result)
        return this.equals((scanfreebie_result)that);
      return false;
    }

    public boolean equals(scanfreebie_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanfreebie_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanfreebie_result typedOther = (scanfreebie_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new InventoryItem();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanfreebie_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class reshipfreebie_args implements org.apache.thrift.TBase<reshipfreebie_args, reshipfreebie_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("reshipfreebie_args");

    private static final org.apache.thrift.protocol.TField OLD_ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("oldOrderId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField NEW_ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("newOrderId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField FREEBIE_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("freebieItemId", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField SCAN_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scanType", org.apache.thrift.protocol.TType.I32, (short)4);

    private long oldOrderId; // required
    private long newOrderId; // required
    private long freebieItemId; // required
    private ScanType scanType; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      OLD_ORDER_ID((short)1, "oldOrderId"),
      NEW_ORDER_ID((short)2, "newOrderId"),
      FREEBIE_ITEM_ID((short)3, "freebieItemId"),
      /**
       * 
       * @see ScanType
       */
      SCAN_TYPE((short)4, "scanType");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // OLD_ORDER_ID
            return OLD_ORDER_ID;
          case 2: // NEW_ORDER_ID
            return NEW_ORDER_ID;
          case 3: // FREEBIE_ITEM_ID
            return FREEBIE_ITEM_ID;
          case 4: // SCAN_TYPE
            return SCAN_TYPE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __OLDORDERID_ISSET_ID = 0;
    private static final int __NEWORDERID_ISSET_ID = 1;
    private static final int __FREEBIEITEMID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.OLD_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("oldOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.NEW_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("newOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FREEBIE_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("freebieItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SCAN_TYPE, new org.apache.thrift.meta_data.FieldMetaData("scanType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(reshipfreebie_args.class, metaDataMap);
    }

    public reshipfreebie_args() {
    }

    public reshipfreebie_args(
      long oldOrderId,
      long newOrderId,
      long freebieItemId,
      ScanType scanType)
    {
      this();
      this.oldOrderId = oldOrderId;
      setOldOrderIdIsSet(true);
      this.newOrderId = newOrderId;
      setNewOrderIdIsSet(true);
      this.freebieItemId = freebieItemId;
      setFreebieItemIdIsSet(true);
      this.scanType = scanType;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public reshipfreebie_args(reshipfreebie_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.oldOrderId = other.oldOrderId;
      this.newOrderId = other.newOrderId;
      this.freebieItemId = other.freebieItemId;
      if (other.isSetScanType()) {
        this.scanType = other.scanType;
      }
    }

    public reshipfreebie_args deepCopy() {
      return new reshipfreebie_args(this);
    }

    @Override
    public void clear() {
      setOldOrderIdIsSet(false);
      this.oldOrderId = 0;
      setNewOrderIdIsSet(false);
      this.newOrderId = 0;
      setFreebieItemIdIsSet(false);
      this.freebieItemId = 0;
      this.scanType = null;
    }

    public long getOldOrderId() {
      return this.oldOrderId;
    }

    public void setOldOrderId(long oldOrderId) {
      this.oldOrderId = oldOrderId;
      setOldOrderIdIsSet(true);
    }

    public void unsetOldOrderId() {
      __isset_bit_vector.clear(__OLDORDERID_ISSET_ID);
    }

    /** Returns true if field oldOrderId is set (has been assigned a value) and false otherwise */
    public boolean isSetOldOrderId() {
      return __isset_bit_vector.get(__OLDORDERID_ISSET_ID);
    }

    public void setOldOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__OLDORDERID_ISSET_ID, value);
    }

    public long getNewOrderId() {
      return this.newOrderId;
    }

    public void setNewOrderId(long newOrderId) {
      this.newOrderId = newOrderId;
      setNewOrderIdIsSet(true);
    }

    public void unsetNewOrderId() {
      __isset_bit_vector.clear(__NEWORDERID_ISSET_ID);
    }

    /** Returns true if field newOrderId is set (has been assigned a value) and false otherwise */
    public boolean isSetNewOrderId() {
      return __isset_bit_vector.get(__NEWORDERID_ISSET_ID);
    }

    public void setNewOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__NEWORDERID_ISSET_ID, value);
    }

    public long getFreebieItemId() {
      return this.freebieItemId;
    }

    public void setFreebieItemId(long freebieItemId) {
      this.freebieItemId = freebieItemId;
      setFreebieItemIdIsSet(true);
    }

    public void unsetFreebieItemId() {
      __isset_bit_vector.clear(__FREEBIEITEMID_ISSET_ID);
    }

    /** Returns true if field freebieItemId is set (has been assigned a value) and false otherwise */
    public boolean isSetFreebieItemId() {
      return __isset_bit_vector.get(__FREEBIEITEMID_ISSET_ID);
    }

    public void setFreebieItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__FREEBIEITEMID_ISSET_ID, value);
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getScanType() {
      return this.scanType;
    }

    /**
     * 
     * @see ScanType
     */
    public void setScanType(ScanType scanType) {
      this.scanType = scanType;
    }

    public void unsetScanType() {
      this.scanType = null;
    }

    /** Returns true if field scanType is set (has been assigned a value) and false otherwise */
    public boolean isSetScanType() {
      return this.scanType != null;
    }

    public void setScanTypeIsSet(boolean value) {
      if (!value) {
        this.scanType = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case OLD_ORDER_ID:
        if (value == null) {
          unsetOldOrderId();
        } else {
          setOldOrderId((Long)value);
        }
        break;

      case NEW_ORDER_ID:
        if (value == null) {
          unsetNewOrderId();
        } else {
          setNewOrderId((Long)value);
        }
        break;

      case FREEBIE_ITEM_ID:
        if (value == null) {
          unsetFreebieItemId();
        } else {
          setFreebieItemId((Long)value);
        }
        break;

      case SCAN_TYPE:
        if (value == null) {
          unsetScanType();
        } else {
          setScanType((ScanType)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case OLD_ORDER_ID:
        return Long.valueOf(getOldOrderId());

      case NEW_ORDER_ID:
        return Long.valueOf(getNewOrderId());

      case FREEBIE_ITEM_ID:
        return Long.valueOf(getFreebieItemId());

      case SCAN_TYPE:
        return getScanType();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case OLD_ORDER_ID:
        return isSetOldOrderId();
      case NEW_ORDER_ID:
        return isSetNewOrderId();
      case FREEBIE_ITEM_ID:
        return isSetFreebieItemId();
      case SCAN_TYPE:
        return isSetScanType();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof reshipfreebie_args)
        return this.equals((reshipfreebie_args)that);
      return false;
    }

    public boolean equals(reshipfreebie_args that) {
      if (that == null)
        return false;

      boolean this_present_oldOrderId = true;
      boolean that_present_oldOrderId = true;
      if (this_present_oldOrderId || that_present_oldOrderId) {
        if (!(this_present_oldOrderId && that_present_oldOrderId))
          return false;
        if (this.oldOrderId != that.oldOrderId)
          return false;
      }

      boolean this_present_newOrderId = true;
      boolean that_present_newOrderId = true;
      if (this_present_newOrderId || that_present_newOrderId) {
        if (!(this_present_newOrderId && that_present_newOrderId))
          return false;
        if (this.newOrderId != that.newOrderId)
          return false;
      }

      boolean this_present_freebieItemId = true;
      boolean that_present_freebieItemId = true;
      if (this_present_freebieItemId || that_present_freebieItemId) {
        if (!(this_present_freebieItemId && that_present_freebieItemId))
          return false;
        if (this.freebieItemId != that.freebieItemId)
          return false;
      }

      boolean this_present_scanType = true && this.isSetScanType();
      boolean that_present_scanType = true && that.isSetScanType();
      if (this_present_scanType || that_present_scanType) {
        if (!(this_present_scanType && that_present_scanType))
          return false;
        if (!this.scanType.equals(that.scanType))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(reshipfreebie_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      reshipfreebie_args typedOther = (reshipfreebie_args)other;

      lastComparison = Boolean.valueOf(isSetOldOrderId()).compareTo(typedOther.isSetOldOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOldOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.oldOrderId, typedOther.oldOrderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetNewOrderId()).compareTo(typedOther.isSetNewOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetNewOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newOrderId, typedOther.newOrderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFreebieItemId()).compareTo(typedOther.isSetFreebieItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFreebieItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freebieItemId, typedOther.freebieItemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetScanType()).compareTo(typedOther.isSetScanType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetScanType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scanType, typedOther.scanType);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // OLD_ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.oldOrderId = iprot.readI64();
              setOldOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // NEW_ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.newOrderId = iprot.readI64();
              setNewOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // FREEBIE_ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.freebieItemId = iprot.readI64();
              setFreebieItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // SCAN_TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.scanType = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(OLD_ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.oldOrderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(NEW_ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.newOrderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FREEBIE_ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.freebieItemId);
      oprot.writeFieldEnd();
      if (this.scanType != null) {
        oprot.writeFieldBegin(SCAN_TYPE_FIELD_DESC);
        oprot.writeI32(this.scanType.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("reshipfreebie_args(");
      boolean first = true;

      sb.append("oldOrderId:");
      sb.append(this.oldOrderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("newOrderId:");
      sb.append(this.newOrderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("freebieItemId:");
      sb.append(this.freebieItemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("scanType:");
      if (this.scanType == null) {
        sb.append("null");
      } else {
        sb.append(this.scanType);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class reshipfreebie_result implements org.apache.thrift.TBase<reshipfreebie_result, reshipfreebie_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("reshipfreebie_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(reshipfreebie_result.class, metaDataMap);
    }

    public reshipfreebie_result() {
    }

    public reshipfreebie_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public reshipfreebie_result(reshipfreebie_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public reshipfreebie_result deepCopy() {
      return new reshipfreebie_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof reshipfreebie_result)
        return this.equals((reshipfreebie_result)that);
      return false;
    }

    public boolean equals(reshipfreebie_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(reshipfreebie_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      reshipfreebie_result typedOther = (reshipfreebie_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("reshipfreebie_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class isItemTransferAllowed_args implements org.apache.thrift.TBase<isItemTransferAllowed_args, isItemTransferAllowed_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isItemTransferAllowed_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TRANSFER_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transferWarehouseId", org.apache.thrift.protocol.TType.I64, (short)2);

    private long warehouseId; // required
    private long transferWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WAREHOUSE_ID((short)1, "warehouseId"),
      TRANSFER_WAREHOUSE_ID((short)2, "transferWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WAREHOUSE_ID
            return WAREHOUSE_ID;
          case 2: // TRANSFER_WAREHOUSE_ID
            return TRANSFER_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __WAREHOUSEID_ISSET_ID = 0;
    private static final int __TRANSFERWAREHOUSEID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TRANSFER_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("transferWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isItemTransferAllowed_args.class, metaDataMap);
    }

    public isItemTransferAllowed_args() {
    }

    public isItemTransferAllowed_args(
      long warehouseId,
      long transferWarehouseId)
    {
      this();
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
      this.transferWarehouseId = transferWarehouseId;
      setTransferWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public isItemTransferAllowed_args(isItemTransferAllowed_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouseId = other.warehouseId;
      this.transferWarehouseId = other.transferWarehouseId;
    }

    public isItemTransferAllowed_args deepCopy() {
      return new isItemTransferAllowed_args(this);
    }

    @Override
    public void clear() {
      setWarehouseIdIsSet(false);
      this.warehouseId = 0;
      setTransferWarehouseIdIsSet(false);
      this.transferWarehouseId = 0;
    }

    public long getWarehouseId() {
      return this.warehouseId;
    }

    public void setWarehouseId(long warehouseId) {
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
    }

    public void unsetWarehouseId() {
      __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field warehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouseId() {
      return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
    }

    public void setWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
    }

    public long getTransferWarehouseId() {
      return this.transferWarehouseId;
    }

    public void setTransferWarehouseId(long transferWarehouseId) {
      this.transferWarehouseId = transferWarehouseId;
      setTransferWarehouseIdIsSet(true);
    }

    public void unsetTransferWarehouseId() {
      __isset_bit_vector.clear(__TRANSFERWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field transferWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetTransferWarehouseId() {
      return __isset_bit_vector.get(__TRANSFERWAREHOUSEID_ISSET_ID);
    }

    public void setTransferWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSFERWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouseId();
        } else {
          setWarehouseId((Long)value);
        }
        break;

      case TRANSFER_WAREHOUSE_ID:
        if (value == null) {
          unsetTransferWarehouseId();
        } else {
          setTransferWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouseId());

      case TRANSFER_WAREHOUSE_ID:
        return Long.valueOf(getTransferWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WAREHOUSE_ID:
        return isSetWarehouseId();
      case TRANSFER_WAREHOUSE_ID:
        return isSetTransferWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof isItemTransferAllowed_args)
        return this.equals((isItemTransferAllowed_args)that);
      return false;
    }

    public boolean equals(isItemTransferAllowed_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouseId = true;
      boolean that_present_warehouseId = true;
      if (this_present_warehouseId || that_present_warehouseId) {
        if (!(this_present_warehouseId && that_present_warehouseId))
          return false;
        if (this.warehouseId != that.warehouseId)
          return false;
      }

      boolean this_present_transferWarehouseId = true;
      boolean that_present_transferWarehouseId = true;
      if (this_present_transferWarehouseId || that_present_transferWarehouseId) {
        if (!(this_present_transferWarehouseId && that_present_transferWarehouseId))
          return false;
        if (this.transferWarehouseId != that.transferWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(isItemTransferAllowed_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      isItemTransferAllowed_args typedOther = (isItemTransferAllowed_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(typedOther.isSetWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTransferWarehouseId()).compareTo(typedOther.isSetTransferWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTransferWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferWarehouseId, typedOther.transferWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.warehouseId = iprot.readI64();
              setWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TRANSFER_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.transferWarehouseId = iprot.readI64();
              setTransferWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TRANSFER_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.transferWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("isItemTransferAllowed_args(");
      boolean first = true;

      sb.append("warehouseId:");
      sb.append(this.warehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("transferWarehouseId:");
      sb.append(this.transferWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class isItemTransferAllowed_result implements org.apache.thrift.TBase<isItemTransferAllowed_result, isItemTransferAllowed_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isItemTransferAllowed_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);

    private boolean success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isItemTransferAllowed_result.class, metaDataMap);
    }

    public isItemTransferAllowed_result() {
    }

    public isItemTransferAllowed_result(
      boolean success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public isItemTransferAllowed_result(isItemTransferAllowed_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
    }

    public isItemTransferAllowed_result deepCopy() {
      return new isItemTransferAllowed_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
    }

    public boolean isSuccess() {
      return this.success;
    }

    public void setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Boolean.valueOf(isSuccess());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof isItemTransferAllowed_result)
        return this.equals((isItemTransferAllowed_result)that);
      return false;
    }

    public boolean equals(isItemTransferAllowed_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(isItemTransferAllowed_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      isItemTransferAllowed_result typedOther = (isItemTransferAllowed_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.success = iprot.readBool();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("isItemTransferAllowed_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class createTransferLot_args implements org.apache.thrift.TBase<createTransferLot_args, createTransferLot_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createTransferLot_args");

    private static final org.apache.thrift.protocol.TField ORIGIN_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("originWarehouseId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField DEST_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("destWarehouseId", org.apache.thrift.protocol.TType.I64, (short)2);

    private long originWarehouseId; // required
    private long destWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ORIGIN_WAREHOUSE_ID((short)1, "originWarehouseId"),
      DEST_WAREHOUSE_ID((short)2, "destWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ORIGIN_WAREHOUSE_ID
            return ORIGIN_WAREHOUSE_ID;
          case 2: // DEST_WAREHOUSE_ID
            return DEST_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORIGINWAREHOUSEID_ISSET_ID = 0;
    private static final int __DESTWAREHOUSEID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ORIGIN_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("originWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.DEST_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("destWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createTransferLot_args.class, metaDataMap);
    }

    public createTransferLot_args() {
    }

    public createTransferLot_args(
      long originWarehouseId,
      long destWarehouseId)
    {
      this();
      this.originWarehouseId = originWarehouseId;
      setOriginWarehouseIdIsSet(true);
      this.destWarehouseId = destWarehouseId;
      setDestWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createTransferLot_args(createTransferLot_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.originWarehouseId = other.originWarehouseId;
      this.destWarehouseId = other.destWarehouseId;
    }

    public createTransferLot_args deepCopy() {
      return new createTransferLot_args(this);
    }

    @Override
    public void clear() {
      setOriginWarehouseIdIsSet(false);
      this.originWarehouseId = 0;
      setDestWarehouseIdIsSet(false);
      this.destWarehouseId = 0;
    }

    public long getOriginWarehouseId() {
      return this.originWarehouseId;
    }

    public void setOriginWarehouseId(long originWarehouseId) {
      this.originWarehouseId = originWarehouseId;
      setOriginWarehouseIdIsSet(true);
    }

    public void unsetOriginWarehouseId() {
      __isset_bit_vector.clear(__ORIGINWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field originWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetOriginWarehouseId() {
      return __isset_bit_vector.get(__ORIGINWAREHOUSEID_ISSET_ID);
    }

    public void setOriginWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORIGINWAREHOUSEID_ISSET_ID, value);
    }

    public long getDestWarehouseId() {
      return this.destWarehouseId;
    }

    public void setDestWarehouseId(long destWarehouseId) {
      this.destWarehouseId = destWarehouseId;
      setDestWarehouseIdIsSet(true);
    }

    public void unsetDestWarehouseId() {
      __isset_bit_vector.clear(__DESTWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field destWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetDestWarehouseId() {
      return __isset_bit_vector.get(__DESTWAREHOUSEID_ISSET_ID);
    }

    public void setDestWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__DESTWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORIGIN_WAREHOUSE_ID:
        if (value == null) {
          unsetOriginWarehouseId();
        } else {
          setOriginWarehouseId((Long)value);
        }
        break;

      case DEST_WAREHOUSE_ID:
        if (value == null) {
          unsetDestWarehouseId();
        } else {
          setDestWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORIGIN_WAREHOUSE_ID:
        return Long.valueOf(getOriginWarehouseId());

      case DEST_WAREHOUSE_ID:
        return Long.valueOf(getDestWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ORIGIN_WAREHOUSE_ID:
        return isSetOriginWarehouseId();
      case DEST_WAREHOUSE_ID:
        return isSetDestWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createTransferLot_args)
        return this.equals((createTransferLot_args)that);
      return false;
    }

    public boolean equals(createTransferLot_args that) {
      if (that == null)
        return false;

      boolean this_present_originWarehouseId = true;
      boolean that_present_originWarehouseId = true;
      if (this_present_originWarehouseId || that_present_originWarehouseId) {
        if (!(this_present_originWarehouseId && that_present_originWarehouseId))
          return false;
        if (this.originWarehouseId != that.originWarehouseId)
          return false;
      }

      boolean this_present_destWarehouseId = true;
      boolean that_present_destWarehouseId = true;
      if (this_present_destWarehouseId || that_present_destWarehouseId) {
        if (!(this_present_destWarehouseId && that_present_destWarehouseId))
          return false;
        if (this.destWarehouseId != that.destWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createTransferLot_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createTransferLot_args typedOther = (createTransferLot_args)other;

      lastComparison = Boolean.valueOf(isSetOriginWarehouseId()).compareTo(typedOther.isSetOriginWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOriginWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.originWarehouseId, typedOther.originWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDestWarehouseId()).compareTo(typedOther.isSetDestWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDestWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.destWarehouseId, typedOther.destWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ORIGIN_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.originWarehouseId = iprot.readI64();
              setOriginWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // DEST_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.destWarehouseId = iprot.readI64();
              setDestWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORIGIN_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.originWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(DEST_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.destWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createTransferLot_args(");
      boolean first = true;

      sb.append("originWarehouseId:");
      sb.append(this.originWarehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("destWarehouseId:");
      sb.append(this.destWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class createTransferLot_result implements org.apache.thrift.TBase<createTransferLot_result, createTransferLot_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createTransferLot_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createTransferLot_result.class, metaDataMap);
    }

    public createTransferLot_result() {
    }

    public createTransferLot_result(
      long success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createTransferLot_result(createTransferLot_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public createTransferLot_result deepCopy() {
      return new createTransferLot_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.wex = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public void setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createTransferLot_result)
        return this.equals((createTransferLot_result)that);
      return false;
    }

    public boolean equals(createTransferLot_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createTransferLot_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createTransferLot_result typedOther = (createTransferLot_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.success = iprot.readI64();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createTransferLot_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getTransferLot_args implements org.apache.thrift.TBase<getTransferLot_args, getTransferLot_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTransferLot_args");

    private static final org.apache.thrift.protocol.TField TRANSFER_LOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transferLotId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long transferLotId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      TRANSFER_LOT_ID((short)1, "transferLotId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // TRANSFER_LOT_ID
            return TRANSFER_LOT_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TRANSFERLOTID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.TRANSFER_LOT_ID, new org.apache.thrift.meta_data.FieldMetaData("transferLotId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTransferLot_args.class, metaDataMap);
    }

    public getTransferLot_args() {
    }

    public getTransferLot_args(
      long transferLotId)
    {
      this();
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransferLot_args(getTransferLot_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.transferLotId = other.transferLotId;
    }

    public getTransferLot_args deepCopy() {
      return new getTransferLot_args(this);
    }

    @Override
    public void clear() {
      setTransferLotIdIsSet(false);
      this.transferLotId = 0;
    }

    public long getTransferLotId() {
      return this.transferLotId;
    }

    public void setTransferLotId(long transferLotId) {
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    public void unsetTransferLotId() {
      __isset_bit_vector.clear(__TRANSFERLOTID_ISSET_ID);
    }

    /** Returns true if field transferLotId is set (has been assigned a value) and false otherwise */
    public boolean isSetTransferLotId() {
      return __isset_bit_vector.get(__TRANSFERLOTID_ISSET_ID);
    }

    public void setTransferLotIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSFERLOTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TRANSFER_LOT_ID:
        if (value == null) {
          unsetTransferLotId();
        } else {
          setTransferLotId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TRANSFER_LOT_ID:
        return Long.valueOf(getTransferLotId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case TRANSFER_LOT_ID:
        return isSetTransferLotId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getTransferLot_args)
        return this.equals((getTransferLot_args)that);
      return false;
    }

    public boolean equals(getTransferLot_args that) {
      if (that == null)
        return false;

      boolean this_present_transferLotId = true;
      boolean that_present_transferLotId = true;
      if (this_present_transferLotId || that_present_transferLotId) {
        if (!(this_present_transferLotId && that_present_transferLotId))
          return false;
        if (this.transferLotId != that.transferLotId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getTransferLot_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getTransferLot_args typedOther = (getTransferLot_args)other;

      lastComparison = Boolean.valueOf(isSetTransferLotId()).compareTo(typedOther.isSetTransferLotId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTransferLotId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferLotId, typedOther.transferLotId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // TRANSFER_LOT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.transferLotId = iprot.readI64();
              setTransferLotIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TRANSFER_LOT_ID_FIELD_DESC);
      oprot.writeI64(this.transferLotId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getTransferLot_args(");
      boolean first = true;

      sb.append("transferLotId:");
      sb.append(this.transferLotId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getTransferLot_result implements org.apache.thrift.TBase<getTransferLot_result, getTransferLot_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTransferLot_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private TransferLot success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransferLot.class)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTransferLot_result.class, metaDataMap);
    }

    public getTransferLot_result() {
    }

    public getTransferLot_result(
      TransferLot success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransferLot_result(getTransferLot_result other) {
      if (other.isSetSuccess()) {
        this.success = new TransferLot(other.success);
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getTransferLot_result deepCopy() {
      return new getTransferLot_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public TransferLot getSuccess() {
      return this.success;
    }

    public void setSuccess(TransferLot success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((TransferLot)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getTransferLot_result)
        return this.equals((getTransferLot_result)that);
      return false;
    }

    public boolean equals(getTransferLot_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getTransferLot_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getTransferLot_result typedOther = (getTransferLot_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new TransferLot();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getTransferLot_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markTransferLotAsReceived_args implements org.apache.thrift.TBase<markTransferLotAsReceived_args, markTransferLotAsReceived_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markTransferLotAsReceived_args");

    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField REMOTE_TRANSFER_REF_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("remoteTransferRefNumber", org.apache.thrift.protocol.TType.STRING, (short)2);

    private long id; // required
    private String remoteTransferRefNumber; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ID((short)1, "id"),
      REMOTE_TRANSFER_REF_NUMBER((short)2, "remoteTransferRefNumber");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ID
            return ID;
          case 2: // REMOTE_TRANSFER_REF_NUMBER
            return REMOTE_TRANSFER_REF_NUMBER;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.REMOTE_TRANSFER_REF_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("remoteTransferRefNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markTransferLotAsReceived_args.class, metaDataMap);
    }

    public markTransferLotAsReceived_args() {
    }

    public markTransferLotAsReceived_args(
      long id,
      String remoteTransferRefNumber)
    {
      this();
      this.id = id;
      setIdIsSet(true);
      this.remoteTransferRefNumber = remoteTransferRefNumber;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markTransferLotAsReceived_args(markTransferLotAsReceived_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
      if (other.isSetRemoteTransferRefNumber()) {
        this.remoteTransferRefNumber = other.remoteTransferRefNumber;
      }
    }

    public markTransferLotAsReceived_args deepCopy() {
      return new markTransferLotAsReceived_args(this);
    }

    @Override
    public void clear() {
      setIdIsSet(false);
      this.id = 0;
      this.remoteTransferRefNumber = null;
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public String getRemoteTransferRefNumber() {
      return this.remoteTransferRefNumber;
    }

    public void setRemoteTransferRefNumber(String remoteTransferRefNumber) {
      this.remoteTransferRefNumber = remoteTransferRefNumber;
    }

    public void unsetRemoteTransferRefNumber() {
      this.remoteTransferRefNumber = null;
    }

    /** Returns true if field remoteTransferRefNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetRemoteTransferRefNumber() {
      return this.remoteTransferRefNumber != null;
    }

    public void setRemoteTransferRefNumberIsSet(boolean value) {
      if (!value) {
        this.remoteTransferRefNumber = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      case REMOTE_TRANSFER_REF_NUMBER:
        if (value == null) {
          unsetRemoteTransferRefNumber();
        } else {
          setRemoteTransferRefNumber((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return Long.valueOf(getId());

      case REMOTE_TRANSFER_REF_NUMBER:
        return getRemoteTransferRefNumber();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ID:
        return isSetId();
      case REMOTE_TRANSFER_REF_NUMBER:
        return isSetRemoteTransferRefNumber();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markTransferLotAsReceived_args)
        return this.equals((markTransferLotAsReceived_args)that);
      return false;
    }

    public boolean equals(markTransferLotAsReceived_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      boolean this_present_remoteTransferRefNumber = true && this.isSetRemoteTransferRefNumber();
      boolean that_present_remoteTransferRefNumber = true && that.isSetRemoteTransferRefNumber();
      if (this_present_remoteTransferRefNumber || that_present_remoteTransferRefNumber) {
        if (!(this_present_remoteTransferRefNumber && that_present_remoteTransferRefNumber))
          return false;
        if (!this.remoteTransferRefNumber.equals(that.remoteTransferRefNumber))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markTransferLotAsReceived_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markTransferLotAsReceived_args typedOther = (markTransferLotAsReceived_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetRemoteTransferRefNumber()).compareTo(typedOther.isSetRemoteTransferRefNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRemoteTransferRefNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.remoteTransferRefNumber, typedOther.remoteTransferRefNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // REMOTE_TRANSFER_REF_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.remoteTransferRefNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      if (this.remoteTransferRefNumber != null) {
        oprot.writeFieldBegin(REMOTE_TRANSFER_REF_NUMBER_FIELD_DESC);
        oprot.writeString(this.remoteTransferRefNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markTransferLotAsReceived_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("remoteTransferRefNumber:");
      if (this.remoteTransferRefNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.remoteTransferRefNumber);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markTransferLotAsReceived_result implements org.apache.thrift.TBase<markTransferLotAsReceived_result, markTransferLotAsReceived_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markTransferLotAsReceived_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markTransferLotAsReceived_result.class, metaDataMap);
    }

    public markTransferLotAsReceived_result() {
    }

    public markTransferLotAsReceived_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markTransferLotAsReceived_result(markTransferLotAsReceived_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public markTransferLotAsReceived_result deepCopy() {
      return new markTransferLotAsReceived_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markTransferLotAsReceived_result)
        return this.equals((markTransferLotAsReceived_result)that);
      return false;
    }

    public boolean equals(markTransferLotAsReceived_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markTransferLotAsReceived_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markTransferLotAsReceived_result typedOther = (markTransferLotAsReceived_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markTransferLotAsReceived_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getTransferLotsByDate_args implements org.apache.thrift.TBase<getTransferLotsByDate_args, getTransferLotsByDate_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTransferLotsByDate_args");

    private static final org.apache.thrift.protocol.TField FROM_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("fromDate", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TO_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("toDate", org.apache.thrift.protocol.TType.I64, (short)2);

    private long fromDate; // required
    private long toDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      FROM_DATE((short)1, "fromDate"),
      TO_DATE((short)2, "toDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // FROM_DATE
            return FROM_DATE;
          case 2: // TO_DATE
            return TO_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __FROMDATE_ISSET_ID = 0;
    private static final int __TODATE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.FROM_DATE, new org.apache.thrift.meta_data.FieldMetaData("fromDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TO_DATE, new org.apache.thrift.meta_data.FieldMetaData("toDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTransferLotsByDate_args.class, metaDataMap);
    }

    public getTransferLotsByDate_args() {
    }

    public getTransferLotsByDate_args(
      long fromDate,
      long toDate)
    {
      this();
      this.fromDate = fromDate;
      setFromDateIsSet(true);
      this.toDate = toDate;
      setToDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransferLotsByDate_args(getTransferLotsByDate_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.fromDate = other.fromDate;
      this.toDate = other.toDate;
    }

    public getTransferLotsByDate_args deepCopy() {
      return new getTransferLotsByDate_args(this);
    }

    @Override
    public void clear() {
      setFromDateIsSet(false);
      this.fromDate = 0;
      setToDateIsSet(false);
      this.toDate = 0;
    }

    public long getFromDate() {
      return this.fromDate;
    }

    public void setFromDate(long fromDate) {
      this.fromDate = fromDate;
      setFromDateIsSet(true);
    }

    public void unsetFromDate() {
      __isset_bit_vector.clear(__FROMDATE_ISSET_ID);
    }

    /** Returns true if field fromDate is set (has been assigned a value) and false otherwise */
    public boolean isSetFromDate() {
      return __isset_bit_vector.get(__FROMDATE_ISSET_ID);
    }

    public void setFromDateIsSet(boolean value) {
      __isset_bit_vector.set(__FROMDATE_ISSET_ID, value);
    }

    public long getToDate() {
      return this.toDate;
    }

    public void setToDate(long toDate) {
      this.toDate = toDate;
      setToDateIsSet(true);
    }

    public void unsetToDate() {
      __isset_bit_vector.clear(__TODATE_ISSET_ID);
    }

    /** Returns true if field toDate is set (has been assigned a value) and false otherwise */
    public boolean isSetToDate() {
      return __isset_bit_vector.get(__TODATE_ISSET_ID);
    }

    public void setToDateIsSet(boolean value) {
      __isset_bit_vector.set(__TODATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FROM_DATE:
        if (value == null) {
          unsetFromDate();
        } else {
          setFromDate((Long)value);
        }
        break;

      case TO_DATE:
        if (value == null) {
          unsetToDate();
        } else {
          setToDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FROM_DATE:
        return Long.valueOf(getFromDate());

      case TO_DATE:
        return Long.valueOf(getToDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case FROM_DATE:
        return isSetFromDate();
      case TO_DATE:
        return isSetToDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getTransferLotsByDate_args)
        return this.equals((getTransferLotsByDate_args)that);
      return false;
    }

    public boolean equals(getTransferLotsByDate_args that) {
      if (that == null)
        return false;

      boolean this_present_fromDate = true;
      boolean that_present_fromDate = true;
      if (this_present_fromDate || that_present_fromDate) {
        if (!(this_present_fromDate && that_present_fromDate))
          return false;
        if (this.fromDate != that.fromDate)
          return false;
      }

      boolean this_present_toDate = true;
      boolean that_present_toDate = true;
      if (this_present_toDate || that_present_toDate) {
        if (!(this_present_toDate && that_present_toDate))
          return false;
        if (this.toDate != that.toDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getTransferLotsByDate_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getTransferLotsByDate_args typedOther = (getTransferLotsByDate_args)other;

      lastComparison = Boolean.valueOf(isSetFromDate()).compareTo(typedOther.isSetFromDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFromDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fromDate, typedOther.fromDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToDate()).compareTo(typedOther.isSetToDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.toDate, typedOther.toDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // FROM_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.fromDate = iprot.readI64();
              setFromDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TO_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.toDate = iprot.readI64();
              setToDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(FROM_DATE_FIELD_DESC);
      oprot.writeI64(this.fromDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_DATE_FIELD_DESC);
      oprot.writeI64(this.toDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getTransferLotsByDate_args(");
      boolean first = true;

      sb.append("fromDate:");
      sb.append(this.fromDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("toDate:");
      sb.append(this.toDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getTransferLotsByDate_result implements org.apache.thrift.TBase<getTransferLotsByDate_result, getTransferLotsByDate_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTransferLotsByDate_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<TransferLot> success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransferLot.class))));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTransferLotsByDate_result.class, metaDataMap);
    }

    public getTransferLotsByDate_result() {
    }

    public getTransferLotsByDate_result(
      List<TransferLot> success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransferLotsByDate_result(getTransferLotsByDate_result other) {
      if (other.isSetSuccess()) {
        List<TransferLot> __this__success = new ArrayList<TransferLot>();
        for (TransferLot other_element : other.success) {
          __this__success.add(new TransferLot(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getTransferLotsByDate_result deepCopy() {
      return new getTransferLotsByDate_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<TransferLot> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(TransferLot elem) {
      if (this.success == null) {
        this.success = new ArrayList<TransferLot>();
      }
      this.success.add(elem);
    }

    public List<TransferLot> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<TransferLot> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<TransferLot>)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getTransferLotsByDate_result)
        return this.equals((getTransferLotsByDate_result)that);
      return false;
    }

    public boolean equals(getTransferLotsByDate_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getTransferLotsByDate_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getTransferLotsByDate_result typedOther = (getTransferLotsByDate_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list88 = iprot.readListBegin();
                this.success = new ArrayList<TransferLot>(_list88.size);
                for (int _i89 = 0; _i89 < _list88.size; ++_i89)
                {
                  TransferLot _elem90; // required
                  _elem90 = new TransferLot();
                  _elem90.read(iprot);
                  this.success.add(_elem90);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (TransferLot _iter91 : this.success)
          {
            _iter91.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getTransferLotsByDate_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getAllowedDestinationWarehousesForTransfer_args implements org.apache.thrift.TBase<getAllowedDestinationWarehousesForTransfer_args, getAllowedDestinationWarehousesForTransfer_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllowedDestinationWarehousesForTransfer_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long warehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WAREHOUSE_ID((short)1, "warehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WAREHOUSE_ID
            return WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __WAREHOUSEID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllowedDestinationWarehousesForTransfer_args.class, metaDataMap);
    }

    public getAllowedDestinationWarehousesForTransfer_args() {
    }

    public getAllowedDestinationWarehousesForTransfer_args(
      long warehouseId)
    {
      this();
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllowedDestinationWarehousesForTransfer_args(getAllowedDestinationWarehousesForTransfer_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouseId = other.warehouseId;
    }

    public getAllowedDestinationWarehousesForTransfer_args deepCopy() {
      return new getAllowedDestinationWarehousesForTransfer_args(this);
    }

    @Override
    public void clear() {
      setWarehouseIdIsSet(false);
      this.warehouseId = 0;
    }

    public long getWarehouseId() {
      return this.warehouseId;
    }

    public void setWarehouseId(long warehouseId) {
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
    }

    public void unsetWarehouseId() {
      __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field warehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouseId() {
      return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
    }

    public void setWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouseId();
        } else {
          setWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WAREHOUSE_ID:
        return isSetWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllowedDestinationWarehousesForTransfer_args)
        return this.equals((getAllowedDestinationWarehousesForTransfer_args)that);
      return false;
    }

    public boolean equals(getAllowedDestinationWarehousesForTransfer_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouseId = true;
      boolean that_present_warehouseId = true;
      if (this_present_warehouseId || that_present_warehouseId) {
        if (!(this_present_warehouseId && that_present_warehouseId))
          return false;
        if (this.warehouseId != that.warehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllowedDestinationWarehousesForTransfer_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllowedDestinationWarehousesForTransfer_args typedOther = (getAllowedDestinationWarehousesForTransfer_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(typedOther.isSetWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.warehouseId = iprot.readI64();
              setWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllowedDestinationWarehousesForTransfer_args(");
      boolean first = true;

      sb.append("warehouseId:");
      sb.append(this.warehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getAllowedDestinationWarehousesForTransfer_result implements org.apache.thrift.TBase<getAllowedDestinationWarehousesForTransfer_result, getAllowedDestinationWarehousesForTransfer_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllowedDestinationWarehousesForTransfer_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<Long> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllowedDestinationWarehousesForTransfer_result.class, metaDataMap);
    }

    public getAllowedDestinationWarehousesForTransfer_result() {
    }

    public getAllowedDestinationWarehousesForTransfer_result(
      List<Long> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllowedDestinationWarehousesForTransfer_result(getAllowedDestinationWarehousesForTransfer_result other) {
      if (other.isSetSuccess()) {
        List<Long> __this__success = new ArrayList<Long>();
        for (Long other_element : other.success) {
          __this__success.add(other_element);
        }
        this.success = __this__success;
      }
    }

    public getAllowedDestinationWarehousesForTransfer_result deepCopy() {
      return new getAllowedDestinationWarehousesForTransfer_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Long> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(long elem) {
      if (this.success == null) {
        this.success = new ArrayList<Long>();
      }
      this.success.add(elem);
    }

    public List<Long> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Long> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllowedDestinationWarehousesForTransfer_result)
        return this.equals((getAllowedDestinationWarehousesForTransfer_result)that);
      return false;
    }

    public boolean equals(getAllowedDestinationWarehousesForTransfer_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllowedDestinationWarehousesForTransfer_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllowedDestinationWarehousesForTransfer_result typedOther = (getAllowedDestinationWarehousesForTransfer_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list92 = iprot.readListBegin();
                this.success = new ArrayList<Long>(_list92.size);
                for (int _i93 = 0; _i93 < _list92.size; ++_i93)
                {
                  long _elem94; // required
                  _elem94 = iprot.readI64();
                  this.success.add(_elem94);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.success.size()));
          for (long _iter95 : this.success)
          {
            oprot.writeI64(_iter95);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllowedDestinationWarehousesForTransfer_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getItemsInTransferLot_args implements org.apache.thrift.TBase<getItemsInTransferLot_args, getItemsInTransferLot_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsInTransferLot_args");

    private static final org.apache.thrift.protocol.TField TRANSFER_LOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transferLotId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long transferLotId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      TRANSFER_LOT_ID((short)1, "transferLotId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // TRANSFER_LOT_ID
            return TRANSFER_LOT_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TRANSFERLOTID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.TRANSFER_LOT_ID, new org.apache.thrift.meta_data.FieldMetaData("transferLotId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemsInTransferLot_args.class, metaDataMap);
    }

    public getItemsInTransferLot_args() {
    }

    public getItemsInTransferLot_args(
      long transferLotId)
    {
      this();
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsInTransferLot_args(getItemsInTransferLot_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.transferLotId = other.transferLotId;
    }

    public getItemsInTransferLot_args deepCopy() {
      return new getItemsInTransferLot_args(this);
    }

    @Override
    public void clear() {
      setTransferLotIdIsSet(false);
      this.transferLotId = 0;
    }

    public long getTransferLotId() {
      return this.transferLotId;
    }

    public void setTransferLotId(long transferLotId) {
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    public void unsetTransferLotId() {
      __isset_bit_vector.clear(__TRANSFERLOTID_ISSET_ID);
    }

    /** Returns true if field transferLotId is set (has been assigned a value) and false otherwise */
    public boolean isSetTransferLotId() {
      return __isset_bit_vector.get(__TRANSFERLOTID_ISSET_ID);
    }

    public void setTransferLotIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSFERLOTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TRANSFER_LOT_ID:
        if (value == null) {
          unsetTransferLotId();
        } else {
          setTransferLotId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TRANSFER_LOT_ID:
        return Long.valueOf(getTransferLotId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case TRANSFER_LOT_ID:
        return isSetTransferLotId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemsInTransferLot_args)
        return this.equals((getItemsInTransferLot_args)that);
      return false;
    }

    public boolean equals(getItemsInTransferLot_args that) {
      if (that == null)
        return false;

      boolean this_present_transferLotId = true;
      boolean that_present_transferLotId = true;
      if (this_present_transferLotId || that_present_transferLotId) {
        if (!(this_present_transferLotId && that_present_transferLotId))
          return false;
        if (this.transferLotId != that.transferLotId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemsInTransferLot_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsInTransferLot_args typedOther = (getItemsInTransferLot_args)other;

      lastComparison = Boolean.valueOf(isSetTransferLotId()).compareTo(typedOther.isSetTransferLotId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTransferLotId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferLotId, typedOther.transferLotId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // TRANSFER_LOT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.transferLotId = iprot.readI64();
              setTransferLotIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TRANSFER_LOT_ID_FIELD_DESC);
      oprot.writeI64(this.transferLotId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemsInTransferLot_args(");
      boolean first = true;

      sb.append("transferLotId:");
      sb.append(this.transferLotId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getItemsInTransferLot_result implements org.apache.thrift.TBase<getItemsInTransferLot_result, getItemsInTransferLot_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsInTransferLot_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);

    private Map<Long,Long> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemsInTransferLot_result.class, metaDataMap);
    }

    public getItemsInTransferLot_result() {
    }

    public getItemsInTransferLot_result(
      Map<Long,Long> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsInTransferLot_result(getItemsInTransferLot_result other) {
      if (other.isSetSuccess()) {
        Map<Long,Long> __this__success = new HashMap<Long,Long>();
        for (Map.Entry<Long, Long> other_element : other.success.entrySet()) {

          Long other_element_key = other_element.getKey();
          Long other_element_value = other_element.getValue();

          Long __this__success_copy_key = other_element_key;

          Long __this__success_copy_value = other_element_value;

          __this__success.put(__this__success_copy_key, __this__success_copy_value);
        }
        this.success = __this__success;
      }
    }

    public getItemsInTransferLot_result deepCopy() {
      return new getItemsInTransferLot_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public void putToSuccess(long key, long val) {
      if (this.success == null) {
        this.success = new HashMap<Long,Long>();
      }
      this.success.put(key, val);
    }

    public Map<Long,Long> getSuccess() {
      return this.success;
    }

    public void setSuccess(Map<Long,Long> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Map<Long,Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemsInTransferLot_result)
        return this.equals((getItemsInTransferLot_result)that);
      return false;
    }

    public boolean equals(getItemsInTransferLot_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemsInTransferLot_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsInTransferLot_result typedOther = (getItemsInTransferLot_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map96 = iprot.readMapBegin();
                this.success = new HashMap<Long,Long>(2*_map96.size);
                for (int _i97 = 0; _i97 < _map96.size; ++_i97)
                {
                  long _key98; // required
                  long _val99; // required
                  _key98 = iprot.readI64();
                  _val99 = iprot.readI64();
                  this.success.put(_key98, _val99);
                }
                iprot.readMapEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.I64, this.success.size()));
          for (Map.Entry<Long, Long> _iter100 : this.success.entrySet())
          {
            oprot.writeI64(_iter100.getKey());
            oprot.writeI64(_iter100.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemsInTransferLot_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markItemsAsReceivedForTransferLot_args implements org.apache.thrift.TBase<markItemsAsReceivedForTransferLot_args, markItemsAsReceivedForTransferLot_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markItemsAsReceivedForTransferLot_args");

    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long id; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ID((short)1, "id");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ID
            return ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markItemsAsReceivedForTransferLot_args.class, metaDataMap);
    }

    public markItemsAsReceivedForTransferLot_args() {
    }

    public markItemsAsReceivedForTransferLot_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markItemsAsReceivedForTransferLot_args(markItemsAsReceivedForTransferLot_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

    public markItemsAsReceivedForTransferLot_args deepCopy() {
      return new markItemsAsReceivedForTransferLot_args(this);
    }

    @Override
    public void clear() {
      setIdIsSet(false);
      this.id = 0;
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return Long.valueOf(getId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markItemsAsReceivedForTransferLot_args)
        return this.equals((markItemsAsReceivedForTransferLot_args)that);
      return false;
    }

    public boolean equals(markItemsAsReceivedForTransferLot_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markItemsAsReceivedForTransferLot_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markItemsAsReceivedForTransferLot_args typedOther = (markItemsAsReceivedForTransferLot_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markItemsAsReceivedForTransferLot_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markItemsAsReceivedForTransferLot_result implements org.apache.thrift.TBase<markItemsAsReceivedForTransferLot_result, markItemsAsReceivedForTransferLot_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markItemsAsReceivedForTransferLot_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markItemsAsReceivedForTransferLot_result.class, metaDataMap);
    }

    public markItemsAsReceivedForTransferLot_result() {
    }

    public markItemsAsReceivedForTransferLot_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markItemsAsReceivedForTransferLot_result(markItemsAsReceivedForTransferLot_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public markItemsAsReceivedForTransferLot_result deepCopy() {
      return new markItemsAsReceivedForTransferLot_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markItemsAsReceivedForTransferLot_result)
        return this.equals((markItemsAsReceivedForTransferLot_result)that);
      return false;
    }

    public boolean equals(markItemsAsReceivedForTransferLot_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markItemsAsReceivedForTransferLot_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markItemsAsReceivedForTransferLot_result typedOther = (markItemsAsReceivedForTransferLot_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markItemsAsReceivedForTransferLot_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class updateTransferLotAfterItemReceive_args implements org.apache.thrift.TBase<updateTransferLotAfterItemReceive_args, updateTransferLotAfterItemReceive_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateTransferLotAfterItemReceive_args");

    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long id; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ID((short)1, "id");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ID
            return ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateTransferLotAfterItemReceive_args.class, metaDataMap);
    }

    public updateTransferLotAfterItemReceive_args() {
    }

    public updateTransferLotAfterItemReceive_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateTransferLotAfterItemReceive_args(updateTransferLotAfterItemReceive_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

    public updateTransferLotAfterItemReceive_args deepCopy() {
      return new updateTransferLotAfterItemReceive_args(this);
    }

    @Override
    public void clear() {
      setIdIsSet(false);
      this.id = 0;
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return Long.valueOf(getId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateTransferLotAfterItemReceive_args)
        return this.equals((updateTransferLotAfterItemReceive_args)that);
      return false;
    }

    public boolean equals(updateTransferLotAfterItemReceive_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateTransferLotAfterItemReceive_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateTransferLotAfterItemReceive_args typedOther = (updateTransferLotAfterItemReceive_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateTransferLotAfterItemReceive_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class updateTransferLotAfterItemReceive_result implements org.apache.thrift.TBase<updateTransferLotAfterItemReceive_result, updateTransferLotAfterItemReceive_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateTransferLotAfterItemReceive_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private TransferLotStatus success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      /**
       * 
       * @see TransferLotStatus
       */
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TransferLotStatus.class)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateTransferLotAfterItemReceive_result.class, metaDataMap);
    }

    public updateTransferLotAfterItemReceive_result() {
    }

    public updateTransferLotAfterItemReceive_result(
      TransferLotStatus success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateTransferLotAfterItemReceive_result(updateTransferLotAfterItemReceive_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public updateTransferLotAfterItemReceive_result deepCopy() {
      return new updateTransferLotAfterItemReceive_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    /**
     * 
     * @see TransferLotStatus
     */
    public TransferLotStatus getSuccess() {
      return this.success;
    }

    /**
     * 
     * @see TransferLotStatus
     */
    public void setSuccess(TransferLotStatus success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((TransferLotStatus)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateTransferLotAfterItemReceive_result)
        return this.equals((updateTransferLotAfterItemReceive_result)that);
      return false;
    }

    public boolean equals(updateTransferLotAfterItemReceive_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateTransferLotAfterItemReceive_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateTransferLotAfterItemReceive_result typedOther = (updateTransferLotAfterItemReceive_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.success = TransferLotStatus.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI32(this.success.getValue());
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateTransferLotAfterItemReceive_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForTransferOut_args implements org.apache.thrift.TBase<scanForTransferOut_args, scanForTransferOut_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForTransferOut_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItems", org.apache.thrift.protocol.TType.LIST, (short)1);
    private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField TRANSFER_LOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transferLotId", org.apache.thrift.protocol.TType.I64, (short)3);

    private List<InventoryItem> inventoryItems; // required
    private ScanType type; // required
    private long transferLotId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEMS((short)1, "inventoryItems"),
      /**
       * 
       * @see ScanType
       */
      TYPE((short)2, "type"),
      TRANSFER_LOT_ID((short)3, "transferLotId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEMS
            return INVENTORY_ITEMS;
          case 2: // TYPE
            return TYPE;
          case 3: // TRANSFER_LOT_ID
            return TRANSFER_LOT_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TRANSFERLOTID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("inventoryItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      tmpMap.put(_Fields.TRANSFER_LOT_ID, new org.apache.thrift.meta_data.FieldMetaData("transferLotId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForTransferOut_args.class, metaDataMap);
    }

    public scanForTransferOut_args() {
    }

    public scanForTransferOut_args(
      List<InventoryItem> inventoryItems,
      ScanType type,
      long transferLotId)
    {
      this();
      this.inventoryItems = inventoryItems;
      this.type = type;
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForTransferOut_args(scanForTransferOut_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetInventoryItems()) {
        List<InventoryItem> __this__inventoryItems = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.inventoryItems) {
          __this__inventoryItems.add(new InventoryItem(other_element));
        }
        this.inventoryItems = __this__inventoryItems;
      }
      if (other.isSetType()) {
        this.type = other.type;
      }
      this.transferLotId = other.transferLotId;
    }

    public scanForTransferOut_args deepCopy() {
      return new scanForTransferOut_args(this);
    }

    @Override
    public void clear() {
      this.inventoryItems = null;
      this.type = null;
      setTransferLotIdIsSet(false);
      this.transferLotId = 0;
    }

    public int getInventoryItemsSize() {
      return (this.inventoryItems == null) ? 0 : this.inventoryItems.size();
    }

    public java.util.Iterator<InventoryItem> getInventoryItemsIterator() {
      return (this.inventoryItems == null) ? null : this.inventoryItems.iterator();
    }

    public void addToInventoryItems(InventoryItem elem) {
      if (this.inventoryItems == null) {
        this.inventoryItems = new ArrayList<InventoryItem>();
      }
      this.inventoryItems.add(elem);
    }

    public List<InventoryItem> getInventoryItems() {
      return this.inventoryItems;
    }

    public void setInventoryItems(List<InventoryItem> inventoryItems) {
      this.inventoryItems = inventoryItems;
    }

    public void unsetInventoryItems() {
      this.inventoryItems = null;
    }

    /** Returns true if field inventoryItems is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItems() {
      return this.inventoryItems != null;
    }

    public void setInventoryItemsIsSet(boolean value) {
      if (!value) {
        this.inventoryItems = null;
      }
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getType() {
      return this.type;
    }

    /**
     * 
     * @see ScanType
     */
    public void setType(ScanType type) {
      this.type = type;
    }

    public void unsetType() {
      this.type = null;
    }

    /** Returns true if field type is set (has been assigned a value) and false otherwise */
    public boolean isSetType() {
      return this.type != null;
    }

    public void setTypeIsSet(boolean value) {
      if (!value) {
        this.type = null;
      }
    }

    public long getTransferLotId() {
      return this.transferLotId;
    }

    public void setTransferLotId(long transferLotId) {
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    public void unsetTransferLotId() {
      __isset_bit_vector.clear(__TRANSFERLOTID_ISSET_ID);
    }

    /** Returns true if field transferLotId is set (has been assigned a value) and false otherwise */
    public boolean isSetTransferLotId() {
      return __isset_bit_vector.get(__TRANSFERLOTID_ISSET_ID);
    }

    public void setTransferLotIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSFERLOTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEMS:
        if (value == null) {
          unsetInventoryItems();
        } else {
          setInventoryItems((List<InventoryItem>)value);
        }
        break;

      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((ScanType)value);
        }
        break;

      case TRANSFER_LOT_ID:
        if (value == null) {
          unsetTransferLotId();
        } else {
          setTransferLotId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEMS:
        return getInventoryItems();

      case TYPE:
        return getType();

      case TRANSFER_LOT_ID:
        return Long.valueOf(getTransferLotId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEMS:
        return isSetInventoryItems();
      case TYPE:
        return isSetType();
      case TRANSFER_LOT_ID:
        return isSetTransferLotId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForTransferOut_args)
        return this.equals((scanForTransferOut_args)that);
      return false;
    }

    public boolean equals(scanForTransferOut_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItems = true && this.isSetInventoryItems();
      boolean that_present_inventoryItems = true && that.isSetInventoryItems();
      if (this_present_inventoryItems || that_present_inventoryItems) {
        if (!(this_present_inventoryItems && that_present_inventoryItems))
          return false;
        if (!this.inventoryItems.equals(that.inventoryItems))
          return false;
      }

      boolean this_present_type = true && this.isSetType();
      boolean that_present_type = true && that.isSetType();
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (!this.type.equals(that.type))
          return false;
      }

      boolean this_present_transferLotId = true;
      boolean that_present_transferLotId = true;
      if (this_present_transferLotId || that_present_transferLotId) {
        if (!(this_present_transferLotId && that_present_transferLotId))
          return false;
        if (this.transferLotId != that.transferLotId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForTransferOut_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForTransferOut_args typedOther = (scanForTransferOut_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItems()).compareTo(typedOther.isSetInventoryItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItems, typedOther.inventoryItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTransferLotId()).compareTo(typedOther.isSetTransferLotId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTransferLotId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferLotId, typedOther.transferLotId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list101 = iprot.readListBegin();
                this.inventoryItems = new ArrayList<InventoryItem>(_list101.size);
                for (int _i102 = 0; _i102 < _list101.size; ++_i102)
                {
                  InventoryItem _elem103; // required
                  _elem103 = new InventoryItem();
                  _elem103.read(iprot);
                  this.inventoryItems.add(_elem103);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.type = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // TRANSFER_LOT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.transferLotId = iprot.readI64();
              setTransferLotIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.inventoryItems != null) {
        oprot.writeFieldBegin(INVENTORY_ITEMS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.inventoryItems.size()));
          for (InventoryItem _iter104 : this.inventoryItems)
          {
            _iter104.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (this.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(this.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(TRANSFER_LOT_ID_FIELD_DESC);
      oprot.writeI64(this.transferLotId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForTransferOut_args(");
      boolean first = true;

      sb.append("inventoryItems:");
      if (this.inventoryItems == null) {
        sb.append("null");
      } else {
        sb.append(this.inventoryItems);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        sb.append(this.type);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("transferLotId:");
      sb.append(this.transferLotId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForTransferOut_result implements org.apache.thrift.TBase<scanForTransferOut_result, scanForTransferOut_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForTransferOut_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForTransferOut_result.class, metaDataMap);
    }

    public scanForTransferOut_result() {
    }

    public scanForTransferOut_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForTransferOut_result(scanForTransferOut_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public scanForTransferOut_result deepCopy() {
      return new scanForTransferOut_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForTransferOut_result)
        return this.equals((scanForTransferOut_result)that);
      return false;
    }

    public boolean equals(scanForTransferOut_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForTransferOut_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForTransferOut_result typedOther = (scanForTransferOut_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForTransferOut_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForTransferIn_args implements org.apache.thrift.TBase<scanForTransferIn_args, scanForTransferIn_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForTransferIn_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItems", org.apache.thrift.protocol.TType.LIST, (short)1);
    private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField TRANSFER_LOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transferLotId", org.apache.thrift.protocol.TType.I64, (short)3);

    private List<InventoryItem> inventoryItems; // required
    private ScanType type; // required
    private long transferLotId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEMS((short)1, "inventoryItems"),
      /**
       * 
       * @see ScanType
       */
      TYPE((short)2, "type"),
      TRANSFER_LOT_ID((short)3, "transferLotId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEMS
            return INVENTORY_ITEMS;
          case 2: // TYPE
            return TYPE;
          case 3: // TRANSFER_LOT_ID
            return TRANSFER_LOT_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TRANSFERLOTID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("inventoryItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      tmpMap.put(_Fields.TRANSFER_LOT_ID, new org.apache.thrift.meta_data.FieldMetaData("transferLotId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForTransferIn_args.class, metaDataMap);
    }

    public scanForTransferIn_args() {
    }

    public scanForTransferIn_args(
      List<InventoryItem> inventoryItems,
      ScanType type,
      long transferLotId)
    {
      this();
      this.inventoryItems = inventoryItems;
      this.type = type;
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForTransferIn_args(scanForTransferIn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetInventoryItems()) {
        List<InventoryItem> __this__inventoryItems = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.inventoryItems) {
          __this__inventoryItems.add(new InventoryItem(other_element));
        }
        this.inventoryItems = __this__inventoryItems;
      }
      if (other.isSetType()) {
        this.type = other.type;
      }
      this.transferLotId = other.transferLotId;
    }

    public scanForTransferIn_args deepCopy() {
      return new scanForTransferIn_args(this);
    }

    @Override
    public void clear() {
      this.inventoryItems = null;
      this.type = null;
      setTransferLotIdIsSet(false);
      this.transferLotId = 0;
    }

    public int getInventoryItemsSize() {
      return (this.inventoryItems == null) ? 0 : this.inventoryItems.size();
    }

    public java.util.Iterator<InventoryItem> getInventoryItemsIterator() {
      return (this.inventoryItems == null) ? null : this.inventoryItems.iterator();
    }

    public void addToInventoryItems(InventoryItem elem) {
      if (this.inventoryItems == null) {
        this.inventoryItems = new ArrayList<InventoryItem>();
      }
      this.inventoryItems.add(elem);
    }

    public List<InventoryItem> getInventoryItems() {
      return this.inventoryItems;
    }

    public void setInventoryItems(List<InventoryItem> inventoryItems) {
      this.inventoryItems = inventoryItems;
    }

    public void unsetInventoryItems() {
      this.inventoryItems = null;
    }

    /** Returns true if field inventoryItems is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItems() {
      return this.inventoryItems != null;
    }

    public void setInventoryItemsIsSet(boolean value) {
      if (!value) {
        this.inventoryItems = null;
      }
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getType() {
      return this.type;
    }

    /**
     * 
     * @see ScanType
     */
    public void setType(ScanType type) {
      this.type = type;
    }

    public void unsetType() {
      this.type = null;
    }

    /** Returns true if field type is set (has been assigned a value) and false otherwise */
    public boolean isSetType() {
      return this.type != null;
    }

    public void setTypeIsSet(boolean value) {
      if (!value) {
        this.type = null;
      }
    }

    public long getTransferLotId() {
      return this.transferLotId;
    }

    public void setTransferLotId(long transferLotId) {
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    public void unsetTransferLotId() {
      __isset_bit_vector.clear(__TRANSFERLOTID_ISSET_ID);
    }

    /** Returns true if field transferLotId is set (has been assigned a value) and false otherwise */
    public boolean isSetTransferLotId() {
      return __isset_bit_vector.get(__TRANSFERLOTID_ISSET_ID);
    }

    public void setTransferLotIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSFERLOTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEMS:
        if (value == null) {
          unsetInventoryItems();
        } else {
          setInventoryItems((List<InventoryItem>)value);
        }
        break;

      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((ScanType)value);
        }
        break;

      case TRANSFER_LOT_ID:
        if (value == null) {
          unsetTransferLotId();
        } else {
          setTransferLotId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEMS:
        return getInventoryItems();

      case TYPE:
        return getType();

      case TRANSFER_LOT_ID:
        return Long.valueOf(getTransferLotId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEMS:
        return isSetInventoryItems();
      case TYPE:
        return isSetType();
      case TRANSFER_LOT_ID:
        return isSetTransferLotId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForTransferIn_args)
        return this.equals((scanForTransferIn_args)that);
      return false;
    }

    public boolean equals(scanForTransferIn_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItems = true && this.isSetInventoryItems();
      boolean that_present_inventoryItems = true && that.isSetInventoryItems();
      if (this_present_inventoryItems || that_present_inventoryItems) {
        if (!(this_present_inventoryItems && that_present_inventoryItems))
          return false;
        if (!this.inventoryItems.equals(that.inventoryItems))
          return false;
      }

      boolean this_present_type = true && this.isSetType();
      boolean that_present_type = true && that.isSetType();
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (!this.type.equals(that.type))
          return false;
      }

      boolean this_present_transferLotId = true;
      boolean that_present_transferLotId = true;
      if (this_present_transferLotId || that_present_transferLotId) {
        if (!(this_present_transferLotId && that_present_transferLotId))
          return false;
        if (this.transferLotId != that.transferLotId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForTransferIn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForTransferIn_args typedOther = (scanForTransferIn_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItems()).compareTo(typedOther.isSetInventoryItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItems, typedOther.inventoryItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTransferLotId()).compareTo(typedOther.isSetTransferLotId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTransferLotId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferLotId, typedOther.transferLotId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list105 = iprot.readListBegin();
                this.inventoryItems = new ArrayList<InventoryItem>(_list105.size);
                for (int _i106 = 0; _i106 < _list105.size; ++_i106)
                {
                  InventoryItem _elem107; // required
                  _elem107 = new InventoryItem();
                  _elem107.read(iprot);
                  this.inventoryItems.add(_elem107);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.type = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // TRANSFER_LOT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.transferLotId = iprot.readI64();
              setTransferLotIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.inventoryItems != null) {
        oprot.writeFieldBegin(INVENTORY_ITEMS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.inventoryItems.size()));
          for (InventoryItem _iter108 : this.inventoryItems)
          {
            _iter108.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (this.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(this.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(TRANSFER_LOT_ID_FIELD_DESC);
      oprot.writeI64(this.transferLotId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForTransferIn_args(");
      boolean first = true;

      sb.append("inventoryItems:");
      if (this.inventoryItems == null) {
        sb.append("null");
      } else {
        sb.append(this.inventoryItems);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        sb.append(this.type);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("transferLotId:");
      sb.append(this.transferLotId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForTransferIn_result implements org.apache.thrift.TBase<scanForTransferIn_result, scanForTransferIn_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForTransferIn_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForTransferIn_result.class, metaDataMap);
    }

    public scanForTransferIn_result() {
    }

    public scanForTransferIn_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForTransferIn_result(scanForTransferIn_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public scanForTransferIn_result deepCopy() {
      return new scanForTransferIn_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForTransferIn_result)
        return this.equals((scanForTransferIn_result)that);
      return false;
    }

    public boolean equals(scanForTransferIn_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForTransferIn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForTransferIn_result typedOther = (scanForTransferIn_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForTransferIn_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForOursThirdPartyReceive_args implements org.apache.thrift.TBase<scanForOursThirdPartyReceive_args, scanForOursThirdPartyReceive_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForOursThirdPartyReceive_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItems", org.apache.thrift.protocol.TType.LIST, (short)1);
    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)2);

    private List<InventoryItem> inventoryItems; // required
    private long id; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEMS((short)1, "inventoryItems"),
      ID((short)2, "id");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEMS
            return INVENTORY_ITEMS;
          case 2: // ID
            return ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("inventoryItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForOursThirdPartyReceive_args.class, metaDataMap);
    }

    public scanForOursThirdPartyReceive_args() {
    }

    public scanForOursThirdPartyReceive_args(
      List<InventoryItem> inventoryItems,
      long id)
    {
      this();
      this.inventoryItems = inventoryItems;
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForOursThirdPartyReceive_args(scanForOursThirdPartyReceive_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetInventoryItems()) {
        List<InventoryItem> __this__inventoryItems = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.inventoryItems) {
          __this__inventoryItems.add(new InventoryItem(other_element));
        }
        this.inventoryItems = __this__inventoryItems;
      }
      this.id = other.id;
    }

    public scanForOursThirdPartyReceive_args deepCopy() {
      return new scanForOursThirdPartyReceive_args(this);
    }

    @Override
    public void clear() {
      this.inventoryItems = null;
      setIdIsSet(false);
      this.id = 0;
    }

    public int getInventoryItemsSize() {
      return (this.inventoryItems == null) ? 0 : this.inventoryItems.size();
    }

    public java.util.Iterator<InventoryItem> getInventoryItemsIterator() {
      return (this.inventoryItems == null) ? null : this.inventoryItems.iterator();
    }

    public void addToInventoryItems(InventoryItem elem) {
      if (this.inventoryItems == null) {
        this.inventoryItems = new ArrayList<InventoryItem>();
      }
      this.inventoryItems.add(elem);
    }

    public List<InventoryItem> getInventoryItems() {
      return this.inventoryItems;
    }

    public void setInventoryItems(List<InventoryItem> inventoryItems) {
      this.inventoryItems = inventoryItems;
    }

    public void unsetInventoryItems() {
      this.inventoryItems = null;
    }

    /** Returns true if field inventoryItems is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItems() {
      return this.inventoryItems != null;
    }

    public void setInventoryItemsIsSet(boolean value) {
      if (!value) {
        this.inventoryItems = null;
      }
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEMS:
        if (value == null) {
          unsetInventoryItems();
        } else {
          setInventoryItems((List<InventoryItem>)value);
        }
        break;

      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEMS:
        return getInventoryItems();

      case ID:
        return Long.valueOf(getId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEMS:
        return isSetInventoryItems();
      case ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForOursThirdPartyReceive_args)
        return this.equals((scanForOursThirdPartyReceive_args)that);
      return false;
    }

    public boolean equals(scanForOursThirdPartyReceive_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItems = true && this.isSetInventoryItems();
      boolean that_present_inventoryItems = true && that.isSetInventoryItems();
      if (this_present_inventoryItems || that_present_inventoryItems) {
        if (!(this_present_inventoryItems && that_present_inventoryItems))
          return false;
        if (!this.inventoryItems.equals(that.inventoryItems))
          return false;
      }

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForOursThirdPartyReceive_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForOursThirdPartyReceive_args typedOther = (scanForOursThirdPartyReceive_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItems()).compareTo(typedOther.isSetInventoryItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItems, typedOther.inventoryItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list109 = iprot.readListBegin();
                this.inventoryItems = new ArrayList<InventoryItem>(_list109.size);
                for (int _i110 = 0; _i110 < _list109.size; ++_i110)
                {
                  InventoryItem _elem111; // required
                  _elem111 = new InventoryItem();
                  _elem111.read(iprot);
                  this.inventoryItems.add(_elem111);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.inventoryItems != null) {
        oprot.writeFieldBegin(INVENTORY_ITEMS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.inventoryItems.size()));
          for (InventoryItem _iter112 : this.inventoryItems)
          {
            _iter112.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForOursThirdPartyReceive_args(");
      boolean first = true;

      sb.append("inventoryItems:");
      if (this.inventoryItems == null) {
        sb.append("null");
      } else {
        sb.append(this.inventoryItems);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForOursThirdPartyReceive_result implements org.apache.thrift.TBase<scanForOursThirdPartyReceive_result, scanForOursThirdPartyReceive_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForOursThirdPartyReceive_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForOursThirdPartyReceive_result.class, metaDataMap);
    }

    public scanForOursThirdPartyReceive_result() {
    }

    public scanForOursThirdPartyReceive_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForOursThirdPartyReceive_result(scanForOursThirdPartyReceive_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public scanForOursThirdPartyReceive_result deepCopy() {
      return new scanForOursThirdPartyReceive_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForOursThirdPartyReceive_result)
        return this.equals((scanForOursThirdPartyReceive_result)that);
      return false;
    }

    public boolean equals(scanForOursThirdPartyReceive_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForOursThirdPartyReceive_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForOursThirdPartyReceive_result typedOther = (scanForOursThirdPartyReceive_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForOursThirdPartyReceive_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args implements org.apache.thrift.TBase<getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args, getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField PHYSICAL_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("physicalWarehouseId", org.apache.thrift.protocol.TType.I64, (short)2);

    private long itemId; // required
    private long physicalWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_ID((short)1, "itemId"),
      PHYSICAL_WAREHOUSE_ID((short)2, "physicalWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_ID
            return ITEM_ID;
          case 2: // PHYSICAL_WAREHOUSE_ID
            return PHYSICAL_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private static final int __PHYSICALWAREHOUSEID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PHYSICAL_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("physicalWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args.class, metaDataMap);
    }

    public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args() {
    }

    public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args(
      long itemId,
      long physicalWarehouseId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.physicalWarehouseId = physicalWarehouseId;
      setPhysicalWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args(getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      this.physicalWarehouseId = other.physicalWarehouseId;
    }

    public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args deepCopy() {
      return new getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      setPhysicalWarehouseIdIsSet(false);
      this.physicalWarehouseId = 0;
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public long getPhysicalWarehouseId() {
      return this.physicalWarehouseId;
    }

    public void setPhysicalWarehouseId(long physicalWarehouseId) {
      this.physicalWarehouseId = physicalWarehouseId;
      setPhysicalWarehouseIdIsSet(true);
    }

    public void unsetPhysicalWarehouseId() {
      __isset_bit_vector.clear(__PHYSICALWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field physicalWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetPhysicalWarehouseId() {
      return __isset_bit_vector.get(__PHYSICALWAREHOUSEID_ISSET_ID);
    }

    public void setPhysicalWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__PHYSICALWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case PHYSICAL_WAREHOUSE_ID:
        if (value == null) {
          unsetPhysicalWarehouseId();
        } else {
          setPhysicalWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case PHYSICAL_WAREHOUSE_ID:
        return Long.valueOf(getPhysicalWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_ID:
        return isSetItemId();
      case PHYSICAL_WAREHOUSE_ID:
        return isSetPhysicalWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args)
        return this.equals((getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args)that);
      return false;
    }

    public boolean equals(getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      boolean this_present_physicalWarehouseId = true;
      boolean that_present_physicalWarehouseId = true;
      if (this_present_physicalWarehouseId || that_present_physicalWarehouseId) {
        if (!(this_present_physicalWarehouseId && that_present_physicalWarehouseId))
          return false;
        if (this.physicalWarehouseId != that.physicalWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args typedOther = (getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPhysicalWarehouseId()).compareTo(typedOther.isSetPhysicalWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPhysicalWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.physicalWarehouseId, typedOther.physicalWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // PHYSICAL_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.physicalWarehouseId = iprot.readI64();
              setPhysicalWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(PHYSICAL_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.physicalWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("physicalWarehouseId:");
      sb.append(this.physicalWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result implements org.apache.thrift.TBase<getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result, getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result.class, metaDataMap);
    }

    public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result() {
    }

    public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result(
      long success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result(getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result deepCopy() {
      return new getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.wex = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public void setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result)
        return this.equals((getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result)that);
      return false;
    }

    public boolean equals(getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result typedOther = (getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.success = iprot.readI64();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCurrentQuantityForNonSerializedInTransitItemInPhysicalWarehouse_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInTransitInventory_args implements org.apache.thrift.TBase<getInTransitInventory_args, getInTransitInventory_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInTransitInventory_args");

    private static final org.apache.thrift.protocol.TField ORIGIN_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("originWarehouseId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long originWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ORIGIN_WAREHOUSE_ID((short)1, "originWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ORIGIN_WAREHOUSE_ID
            return ORIGIN_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORIGINWAREHOUSEID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ORIGIN_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("originWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInTransitInventory_args.class, metaDataMap);
    }

    public getInTransitInventory_args() {
    }

    public getInTransitInventory_args(
      long originWarehouseId)
    {
      this();
      this.originWarehouseId = originWarehouseId;
      setOriginWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInTransitInventory_args(getInTransitInventory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.originWarehouseId = other.originWarehouseId;
    }

    public getInTransitInventory_args deepCopy() {
      return new getInTransitInventory_args(this);
    }

    @Override
    public void clear() {
      setOriginWarehouseIdIsSet(false);
      this.originWarehouseId = 0;
    }

    public long getOriginWarehouseId() {
      return this.originWarehouseId;
    }

    public void setOriginWarehouseId(long originWarehouseId) {
      this.originWarehouseId = originWarehouseId;
      setOriginWarehouseIdIsSet(true);
    }

    public void unsetOriginWarehouseId() {
      __isset_bit_vector.clear(__ORIGINWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field originWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetOriginWarehouseId() {
      return __isset_bit_vector.get(__ORIGINWAREHOUSEID_ISSET_ID);
    }

    public void setOriginWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORIGINWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORIGIN_WAREHOUSE_ID:
        if (value == null) {
          unsetOriginWarehouseId();
        } else {
          setOriginWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORIGIN_WAREHOUSE_ID:
        return Long.valueOf(getOriginWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ORIGIN_WAREHOUSE_ID:
        return isSetOriginWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInTransitInventory_args)
        return this.equals((getInTransitInventory_args)that);
      return false;
    }

    public boolean equals(getInTransitInventory_args that) {
      if (that == null)
        return false;

      boolean this_present_originWarehouseId = true;
      boolean that_present_originWarehouseId = true;
      if (this_present_originWarehouseId || that_present_originWarehouseId) {
        if (!(this_present_originWarehouseId && that_present_originWarehouseId))
          return false;
        if (this.originWarehouseId != that.originWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInTransitInventory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInTransitInventory_args typedOther = (getInTransitInventory_args)other;

      lastComparison = Boolean.valueOf(isSetOriginWarehouseId()).compareTo(typedOther.isSetOriginWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOriginWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.originWarehouseId, typedOther.originWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ORIGIN_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.originWarehouseId = iprot.readI64();
              setOriginWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORIGIN_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.originWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInTransitInventory_args(");
      boolean first = true;

      sb.append("originWarehouseId:");
      sb.append(this.originWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInTransitInventory_result implements org.apache.thrift.TBase<getInTransitInventory_result, getInTransitInventory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInTransitInventory_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InTransitInventory> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InTransitInventory.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInTransitInventory_result.class, metaDataMap);
    }

    public getInTransitInventory_result() {
    }

    public getInTransitInventory_result(
      List<InTransitInventory> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInTransitInventory_result(getInTransitInventory_result other) {
      if (other.isSetSuccess()) {
        List<InTransitInventory> __this__success = new ArrayList<InTransitInventory>();
        for (InTransitInventory other_element : other.success) {
          __this__success.add(new InTransitInventory(other_element));
        }
        this.success = __this__success;
      }
    }

    public getInTransitInventory_result deepCopy() {
      return new getInTransitInventory_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InTransitInventory> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InTransitInventory elem) {
      if (this.success == null) {
        this.success = new ArrayList<InTransitInventory>();
      }
      this.success.add(elem);
    }

    public List<InTransitInventory> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InTransitInventory> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InTransitInventory>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInTransitInventory_result)
        return this.equals((getInTransitInventory_result)that);
      return false;
    }

    public boolean equals(getInTransitInventory_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInTransitInventory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInTransitInventory_result typedOther = (getInTransitInventory_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list113 = iprot.readListBegin();
                this.success = new ArrayList<InTransitInventory>(_list113.size);
                for (int _i114 = 0; _i114 < _list113.size; ++_i114)
                {
                  InTransitInventory _elem115; // required
                  _elem115 = new InTransitInventory();
                  _elem115.read(iprot);
                  this.success.add(_elem115);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InTransitInventory _iter116 : this.success)
          {
            _iter116.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInTransitInventory_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class isItemAvailableForSale_args implements org.apache.thrift.TBase<isItemAvailableForSale_args, isItemAvailableForSale_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isItemAvailableForSale_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SERIAL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("serialNumber", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)3);

    private long itemId; // required
    private String serialNumber; // required
    private long warehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_ID((short)1, "itemId"),
      SERIAL_NUMBER((short)2, "serialNumber"),
      WAREHOUSE_ID((short)3, "warehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_ID
            return ITEM_ID;
          case 2: // SERIAL_NUMBER
            return SERIAL_NUMBER;
          case 3: // WAREHOUSE_ID
            return WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private static final int __WAREHOUSEID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SERIAL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("serialNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isItemAvailableForSale_args.class, metaDataMap);
    }

    public isItemAvailableForSale_args() {
    }

    public isItemAvailableForSale_args(
      long itemId,
      String serialNumber,
      long warehouseId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.serialNumber = serialNumber;
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public isItemAvailableForSale_args(isItemAvailableForSale_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      if (other.isSetSerialNumber()) {
        this.serialNumber = other.serialNumber;
      }
      this.warehouseId = other.warehouseId;
    }

    public isItemAvailableForSale_args deepCopy() {
      return new isItemAvailableForSale_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      this.serialNumber = null;
      setWarehouseIdIsSet(false);
      this.warehouseId = 0;
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public String getSerialNumber() {
      return this.serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
      this.serialNumber = serialNumber;
    }

    public void unsetSerialNumber() {
      this.serialNumber = null;
    }

    /** Returns true if field serialNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetSerialNumber() {
      return this.serialNumber != null;
    }

    public void setSerialNumberIsSet(boolean value) {
      if (!value) {
        this.serialNumber = null;
      }
    }

    public long getWarehouseId() {
      return this.warehouseId;
    }

    public void setWarehouseId(long warehouseId) {
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
    }

    public void unsetWarehouseId() {
      __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field warehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouseId() {
      return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
    }

    public void setWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case SERIAL_NUMBER:
        if (value == null) {
          unsetSerialNumber();
        } else {
          setSerialNumber((String)value);
        }
        break;

      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouseId();
        } else {
          setWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case SERIAL_NUMBER:
        return getSerialNumber();

      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_ID:
        return isSetItemId();
      case SERIAL_NUMBER:
        return isSetSerialNumber();
      case WAREHOUSE_ID:
        return isSetWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof isItemAvailableForSale_args)
        return this.equals((isItemAvailableForSale_args)that);
      return false;
    }

    public boolean equals(isItemAvailableForSale_args that) {
      if (that == null)
        return false;

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      boolean this_present_serialNumber = true && this.isSetSerialNumber();
      boolean that_present_serialNumber = true && that.isSetSerialNumber();
      if (this_present_serialNumber || that_present_serialNumber) {
        if (!(this_present_serialNumber && that_present_serialNumber))
          return false;
        if (!this.serialNumber.equals(that.serialNumber))
          return false;
      }

      boolean this_present_warehouseId = true;
      boolean that_present_warehouseId = true;
      if (this_present_warehouseId || that_present_warehouseId) {
        if (!(this_present_warehouseId && that_present_warehouseId))
          return false;
        if (this.warehouseId != that.warehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(isItemAvailableForSale_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      isItemAvailableForSale_args typedOther = (isItemAvailableForSale_args)other;

      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSerialNumber()).compareTo(typedOther.isSetSerialNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSerialNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialNumber, typedOther.serialNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(typedOther.isSetWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // SERIAL_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.serialNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.warehouseId = iprot.readI64();
              setWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      if (this.serialNumber != null) {
        oprot.writeFieldBegin(SERIAL_NUMBER_FIELD_DESC);
        oprot.writeString(this.serialNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("isItemAvailableForSale_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("serialNumber:");
      if (this.serialNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.serialNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("warehouseId:");
      sb.append(this.warehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class isItemAvailableForSale_result implements org.apache.thrift.TBase<isItemAvailableForSale_result, isItemAvailableForSale_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isItemAvailableForSale_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private boolean success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isItemAvailableForSale_result.class, metaDataMap);
    }

    public isItemAvailableForSale_result() {
    }

    public isItemAvailableForSale_result(
      boolean success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public isItemAvailableForSale_result(isItemAvailableForSale_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public isItemAvailableForSale_result deepCopy() {
      return new isItemAvailableForSale_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
      this.wex = null;
    }

    public boolean isSuccess() {
      return this.success;
    }

    public void setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Boolean.valueOf(isSuccess());

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof isItemAvailableForSale_result)
        return this.equals((isItemAvailableForSale_result)that);
      return false;
    }

    public boolean equals(isItemAvailableForSale_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(isItemAvailableForSale_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      isItemAvailableForSale_result typedOther = (isItemAvailableForSale_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.success = iprot.readBool();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("isItemAvailableForSale_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getHistoricBadInventoryByScans_args implements org.apache.thrift.TBase<getHistoricBadInventoryByScans_args, getHistoricBadInventoryByScans_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getHistoricBadInventoryByScans_args");

    private static final org.apache.thrift.protocol.TField DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("date", org.apache.thrift.protocol.TType.I64, (short)1);

    private long date; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      DATE((short)1, "date");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DATE
            return DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __DATE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DATE, new org.apache.thrift.meta_data.FieldMetaData("date", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getHistoricBadInventoryByScans_args.class, metaDataMap);
    }

    public getHistoricBadInventoryByScans_args() {
    }

    public getHistoricBadInventoryByScans_args(
      long date)
    {
      this();
      this.date = date;
      setDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getHistoricBadInventoryByScans_args(getHistoricBadInventoryByScans_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.date = other.date;
    }

    public getHistoricBadInventoryByScans_args deepCopy() {
      return new getHistoricBadInventoryByScans_args(this);
    }

    @Override
    public void clear() {
      setDateIsSet(false);
      this.date = 0;
    }

    public long getDate() {
      return this.date;
    }

    public void setDate(long date) {
      this.date = date;
      setDateIsSet(true);
    }

    public void unsetDate() {
      __isset_bit_vector.clear(__DATE_ISSET_ID);
    }

    /** Returns true if field date is set (has been assigned a value) and false otherwise */
    public boolean isSetDate() {
      return __isset_bit_vector.get(__DATE_ISSET_ID);
    }

    public void setDateIsSet(boolean value) {
      __isset_bit_vector.set(__DATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DATE:
        if (value == null) {
          unsetDate();
        } else {
          setDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DATE:
        return Long.valueOf(getDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DATE:
        return isSetDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getHistoricBadInventoryByScans_args)
        return this.equals((getHistoricBadInventoryByScans_args)that);
      return false;
    }

    public boolean equals(getHistoricBadInventoryByScans_args that) {
      if (that == null)
        return false;

      boolean this_present_date = true;
      boolean that_present_date = true;
      if (this_present_date || that_present_date) {
        if (!(this_present_date && that_present_date))
          return false;
        if (this.date != that.date)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getHistoricBadInventoryByScans_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getHistoricBadInventoryByScans_args typedOther = (getHistoricBadInventoryByScans_args)other;

      lastComparison = Boolean.valueOf(isSetDate()).compareTo(typedOther.isSetDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.date, typedOther.date);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.date = iprot.readI64();
              setDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(DATE_FIELD_DESC);
      oprot.writeI64(this.date);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getHistoricBadInventoryByScans_args(");
      boolean first = true;

      sb.append("date:");
      sb.append(this.date);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getHistoricBadInventoryByScans_result implements org.apache.thrift.TBase<getHistoricBadInventoryByScans_result, getHistoricBadInventoryByScans_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getHistoricBadInventoryByScans_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<InventoryAvailability> success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryAvailability.class))));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getHistoricBadInventoryByScans_result.class, metaDataMap);
    }

    public getHistoricBadInventoryByScans_result() {
    }

    public getHistoricBadInventoryByScans_result(
      List<InventoryAvailability> success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getHistoricBadInventoryByScans_result(getHistoricBadInventoryByScans_result other) {
      if (other.isSetSuccess()) {
        List<InventoryAvailability> __this__success = new ArrayList<InventoryAvailability>();
        for (InventoryAvailability other_element : other.success) {
          __this__success.add(new InventoryAvailability(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getHistoricBadInventoryByScans_result deepCopy() {
      return new getHistoricBadInventoryByScans_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryAvailability> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryAvailability elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryAvailability>();
      }
      this.success.add(elem);
    }

    public List<InventoryAvailability> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryAvailability> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryAvailability>)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getHistoricBadInventoryByScans_result)
        return this.equals((getHistoricBadInventoryByScans_result)that);
      return false;
    }

    public boolean equals(getHistoricBadInventoryByScans_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getHistoricBadInventoryByScans_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getHistoricBadInventoryByScans_result typedOther = (getHistoricBadInventoryByScans_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list117 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAvailability>(_list117.size);
                for (int _i118 = 0; _i118 < _list117.size; ++_i118)
                {
                  InventoryAvailability _elem119; // required
                  _elem119 = new InventoryAvailability();
                  _elem119.read(iprot);
                  this.success.add(_elem119);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryAvailability _iter120 : this.success)
          {
            _iter120.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getHistoricBadInventoryByScans_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForBadSale_args implements org.apache.thrift.TBase<scanForBadSale_args, scanForBadSale_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForBadSale_args");

    private static final org.apache.thrift.protocol.TField SERIAL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("serialNumber", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField ITEM_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("itemNumber", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)4);
    private static final org.apache.thrift.protocol.TField FULFILMENT_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fulfilmentWarehouseId", org.apache.thrift.protocol.TType.I64, (short)5);
    private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.I64, (short)6);
    private static final org.apache.thrift.protocol.TField BILLING_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("billingWarehouseId", org.apache.thrift.protocol.TType.I64, (short)7);

    private String serialNumber; // required
    private String itemNumber; // required
    private long itemId; // required
    private long orderId; // required
    private long fulfilmentWarehouseId; // required
    private long quantity; // required
    private long billingWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SERIAL_NUMBER((short)1, "serialNumber"),
      ITEM_NUMBER((short)2, "itemNumber"),
      ITEM_ID((short)3, "itemId"),
      ORDER_ID((short)4, "orderId"),
      FULFILMENT_WAREHOUSE_ID((short)5, "fulfilmentWarehouseId"),
      QUANTITY((short)6, "quantity"),
      BILLING_WAREHOUSE_ID((short)7, "billingWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SERIAL_NUMBER
            return SERIAL_NUMBER;
          case 2: // ITEM_NUMBER
            return ITEM_NUMBER;
          case 3: // ITEM_ID
            return ITEM_ID;
          case 4: // ORDER_ID
            return ORDER_ID;
          case 5: // FULFILMENT_WAREHOUSE_ID
            return FULFILMENT_WAREHOUSE_ID;
          case 6: // QUANTITY
            return QUANTITY;
          case 7: // BILLING_WAREHOUSE_ID
            return BILLING_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private static final int __ORDERID_ISSET_ID = 1;
    private static final int __FULFILMENTWAREHOUSEID_ISSET_ID = 2;
    private static final int __QUANTITY_ISSET_ID = 3;
    private static final int __BILLINGWAREHOUSEID_ISSET_ID = 4;
    private BitSet __isset_bit_vector = new BitSet(5);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SERIAL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("serialNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.ITEM_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("itemNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FULFILMENT_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("fulfilmentWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BILLING_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("billingWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForBadSale_args.class, metaDataMap);
    }

    public scanForBadSale_args() {
    }

    public scanForBadSale_args(
      String serialNumber,
      String itemNumber,
      long itemId,
      long orderId,
      long fulfilmentWarehouseId,
      long quantity,
      long billingWarehouseId)
    {
      this();
      this.serialNumber = serialNumber;
      this.itemNumber = itemNumber;
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.fulfilmentWarehouseId = fulfilmentWarehouseId;
      setFulfilmentWarehouseIdIsSet(true);
      this.quantity = quantity;
      setQuantityIsSet(true);
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForBadSale_args(scanForBadSale_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetSerialNumber()) {
        this.serialNumber = other.serialNumber;
      }
      if (other.isSetItemNumber()) {
        this.itemNumber = other.itemNumber;
      }
      this.itemId = other.itemId;
      this.orderId = other.orderId;
      this.fulfilmentWarehouseId = other.fulfilmentWarehouseId;
      this.quantity = other.quantity;
      this.billingWarehouseId = other.billingWarehouseId;
    }

    public scanForBadSale_args deepCopy() {
      return new scanForBadSale_args(this);
    }

    @Override
    public void clear() {
      this.serialNumber = null;
      this.itemNumber = null;
      setItemIdIsSet(false);
      this.itemId = 0;
      setOrderIdIsSet(false);
      this.orderId = 0;
      setFulfilmentWarehouseIdIsSet(false);
      this.fulfilmentWarehouseId = 0;
      setQuantityIsSet(false);
      this.quantity = 0;
      setBillingWarehouseIdIsSet(false);
      this.billingWarehouseId = 0;
    }

    public String getSerialNumber() {
      return this.serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
      this.serialNumber = serialNumber;
    }

    public void unsetSerialNumber() {
      this.serialNumber = null;
    }

    /** Returns true if field serialNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetSerialNumber() {
      return this.serialNumber != null;
    }

    public void setSerialNumberIsSet(boolean value) {
      if (!value) {
        this.serialNumber = null;
      }
    }

    public String getItemNumber() {
      return this.itemNumber;
    }

    public void setItemNumber(String itemNumber) {
      this.itemNumber = itemNumber;
    }

    public void unsetItemNumber() {
      this.itemNumber = null;
    }

    /** Returns true if field itemNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetItemNumber() {
      return this.itemNumber != null;
    }

    public void setItemNumberIsSet(boolean value) {
      if (!value) {
        this.itemNumber = null;
      }
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public void setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public long getFulfilmentWarehouseId() {
      return this.fulfilmentWarehouseId;
    }

    public void setFulfilmentWarehouseId(long fulfilmentWarehouseId) {
      this.fulfilmentWarehouseId = fulfilmentWarehouseId;
      setFulfilmentWarehouseIdIsSet(true);
    }

    public void unsetFulfilmentWarehouseId() {
      __isset_bit_vector.clear(__FULFILMENTWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field fulfilmentWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetFulfilmentWarehouseId() {
      return __isset_bit_vector.get(__FULFILMENTWAREHOUSEID_ISSET_ID);
    }

    public void setFulfilmentWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__FULFILMENTWAREHOUSEID_ISSET_ID, value);
    }

    public long getQuantity() {
      return this.quantity;
    }

    public void setQuantity(long quantity) {
      this.quantity = quantity;
      setQuantityIsSet(true);
    }

    public void unsetQuantity() {
      __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
    }

    /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
    public boolean isSetQuantity() {
      return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
    }

    public void setQuantityIsSet(boolean value) {
      __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
    }

    public long getBillingWarehouseId() {
      return this.billingWarehouseId;
    }

    public void setBillingWarehouseId(long billingWarehouseId) {
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    public void unsetBillingWarehouseId() {
      __isset_bit_vector.clear(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field billingWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetBillingWarehouseId() {
      return __isset_bit_vector.get(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    public void setBillingWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__BILLINGWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SERIAL_NUMBER:
        if (value == null) {
          unsetSerialNumber();
        } else {
          setSerialNumber((String)value);
        }
        break;

      case ITEM_NUMBER:
        if (value == null) {
          unsetItemNumber();
        } else {
          setItemNumber((String)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case FULFILMENT_WAREHOUSE_ID:
        if (value == null) {
          unsetFulfilmentWarehouseId();
        } else {
          setFulfilmentWarehouseId((Long)value);
        }
        break;

      case QUANTITY:
        if (value == null) {
          unsetQuantity();
        } else {
          setQuantity((Long)value);
        }
        break;

      case BILLING_WAREHOUSE_ID:
        if (value == null) {
          unsetBillingWarehouseId();
        } else {
          setBillingWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SERIAL_NUMBER:
        return getSerialNumber();

      case ITEM_NUMBER:
        return getItemNumber();

      case ITEM_ID:
        return Long.valueOf(getItemId());

      case ORDER_ID:
        return Long.valueOf(getOrderId());

      case FULFILMENT_WAREHOUSE_ID:
        return Long.valueOf(getFulfilmentWarehouseId());

      case QUANTITY:
        return Long.valueOf(getQuantity());

      case BILLING_WAREHOUSE_ID:
        return Long.valueOf(getBillingWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SERIAL_NUMBER:
        return isSetSerialNumber();
      case ITEM_NUMBER:
        return isSetItemNumber();
      case ITEM_ID:
        return isSetItemId();
      case ORDER_ID:
        return isSetOrderId();
      case FULFILMENT_WAREHOUSE_ID:
        return isSetFulfilmentWarehouseId();
      case QUANTITY:
        return isSetQuantity();
      case BILLING_WAREHOUSE_ID:
        return isSetBillingWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForBadSale_args)
        return this.equals((scanForBadSale_args)that);
      return false;
    }

    public boolean equals(scanForBadSale_args that) {
      if (that == null)
        return false;

      boolean this_present_serialNumber = true && this.isSetSerialNumber();
      boolean that_present_serialNumber = true && that.isSetSerialNumber();
      if (this_present_serialNumber || that_present_serialNumber) {
        if (!(this_present_serialNumber && that_present_serialNumber))
          return false;
        if (!this.serialNumber.equals(that.serialNumber))
          return false;
      }

      boolean this_present_itemNumber = true && this.isSetItemNumber();
      boolean that_present_itemNumber = true && that.isSetItemNumber();
      if (this_present_itemNumber || that_present_itemNumber) {
        if (!(this_present_itemNumber && that_present_itemNumber))
          return false;
        if (!this.itemNumber.equals(that.itemNumber))
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_fulfilmentWarehouseId = true;
      boolean that_present_fulfilmentWarehouseId = true;
      if (this_present_fulfilmentWarehouseId || that_present_fulfilmentWarehouseId) {
        if (!(this_present_fulfilmentWarehouseId && that_present_fulfilmentWarehouseId))
          return false;
        if (this.fulfilmentWarehouseId != that.fulfilmentWarehouseId)
          return false;
      }

      boolean this_present_quantity = true;
      boolean that_present_quantity = true;
      if (this_present_quantity || that_present_quantity) {
        if (!(this_present_quantity && that_present_quantity))
          return false;
        if (this.quantity != that.quantity)
          return false;
      }

      boolean this_present_billingWarehouseId = true;
      boolean that_present_billingWarehouseId = true;
      if (this_present_billingWarehouseId || that_present_billingWarehouseId) {
        if (!(this_present_billingWarehouseId && that_present_billingWarehouseId))
          return false;
        if (this.billingWarehouseId != that.billingWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForBadSale_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForBadSale_args typedOther = (scanForBadSale_args)other;

      lastComparison = Boolean.valueOf(isSetSerialNumber()).compareTo(typedOther.isSetSerialNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSerialNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialNumber, typedOther.serialNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetItemNumber()).compareTo(typedOther.isSetItemNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemNumber, typedOther.itemNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFulfilmentWarehouseId()).compareTo(typedOther.isSetFulfilmentWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFulfilmentWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fulfilmentWarehouseId, typedOther.fulfilmentWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetQuantity()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBillingWarehouseId()).compareTo(typedOther.isSetBillingWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBillingWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.billingWarehouseId, typedOther.billingWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SERIAL_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.serialNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // ITEM_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.itemNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.orderId = iprot.readI64();
              setOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // FULFILMENT_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.fulfilmentWarehouseId = iprot.readI64();
              setFulfilmentWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 6: // QUANTITY
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.quantity = iprot.readI64();
              setQuantityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 7: // BILLING_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.billingWarehouseId = iprot.readI64();
              setBillingWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.serialNumber != null) {
        oprot.writeFieldBegin(SERIAL_NUMBER_FIELD_DESC);
        oprot.writeString(this.serialNumber);
        oprot.writeFieldEnd();
      }
      if (this.itemNumber != null) {
        oprot.writeFieldBegin(ITEM_NUMBER_FIELD_DESC);
        oprot.writeString(this.itemNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FULFILMENT_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.fulfilmentWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
      oprot.writeI64(this.quantity);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BILLING_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.billingWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForBadSale_args(");
      boolean first = true;

      sb.append("serialNumber:");
      if (this.serialNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.serialNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemNumber:");
      if (this.itemNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.itemNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("fulfilmentWarehouseId:");
      sb.append(this.fulfilmentWarehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("quantity:");
      sb.append(this.quantity);
      first = false;
      if (!first) sb.append(", ");
      sb.append("billingWarehouseId:");
      sb.append(this.billingWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForBadSale_result implements org.apache.thrift.TBase<scanForBadSale_result, scanForBadSale_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForBadSale_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryItem success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForBadSale_result.class, metaDataMap);
    }

    public scanForBadSale_result() {
    }

    public scanForBadSale_result(
      InventoryItem success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForBadSale_result(scanForBadSale_result other) {
      if (other.isSetSuccess()) {
        this.success = new InventoryItem(other.success);
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public scanForBadSale_result deepCopy() {
      return new scanForBadSale_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public InventoryItem getSuccess() {
      return this.success;
    }

    public void setSuccess(InventoryItem success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((InventoryItem)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForBadSale_result)
        return this.equals((scanForBadSale_result)that);
      return false;
    }

    public boolean equals(scanForBadSale_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForBadSale_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForBadSale_result typedOther = (scanForBadSale_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new InventoryItem();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForBadSale_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getTransferLotItemsForMarkReceive_args implements org.apache.thrift.TBase<getTransferLotItemsForMarkReceive_args, getTransferLotItemsForMarkReceive_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTransferLotItemsForMarkReceive_args");

    private static final org.apache.thrift.protocol.TField TRANSFER_LOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transferLotId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SCAN_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scanType", org.apache.thrift.protocol.TType.I32, (short)2);

    private long transferLotId; // required
    private ScanType scanType; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      TRANSFER_LOT_ID((short)1, "transferLotId"),
      /**
       * 
       * @see ScanType
       */
      SCAN_TYPE((short)2, "scanType");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // TRANSFER_LOT_ID
            return TRANSFER_LOT_ID;
          case 2: // SCAN_TYPE
            return SCAN_TYPE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TRANSFERLOTID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.TRANSFER_LOT_ID, new org.apache.thrift.meta_data.FieldMetaData("transferLotId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SCAN_TYPE, new org.apache.thrift.meta_data.FieldMetaData("scanType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTransferLotItemsForMarkReceive_args.class, metaDataMap);
    }

    public getTransferLotItemsForMarkReceive_args() {
    }

    public getTransferLotItemsForMarkReceive_args(
      long transferLotId,
      ScanType scanType)
    {
      this();
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
      this.scanType = scanType;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransferLotItemsForMarkReceive_args(getTransferLotItemsForMarkReceive_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.transferLotId = other.transferLotId;
      if (other.isSetScanType()) {
        this.scanType = other.scanType;
      }
    }

    public getTransferLotItemsForMarkReceive_args deepCopy() {
      return new getTransferLotItemsForMarkReceive_args(this);
    }

    @Override
    public void clear() {
      setTransferLotIdIsSet(false);
      this.transferLotId = 0;
      this.scanType = null;
    }

    public long getTransferLotId() {
      return this.transferLotId;
    }

    public void setTransferLotId(long transferLotId) {
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    public void unsetTransferLotId() {
      __isset_bit_vector.clear(__TRANSFERLOTID_ISSET_ID);
    }

    /** Returns true if field transferLotId is set (has been assigned a value) and false otherwise */
    public boolean isSetTransferLotId() {
      return __isset_bit_vector.get(__TRANSFERLOTID_ISSET_ID);
    }

    public void setTransferLotIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSFERLOTID_ISSET_ID, value);
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getScanType() {
      return this.scanType;
    }

    /**
     * 
     * @see ScanType
     */
    public void setScanType(ScanType scanType) {
      this.scanType = scanType;
    }

    public void unsetScanType() {
      this.scanType = null;
    }

    /** Returns true if field scanType is set (has been assigned a value) and false otherwise */
    public boolean isSetScanType() {
      return this.scanType != null;
    }

    public void setScanTypeIsSet(boolean value) {
      if (!value) {
        this.scanType = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TRANSFER_LOT_ID:
        if (value == null) {
          unsetTransferLotId();
        } else {
          setTransferLotId((Long)value);
        }
        break;

      case SCAN_TYPE:
        if (value == null) {
          unsetScanType();
        } else {
          setScanType((ScanType)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TRANSFER_LOT_ID:
        return Long.valueOf(getTransferLotId());

      case SCAN_TYPE:
        return getScanType();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case TRANSFER_LOT_ID:
        return isSetTransferLotId();
      case SCAN_TYPE:
        return isSetScanType();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getTransferLotItemsForMarkReceive_args)
        return this.equals((getTransferLotItemsForMarkReceive_args)that);
      return false;
    }

    public boolean equals(getTransferLotItemsForMarkReceive_args that) {
      if (that == null)
        return false;

      boolean this_present_transferLotId = true;
      boolean that_present_transferLotId = true;
      if (this_present_transferLotId || that_present_transferLotId) {
        if (!(this_present_transferLotId && that_present_transferLotId))
          return false;
        if (this.transferLotId != that.transferLotId)
          return false;
      }

      boolean this_present_scanType = true && this.isSetScanType();
      boolean that_present_scanType = true && that.isSetScanType();
      if (this_present_scanType || that_present_scanType) {
        if (!(this_present_scanType && that_present_scanType))
          return false;
        if (!this.scanType.equals(that.scanType))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getTransferLotItemsForMarkReceive_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getTransferLotItemsForMarkReceive_args typedOther = (getTransferLotItemsForMarkReceive_args)other;

      lastComparison = Boolean.valueOf(isSetTransferLotId()).compareTo(typedOther.isSetTransferLotId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTransferLotId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferLotId, typedOther.transferLotId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetScanType()).compareTo(typedOther.isSetScanType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetScanType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scanType, typedOther.scanType);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // TRANSFER_LOT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.transferLotId = iprot.readI64();
              setTransferLotIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // SCAN_TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.scanType = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TRANSFER_LOT_ID_FIELD_DESC);
      oprot.writeI64(this.transferLotId);
      oprot.writeFieldEnd();
      if (this.scanType != null) {
        oprot.writeFieldBegin(SCAN_TYPE_FIELD_DESC);
        oprot.writeI32(this.scanType.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getTransferLotItemsForMarkReceive_args(");
      boolean first = true;

      sb.append("transferLotId:");
      sb.append(this.transferLotId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("scanType:");
      if (this.scanType == null) {
        sb.append("null");
      } else {
        sb.append(this.scanType);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getTransferLotItemsForMarkReceive_result implements org.apache.thrift.TBase<getTransferLotItemsForMarkReceive_result, getTransferLotItemsForMarkReceive_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTransferLotItemsForMarkReceive_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<InventoryItem> success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTransferLotItemsForMarkReceive_result.class, metaDataMap);
    }

    public getTransferLotItemsForMarkReceive_result() {
    }

    public getTransferLotItemsForMarkReceive_result(
      List<InventoryItem> success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransferLotItemsForMarkReceive_result(getTransferLotItemsForMarkReceive_result other) {
      if (other.isSetSuccess()) {
        List<InventoryItem> __this__success = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.success) {
          __this__success.add(new InventoryItem(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getTransferLotItemsForMarkReceive_result deepCopy() {
      return new getTransferLotItemsForMarkReceive_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryItem> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryItem elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryItem>();
      }
      this.success.add(elem);
    }

    public List<InventoryItem> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryItem> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryItem>)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getTransferLotItemsForMarkReceive_result)
        return this.equals((getTransferLotItemsForMarkReceive_result)that);
      return false;
    }

    public boolean equals(getTransferLotItemsForMarkReceive_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getTransferLotItemsForMarkReceive_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getTransferLotItemsForMarkReceive_result typedOther = (getTransferLotItemsForMarkReceive_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list121 = iprot.readListBegin();
                this.success = new ArrayList<InventoryItem>(_list121.size);
                for (int _i122 = 0; _i122 < _list121.size; ++_i122)
                {
                  InventoryItem _elem123; // required
                  _elem123 = new InventoryItem();
                  _elem123.read(iprot);
                  this.success.add(_elem123);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryItem _iter124 : this.success)
          {
            _iter124.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getTransferLotItemsForMarkReceive_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markItemsAsReceivedForTransferLotPartial_args implements org.apache.thrift.TBase<markItemsAsReceivedForTransferLotPartial_args, markItemsAsReceivedForTransferLotPartial_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markItemsAsReceivedForTransferLotPartial_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItems", org.apache.thrift.protocol.TType.LIST, (short)1);
    private static final org.apache.thrift.protocol.TField TRANSFER_LOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transferLotId", org.apache.thrift.protocol.TType.I64, (short)2);

    private List<InventoryItem> inventoryItems; // required
    private long transferLotId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEMS((short)1, "inventoryItems"),
      TRANSFER_LOT_ID((short)2, "transferLotId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEMS
            return INVENTORY_ITEMS;
          case 2: // TRANSFER_LOT_ID
            return TRANSFER_LOT_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TRANSFERLOTID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("inventoryItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.TRANSFER_LOT_ID, new org.apache.thrift.meta_data.FieldMetaData("transferLotId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markItemsAsReceivedForTransferLotPartial_args.class, metaDataMap);
    }

    public markItemsAsReceivedForTransferLotPartial_args() {
    }

    public markItemsAsReceivedForTransferLotPartial_args(
      List<InventoryItem> inventoryItems,
      long transferLotId)
    {
      this();
      this.inventoryItems = inventoryItems;
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markItemsAsReceivedForTransferLotPartial_args(markItemsAsReceivedForTransferLotPartial_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetInventoryItems()) {
        List<InventoryItem> __this__inventoryItems = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.inventoryItems) {
          __this__inventoryItems.add(new InventoryItem(other_element));
        }
        this.inventoryItems = __this__inventoryItems;
      }
      this.transferLotId = other.transferLotId;
    }

    public markItemsAsReceivedForTransferLotPartial_args deepCopy() {
      return new markItemsAsReceivedForTransferLotPartial_args(this);
    }

    @Override
    public void clear() {
      this.inventoryItems = null;
      setTransferLotIdIsSet(false);
      this.transferLotId = 0;
    }

    public int getInventoryItemsSize() {
      return (this.inventoryItems == null) ? 0 : this.inventoryItems.size();
    }

    public java.util.Iterator<InventoryItem> getInventoryItemsIterator() {
      return (this.inventoryItems == null) ? null : this.inventoryItems.iterator();
    }

    public void addToInventoryItems(InventoryItem elem) {
      if (this.inventoryItems == null) {
        this.inventoryItems = new ArrayList<InventoryItem>();
      }
      this.inventoryItems.add(elem);
    }

    public List<InventoryItem> getInventoryItems() {
      return this.inventoryItems;
    }

    public void setInventoryItems(List<InventoryItem> inventoryItems) {
      this.inventoryItems = inventoryItems;
    }

    public void unsetInventoryItems() {
      this.inventoryItems = null;
    }

    /** Returns true if field inventoryItems is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItems() {
      return this.inventoryItems != null;
    }

    public void setInventoryItemsIsSet(boolean value) {
      if (!value) {
        this.inventoryItems = null;
      }
    }

    public long getTransferLotId() {
      return this.transferLotId;
    }

    public void setTransferLotId(long transferLotId) {
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    public void unsetTransferLotId() {
      __isset_bit_vector.clear(__TRANSFERLOTID_ISSET_ID);
    }

    /** Returns true if field transferLotId is set (has been assigned a value) and false otherwise */
    public boolean isSetTransferLotId() {
      return __isset_bit_vector.get(__TRANSFERLOTID_ISSET_ID);
    }

    public void setTransferLotIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSFERLOTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEMS:
        if (value == null) {
          unsetInventoryItems();
        } else {
          setInventoryItems((List<InventoryItem>)value);
        }
        break;

      case TRANSFER_LOT_ID:
        if (value == null) {
          unsetTransferLotId();
        } else {
          setTransferLotId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEMS:
        return getInventoryItems();

      case TRANSFER_LOT_ID:
        return Long.valueOf(getTransferLotId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEMS:
        return isSetInventoryItems();
      case TRANSFER_LOT_ID:
        return isSetTransferLotId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markItemsAsReceivedForTransferLotPartial_args)
        return this.equals((markItemsAsReceivedForTransferLotPartial_args)that);
      return false;
    }

    public boolean equals(markItemsAsReceivedForTransferLotPartial_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItems = true && this.isSetInventoryItems();
      boolean that_present_inventoryItems = true && that.isSetInventoryItems();
      if (this_present_inventoryItems || that_present_inventoryItems) {
        if (!(this_present_inventoryItems && that_present_inventoryItems))
          return false;
        if (!this.inventoryItems.equals(that.inventoryItems))
          return false;
      }

      boolean this_present_transferLotId = true;
      boolean that_present_transferLotId = true;
      if (this_present_transferLotId || that_present_transferLotId) {
        if (!(this_present_transferLotId && that_present_transferLotId))
          return false;
        if (this.transferLotId != that.transferLotId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markItemsAsReceivedForTransferLotPartial_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markItemsAsReceivedForTransferLotPartial_args typedOther = (markItemsAsReceivedForTransferLotPartial_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItems()).compareTo(typedOther.isSetInventoryItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItems, typedOther.inventoryItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTransferLotId()).compareTo(typedOther.isSetTransferLotId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTransferLotId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferLotId, typedOther.transferLotId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list125 = iprot.readListBegin();
                this.inventoryItems = new ArrayList<InventoryItem>(_list125.size);
                for (int _i126 = 0; _i126 < _list125.size; ++_i126)
                {
                  InventoryItem _elem127; // required
                  _elem127 = new InventoryItem();
                  _elem127.read(iprot);
                  this.inventoryItems.add(_elem127);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TRANSFER_LOT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.transferLotId = iprot.readI64();
              setTransferLotIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.inventoryItems != null) {
        oprot.writeFieldBegin(INVENTORY_ITEMS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.inventoryItems.size()));
          for (InventoryItem _iter128 : this.inventoryItems)
          {
            _iter128.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(TRANSFER_LOT_ID_FIELD_DESC);
      oprot.writeI64(this.transferLotId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markItemsAsReceivedForTransferLotPartial_args(");
      boolean first = true;

      sb.append("inventoryItems:");
      if (this.inventoryItems == null) {
        sb.append("null");
      } else {
        sb.append(this.inventoryItems);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("transferLotId:");
      sb.append(this.transferLotId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markItemsAsReceivedForTransferLotPartial_result implements org.apache.thrift.TBase<markItemsAsReceivedForTransferLotPartial_result, markItemsAsReceivedForTransferLotPartial_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markItemsAsReceivedForTransferLotPartial_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markItemsAsReceivedForTransferLotPartial_result.class, metaDataMap);
    }

    public markItemsAsReceivedForTransferLotPartial_result() {
    }

    public markItemsAsReceivedForTransferLotPartial_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markItemsAsReceivedForTransferLotPartial_result(markItemsAsReceivedForTransferLotPartial_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public markItemsAsReceivedForTransferLotPartial_result deepCopy() {
      return new markItemsAsReceivedForTransferLotPartial_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markItemsAsReceivedForTransferLotPartial_result)
        return this.equals((markItemsAsReceivedForTransferLotPartial_result)that);
      return false;
    }

    public boolean equals(markItemsAsReceivedForTransferLotPartial_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markItemsAsReceivedForTransferLotPartial_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markItemsAsReceivedForTransferLotPartial_result typedOther = (markItemsAsReceivedForTransferLotPartial_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markItemsAsReceivedForTransferLotPartial_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markTransferLotAsReceivedPartial_args implements org.apache.thrift.TBase<markTransferLotAsReceivedPartial_args, markTransferLotAsReceivedPartial_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markTransferLotAsReceivedPartial_args");

    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField REMOTE_TRANSFER_REF_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("remoteTransferRefNumber", org.apache.thrift.protocol.TType.STRING, (short)2);

    private long id; // required
    private String remoteTransferRefNumber; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ID((short)1, "id"),
      REMOTE_TRANSFER_REF_NUMBER((short)2, "remoteTransferRefNumber");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ID
            return ID;
          case 2: // REMOTE_TRANSFER_REF_NUMBER
            return REMOTE_TRANSFER_REF_NUMBER;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.REMOTE_TRANSFER_REF_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("remoteTransferRefNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markTransferLotAsReceivedPartial_args.class, metaDataMap);
    }

    public markTransferLotAsReceivedPartial_args() {
    }

    public markTransferLotAsReceivedPartial_args(
      long id,
      String remoteTransferRefNumber)
    {
      this();
      this.id = id;
      setIdIsSet(true);
      this.remoteTransferRefNumber = remoteTransferRefNumber;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markTransferLotAsReceivedPartial_args(markTransferLotAsReceivedPartial_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
      if (other.isSetRemoteTransferRefNumber()) {
        this.remoteTransferRefNumber = other.remoteTransferRefNumber;
      }
    }

    public markTransferLotAsReceivedPartial_args deepCopy() {
      return new markTransferLotAsReceivedPartial_args(this);
    }

    @Override
    public void clear() {
      setIdIsSet(false);
      this.id = 0;
      this.remoteTransferRefNumber = null;
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public String getRemoteTransferRefNumber() {
      return this.remoteTransferRefNumber;
    }

    public void setRemoteTransferRefNumber(String remoteTransferRefNumber) {
      this.remoteTransferRefNumber = remoteTransferRefNumber;
    }

    public void unsetRemoteTransferRefNumber() {
      this.remoteTransferRefNumber = null;
    }

    /** Returns true if field remoteTransferRefNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetRemoteTransferRefNumber() {
      return this.remoteTransferRefNumber != null;
    }

    public void setRemoteTransferRefNumberIsSet(boolean value) {
      if (!value) {
        this.remoteTransferRefNumber = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      case REMOTE_TRANSFER_REF_NUMBER:
        if (value == null) {
          unsetRemoteTransferRefNumber();
        } else {
          setRemoteTransferRefNumber((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return Long.valueOf(getId());

      case REMOTE_TRANSFER_REF_NUMBER:
        return getRemoteTransferRefNumber();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ID:
        return isSetId();
      case REMOTE_TRANSFER_REF_NUMBER:
        return isSetRemoteTransferRefNumber();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markTransferLotAsReceivedPartial_args)
        return this.equals((markTransferLotAsReceivedPartial_args)that);
      return false;
    }

    public boolean equals(markTransferLotAsReceivedPartial_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      boolean this_present_remoteTransferRefNumber = true && this.isSetRemoteTransferRefNumber();
      boolean that_present_remoteTransferRefNumber = true && that.isSetRemoteTransferRefNumber();
      if (this_present_remoteTransferRefNumber || that_present_remoteTransferRefNumber) {
        if (!(this_present_remoteTransferRefNumber && that_present_remoteTransferRefNumber))
          return false;
        if (!this.remoteTransferRefNumber.equals(that.remoteTransferRefNumber))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markTransferLotAsReceivedPartial_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markTransferLotAsReceivedPartial_args typedOther = (markTransferLotAsReceivedPartial_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetRemoteTransferRefNumber()).compareTo(typedOther.isSetRemoteTransferRefNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRemoteTransferRefNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.remoteTransferRefNumber, typedOther.remoteTransferRefNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // REMOTE_TRANSFER_REF_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.remoteTransferRefNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      if (this.remoteTransferRefNumber != null) {
        oprot.writeFieldBegin(REMOTE_TRANSFER_REF_NUMBER_FIELD_DESC);
        oprot.writeString(this.remoteTransferRefNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markTransferLotAsReceivedPartial_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("remoteTransferRefNumber:");
      if (this.remoteTransferRefNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.remoteTransferRefNumber);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markTransferLotAsReceivedPartial_result implements org.apache.thrift.TBase<markTransferLotAsReceivedPartial_result, markTransferLotAsReceivedPartial_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markTransferLotAsReceivedPartial_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markTransferLotAsReceivedPartial_result.class, metaDataMap);
    }

    public markTransferLotAsReceivedPartial_result() {
    }

    public markTransferLotAsReceivedPartial_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markTransferLotAsReceivedPartial_result(markTransferLotAsReceivedPartial_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public markTransferLotAsReceivedPartial_result deepCopy() {
      return new markTransferLotAsReceivedPartial_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markTransferLotAsReceivedPartial_result)
        return this.equals((markTransferLotAsReceivedPartial_result)that);
      return false;
    }

    public boolean equals(markTransferLotAsReceivedPartial_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markTransferLotAsReceivedPartial_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markTransferLotAsReceivedPartial_result typedOther = (markTransferLotAsReceivedPartial_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markTransferLotAsReceivedPartial_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemScannedInForPO_args implements org.apache.thrift.TBase<getInventoryItemScannedInForPO_args, getInventoryItemScannedInForPO_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemScannedInForPO_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField PURCHASE_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseIds", org.apache.thrift.protocol.TType.LIST, (short)2);

    private long itemId; // required
    private List<Long> purchaseIds; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_ID((short)1, "itemId"),
      PURCHASE_IDS((short)2, "purchaseIds");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_ID
            return ITEM_ID;
          case 2: // PURCHASE_IDS
            return PURCHASE_IDS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PURCHASE_IDS, new org.apache.thrift.meta_data.FieldMetaData("purchaseIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemScannedInForPO_args.class, metaDataMap);
    }

    public getInventoryItemScannedInForPO_args() {
    }

    public getInventoryItemScannedInForPO_args(
      long itemId,
      List<Long> purchaseIds)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.purchaseIds = purchaseIds;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemScannedInForPO_args(getInventoryItemScannedInForPO_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      if (other.isSetPurchaseIds()) {
        List<Long> __this__purchaseIds = new ArrayList<Long>();
        for (Long other_element : other.purchaseIds) {
          __this__purchaseIds.add(other_element);
        }
        this.purchaseIds = __this__purchaseIds;
      }
    }

    public getInventoryItemScannedInForPO_args deepCopy() {
      return new getInventoryItemScannedInForPO_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      this.purchaseIds = null;
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public int getPurchaseIdsSize() {
      return (this.purchaseIds == null) ? 0 : this.purchaseIds.size();
    }

    public java.util.Iterator<Long> getPurchaseIdsIterator() {
      return (this.purchaseIds == null) ? null : this.purchaseIds.iterator();
    }

    public void addToPurchaseIds(long elem) {
      if (this.purchaseIds == null) {
        this.purchaseIds = new ArrayList<Long>();
      }
      this.purchaseIds.add(elem);
    }

    public List<Long> getPurchaseIds() {
      return this.purchaseIds;
    }

    public void setPurchaseIds(List<Long> purchaseIds) {
      this.purchaseIds = purchaseIds;
    }

    public void unsetPurchaseIds() {
      this.purchaseIds = null;
    }

    /** Returns true if field purchaseIds is set (has been assigned a value) and false otherwise */
    public boolean isSetPurchaseIds() {
      return this.purchaseIds != null;
    }

    public void setPurchaseIdsIsSet(boolean value) {
      if (!value) {
        this.purchaseIds = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case PURCHASE_IDS:
        if (value == null) {
          unsetPurchaseIds();
        } else {
          setPurchaseIds((List<Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case PURCHASE_IDS:
        return getPurchaseIds();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_ID:
        return isSetItemId();
      case PURCHASE_IDS:
        return isSetPurchaseIds();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemScannedInForPO_args)
        return this.equals((getInventoryItemScannedInForPO_args)that);
      return false;
    }

    public boolean equals(getInventoryItemScannedInForPO_args that) {
      if (that == null)
        return false;

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      boolean this_present_purchaseIds = true && this.isSetPurchaseIds();
      boolean that_present_purchaseIds = true && that.isSetPurchaseIds();
      if (this_present_purchaseIds || that_present_purchaseIds) {
        if (!(this_present_purchaseIds && that_present_purchaseIds))
          return false;
        if (!this.purchaseIds.equals(that.purchaseIds))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemScannedInForPO_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemScannedInForPO_args typedOther = (getInventoryItemScannedInForPO_args)other;

      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPurchaseIds()).compareTo(typedOther.isSetPurchaseIds());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPurchaseIds()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseIds, typedOther.purchaseIds);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // PURCHASE_IDS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list129 = iprot.readListBegin();
                this.purchaseIds = new ArrayList<Long>(_list129.size);
                for (int _i130 = 0; _i130 < _list129.size; ++_i130)
                {
                  long _elem131; // required
                  _elem131 = iprot.readI64();
                  this.purchaseIds.add(_elem131);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      if (this.purchaseIds != null) {
        oprot.writeFieldBegin(PURCHASE_IDS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.purchaseIds.size()));
          for (long _iter132 : this.purchaseIds)
          {
            oprot.writeI64(_iter132);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemScannedInForPO_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("purchaseIds:");
      if (this.purchaseIds == null) {
        sb.append("null");
      } else {
        sb.append(this.purchaseIds);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemScannedInForPO_result implements org.apache.thrift.TBase<getInventoryItemScannedInForPO_result, getInventoryItemScannedInForPO_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemScannedInForPO_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<InventoryItem> success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemScannedInForPO_result.class, metaDataMap);
    }

    public getInventoryItemScannedInForPO_result() {
    }

    public getInventoryItemScannedInForPO_result(
      List<InventoryItem> success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemScannedInForPO_result(getInventoryItemScannedInForPO_result other) {
      if (other.isSetSuccess()) {
        List<InventoryItem> __this__success = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.success) {
          __this__success.add(new InventoryItem(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getInventoryItemScannedInForPO_result deepCopy() {
      return new getInventoryItemScannedInForPO_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryItem> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryItem elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryItem>();
      }
      this.success.add(elem);
    }

    public List<InventoryItem> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryItem> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryItem>)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemScannedInForPO_result)
        return this.equals((getInventoryItemScannedInForPO_result)that);
      return false;
    }

    public boolean equals(getInventoryItemScannedInForPO_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemScannedInForPO_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemScannedInForPO_result typedOther = (getInventoryItemScannedInForPO_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list133 = iprot.readListBegin();
                this.success = new ArrayList<InventoryItem>(_list133.size);
                for (int _i134 = 0; _i134 < _list133.size; ++_i134)
                {
                  InventoryItem _elem135; // required
                  _elem135 = new InventoryItem();
                  _elem135.read(iprot);
                  this.success.add(_elem135);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryItem _iter136 : this.success)
          {
            _iter136.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemScannedInForPO_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getAmazonTransferredSkuDetails_args implements org.apache.thrift.TBase<getAmazonTransferredSkuDetails_args, getAmazonTransferredSkuDetails_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAmazonTransferredSkuDetails_args");

    private static final org.apache.thrift.protocol.TField ITEM_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("itemIds", org.apache.thrift.protocol.TType.LIST, (short)1);

    private List<Long> itemIds; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_IDS((short)1, "itemIds");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_IDS
            return ITEM_IDS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAmazonTransferredSkuDetails_args.class, metaDataMap);
    }

    public getAmazonTransferredSkuDetails_args() {
    }

    public getAmazonTransferredSkuDetails_args(
      List<Long> itemIds)
    {
      this();
      this.itemIds = itemIds;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAmazonTransferredSkuDetails_args(getAmazonTransferredSkuDetails_args other) {
      if (other.isSetItemIds()) {
        List<Long> __this__itemIds = new ArrayList<Long>();
        for (Long other_element : other.itemIds) {
          __this__itemIds.add(other_element);
        }
        this.itemIds = __this__itemIds;
      }
    }

    public getAmazonTransferredSkuDetails_args deepCopy() {
      return new getAmazonTransferredSkuDetails_args(this);
    }

    @Override
    public void clear() {
      this.itemIds = null;
    }

    public int getItemIdsSize() {
      return (this.itemIds == null) ? 0 : this.itemIds.size();
    }

    public java.util.Iterator<Long> getItemIdsIterator() {
      return (this.itemIds == null) ? null : this.itemIds.iterator();
    }

    public void addToItemIds(long elem) {
      if (this.itemIds == null) {
        this.itemIds = new ArrayList<Long>();
      }
      this.itemIds.add(elem);
    }

    public List<Long> getItemIds() {
      return this.itemIds;
    }

    public void setItemIds(List<Long> itemIds) {
      this.itemIds = itemIds;
    }

    public void unsetItemIds() {
      this.itemIds = null;
    }

    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
    public boolean isSetItemIds() {
      return this.itemIds != null;
    }

    public void setItemIdsIsSet(boolean value) {
      if (!value) {
        this.itemIds = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_IDS:
        if (value == null) {
          unsetItemIds();
        } else {
          setItemIds((List<Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_IDS:
        return getItemIds();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_IDS:
        return isSetItemIds();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAmazonTransferredSkuDetails_args)
        return this.equals((getAmazonTransferredSkuDetails_args)that);
      return false;
    }

    public boolean equals(getAmazonTransferredSkuDetails_args that) {
      if (that == null)
        return false;

      boolean this_present_itemIds = true && this.isSetItemIds();
      boolean that_present_itemIds = true && that.isSetItemIds();
      if (this_present_itemIds || that_present_itemIds) {
        if (!(this_present_itemIds && that_present_itemIds))
          return false;
        if (!this.itemIds.equals(that.itemIds))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAmazonTransferredSkuDetails_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAmazonTransferredSkuDetails_args typedOther = (getAmazonTransferredSkuDetails_args)other;

      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemIds()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_IDS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list137 = iprot.readListBegin();
                this.itemIds = new ArrayList<Long>(_list137.size);
                for (int _i138 = 0; _i138 < _list137.size; ++_i138)
                {
                  long _elem139; // required
                  _elem139 = iprot.readI64();
                  this.itemIds.add(_elem139);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.itemIds != null) {
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
          for (long _iter140 : this.itemIds)
          {
            oprot.writeI64(_iter140);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAmazonTransferredSkuDetails_args(");
      boolean first = true;

      sb.append("itemIds:");
      if (this.itemIds == null) {
        sb.append("null");
      } else {
        sb.append(this.itemIds);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getAmazonTransferredSkuDetails_result implements org.apache.thrift.TBase<getAmazonTransferredSkuDetails_result, getAmazonTransferredSkuDetails_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAmazonTransferredSkuDetails_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<AmazonTransferredSkuDetail> success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, AmazonTransferredSkuDetail.class))));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAmazonTransferredSkuDetails_result.class, metaDataMap);
    }

    public getAmazonTransferredSkuDetails_result() {
    }

    public getAmazonTransferredSkuDetails_result(
      List<AmazonTransferredSkuDetail> success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAmazonTransferredSkuDetails_result(getAmazonTransferredSkuDetails_result other) {
      if (other.isSetSuccess()) {
        List<AmazonTransferredSkuDetail> __this__success = new ArrayList<AmazonTransferredSkuDetail>();
        for (AmazonTransferredSkuDetail other_element : other.success) {
          __this__success.add(new AmazonTransferredSkuDetail(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getAmazonTransferredSkuDetails_result deepCopy() {
      return new getAmazonTransferredSkuDetails_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<AmazonTransferredSkuDetail> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(AmazonTransferredSkuDetail elem) {
      if (this.success == null) {
        this.success = new ArrayList<AmazonTransferredSkuDetail>();
      }
      this.success.add(elem);
    }

    public List<AmazonTransferredSkuDetail> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<AmazonTransferredSkuDetail> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<AmazonTransferredSkuDetail>)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAmazonTransferredSkuDetails_result)
        return this.equals((getAmazonTransferredSkuDetails_result)that);
      return false;
    }

    public boolean equals(getAmazonTransferredSkuDetails_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAmazonTransferredSkuDetails_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAmazonTransferredSkuDetails_result typedOther = (getAmazonTransferredSkuDetails_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list141 = iprot.readListBegin();
                this.success = new ArrayList<AmazonTransferredSkuDetail>(_list141.size);
                for (int _i142 = 0; _i142 < _list141.size; ++_i142)
                {
                  AmazonTransferredSkuDetail _elem143; // required
                  _elem143 = new AmazonTransferredSkuDetail();
                  _elem143.read(iprot);
                  this.success.add(_elem143);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (AmazonTransferredSkuDetail _iter144 : this.success)
          {
            _iter144.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAmazonTransferredSkuDetails_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getScansforPurchase_args implements org.apache.thrift.TBase<getScansforPurchase_args, getScansforPurchase_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScansforPurchase_args");

    private static final org.apache.thrift.protocol.TField PURCHASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SCAN_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scanType", org.apache.thrift.protocol.TType.I32, (short)2);

    private long purchaseId; // required
    private ScanType scanType; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      PURCHASE_ID((short)1, "purchaseId"),
      /**
       * 
       * @see ScanType
       */
      SCAN_TYPE((short)2, "scanType");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // PURCHASE_ID
            return PURCHASE_ID;
          case 2: // SCAN_TYPE
            return SCAN_TYPE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __PURCHASEID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.PURCHASE_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SCAN_TYPE, new org.apache.thrift.meta_data.FieldMetaData("scanType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScansforPurchase_args.class, metaDataMap);
    }

    public getScansforPurchase_args() {
    }

    public getScansforPurchase_args(
      long purchaseId,
      ScanType scanType)
    {
      this();
      this.purchaseId = purchaseId;
      setPurchaseIdIsSet(true);
      this.scanType = scanType;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getScansforPurchase_args(getScansforPurchase_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.purchaseId = other.purchaseId;
      if (other.isSetScanType()) {
        this.scanType = other.scanType;
      }
    }

    public getScansforPurchase_args deepCopy() {
      return new getScansforPurchase_args(this);
    }

    @Override
    public void clear() {
      setPurchaseIdIsSet(false);
      this.purchaseId = 0;
      this.scanType = null;
    }

    public long getPurchaseId() {
      return this.purchaseId;
    }

    public void setPurchaseId(long purchaseId) {
      this.purchaseId = purchaseId;
      setPurchaseIdIsSet(true);
    }

    public void unsetPurchaseId() {
      __isset_bit_vector.clear(__PURCHASEID_ISSET_ID);
    }

    /** Returns true if field purchaseId is set (has been assigned a value) and false otherwise */
    public boolean isSetPurchaseId() {
      return __isset_bit_vector.get(__PURCHASEID_ISSET_ID);
    }

    public void setPurchaseIdIsSet(boolean value) {
      __isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getScanType() {
      return this.scanType;
    }

    /**
     * 
     * @see ScanType
     */
    public void setScanType(ScanType scanType) {
      this.scanType = scanType;
    }

    public void unsetScanType() {
      this.scanType = null;
    }

    /** Returns true if field scanType is set (has been assigned a value) and false otherwise */
    public boolean isSetScanType() {
      return this.scanType != null;
    }

    public void setScanTypeIsSet(boolean value) {
      if (!value) {
        this.scanType = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PURCHASE_ID:
        if (value == null) {
          unsetPurchaseId();
        } else {
          setPurchaseId((Long)value);
        }
        break;

      case SCAN_TYPE:
        if (value == null) {
          unsetScanType();
        } else {
          setScanType((ScanType)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PURCHASE_ID:
        return Long.valueOf(getPurchaseId());

      case SCAN_TYPE:
        return getScanType();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case PURCHASE_ID:
        return isSetPurchaseId();
      case SCAN_TYPE:
        return isSetScanType();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getScansforPurchase_args)
        return this.equals((getScansforPurchase_args)that);
      return false;
    }

    public boolean equals(getScansforPurchase_args that) {
      if (that == null)
        return false;

      boolean this_present_purchaseId = true;
      boolean that_present_purchaseId = true;
      if (this_present_purchaseId || that_present_purchaseId) {
        if (!(this_present_purchaseId && that_present_purchaseId))
          return false;
        if (this.purchaseId != that.purchaseId)
          return false;
      }

      boolean this_present_scanType = true && this.isSetScanType();
      boolean that_present_scanType = true && that.isSetScanType();
      if (this_present_scanType || that_present_scanType) {
        if (!(this_present_scanType && that_present_scanType))
          return false;
        if (!this.scanType.equals(that.scanType))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getScansforPurchase_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getScansforPurchase_args typedOther = (getScansforPurchase_args)other;

      lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(typedOther.isSetPurchaseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPurchaseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseId, typedOther.purchaseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetScanType()).compareTo(typedOther.isSetScanType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetScanType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scanType, typedOther.scanType);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // PURCHASE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.purchaseId = iprot.readI64();
              setPurchaseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // SCAN_TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.scanType = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
      oprot.writeI64(this.purchaseId);
      oprot.writeFieldEnd();
      if (this.scanType != null) {
        oprot.writeFieldBegin(SCAN_TYPE_FIELD_DESC);
        oprot.writeI32(this.scanType.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getScansforPurchase_args(");
      boolean first = true;

      sb.append("purchaseId:");
      sb.append(this.purchaseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("scanType:");
      if (this.scanType == null) {
        sb.append("null");
      } else {
        sb.append(this.scanType);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getScansforPurchase_result implements org.apache.thrift.TBase<getScansforPurchase_result, getScansforPurchase_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScansforPurchase_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Scan> success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Scan.class))));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScansforPurchase_result.class, metaDataMap);
    }

    public getScansforPurchase_result() {
    }

    public getScansforPurchase_result(
      List<Scan> success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getScansforPurchase_result(getScansforPurchase_result other) {
      if (other.isSetSuccess()) {
        List<Scan> __this__success = new ArrayList<Scan>();
        for (Scan other_element : other.success) {
          __this__success.add(new Scan(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getScansforPurchase_result deepCopy() {
      return new getScansforPurchase_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Scan> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Scan elem) {
      if (this.success == null) {
        this.success = new ArrayList<Scan>();
      }
      this.success.add(elem);
    }

    public List<Scan> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Scan> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Scan>)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getScansforPurchase_result)
        return this.equals((getScansforPurchase_result)that);
      return false;
    }

    public boolean equals(getScansforPurchase_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getScansforPurchase_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getScansforPurchase_result typedOther = (getScansforPurchase_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list145 = iprot.readListBegin();
                this.success = new ArrayList<Scan>(_list145.size);
                for (int _i146 = 0; _i146 < _list145.size; ++_i146)
                {
                  Scan _elem147; // required
                  _elem147 = new Scan();
                  _elem147.read(iprot);
                  this.success.add(_elem147);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Scan _iter148 : this.success)
          {
            _iter148.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getScansforPurchase_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCurrentBadQuantityForItem_args implements org.apache.thrift.TBase<getCurrentBadQuantityForItem_args, getCurrentBadQuantityForItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCurrentBadQuantityForItem_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField CURRENT_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("currentWarehouseId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField PHYSICAL_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("physicalWarehouseId", org.apache.thrift.protocol.TType.I64, (short)3);

    private long itemId; // required
    private long currentWarehouseId; // required
    private long physicalWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_ID((short)1, "itemId"),
      CURRENT_WAREHOUSE_ID((short)2, "currentWarehouseId"),
      PHYSICAL_WAREHOUSE_ID((short)3, "physicalWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_ID
            return ITEM_ID;
          case 2: // CURRENT_WAREHOUSE_ID
            return CURRENT_WAREHOUSE_ID;
          case 3: // PHYSICAL_WAREHOUSE_ID
            return PHYSICAL_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private static final int __CURRENTWAREHOUSEID_ISSET_ID = 1;
    private static final int __PHYSICALWAREHOUSEID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.CURRENT_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("currentWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PHYSICAL_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("physicalWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentBadQuantityForItem_args.class, metaDataMap);
    }

    public getCurrentBadQuantityForItem_args() {
    }

    public getCurrentBadQuantityForItem_args(
      long itemId,
      long currentWarehouseId,
      long physicalWarehouseId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.currentWarehouseId = currentWarehouseId;
      setCurrentWarehouseIdIsSet(true);
      this.physicalWarehouseId = physicalWarehouseId;
      setPhysicalWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCurrentBadQuantityForItem_args(getCurrentBadQuantityForItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      this.currentWarehouseId = other.currentWarehouseId;
      this.physicalWarehouseId = other.physicalWarehouseId;
    }

    public getCurrentBadQuantityForItem_args deepCopy() {
      return new getCurrentBadQuantityForItem_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      setCurrentWarehouseIdIsSet(false);
      this.currentWarehouseId = 0;
      setPhysicalWarehouseIdIsSet(false);
      this.physicalWarehouseId = 0;
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public long getCurrentWarehouseId() {
      return this.currentWarehouseId;
    }

    public void setCurrentWarehouseId(long currentWarehouseId) {
      this.currentWarehouseId = currentWarehouseId;
      setCurrentWarehouseIdIsSet(true);
    }

    public void unsetCurrentWarehouseId() {
      __isset_bit_vector.clear(__CURRENTWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field currentWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetCurrentWarehouseId() {
      return __isset_bit_vector.get(__CURRENTWAREHOUSEID_ISSET_ID);
    }

    public void setCurrentWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__CURRENTWAREHOUSEID_ISSET_ID, value);
    }

    public long getPhysicalWarehouseId() {
      return this.physicalWarehouseId;
    }

    public void setPhysicalWarehouseId(long physicalWarehouseId) {
      this.physicalWarehouseId = physicalWarehouseId;
      setPhysicalWarehouseIdIsSet(true);
    }

    public void unsetPhysicalWarehouseId() {
      __isset_bit_vector.clear(__PHYSICALWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field physicalWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetPhysicalWarehouseId() {
      return __isset_bit_vector.get(__PHYSICALWAREHOUSEID_ISSET_ID);
    }

    public void setPhysicalWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__PHYSICALWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case CURRENT_WAREHOUSE_ID:
        if (value == null) {
          unsetCurrentWarehouseId();
        } else {
          setCurrentWarehouseId((Long)value);
        }
        break;

      case PHYSICAL_WAREHOUSE_ID:
        if (value == null) {
          unsetPhysicalWarehouseId();
        } else {
          setPhysicalWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case CURRENT_WAREHOUSE_ID:
        return Long.valueOf(getCurrentWarehouseId());

      case PHYSICAL_WAREHOUSE_ID:
        return Long.valueOf(getPhysicalWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_ID:
        return isSetItemId();
      case CURRENT_WAREHOUSE_ID:
        return isSetCurrentWarehouseId();
      case PHYSICAL_WAREHOUSE_ID:
        return isSetPhysicalWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCurrentBadQuantityForItem_args)
        return this.equals((getCurrentBadQuantityForItem_args)that);
      return false;
    }

    public boolean equals(getCurrentBadQuantityForItem_args that) {
      if (that == null)
        return false;

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      boolean this_present_currentWarehouseId = true;
      boolean that_present_currentWarehouseId = true;
      if (this_present_currentWarehouseId || that_present_currentWarehouseId) {
        if (!(this_present_currentWarehouseId && that_present_currentWarehouseId))
          return false;
        if (this.currentWarehouseId != that.currentWarehouseId)
          return false;
      }

      boolean this_present_physicalWarehouseId = true;
      boolean that_present_physicalWarehouseId = true;
      if (this_present_physicalWarehouseId || that_present_physicalWarehouseId) {
        if (!(this_present_physicalWarehouseId && that_present_physicalWarehouseId))
          return false;
        if (this.physicalWarehouseId != that.physicalWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCurrentBadQuantityForItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCurrentBadQuantityForItem_args typedOther = (getCurrentBadQuantityForItem_args)other;

      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCurrentWarehouseId()).compareTo(typedOther.isSetCurrentWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCurrentWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.currentWarehouseId, typedOther.currentWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPhysicalWarehouseId()).compareTo(typedOther.isSetPhysicalWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPhysicalWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.physicalWarehouseId, typedOther.physicalWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // CURRENT_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.currentWarehouseId = iprot.readI64();
              setCurrentWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // PHYSICAL_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.physicalWarehouseId = iprot.readI64();
              setPhysicalWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CURRENT_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.currentWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(PHYSICAL_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.physicalWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCurrentBadQuantityForItem_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("currentWarehouseId:");
      sb.append(this.currentWarehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("physicalWarehouseId:");
      sb.append(this.physicalWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCurrentBadQuantityForItem_result implements org.apache.thrift.TBase<getCurrentBadQuantityForItem_result, getCurrentBadQuantityForItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCurrentBadQuantityForItem_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCurrentBadQuantityForItem_result.class, metaDataMap);
    }

    public getCurrentBadQuantityForItem_result() {
    }

    public getCurrentBadQuantityForItem_result(
      long success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCurrentBadQuantityForItem_result(getCurrentBadQuantityForItem_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getCurrentBadQuantityForItem_result deepCopy() {
      return new getCurrentBadQuantityForItem_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.wex = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public void setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCurrentBadQuantityForItem_result)
        return this.equals((getCurrentBadQuantityForItem_result)that);
      return false;
    }

    public boolean equals(getCurrentBadQuantityForItem_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCurrentBadQuantityForItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCurrentBadQuantityForItem_result typedOther = (getCurrentBadQuantityForItem_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.success = iprot.readI64();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCurrentBadQuantityForItem_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForBadPurchaseReturn_args implements org.apache.thrift.TBase<scanForBadPurchaseReturn_args, scanForBadPurchaseReturn_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForBadPurchaseReturn_args");

    private static final org.apache.thrift.protocol.TField SALE_RETURN_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("saleReturnItems", org.apache.thrift.protocol.TType.LIST, (short)1);
    private static final org.apache.thrift.protocol.TField VENDOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField BILLING_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("billingWarehouseId", org.apache.thrift.protocol.TType.I64, (short)3);

    private List<InventoryItem> saleReturnItems; // required
    private long vendorId; // required
    private long billingWarehouseId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SALE_RETURN_ITEMS((short)1, "saleReturnItems"),
      VENDOR_ID((short)2, "vendorId"),
      BILLING_WAREHOUSE_ID((short)3, "billingWarehouseId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SALE_RETURN_ITEMS
            return SALE_RETURN_ITEMS;
          case 2: // VENDOR_ID
            return VENDOR_ID;
          case 3: // BILLING_WAREHOUSE_ID
            return BILLING_WAREHOUSE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __VENDORID_ISSET_ID = 0;
    private static final int __BILLINGWAREHOUSEID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SALE_RETURN_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("saleReturnItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.VENDOR_ID, new org.apache.thrift.meta_data.FieldMetaData("vendorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BILLING_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("billingWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForBadPurchaseReturn_args.class, metaDataMap);
    }

    public scanForBadPurchaseReturn_args() {
    }

    public scanForBadPurchaseReturn_args(
      List<InventoryItem> saleReturnItems,
      long vendorId,
      long billingWarehouseId)
    {
      this();
      this.saleReturnItems = saleReturnItems;
      this.vendorId = vendorId;
      setVendorIdIsSet(true);
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForBadPurchaseReturn_args(scanForBadPurchaseReturn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetSaleReturnItems()) {
        List<InventoryItem> __this__saleReturnItems = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.saleReturnItems) {
          __this__saleReturnItems.add(new InventoryItem(other_element));
        }
        this.saleReturnItems = __this__saleReturnItems;
      }
      this.vendorId = other.vendorId;
      this.billingWarehouseId = other.billingWarehouseId;
    }

    public scanForBadPurchaseReturn_args deepCopy() {
      return new scanForBadPurchaseReturn_args(this);
    }

    @Override
    public void clear() {
      this.saleReturnItems = null;
      setVendorIdIsSet(false);
      this.vendorId = 0;
      setBillingWarehouseIdIsSet(false);
      this.billingWarehouseId = 0;
    }

    public int getSaleReturnItemsSize() {
      return (this.saleReturnItems == null) ? 0 : this.saleReturnItems.size();
    }

    public java.util.Iterator<InventoryItem> getSaleReturnItemsIterator() {
      return (this.saleReturnItems == null) ? null : this.saleReturnItems.iterator();
    }

    public void addToSaleReturnItems(InventoryItem elem) {
      if (this.saleReturnItems == null) {
        this.saleReturnItems = new ArrayList<InventoryItem>();
      }
      this.saleReturnItems.add(elem);
    }

    public List<InventoryItem> getSaleReturnItems() {
      return this.saleReturnItems;
    }

    public void setSaleReturnItems(List<InventoryItem> saleReturnItems) {
      this.saleReturnItems = saleReturnItems;
    }

    public void unsetSaleReturnItems() {
      this.saleReturnItems = null;
    }

    /** Returns true if field saleReturnItems is set (has been assigned a value) and false otherwise */
    public boolean isSetSaleReturnItems() {
      return this.saleReturnItems != null;
    }

    public void setSaleReturnItemsIsSet(boolean value) {
      if (!value) {
        this.saleReturnItems = null;
      }
    }

    public long getVendorId() {
      return this.vendorId;
    }

    public void setVendorId(long vendorId) {
      this.vendorId = vendorId;
      setVendorIdIsSet(true);
    }

    public void unsetVendorId() {
      __isset_bit_vector.clear(__VENDORID_ISSET_ID);
    }

    /** Returns true if field vendorId is set (has been assigned a value) and false otherwise */
    public boolean isSetVendorId() {
      return __isset_bit_vector.get(__VENDORID_ISSET_ID);
    }

    public void setVendorIdIsSet(boolean value) {
      __isset_bit_vector.set(__VENDORID_ISSET_ID, value);
    }

    public long getBillingWarehouseId() {
      return this.billingWarehouseId;
    }

    public void setBillingWarehouseId(long billingWarehouseId) {
      this.billingWarehouseId = billingWarehouseId;
      setBillingWarehouseIdIsSet(true);
    }

    public void unsetBillingWarehouseId() {
      __isset_bit_vector.clear(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field billingWarehouseId is set (has been assigned a value) and false otherwise */
    public boolean isSetBillingWarehouseId() {
      return __isset_bit_vector.get(__BILLINGWAREHOUSEID_ISSET_ID);
    }

    public void setBillingWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__BILLINGWAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SALE_RETURN_ITEMS:
        if (value == null) {
          unsetSaleReturnItems();
        } else {
          setSaleReturnItems((List<InventoryItem>)value);
        }
        break;

      case VENDOR_ID:
        if (value == null) {
          unsetVendorId();
        } else {
          setVendorId((Long)value);
        }
        break;

      case BILLING_WAREHOUSE_ID:
        if (value == null) {
          unsetBillingWarehouseId();
        } else {
          setBillingWarehouseId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SALE_RETURN_ITEMS:
        return getSaleReturnItems();

      case VENDOR_ID:
        return Long.valueOf(getVendorId());

      case BILLING_WAREHOUSE_ID:
        return Long.valueOf(getBillingWarehouseId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SALE_RETURN_ITEMS:
        return isSetSaleReturnItems();
      case VENDOR_ID:
        return isSetVendorId();
      case BILLING_WAREHOUSE_ID:
        return isSetBillingWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForBadPurchaseReturn_args)
        return this.equals((scanForBadPurchaseReturn_args)that);
      return false;
    }

    public boolean equals(scanForBadPurchaseReturn_args that) {
      if (that == null)
        return false;

      boolean this_present_saleReturnItems = true && this.isSetSaleReturnItems();
      boolean that_present_saleReturnItems = true && that.isSetSaleReturnItems();
      if (this_present_saleReturnItems || that_present_saleReturnItems) {
        if (!(this_present_saleReturnItems && that_present_saleReturnItems))
          return false;
        if (!this.saleReturnItems.equals(that.saleReturnItems))
          return false;
      }

      boolean this_present_vendorId = true;
      boolean that_present_vendorId = true;
      if (this_present_vendorId || that_present_vendorId) {
        if (!(this_present_vendorId && that_present_vendorId))
          return false;
        if (this.vendorId != that.vendorId)
          return false;
      }

      boolean this_present_billingWarehouseId = true;
      boolean that_present_billingWarehouseId = true;
      if (this_present_billingWarehouseId || that_present_billingWarehouseId) {
        if (!(this_present_billingWarehouseId && that_present_billingWarehouseId))
          return false;
        if (this.billingWarehouseId != that.billingWarehouseId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForBadPurchaseReturn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForBadPurchaseReturn_args typedOther = (scanForBadPurchaseReturn_args)other;

      lastComparison = Boolean.valueOf(isSetSaleReturnItems()).compareTo(typedOther.isSetSaleReturnItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSaleReturnItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.saleReturnItems, typedOther.saleReturnItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetVendorId()).compareTo(typedOther.isSetVendorId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetVendorId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vendorId, typedOther.vendorId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBillingWarehouseId()).compareTo(typedOther.isSetBillingWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBillingWarehouseId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.billingWarehouseId, typedOther.billingWarehouseId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SALE_RETURN_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list149 = iprot.readListBegin();
                this.saleReturnItems = new ArrayList<InventoryItem>(_list149.size);
                for (int _i150 = 0; _i150 < _list149.size; ++_i150)
                {
                  InventoryItem _elem151; // required
                  _elem151 = new InventoryItem();
                  _elem151.read(iprot);
                  this.saleReturnItems.add(_elem151);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // VENDOR_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.vendorId = iprot.readI64();
              setVendorIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // BILLING_WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.billingWarehouseId = iprot.readI64();
              setBillingWarehouseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.saleReturnItems != null) {
        oprot.writeFieldBegin(SALE_RETURN_ITEMS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.saleReturnItems.size()));
          for (InventoryItem _iter152 : this.saleReturnItems)
          {
            _iter152.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(VENDOR_ID_FIELD_DESC);
      oprot.writeI64(this.vendorId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BILLING_WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.billingWarehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForBadPurchaseReturn_args(");
      boolean first = true;

      sb.append("saleReturnItems:");
      if (this.saleReturnItems == null) {
        sb.append("null");
      } else {
        sb.append(this.saleReturnItems);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("vendorId:");
      sb.append(this.vendorId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("billingWarehouseId:");
      sb.append(this.billingWarehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanForBadPurchaseReturn_result implements org.apache.thrift.TBase<scanForBadPurchaseReturn_result, scanForBadPurchaseReturn_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanForBadPurchaseReturn_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanForBadPurchaseReturn_result.class, metaDataMap);
    }

    public scanForBadPurchaseReturn_result() {
    }

    public scanForBadPurchaseReturn_result(
      long success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForBadPurchaseReturn_result(scanForBadPurchaseReturn_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public scanForBadPurchaseReturn_result deepCopy() {
      return new scanForBadPurchaseReturn_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.ex = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public void setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanForBadPurchaseReturn_result)
        return this.equals((scanForBadPurchaseReturn_result)that);
      return false;
    }

    public boolean equals(scanForBadPurchaseReturn_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanForBadPurchaseReturn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanForBadPurchaseReturn_result typedOther = (scanForBadPurchaseReturn_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.success = iprot.readI64();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanForBadPurchaseReturn_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getItemsInPurchaseReturn_args implements org.apache.thrift.TBase<getItemsInPurchaseReturn_args, getItemsInPurchaseReturn_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsInPurchaseReturn_args");

    private static final org.apache.thrift.protocol.TField PURCHASE_RETURN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseReturnId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField RETURN_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("returnTime", org.apache.thrift.protocol.TType.STRING, (short)3);

    private long purchaseReturnId; // required
    private ScanType type; // required
    private String returnTime; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      PURCHASE_RETURN_ID((short)1, "purchaseReturnId"),
      /**
       * 
       * @see ScanType
       */
      TYPE((short)2, "type"),
      RETURN_TIME((short)3, "returnTime");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // PURCHASE_RETURN_ID
            return PURCHASE_RETURN_ID;
          case 2: // TYPE
            return TYPE;
          case 3: // RETURN_TIME
            return RETURN_TIME;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __PURCHASERETURNID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.PURCHASE_RETURN_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseReturnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      tmpMap.put(_Fields.RETURN_TIME, new org.apache.thrift.meta_data.FieldMetaData("returnTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemsInPurchaseReturn_args.class, metaDataMap);
    }

    public getItemsInPurchaseReturn_args() {
    }

    public getItemsInPurchaseReturn_args(
      long purchaseReturnId,
      ScanType type,
      String returnTime)
    {
      this();
      this.purchaseReturnId = purchaseReturnId;
      setPurchaseReturnIdIsSet(true);
      this.type = type;
      this.returnTime = returnTime;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsInPurchaseReturn_args(getItemsInPurchaseReturn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.purchaseReturnId = other.purchaseReturnId;
      if (other.isSetType()) {
        this.type = other.type;
      }
      if (other.isSetReturnTime()) {
        this.returnTime = other.returnTime;
      }
    }

    public getItemsInPurchaseReturn_args deepCopy() {
      return new getItemsInPurchaseReturn_args(this);
    }

    @Override
    public void clear() {
      setPurchaseReturnIdIsSet(false);
      this.purchaseReturnId = 0;
      this.type = null;
      this.returnTime = null;
    }

    public long getPurchaseReturnId() {
      return this.purchaseReturnId;
    }

    public void setPurchaseReturnId(long purchaseReturnId) {
      this.purchaseReturnId = purchaseReturnId;
      setPurchaseReturnIdIsSet(true);
    }

    public void unsetPurchaseReturnId() {
      __isset_bit_vector.clear(__PURCHASERETURNID_ISSET_ID);
    }

    /** Returns true if field purchaseReturnId is set (has been assigned a value) and false otherwise */
    public boolean isSetPurchaseReturnId() {
      return __isset_bit_vector.get(__PURCHASERETURNID_ISSET_ID);
    }

    public void setPurchaseReturnIdIsSet(boolean value) {
      __isset_bit_vector.set(__PURCHASERETURNID_ISSET_ID, value);
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getType() {
      return this.type;
    }

    /**
     * 
     * @see ScanType
     */
    public void setType(ScanType type) {
      this.type = type;
    }

    public void unsetType() {
      this.type = null;
    }

    /** Returns true if field type is set (has been assigned a value) and false otherwise */
    public boolean isSetType() {
      return this.type != null;
    }

    public void setTypeIsSet(boolean value) {
      if (!value) {
        this.type = null;
      }
    }

    public String getReturnTime() {
      return this.returnTime;
    }

    public void setReturnTime(String returnTime) {
      this.returnTime = returnTime;
    }

    public void unsetReturnTime() {
      this.returnTime = null;
    }

    /** Returns true if field returnTime is set (has been assigned a value) and false otherwise */
    public boolean isSetReturnTime() {
      return this.returnTime != null;
    }

    public void setReturnTimeIsSet(boolean value) {
      if (!value) {
        this.returnTime = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PURCHASE_RETURN_ID:
        if (value == null) {
          unsetPurchaseReturnId();
        } else {
          setPurchaseReturnId((Long)value);
        }
        break;

      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((ScanType)value);
        }
        break;

      case RETURN_TIME:
        if (value == null) {
          unsetReturnTime();
        } else {
          setReturnTime((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PURCHASE_RETURN_ID:
        return Long.valueOf(getPurchaseReturnId());

      case TYPE:
        return getType();

      case RETURN_TIME:
        return getReturnTime();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case PURCHASE_RETURN_ID:
        return isSetPurchaseReturnId();
      case TYPE:
        return isSetType();
      case RETURN_TIME:
        return isSetReturnTime();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemsInPurchaseReturn_args)
        return this.equals((getItemsInPurchaseReturn_args)that);
      return false;
    }

    public boolean equals(getItemsInPurchaseReturn_args that) {
      if (that == null)
        return false;

      boolean this_present_purchaseReturnId = true;
      boolean that_present_purchaseReturnId = true;
      if (this_present_purchaseReturnId || that_present_purchaseReturnId) {
        if (!(this_present_purchaseReturnId && that_present_purchaseReturnId))
          return false;
        if (this.purchaseReturnId != that.purchaseReturnId)
          return false;
      }

      boolean this_present_type = true && this.isSetType();
      boolean that_present_type = true && that.isSetType();
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (!this.type.equals(that.type))
          return false;
      }

      boolean this_present_returnTime = true && this.isSetReturnTime();
      boolean that_present_returnTime = true && that.isSetReturnTime();
      if (this_present_returnTime || that_present_returnTime) {
        if (!(this_present_returnTime && that_present_returnTime))
          return false;
        if (!this.returnTime.equals(that.returnTime))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemsInPurchaseReturn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsInPurchaseReturn_args typedOther = (getItemsInPurchaseReturn_args)other;

      lastComparison = Boolean.valueOf(isSetPurchaseReturnId()).compareTo(typedOther.isSetPurchaseReturnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPurchaseReturnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseReturnId, typedOther.purchaseReturnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetReturnTime()).compareTo(typedOther.isSetReturnTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetReturnTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returnTime, typedOther.returnTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // PURCHASE_RETURN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.purchaseReturnId = iprot.readI64();
              setPurchaseReturnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.type = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // RETURN_TIME
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.returnTime = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PURCHASE_RETURN_ID_FIELD_DESC);
      oprot.writeI64(this.purchaseReturnId);
      oprot.writeFieldEnd();
      if (this.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(this.type.getValue());
        oprot.writeFieldEnd();
      }
      if (this.returnTime != null) {
        oprot.writeFieldBegin(RETURN_TIME_FIELD_DESC);
        oprot.writeString(this.returnTime);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemsInPurchaseReturn_args(");
      boolean first = true;

      sb.append("purchaseReturnId:");
      sb.append(this.purchaseReturnId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        sb.append(this.type);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("returnTime:");
      if (this.returnTime == null) {
        sb.append("null");
      } else {
        sb.append(this.returnTime);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getItemsInPurchaseReturn_result implements org.apache.thrift.TBase<getItemsInPurchaseReturn_result, getItemsInPurchaseReturn_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsInPurchaseReturn_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Map<Long,Long> success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemsInPurchaseReturn_result.class, metaDataMap);
    }

    public getItemsInPurchaseReturn_result() {
    }

    public getItemsInPurchaseReturn_result(
      Map<Long,Long> success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsInPurchaseReturn_result(getItemsInPurchaseReturn_result other) {
      if (other.isSetSuccess()) {
        Map<Long,Long> __this__success = new HashMap<Long,Long>();
        for (Map.Entry<Long, Long> other_element : other.success.entrySet()) {

          Long other_element_key = other_element.getKey();
          Long other_element_value = other_element.getValue();

          Long __this__success_copy_key = other_element_key;

          Long __this__success_copy_value = other_element_value;

          __this__success.put(__this__success_copy_key, __this__success_copy_value);
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public getItemsInPurchaseReturn_result deepCopy() {
      return new getItemsInPurchaseReturn_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.ex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public void putToSuccess(long key, long val) {
      if (this.success == null) {
        this.success = new HashMap<Long,Long>();
      }
      this.success.put(key, val);
    }

    public Map<Long,Long> getSuccess() {
      return this.success;
    }

    public void setSuccess(Map<Long,Long> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Map<Long,Long>)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemsInPurchaseReturn_result)
        return this.equals((getItemsInPurchaseReturn_result)that);
      return false;
    }

    public boolean equals(getItemsInPurchaseReturn_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemsInPurchaseReturn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsInPurchaseReturn_result typedOther = (getItemsInPurchaseReturn_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map153 = iprot.readMapBegin();
                this.success = new HashMap<Long,Long>(2*_map153.size);
                for (int _i154 = 0; _i154 < _map153.size; ++_i154)
                {
                  long _key155; // required
                  long _val156; // required
                  _key155 = iprot.readI64();
                  _val156 = iprot.readI64();
                  this.success.put(_key155, _val156);
                }
                iprot.readMapEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.I64, this.success.size()));
          for (Map.Entry<Long, Long> _iter157 : this.success.entrySet())
          {
            oprot.writeI64(_iter157.getKey());
            oprot.writeI64(_iter157.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemsInPurchaseReturn_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getScansForInventoryItem_args implements org.apache.thrift.TBase<getScansForInventoryItem_args, getScansForInventoryItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScansForInventoryItem_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItemId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2);

    private long inventoryItemId; // required
    private ScanType type; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEM_ID((short)1, "inventoryItemId"),
      /**
       * 
       * @see ScanType
       */
      TYPE((short)2, "type");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEM_ID
            return INVENTORY_ITEM_ID;
          case 2: // TYPE
            return TYPE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __INVENTORYITEMID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("inventoryItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScansForInventoryItem_args.class, metaDataMap);
    }

    public getScansForInventoryItem_args() {
    }

    public getScansForInventoryItem_args(
      long inventoryItemId,
      ScanType type)
    {
      this();
      this.inventoryItemId = inventoryItemId;
      setInventoryItemIdIsSet(true);
      this.type = type;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getScansForInventoryItem_args(getScansForInventoryItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.inventoryItemId = other.inventoryItemId;
      if (other.isSetType()) {
        this.type = other.type;
      }
    }

    public getScansForInventoryItem_args deepCopy() {
      return new getScansForInventoryItem_args(this);
    }

    @Override
    public void clear() {
      setInventoryItemIdIsSet(false);
      this.inventoryItemId = 0;
      this.type = null;
    }

    public long getInventoryItemId() {
      return this.inventoryItemId;
    }

    public void setInventoryItemId(long inventoryItemId) {
      this.inventoryItemId = inventoryItemId;
      setInventoryItemIdIsSet(true);
    }

    public void unsetInventoryItemId() {
      __isset_bit_vector.clear(__INVENTORYITEMID_ISSET_ID);
    }

    /** Returns true if field inventoryItemId is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItemId() {
      return __isset_bit_vector.get(__INVENTORYITEMID_ISSET_ID);
    }

    public void setInventoryItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__INVENTORYITEMID_ISSET_ID, value);
    }

    /**
     * 
     * @see ScanType
     */
    public ScanType getType() {
      return this.type;
    }

    /**
     * 
     * @see ScanType
     */
    public void setType(ScanType type) {
      this.type = type;
    }

    public void unsetType() {
      this.type = null;
    }

    /** Returns true if field type is set (has been assigned a value) and false otherwise */
    public boolean isSetType() {
      return this.type != null;
    }

    public void setTypeIsSet(boolean value) {
      if (!value) {
        this.type = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEM_ID:
        if (value == null) {
          unsetInventoryItemId();
        } else {
          setInventoryItemId((Long)value);
        }
        break;

      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((ScanType)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEM_ID:
        return Long.valueOf(getInventoryItemId());

      case TYPE:
        return getType();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEM_ID:
        return isSetInventoryItemId();
      case TYPE:
        return isSetType();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getScansForInventoryItem_args)
        return this.equals((getScansForInventoryItem_args)that);
      return false;
    }

    public boolean equals(getScansForInventoryItem_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItemId = true;
      boolean that_present_inventoryItemId = true;
      if (this_present_inventoryItemId || that_present_inventoryItemId) {
        if (!(this_present_inventoryItemId && that_present_inventoryItemId))
          return false;
        if (this.inventoryItemId != that.inventoryItemId)
          return false;
      }

      boolean this_present_type = true && this.isSetType();
      boolean that_present_type = true && that.isSetType();
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (!this.type.equals(that.type))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getScansForInventoryItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getScansForInventoryItem_args typedOther = (getScansForInventoryItem_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItemId()).compareTo(typedOther.isSetInventoryItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItemId, typedOther.inventoryItemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.inventoryItemId = iprot.readI64();
              setInventoryItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TYPE
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.type = ScanType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(INVENTORY_ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.inventoryItemId);
      oprot.writeFieldEnd();
      if (this.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(this.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getScansForInventoryItem_args(");
      boolean first = true;

      sb.append("inventoryItemId:");
      sb.append(this.inventoryItemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        sb.append(this.type);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getScansForInventoryItem_result implements org.apache.thrift.TBase<getScansForInventoryItem_result, getScansForInventoryItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getScansForInventoryItem_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Scan> success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Scan.class))));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getScansForInventoryItem_result.class, metaDataMap);
    }

    public getScansForInventoryItem_result() {
    }

    public getScansForInventoryItem_result(
      List<Scan> success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getScansForInventoryItem_result(getScansForInventoryItem_result other) {
      if (other.isSetSuccess()) {
        List<Scan> __this__success = new ArrayList<Scan>();
        for (Scan other_element : other.success) {
          __this__success.add(new Scan(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public getScansForInventoryItem_result deepCopy() {
      return new getScansForInventoryItem_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.ex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Scan> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Scan elem) {
      if (this.success == null) {
        this.success = new ArrayList<Scan>();
      }
      this.success.add(elem);
    }

    public List<Scan> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Scan> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Scan>)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getScansForInventoryItem_result)
        return this.equals((getScansForInventoryItem_result)that);
      return false;
    }

    public boolean equals(getScansForInventoryItem_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getScansForInventoryItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getScansForInventoryItem_result typedOther = (getScansForInventoryItem_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list158 = iprot.readListBegin();
                this.success = new ArrayList<Scan>(_list158.size);
                for (int _i159 = 0; _i159 < _list158.size; ++_i159)
                {
                  Scan _elem160; // required
                  _elem160 = new Scan();
                  _elem160.read(iprot);
                  this.success.add(_elem160);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Scan _iter161 : this.success)
          {
            _iter161.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getScansForInventoryItem_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class checkGrnImeiStatus_args implements org.apache.thrift.TBase<checkGrnImeiStatus_args, checkGrnImeiStatus_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkGrnImeiStatus_args");

    private static final org.apache.thrift.protocol.TField IMEI_NOS_FIELD_DESC = new org.apache.thrift.protocol.TField("imeiNos", org.apache.thrift.protocol.TType.LIST, (short)1);

    private List<String> imeiNos; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      IMEI_NOS((short)1, "imeiNos");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // IMEI_NOS
            return IMEI_NOS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.IMEI_NOS, new org.apache.thrift.meta_data.FieldMetaData("imeiNos", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkGrnImeiStatus_args.class, metaDataMap);
    }

    public checkGrnImeiStatus_args() {
    }

    public checkGrnImeiStatus_args(
      List<String> imeiNos)
    {
      this();
      this.imeiNos = imeiNos;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public checkGrnImeiStatus_args(checkGrnImeiStatus_args other) {
      if (other.isSetImeiNos()) {
        List<String> __this__imeiNos = new ArrayList<String>();
        for (String other_element : other.imeiNos) {
          __this__imeiNos.add(other_element);
        }
        this.imeiNos = __this__imeiNos;
      }
    }

    public checkGrnImeiStatus_args deepCopy() {
      return new checkGrnImeiStatus_args(this);
    }

    @Override
    public void clear() {
      this.imeiNos = null;
    }

    public int getImeiNosSize() {
      return (this.imeiNos == null) ? 0 : this.imeiNos.size();
    }

    public java.util.Iterator<String> getImeiNosIterator() {
      return (this.imeiNos == null) ? null : this.imeiNos.iterator();
    }

    public void addToImeiNos(String elem) {
      if (this.imeiNos == null) {
        this.imeiNos = new ArrayList<String>();
      }
      this.imeiNos.add(elem);
    }

    public List<String> getImeiNos() {
      return this.imeiNos;
    }

    public void setImeiNos(List<String> imeiNos) {
      this.imeiNos = imeiNos;
    }

    public void unsetImeiNos() {
      this.imeiNos = null;
    }

    /** Returns true if field imeiNos is set (has been assigned a value) and false otherwise */
    public boolean isSetImeiNos() {
      return this.imeiNos != null;
    }

    public void setImeiNosIsSet(boolean value) {
      if (!value) {
        this.imeiNos = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case IMEI_NOS:
        if (value == null) {
          unsetImeiNos();
        } else {
          setImeiNos((List<String>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case IMEI_NOS:
        return getImeiNos();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case IMEI_NOS:
        return isSetImeiNos();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof checkGrnImeiStatus_args)
        return this.equals((checkGrnImeiStatus_args)that);
      return false;
    }

    public boolean equals(checkGrnImeiStatus_args that) {
      if (that == null)
        return false;

      boolean this_present_imeiNos = true && this.isSetImeiNos();
      boolean that_present_imeiNos = true && that.isSetImeiNos();
      if (this_present_imeiNos || that_present_imeiNos) {
        if (!(this_present_imeiNos && that_present_imeiNos))
          return false;
        if (!this.imeiNos.equals(that.imeiNos))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(checkGrnImeiStatus_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      checkGrnImeiStatus_args typedOther = (checkGrnImeiStatus_args)other;

      lastComparison = Boolean.valueOf(isSetImeiNos()).compareTo(typedOther.isSetImeiNos());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetImeiNos()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imeiNos, typedOther.imeiNos);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // IMEI_NOS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list162 = iprot.readListBegin();
                this.imeiNos = new ArrayList<String>(_list162.size);
                for (int _i163 = 0; _i163 < _list162.size; ++_i163)
                {
                  String _elem164; // required
                  _elem164 = iprot.readString();
                  this.imeiNos.add(_elem164);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.imeiNos != null) {
        oprot.writeFieldBegin(IMEI_NOS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.imeiNos.size()));
          for (String _iter165 : this.imeiNos)
          {
            oprot.writeString(_iter165);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("checkGrnImeiStatus_args(");
      boolean first = true;

      sb.append("imeiNos:");
      if (this.imeiNos == null) {
        sb.append("null");
      } else {
        sb.append(this.imeiNos);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class checkGrnImeiStatus_result implements org.apache.thrift.TBase<checkGrnImeiStatus_result, checkGrnImeiStatus_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkGrnImeiStatus_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<String> success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkGrnImeiStatus_result.class, metaDataMap);
    }

    public checkGrnImeiStatus_result() {
    }

    public checkGrnImeiStatus_result(
      List<String> success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public checkGrnImeiStatus_result(checkGrnImeiStatus_result other) {
      if (other.isSetSuccess()) {
        List<String> __this__success = new ArrayList<String>();
        for (String other_element : other.success) {
          __this__success.add(other_element);
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public checkGrnImeiStatus_result deepCopy() {
      return new checkGrnImeiStatus_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.ex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<String> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(String elem) {
      if (this.success == null) {
        this.success = new ArrayList<String>();
      }
      this.success.add(elem);
    }

    public List<String> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<String> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<String>)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof checkGrnImeiStatus_result)
        return this.equals((checkGrnImeiStatus_result)that);
      return false;
    }

    public boolean equals(checkGrnImeiStatus_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(checkGrnImeiStatus_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      checkGrnImeiStatus_result typedOther = (checkGrnImeiStatus_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list166 = iprot.readListBegin();
                this.success = new ArrayList<String>(_list166.size);
                for (int _i167 = 0; _i167 < _list166.size; ++_i167)
                {
                  String _elem168; // required
                  _elem168 = iprot.readString();
                  this.success.add(_elem168);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.success.size()));
          for (String _iter169 : this.success)
          {
            oprot.writeString(_iter169);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("checkGrnImeiStatus_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryAgeConsideredItems_args implements org.apache.thrift.TBase<getInventoryAgeConsideredItems_args, getInventoryAgeConsideredItems_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryAgeConsideredItems_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long itemId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ITEM_ID((short)1, "itemId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ITEM_ID
            return ITEM_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryAgeConsideredItems_args.class, metaDataMap);
    }

    public getInventoryAgeConsideredItems_args() {
    }

    public getInventoryAgeConsideredItems_args(
      long itemId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryAgeConsideredItems_args(getInventoryAgeConsideredItems_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
    }

    public getInventoryAgeConsideredItems_args deepCopy() {
      return new getInventoryAgeConsideredItems_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
    }

    public long getItemId() {
      return this.itemId;
    }

    public void setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ITEM_ID:
        return isSetItemId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryAgeConsideredItems_args)
        return this.equals((getInventoryAgeConsideredItems_args)that);
      return false;
    }

    public boolean equals(getInventoryAgeConsideredItems_args that) {
      if (that == null)
        return false;

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryAgeConsideredItems_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryAgeConsideredItems_args typedOther = (getInventoryAgeConsideredItems_args)other;

      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryAgeConsideredItems_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryAgeConsideredItems_result implements org.apache.thrift.TBase<getInventoryAgeConsideredItems_result, getInventoryAgeConsideredItems_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryAgeConsideredItems_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<InvAgeConsiderItems> success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InvAgeConsiderItems.class))));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryAgeConsideredItems_result.class, metaDataMap);
    }

    public getInventoryAgeConsideredItems_result() {
    }

    public getInventoryAgeConsideredItems_result(
      List<InvAgeConsiderItems> success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryAgeConsideredItems_result(getInventoryAgeConsideredItems_result other) {
      if (other.isSetSuccess()) {
        List<InvAgeConsiderItems> __this__success = new ArrayList<InvAgeConsiderItems>();
        for (InvAgeConsiderItems other_element : other.success) {
          __this__success.add(new InvAgeConsiderItems(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public getInventoryAgeConsideredItems_result deepCopy() {
      return new getInventoryAgeConsideredItems_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.ex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InvAgeConsiderItems> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InvAgeConsiderItems elem) {
      if (this.success == null) {
        this.success = new ArrayList<InvAgeConsiderItems>();
      }
      this.success.add(elem);
    }

    public List<InvAgeConsiderItems> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InvAgeConsiderItems> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InvAgeConsiderItems>)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryAgeConsideredItems_result)
        return this.equals((getInventoryAgeConsideredItems_result)that);
      return false;
    }

    public boolean equals(getInventoryAgeConsideredItems_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryAgeConsideredItems_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryAgeConsideredItems_result typedOther = (getInventoryAgeConsideredItems_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list170 = iprot.readListBegin();
                this.success = new ArrayList<InvAgeConsiderItems>(_list170.size);
                for (int _i171 = 0; _i171 < _list170.size; ++_i171)
                {
                  InvAgeConsiderItems _elem172; // required
                  _elem172 = new InvAgeConsiderItems();
                  _elem172.read(iprot);
                  this.success.add(_elem172);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InvAgeConsiderItems _iter173 : this.success)
          {
            _iter173.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryAgeConsideredItems_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCompleteMovementForThirdPartyWarehouse_args implements org.apache.thrift.TBase<getCompleteMovementForThirdPartyWarehouse_args, getCompleteMovementForThirdPartyWarehouse_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCompleteMovementForThirdPartyWarehouse_args");

    private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)2);

    private long startDate; // required
    private long endDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      START_DATE((short)1, "startDate"),
      END_DATE((short)2, "endDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // START_DATE
            return START_DATE;
          case 2: // END_DATE
            return END_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STARTDATE_ISSET_ID = 0;
    private static final int __ENDDATE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCompleteMovementForThirdPartyWarehouse_args.class, metaDataMap);
    }

    public getCompleteMovementForThirdPartyWarehouse_args() {
    }

    public getCompleteMovementForThirdPartyWarehouse_args(
      long startDate,
      long endDate)
    {
      this();
      this.startDate = startDate;
      setStartDateIsSet(true);
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCompleteMovementForThirdPartyWarehouse_args(getCompleteMovementForThirdPartyWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.startDate = other.startDate;
      this.endDate = other.endDate;
    }

    public getCompleteMovementForThirdPartyWarehouse_args deepCopy() {
      return new getCompleteMovementForThirdPartyWarehouse_args(this);
    }

    @Override
    public void clear() {
      setStartDateIsSet(false);
      this.startDate = 0;
      setEndDateIsSet(false);
      this.endDate = 0;
    }

    public long getStartDate() {
      return this.startDate;
    }

    public void setStartDate(long startDate) {
      this.startDate = startDate;
      setStartDateIsSet(true);
    }

    public void unsetStartDate() {
      __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
    }

    /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
    public boolean isSetStartDate() {
      return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
    }

    public void setStartDateIsSet(boolean value) {
      __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
    }

    public long getEndDate() {
      return this.endDate;
    }

    public void setEndDate(long endDate) {
      this.endDate = endDate;
      setEndDateIsSet(true);
    }

    public void unsetEndDate() {
      __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
    }

    /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
    public boolean isSetEndDate() {
      return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
    }

    public void setEndDateIsSet(boolean value) {
      __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case START_DATE:
        if (value == null) {
          unsetStartDate();
        } else {
          setStartDate((Long)value);
        }
        break;

      case END_DATE:
        if (value == null) {
          unsetEndDate();
        } else {
          setEndDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case START_DATE:
        return Long.valueOf(getStartDate());

      case END_DATE:
        return Long.valueOf(getEndDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case START_DATE:
        return isSetStartDate();
      case END_DATE:
        return isSetEndDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCompleteMovementForThirdPartyWarehouse_args)
        return this.equals((getCompleteMovementForThirdPartyWarehouse_args)that);
      return false;
    }

    public boolean equals(getCompleteMovementForThirdPartyWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_startDate = true;
      boolean that_present_startDate = true;
      if (this_present_startDate || that_present_startDate) {
        if (!(this_present_startDate && that_present_startDate))
          return false;
        if (this.startDate != that.startDate)
          return false;
      }

      boolean this_present_endDate = true;
      boolean that_present_endDate = true;
      if (this_present_endDate || that_present_endDate) {
        if (!(this_present_endDate && that_present_endDate))
          return false;
        if (this.endDate != that.endDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCompleteMovementForThirdPartyWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCompleteMovementForThirdPartyWarehouse_args typedOther = (getCompleteMovementForThirdPartyWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // START_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.startDate = iprot.readI64();
              setStartDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // END_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.endDate = iprot.readI64();
              setEndDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
      oprot.writeI64(this.startDate);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
      oprot.writeI64(this.endDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCompleteMovementForThirdPartyWarehouse_args(");
      boolean first = true;

      sb.append("startDate:");
      sb.append(this.startDate);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endDate:");
      sb.append(this.endDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getCompleteMovementForThirdPartyWarehouse_result implements org.apache.thrift.TBase<getCompleteMovementForThirdPartyWarehouse_result, getCompleteMovementForThirdPartyWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCompleteMovementForThirdPartyWarehouse_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<InventoryMovement> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryMovement.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCompleteMovementForThirdPartyWarehouse_result.class, metaDataMap);
    }

    public getCompleteMovementForThirdPartyWarehouse_result() {
    }

    public getCompleteMovementForThirdPartyWarehouse_result(
      List<InventoryMovement> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCompleteMovementForThirdPartyWarehouse_result(getCompleteMovementForThirdPartyWarehouse_result other) {
      if (other.isSetSuccess()) {
        List<InventoryMovement> __this__success = new ArrayList<InventoryMovement>();
        for (InventoryMovement other_element : other.success) {
          __this__success.add(new InventoryMovement(other_element));
        }
        this.success = __this__success;
      }
    }

    public getCompleteMovementForThirdPartyWarehouse_result deepCopy() {
      return new getCompleteMovementForThirdPartyWarehouse_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryMovement> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryMovement elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryMovement>();
      }
      this.success.add(elem);
    }

    public List<InventoryMovement> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryMovement> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryMovement>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCompleteMovementForThirdPartyWarehouse_result)
        return this.equals((getCompleteMovementForThirdPartyWarehouse_result)that);
      return false;
    }

    public boolean equals(getCompleteMovementForThirdPartyWarehouse_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCompleteMovementForThirdPartyWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCompleteMovementForThirdPartyWarehouse_result typedOther = (getCompleteMovementForThirdPartyWarehouse_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list174 = iprot.readListBegin();
                this.success = new ArrayList<InventoryMovement>(_list174.size);
                for (int _i175 = 0; _i175 < _list174.size; ++_i175)
                {
                  InventoryMovement _elem176; // required
                  _elem176 = new InventoryMovement();
                  _elem176.read(iprot);
                  this.success.add(_elem176);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryMovement _iter177 : this.success)
          {
            _iter177.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCompleteMovementForThirdPartyWarehouse_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getAllDoaOutInventoryItems_args implements org.apache.thrift.TBase<getAllDoaOutInventoryItems_args, getAllDoaOutInventoryItems_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllDoaOutInventoryItems_args");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllDoaOutInventoryItems_args.class, metaDataMap);
    }

    public getAllDoaOutInventoryItems_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllDoaOutInventoryItems_args(getAllDoaOutInventoryItems_args other) {
    }

    public getAllDoaOutInventoryItems_args deepCopy() {
      return new getAllDoaOutInventoryItems_args(this);
    }

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllDoaOutInventoryItems_args)
        return this.equals((getAllDoaOutInventoryItems_args)that);
      return false;
    }

    public boolean equals(getAllDoaOutInventoryItems_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllDoaOutInventoryItems_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllDoaOutInventoryItems_args typedOther = (getAllDoaOutInventoryItems_args)other;

      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllDoaOutInventoryItems_args(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getAllDoaOutInventoryItems_result implements org.apache.thrift.TBase<getAllDoaOutInventoryItems_result, getAllDoaOutInventoryItems_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllDoaOutInventoryItems_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<DoaOutInventoryItem> success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DoaOutInventoryItem.class))));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllDoaOutInventoryItems_result.class, metaDataMap);
    }

    public getAllDoaOutInventoryItems_result() {
    }

    public getAllDoaOutInventoryItems_result(
      List<DoaOutInventoryItem> success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllDoaOutInventoryItems_result(getAllDoaOutInventoryItems_result other) {
      if (other.isSetSuccess()) {
        List<DoaOutInventoryItem> __this__success = new ArrayList<DoaOutInventoryItem>();
        for (DoaOutInventoryItem other_element : other.success) {
          __this__success.add(new DoaOutInventoryItem(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public getAllDoaOutInventoryItems_result deepCopy() {
      return new getAllDoaOutInventoryItems_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.ex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<DoaOutInventoryItem> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(DoaOutInventoryItem elem) {
      if (this.success == null) {
        this.success = new ArrayList<DoaOutInventoryItem>();
      }
      this.success.add(elem);
    }

    public List<DoaOutInventoryItem> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<DoaOutInventoryItem> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<DoaOutInventoryItem>)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllDoaOutInventoryItems_result)
        return this.equals((getAllDoaOutInventoryItems_result)that);
      return false;
    }

    public boolean equals(getAllDoaOutInventoryItems_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllDoaOutInventoryItems_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllDoaOutInventoryItems_result typedOther = (getAllDoaOutInventoryItems_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list178 = iprot.readListBegin();
                this.success = new ArrayList<DoaOutInventoryItem>(_list178.size);
                for (int _i179 = 0; _i179 < _list178.size; ++_i179)
                {
                  DoaOutInventoryItem _elem180; // required
                  _elem180 = new DoaOutInventoryItem();
                  _elem180.read(iprot);
                  this.success.add(_elem180);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (DoaOutInventoryItem _iter181 : this.success)
          {
            _iter181.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllDoaOutInventoryItems_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getAllUnCompletedStockShipments_args implements org.apache.thrift.TBase<getAllUnCompletedStockShipments_args, getAllUnCompletedStockShipments_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUnCompletedStockShipments_args");

    private static final org.apache.thrift.protocol.TField SOURCE_FIELD_DESC = new org.apache.thrift.protocol.TField("source", org.apache.thrift.protocol.TType.STRING, (short)1);

    private String source; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SOURCE((short)1, "source");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SOURCE
            return SOURCE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SOURCE, new org.apache.thrift.meta_data.FieldMetaData("source", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUnCompletedStockShipments_args.class, metaDataMap);
    }

    public getAllUnCompletedStockShipments_args() {
    }

    public getAllUnCompletedStockShipments_args(
      String source)
    {
      this();
      this.source = source;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllUnCompletedStockShipments_args(getAllUnCompletedStockShipments_args other) {
      if (other.isSetSource()) {
        this.source = other.source;
      }
    }

    public getAllUnCompletedStockShipments_args deepCopy() {
      return new getAllUnCompletedStockShipments_args(this);
    }

    @Override
    public void clear() {
      this.source = null;
    }

    public String getSource() {
      return this.source;
    }

    public void setSource(String source) {
      this.source = source;
    }

    public void unsetSource() {
      this.source = null;
    }

    /** Returns true if field source is set (has been assigned a value) and false otherwise */
    public boolean isSetSource() {
      return this.source != null;
    }

    public void setSourceIsSet(boolean value) {
      if (!value) {
        this.source = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SOURCE:
        if (value == null) {
          unsetSource();
        } else {
          setSource((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SOURCE:
        return getSource();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SOURCE:
        return isSetSource();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllUnCompletedStockShipments_args)
        return this.equals((getAllUnCompletedStockShipments_args)that);
      return false;
    }

    public boolean equals(getAllUnCompletedStockShipments_args that) {
      if (that == null)
        return false;

      boolean this_present_source = true && this.isSetSource();
      boolean that_present_source = true && that.isSetSource();
      if (this_present_source || that_present_source) {
        if (!(this_present_source && that_present_source))
          return false;
        if (!this.source.equals(that.source))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllUnCompletedStockShipments_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllUnCompletedStockShipments_args typedOther = (getAllUnCompletedStockShipments_args)other;

      lastComparison = Boolean.valueOf(isSetSource()).compareTo(typedOther.isSetSource());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSource()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source, typedOther.source);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SOURCE
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.source = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.source != null) {
        oprot.writeFieldBegin(SOURCE_FIELD_DESC);
        oprot.writeString(this.source);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllUnCompletedStockShipments_args(");
      boolean first = true;

      sb.append("source:");
      if (this.source == null) {
        sb.append("null");
      } else {
        sb.append(this.source);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getAllUnCompletedStockShipments_result implements org.apache.thrift.TBase<getAllUnCompletedStockShipments_result, getAllUnCompletedStockShipments_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUnCompletedStockShipments_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<RemovalStockShipmentReference> success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RemovalStockShipmentReference.class))));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUnCompletedStockShipments_result.class, metaDataMap);
    }

    public getAllUnCompletedStockShipments_result() {
    }

    public getAllUnCompletedStockShipments_result(
      List<RemovalStockShipmentReference> success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllUnCompletedStockShipments_result(getAllUnCompletedStockShipments_result other) {
      if (other.isSetSuccess()) {
        List<RemovalStockShipmentReference> __this__success = new ArrayList<RemovalStockShipmentReference>();
        for (RemovalStockShipmentReference other_element : other.success) {
          __this__success.add(new RemovalStockShipmentReference(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public getAllUnCompletedStockShipments_result deepCopy() {
      return new getAllUnCompletedStockShipments_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.ex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<RemovalStockShipmentReference> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(RemovalStockShipmentReference elem) {
      if (this.success == null) {
        this.success = new ArrayList<RemovalStockShipmentReference>();
      }
      this.success.add(elem);
    }

    public List<RemovalStockShipmentReference> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<RemovalStockShipmentReference> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<RemovalStockShipmentReference>)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllUnCompletedStockShipments_result)
        return this.equals((getAllUnCompletedStockShipments_result)that);
      return false;
    }

    public boolean equals(getAllUnCompletedStockShipments_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllUnCompletedStockShipments_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllUnCompletedStockShipments_result typedOther = (getAllUnCompletedStockShipments_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list182 = iprot.readListBegin();
                this.success = new ArrayList<RemovalStockShipmentReference>(_list182.size);
                for (int _i183 = 0; _i183 < _list182.size; ++_i183)
                {
                  RemovalStockShipmentReference _elem184; // required
                  _elem184 = new RemovalStockShipmentReference();
                  _elem184.read(iprot);
                  this.success.add(_elem184);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (RemovalStockShipmentReference _iter185 : this.success)
          {
            _iter185.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllUnCompletedStockShipments_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getRemovalStockShipmentReferenceById_args implements org.apache.thrift.TBase<getRemovalStockShipmentReferenceById_args, getRemovalStockShipmentReferenceById_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRemovalStockShipmentReferenceById_args");

    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long id; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ID((short)1, "id");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ID
            return ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRemovalStockShipmentReferenceById_args.class, metaDataMap);
    }

    public getRemovalStockShipmentReferenceById_args() {
    }

    public getRemovalStockShipmentReferenceById_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRemovalStockShipmentReferenceById_args(getRemovalStockShipmentReferenceById_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

    public getRemovalStockShipmentReferenceById_args deepCopy() {
      return new getRemovalStockShipmentReferenceById_args(this);
    }

    @Override
    public void clear() {
      setIdIsSet(false);
      this.id = 0;
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return Long.valueOf(getId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getRemovalStockShipmentReferenceById_args)
        return this.equals((getRemovalStockShipmentReferenceById_args)that);
      return false;
    }

    public boolean equals(getRemovalStockShipmentReferenceById_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getRemovalStockShipmentReferenceById_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getRemovalStockShipmentReferenceById_args typedOther = (getRemovalStockShipmentReferenceById_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getRemovalStockShipmentReferenceById_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getRemovalStockShipmentReferenceById_result implements org.apache.thrift.TBase<getRemovalStockShipmentReferenceById_result, getRemovalStockShipmentReferenceById_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRemovalStockShipmentReferenceById_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private RemovalStockShipmentReference success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RemovalStockShipmentReference.class)));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRemovalStockShipmentReferenceById_result.class, metaDataMap);
    }

    public getRemovalStockShipmentReferenceById_result() {
    }

    public getRemovalStockShipmentReferenceById_result(
      RemovalStockShipmentReference success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRemovalStockShipmentReferenceById_result(getRemovalStockShipmentReferenceById_result other) {
      if (other.isSetSuccess()) {
        this.success = new RemovalStockShipmentReference(other.success);
      }
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public getRemovalStockShipmentReferenceById_result deepCopy() {
      return new getRemovalStockShipmentReferenceById_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.ex = null;
    }

    public RemovalStockShipmentReference getSuccess() {
      return this.success;
    }

    public void setSuccess(RemovalStockShipmentReference success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RemovalStockShipmentReference)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getRemovalStockShipmentReferenceById_result)
        return this.equals((getRemovalStockShipmentReferenceById_result)that);
      return false;
    }

    public boolean equals(getRemovalStockShipmentReferenceById_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getRemovalStockShipmentReferenceById_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getRemovalStockShipmentReferenceById_result typedOther = (getRemovalStockShipmentReferenceById_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new RemovalStockShipmentReference();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getRemovalStockShipmentReferenceById_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class createRemovalStockShipmentReference_args implements org.apache.thrift.TBase<createRemovalStockShipmentReference_args, createRemovalStockShipmentReference_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createRemovalStockShipmentReference_args");

    private static final org.apache.thrift.protocol.TField REMOVAL_STOCK_SHIPMENT_REFERENCE_FIELD_DESC = new org.apache.thrift.protocol.TField("removalStockShipmentReference", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private RemovalStockShipmentReference removalStockShipmentReference; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      REMOVAL_STOCK_SHIPMENT_REFERENCE((short)1, "removalStockShipmentReference");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REMOVAL_STOCK_SHIPMENT_REFERENCE
            return REMOVAL_STOCK_SHIPMENT_REFERENCE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.REMOVAL_STOCK_SHIPMENT_REFERENCE, new org.apache.thrift.meta_data.FieldMetaData("removalStockShipmentReference", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RemovalStockShipmentReference.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createRemovalStockShipmentReference_args.class, metaDataMap);
    }

    public createRemovalStockShipmentReference_args() {
    }

    public createRemovalStockShipmentReference_args(
      RemovalStockShipmentReference removalStockShipmentReference)
    {
      this();
      this.removalStockShipmentReference = removalStockShipmentReference;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createRemovalStockShipmentReference_args(createRemovalStockShipmentReference_args other) {
      if (other.isSetRemovalStockShipmentReference()) {
        this.removalStockShipmentReference = new RemovalStockShipmentReference(other.removalStockShipmentReference);
      }
    }

    public createRemovalStockShipmentReference_args deepCopy() {
      return new createRemovalStockShipmentReference_args(this);
    }

    @Override
    public void clear() {
      this.removalStockShipmentReference = null;
    }

    public RemovalStockShipmentReference getRemovalStockShipmentReference() {
      return this.removalStockShipmentReference;
    }

    public void setRemovalStockShipmentReference(RemovalStockShipmentReference removalStockShipmentReference) {
      this.removalStockShipmentReference = removalStockShipmentReference;
    }

    public void unsetRemovalStockShipmentReference() {
      this.removalStockShipmentReference = null;
    }

    /** Returns true if field removalStockShipmentReference is set (has been assigned a value) and false otherwise */
    public boolean isSetRemovalStockShipmentReference() {
      return this.removalStockShipmentReference != null;
    }

    public void setRemovalStockShipmentReferenceIsSet(boolean value) {
      if (!value) {
        this.removalStockShipmentReference = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case REMOVAL_STOCK_SHIPMENT_REFERENCE:
        if (value == null) {
          unsetRemovalStockShipmentReference();
        } else {
          setRemovalStockShipmentReference((RemovalStockShipmentReference)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case REMOVAL_STOCK_SHIPMENT_REFERENCE:
        return getRemovalStockShipmentReference();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case REMOVAL_STOCK_SHIPMENT_REFERENCE:
        return isSetRemovalStockShipmentReference();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createRemovalStockShipmentReference_args)
        return this.equals((createRemovalStockShipmentReference_args)that);
      return false;
    }

    public boolean equals(createRemovalStockShipmentReference_args that) {
      if (that == null)
        return false;

      boolean this_present_removalStockShipmentReference = true && this.isSetRemovalStockShipmentReference();
      boolean that_present_removalStockShipmentReference = true && that.isSetRemovalStockShipmentReference();
      if (this_present_removalStockShipmentReference || that_present_removalStockShipmentReference) {
        if (!(this_present_removalStockShipmentReference && that_present_removalStockShipmentReference))
          return false;
        if (!this.removalStockShipmentReference.equals(that.removalStockShipmentReference))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createRemovalStockShipmentReference_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createRemovalStockShipmentReference_args typedOther = (createRemovalStockShipmentReference_args)other;

      lastComparison = Boolean.valueOf(isSetRemovalStockShipmentReference()).compareTo(typedOther.isSetRemovalStockShipmentReference());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRemovalStockShipmentReference()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.removalStockShipmentReference, typedOther.removalStockShipmentReference);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // REMOVAL_STOCK_SHIPMENT_REFERENCE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.removalStockShipmentReference = new RemovalStockShipmentReference();
              this.removalStockShipmentReference.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.removalStockShipmentReference != null) {
        oprot.writeFieldBegin(REMOVAL_STOCK_SHIPMENT_REFERENCE_FIELD_DESC);
        this.removalStockShipmentReference.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createRemovalStockShipmentReference_args(");
      boolean first = true;

      sb.append("removalStockShipmentReference:");
      if (this.removalStockShipmentReference == null) {
        sb.append("null");
      } else {
        sb.append(this.removalStockShipmentReference);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class createRemovalStockShipmentReference_result implements org.apache.thrift.TBase<createRemovalStockShipmentReference_result, createRemovalStockShipmentReference_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createRemovalStockShipmentReference_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createRemovalStockShipmentReference_result.class, metaDataMap);
    }

    public createRemovalStockShipmentReference_result() {
    }

    public createRemovalStockShipmentReference_result(
      long success,
      WarehouseServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createRemovalStockShipmentReference_result(createRemovalStockShipmentReference_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public createRemovalStockShipmentReference_result deepCopy() {
      return new createRemovalStockShipmentReference_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.ex = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public void setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createRemovalStockShipmentReference_result)
        return this.equals((createRemovalStockShipmentReference_result)that);
      return false;
    }

    public boolean equals(createRemovalStockShipmentReference_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createRemovalStockShipmentReference_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createRemovalStockShipmentReference_result typedOther = (createRemovalStockShipmentReference_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.success = iprot.readI64();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createRemovalStockShipmentReference_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class updateShipmentReferenceTransferLot_args implements org.apache.thrift.TBase<updateShipmentReferenceTransferLot_args, updateShipmentReferenceTransferLot_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateShipmentReferenceTransferLot_args");

    private static final org.apache.thrift.protocol.TField TRANSFER_LOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transferLotId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SHIPMENT_REFERENCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("shipmentReferenceId", org.apache.thrift.protocol.TType.I64, (short)2);

    private long transferLotId; // required
    private long shipmentReferenceId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      TRANSFER_LOT_ID((short)1, "transferLotId"),
      SHIPMENT_REFERENCE_ID((short)2, "shipmentReferenceId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // TRANSFER_LOT_ID
            return TRANSFER_LOT_ID;
          case 2: // SHIPMENT_REFERENCE_ID
            return SHIPMENT_REFERENCE_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TRANSFERLOTID_ISSET_ID = 0;
    private static final int __SHIPMENTREFERENCEID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.TRANSFER_LOT_ID, new org.apache.thrift.meta_data.FieldMetaData("transferLotId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SHIPMENT_REFERENCE_ID, new org.apache.thrift.meta_data.FieldMetaData("shipmentReferenceId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateShipmentReferenceTransferLot_args.class, metaDataMap);
    }

    public updateShipmentReferenceTransferLot_args() {
    }

    public updateShipmentReferenceTransferLot_args(
      long transferLotId,
      long shipmentReferenceId)
    {
      this();
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
      this.shipmentReferenceId = shipmentReferenceId;
      setShipmentReferenceIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateShipmentReferenceTransferLot_args(updateShipmentReferenceTransferLot_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.transferLotId = other.transferLotId;
      this.shipmentReferenceId = other.shipmentReferenceId;
    }

    public updateShipmentReferenceTransferLot_args deepCopy() {
      return new updateShipmentReferenceTransferLot_args(this);
    }

    @Override
    public void clear() {
      setTransferLotIdIsSet(false);
      this.transferLotId = 0;
      setShipmentReferenceIdIsSet(false);
      this.shipmentReferenceId = 0;
    }

    public long getTransferLotId() {
      return this.transferLotId;
    }

    public void setTransferLotId(long transferLotId) {
      this.transferLotId = transferLotId;
      setTransferLotIdIsSet(true);
    }

    public void unsetTransferLotId() {
      __isset_bit_vector.clear(__TRANSFERLOTID_ISSET_ID);
    }

    /** Returns true if field transferLotId is set (has been assigned a value) and false otherwise */
    public boolean isSetTransferLotId() {
      return __isset_bit_vector.get(__TRANSFERLOTID_ISSET_ID);
    }

    public void setTransferLotIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSFERLOTID_ISSET_ID, value);
    }

    public long getShipmentReferenceId() {
      return this.shipmentReferenceId;
    }

    public void setShipmentReferenceId(long shipmentReferenceId) {
      this.shipmentReferenceId = shipmentReferenceId;
      setShipmentReferenceIdIsSet(true);
    }

    public void unsetShipmentReferenceId() {
      __isset_bit_vector.clear(__SHIPMENTREFERENCEID_ISSET_ID);
    }

    /** Returns true if field shipmentReferenceId is set (has been assigned a value) and false otherwise */
    public boolean isSetShipmentReferenceId() {
      return __isset_bit_vector.get(__SHIPMENTREFERENCEID_ISSET_ID);
    }

    public void setShipmentReferenceIdIsSet(boolean value) {
      __isset_bit_vector.set(__SHIPMENTREFERENCEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TRANSFER_LOT_ID:
        if (value == null) {
          unsetTransferLotId();
        } else {
          setTransferLotId((Long)value);
        }
        break;

      case SHIPMENT_REFERENCE_ID:
        if (value == null) {
          unsetShipmentReferenceId();
        } else {
          setShipmentReferenceId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TRANSFER_LOT_ID:
        return Long.valueOf(getTransferLotId());

      case SHIPMENT_REFERENCE_ID:
        return Long.valueOf(getShipmentReferenceId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case TRANSFER_LOT_ID:
        return isSetTransferLotId();
      case SHIPMENT_REFERENCE_ID:
        return isSetShipmentReferenceId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateShipmentReferenceTransferLot_args)
        return this.equals((updateShipmentReferenceTransferLot_args)that);
      return false;
    }

    public boolean equals(updateShipmentReferenceTransferLot_args that) {
      if (that == null)
        return false;

      boolean this_present_transferLotId = true;
      boolean that_present_transferLotId = true;
      if (this_present_transferLotId || that_present_transferLotId) {
        if (!(this_present_transferLotId && that_present_transferLotId))
          return false;
        if (this.transferLotId != that.transferLotId)
          return false;
      }

      boolean this_present_shipmentReferenceId = true;
      boolean that_present_shipmentReferenceId = true;
      if (this_present_shipmentReferenceId || that_present_shipmentReferenceId) {
        if (!(this_present_shipmentReferenceId && that_present_shipmentReferenceId))
          return false;
        if (this.shipmentReferenceId != that.shipmentReferenceId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateShipmentReferenceTransferLot_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateShipmentReferenceTransferLot_args typedOther = (updateShipmentReferenceTransferLot_args)other;

      lastComparison = Boolean.valueOf(isSetTransferLotId()).compareTo(typedOther.isSetTransferLotId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTransferLotId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferLotId, typedOther.transferLotId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetShipmentReferenceId()).compareTo(typedOther.isSetShipmentReferenceId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetShipmentReferenceId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shipmentReferenceId, typedOther.shipmentReferenceId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // TRANSFER_LOT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.transferLotId = iprot.readI64();
              setTransferLotIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // SHIPMENT_REFERENCE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.shipmentReferenceId = iprot.readI64();
              setShipmentReferenceIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TRANSFER_LOT_ID_FIELD_DESC);
      oprot.writeI64(this.transferLotId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(SHIPMENT_REFERENCE_ID_FIELD_DESC);
      oprot.writeI64(this.shipmentReferenceId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateShipmentReferenceTransferLot_args(");
      boolean first = true;

      sb.append("transferLotId:");
      sb.append(this.transferLotId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("shipmentReferenceId:");
      sb.append(this.shipmentReferenceId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class updateShipmentReferenceTransferLot_result implements org.apache.thrift.TBase<updateShipmentReferenceTransferLot_result, updateShipmentReferenceTransferLot_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateShipmentReferenceTransferLot_result");

    private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException ex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      EX((short)1, "ex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // EX
            return EX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateShipmentReferenceTransferLot_result.class, metaDataMap);
    }

    public updateShipmentReferenceTransferLot_result() {
    }

    public updateShipmentReferenceTransferLot_result(
      WarehouseServiceException ex)
    {
      this();
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateShipmentReferenceTransferLot_result(updateShipmentReferenceTransferLot_result other) {
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public updateShipmentReferenceTransferLot_result deepCopy() {
      return new updateShipmentReferenceTransferLot_result(this);
    }

    @Override
    public void clear() {
      this.ex = null;
    }

    public WarehouseServiceException getEx() {
      return this.ex;
    }

    public void setEx(WarehouseServiceException ex) {
      this.ex = ex;
    }

    public void unsetEx() {
      this.ex = null;
    }

    /** Returns true if field ex is set (has been assigned a value) and false otherwise */
    public boolean isSetEx() {
      return this.ex != null;
    }

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateShipmentReferenceTransferLot_result)
        return this.equals((updateShipmentReferenceTransferLot_result)that);
      return false;
    }

    public boolean equals(updateShipmentReferenceTransferLot_result that) {
      if (that == null)
        return false;

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateShipmentReferenceTransferLot_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateShipmentReferenceTransferLot_result typedOther = (updateShipmentReferenceTransferLot_result)other;

      lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, typedOther.ex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // EX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.ex = new WarehouseServiceException();
              this.ex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateShipmentReferenceTransferLot_result(");
      boolean first = true;

      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class fetchScansPerTransferInvoiceNumber_args implements org.apache.thrift.TBase<fetchScansPerTransferInvoiceNumber_args, fetchScansPerTransferInvoiceNumber_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchScansPerTransferInvoiceNumber_args");

    private static final org.apache.thrift.protocol.TField DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("date", org.apache.thrift.protocol.TType.I64, (short)1);

    private long date; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      DATE((short)1, "date");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DATE
            return DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __DATE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DATE, new org.apache.thrift.meta_data.FieldMetaData("date", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchScansPerTransferInvoiceNumber_args.class, metaDataMap);
    }

    public fetchScansPerTransferInvoiceNumber_args() {
    }

    public fetchScansPerTransferInvoiceNumber_args(
      long date)
    {
      this();
      this.date = date;
      setDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public fetchScansPerTransferInvoiceNumber_args(fetchScansPerTransferInvoiceNumber_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.date = other.date;
    }

    public fetchScansPerTransferInvoiceNumber_args deepCopy() {
      return new fetchScansPerTransferInvoiceNumber_args(this);
    }

    @Override
    public void clear() {
      setDateIsSet(false);
      this.date = 0;
    }

    public long getDate() {
      return this.date;
    }

    public void setDate(long date) {
      this.date = date;
      setDateIsSet(true);
    }

    public void unsetDate() {
      __isset_bit_vector.clear(__DATE_ISSET_ID);
    }

    /** Returns true if field date is set (has been assigned a value) and false otherwise */
    public boolean isSetDate() {
      return __isset_bit_vector.get(__DATE_ISSET_ID);
    }

    public void setDateIsSet(boolean value) {
      __isset_bit_vector.set(__DATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DATE:
        if (value == null) {
          unsetDate();
        } else {
          setDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DATE:
        return Long.valueOf(getDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DATE:
        return isSetDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof fetchScansPerTransferInvoiceNumber_args)
        return this.equals((fetchScansPerTransferInvoiceNumber_args)that);
      return false;
    }

    public boolean equals(fetchScansPerTransferInvoiceNumber_args that) {
      if (that == null)
        return false;

      boolean this_present_date = true;
      boolean that_present_date = true;
      if (this_present_date || that_present_date) {
        if (!(this_present_date && that_present_date))
          return false;
        if (this.date != that.date)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(fetchScansPerTransferInvoiceNumber_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      fetchScansPerTransferInvoiceNumber_args typedOther = (fetchScansPerTransferInvoiceNumber_args)other;

      lastComparison = Boolean.valueOf(isSetDate()).compareTo(typedOther.isSetDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.date, typedOther.date);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.date = iprot.readI64();
              setDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(DATE_FIELD_DESC);
      oprot.writeI64(this.date);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("fetchScansPerTransferInvoiceNumber_args(");
      boolean first = true;

      sb.append("date:");
      sb.append(this.date);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class fetchScansPerTransferInvoiceNumber_result implements org.apache.thrift.TBase<fetchScansPerTransferInvoiceNumber_result, fetchScansPerTransferInvoiceNumber_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchScansPerTransferInvoiceNumber_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<TransferInvoiceScan> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransferInvoiceScan.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchScansPerTransferInvoiceNumber_result.class, metaDataMap);
    }

    public fetchScansPerTransferInvoiceNumber_result() {
    }

    public fetchScansPerTransferInvoiceNumber_result(
      List<TransferInvoiceScan> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public fetchScansPerTransferInvoiceNumber_result(fetchScansPerTransferInvoiceNumber_result other) {
      if (other.isSetSuccess()) {
        List<TransferInvoiceScan> __this__success = new ArrayList<TransferInvoiceScan>();
        for (TransferInvoiceScan other_element : other.success) {
          __this__success.add(new TransferInvoiceScan(other_element));
        }
        this.success = __this__success;
      }
    }

    public fetchScansPerTransferInvoiceNumber_result deepCopy() {
      return new fetchScansPerTransferInvoiceNumber_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<TransferInvoiceScan> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(TransferInvoiceScan elem) {
      if (this.success == null) {
        this.success = new ArrayList<TransferInvoiceScan>();
      }
      this.success.add(elem);
    }

    public List<TransferInvoiceScan> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<TransferInvoiceScan> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<TransferInvoiceScan>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof fetchScansPerTransferInvoiceNumber_result)
        return this.equals((fetchScansPerTransferInvoiceNumber_result)that);
      return false;
    }

    public boolean equals(fetchScansPerTransferInvoiceNumber_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(fetchScansPerTransferInvoiceNumber_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      fetchScansPerTransferInvoiceNumber_result typedOther = (fetchScansPerTransferInvoiceNumber_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list186 = iprot.readListBegin();
                this.success = new ArrayList<TransferInvoiceScan>(_list186.size);
                for (int _i187 = 0; _i187 < _list186.size; ++_i187)
                {
                  TransferInvoiceScan _elem188; // required
                  _elem188 = new TransferInvoiceScan();
                  _elem188.read(iprot);
                  this.success.add(_elem188);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (TransferInvoiceScan _iter189 : this.success)
          {
            _iter189.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("fetchScansPerTransferInvoiceNumber_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItems_args implements org.apache.thrift.TBase<getInventoryItems_args, getInventoryItems_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItems_args");

    private static final org.apache.thrift.protocol.TField SERIAL_NUMBERS_FIELD_DESC = new org.apache.thrift.protocol.TField("serialNumbers", org.apache.thrift.protocol.TType.LIST, (short)1);

    private List<String> serialNumbers; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SERIAL_NUMBERS((short)1, "serialNumbers");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SERIAL_NUMBERS
            return SERIAL_NUMBERS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SERIAL_NUMBERS, new org.apache.thrift.meta_data.FieldMetaData("serialNumbers", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItems_args.class, metaDataMap);
    }

    public getInventoryItems_args() {
    }

    public getInventoryItems_args(
      List<String> serialNumbers)
    {
      this();
      this.serialNumbers = serialNumbers;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItems_args(getInventoryItems_args other) {
      if (other.isSetSerialNumbers()) {
        List<String> __this__serialNumbers = new ArrayList<String>();
        for (String other_element : other.serialNumbers) {
          __this__serialNumbers.add(other_element);
        }
        this.serialNumbers = __this__serialNumbers;
      }
    }

    public getInventoryItems_args deepCopy() {
      return new getInventoryItems_args(this);
    }

    @Override
    public void clear() {
      this.serialNumbers = null;
    }

    public int getSerialNumbersSize() {
      return (this.serialNumbers == null) ? 0 : this.serialNumbers.size();
    }

    public java.util.Iterator<String> getSerialNumbersIterator() {
      return (this.serialNumbers == null) ? null : this.serialNumbers.iterator();
    }

    public void addToSerialNumbers(String elem) {
      if (this.serialNumbers == null) {
        this.serialNumbers = new ArrayList<String>();
      }
      this.serialNumbers.add(elem);
    }

    public List<String> getSerialNumbers() {
      return this.serialNumbers;
    }

    public void setSerialNumbers(List<String> serialNumbers) {
      this.serialNumbers = serialNumbers;
    }

    public void unsetSerialNumbers() {
      this.serialNumbers = null;
    }

    /** Returns true if field serialNumbers is set (has been assigned a value) and false otherwise */
    public boolean isSetSerialNumbers() {
      return this.serialNumbers != null;
    }

    public void setSerialNumbersIsSet(boolean value) {
      if (!value) {
        this.serialNumbers = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SERIAL_NUMBERS:
        if (value == null) {
          unsetSerialNumbers();
        } else {
          setSerialNumbers((List<String>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SERIAL_NUMBERS:
        return getSerialNumbers();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SERIAL_NUMBERS:
        return isSetSerialNumbers();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItems_args)
        return this.equals((getInventoryItems_args)that);
      return false;
    }

    public boolean equals(getInventoryItems_args that) {
      if (that == null)
        return false;

      boolean this_present_serialNumbers = true && this.isSetSerialNumbers();
      boolean that_present_serialNumbers = true && that.isSetSerialNumbers();
      if (this_present_serialNumbers || that_present_serialNumbers) {
        if (!(this_present_serialNumbers && that_present_serialNumbers))
          return false;
        if (!this.serialNumbers.equals(that.serialNumbers))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItems_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItems_args typedOther = (getInventoryItems_args)other;

      lastComparison = Boolean.valueOf(isSetSerialNumbers()).compareTo(typedOther.isSetSerialNumbers());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSerialNumbers()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialNumbers, typedOther.serialNumbers);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SERIAL_NUMBERS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list190 = iprot.readListBegin();
                this.serialNumbers = new ArrayList<String>(_list190.size);
                for (int _i191 = 0; _i191 < _list190.size; ++_i191)
                {
                  String _elem192; // required
                  _elem192 = iprot.readString();
                  this.serialNumbers.add(_elem192);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.serialNumbers != null) {
        oprot.writeFieldBegin(SERIAL_NUMBERS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.serialNumbers.size()));
          for (String _iter193 : this.serialNumbers)
          {
            oprot.writeString(_iter193);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItems_args(");
      boolean first = true;

      sb.append("serialNumbers:");
      if (this.serialNumbers == null) {
        sb.append("null");
      } else {
        sb.append(this.serialNumbers);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItems_result implements org.apache.thrift.TBase<getInventoryItems_result, getInventoryItems_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItems_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<InventoryItem> success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItems_result.class, metaDataMap);
    }

    public getInventoryItems_result() {
    }

    public getInventoryItems_result(
      List<InventoryItem> success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItems_result(getInventoryItems_result other) {
      if (other.isSetSuccess()) {
        List<InventoryItem> __this__success = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.success) {
          __this__success.add(new InventoryItem(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getInventoryItems_result deepCopy() {
      return new getInventoryItems_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryItem> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryItem elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryItem>();
      }
      this.success.add(elem);
    }

    public List<InventoryItem> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryItem> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryItem>)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItems_result)
        return this.equals((getInventoryItems_result)that);
      return false;
    }

    public boolean equals(getInventoryItems_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItems_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItems_result typedOther = (getInventoryItems_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list194 = iprot.readListBegin();
                this.success = new ArrayList<InventoryItem>(_list194.size);
                for (int _i195 = 0; _i195 < _list194.size; ++_i195)
                {
                  InventoryItem _elem196; // required
                  _elem196 = new InventoryItem();
                  _elem196.read(iprot);
                  this.success.add(_elem196);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryItem _iter197 : this.success)
          {
            _iter197.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItems_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemsBySerailNumbers_args implements org.apache.thrift.TBase<getInventoryItemsBySerailNumbers_args, getInventoryItemsBySerailNumbers_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemsBySerailNumbers_args");

    private static final org.apache.thrift.protocol.TField SERIAL_NUMBERS_FIELD_DESC = new org.apache.thrift.protocol.TField("serialNumbers", org.apache.thrift.protocol.TType.LIST, (short)1);

    private List<String> serialNumbers; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SERIAL_NUMBERS((short)1, "serialNumbers");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SERIAL_NUMBERS
            return SERIAL_NUMBERS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SERIAL_NUMBERS, new org.apache.thrift.meta_data.FieldMetaData("serialNumbers", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemsBySerailNumbers_args.class, metaDataMap);
    }

    public getInventoryItemsBySerailNumbers_args() {
    }

    public getInventoryItemsBySerailNumbers_args(
      List<String> serialNumbers)
    {
      this();
      this.serialNumbers = serialNumbers;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemsBySerailNumbers_args(getInventoryItemsBySerailNumbers_args other) {
      if (other.isSetSerialNumbers()) {
        List<String> __this__serialNumbers = new ArrayList<String>();
        for (String other_element : other.serialNumbers) {
          __this__serialNumbers.add(other_element);
        }
        this.serialNumbers = __this__serialNumbers;
      }
    }

    public getInventoryItemsBySerailNumbers_args deepCopy() {
      return new getInventoryItemsBySerailNumbers_args(this);
    }

    @Override
    public void clear() {
      this.serialNumbers = null;
    }

    public int getSerialNumbersSize() {
      return (this.serialNumbers == null) ? 0 : this.serialNumbers.size();
    }

    public java.util.Iterator<String> getSerialNumbersIterator() {
      return (this.serialNumbers == null) ? null : this.serialNumbers.iterator();
    }

    public void addToSerialNumbers(String elem) {
      if (this.serialNumbers == null) {
        this.serialNumbers = new ArrayList<String>();
      }
      this.serialNumbers.add(elem);
    }

    public List<String> getSerialNumbers() {
      return this.serialNumbers;
    }

    public void setSerialNumbers(List<String> serialNumbers) {
      this.serialNumbers = serialNumbers;
    }

    public void unsetSerialNumbers() {
      this.serialNumbers = null;
    }

    /** Returns true if field serialNumbers is set (has been assigned a value) and false otherwise */
    public boolean isSetSerialNumbers() {
      return this.serialNumbers != null;
    }

    public void setSerialNumbersIsSet(boolean value) {
      if (!value) {
        this.serialNumbers = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SERIAL_NUMBERS:
        if (value == null) {
          unsetSerialNumbers();
        } else {
          setSerialNumbers((List<String>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SERIAL_NUMBERS:
        return getSerialNumbers();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SERIAL_NUMBERS:
        return isSetSerialNumbers();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemsBySerailNumbers_args)
        return this.equals((getInventoryItemsBySerailNumbers_args)that);
      return false;
    }

    public boolean equals(getInventoryItemsBySerailNumbers_args that) {
      if (that == null)
        return false;

      boolean this_present_serialNumbers = true && this.isSetSerialNumbers();
      boolean that_present_serialNumbers = true && that.isSetSerialNumbers();
      if (this_present_serialNumbers || that_present_serialNumbers) {
        if (!(this_present_serialNumbers && that_present_serialNumbers))
          return false;
        if (!this.serialNumbers.equals(that.serialNumbers))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemsBySerailNumbers_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemsBySerailNumbers_args typedOther = (getInventoryItemsBySerailNumbers_args)other;

      lastComparison = Boolean.valueOf(isSetSerialNumbers()).compareTo(typedOther.isSetSerialNumbers());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSerialNumbers()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialNumbers, typedOther.serialNumbers);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SERIAL_NUMBERS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list198 = iprot.readListBegin();
                this.serialNumbers = new ArrayList<String>(_list198.size);
                for (int _i199 = 0; _i199 < _list198.size; ++_i199)
                {
                  String _elem200; // required
                  _elem200 = iprot.readString();
                  this.serialNumbers.add(_elem200);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.serialNumbers != null) {
        oprot.writeFieldBegin(SERIAL_NUMBERS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.serialNumbers.size()));
          for (String _iter201 : this.serialNumbers)
          {
            oprot.writeString(_iter201);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemsBySerailNumbers_args(");
      boolean first = true;

      sb.append("serialNumbers:");
      if (this.serialNumbers == null) {
        sb.append("null");
      } else {
        sb.append(this.serialNumbers);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getInventoryItemsBySerailNumbers_result implements org.apache.thrift.TBase<getInventoryItemsBySerailNumbers_result, getInventoryItemsBySerailNumbers_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItemsBySerailNumbers_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<InventoryItem> success; // required
    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItemsBySerailNumbers_result.class, metaDataMap);
    }

    public getInventoryItemsBySerailNumbers_result() {
    }

    public getInventoryItemsBySerailNumbers_result(
      List<InventoryItem> success,
      WarehouseServiceException wex)
    {
      this();
      this.success = success;
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInventoryItemsBySerailNumbers_result(getInventoryItemsBySerailNumbers_result other) {
      if (other.isSetSuccess()) {
        List<InventoryItem> __this__success = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.success) {
          __this__success.add(new InventoryItem(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public getInventoryItemsBySerailNumbers_result deepCopy() {
      return new getInventoryItemsBySerailNumbers_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.wex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<InventoryItem> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(InventoryItem elem) {
      if (this.success == null) {
        this.success = new ArrayList<InventoryItem>();
      }
      this.success.add(elem);
    }

    public List<InventoryItem> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<InventoryItem> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<InventoryItem>)value);
        }
        break;

      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInventoryItemsBySerailNumbers_result)
        return this.equals((getInventoryItemsBySerailNumbers_result)that);
      return false;
    }

    public boolean equals(getInventoryItemsBySerailNumbers_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInventoryItemsBySerailNumbers_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInventoryItemsBySerailNumbers_result typedOther = (getInventoryItemsBySerailNumbers_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list202 = iprot.readListBegin();
                this.success = new ArrayList<InventoryItem>(_list202.size);
                for (int _i203 = 0; _i203 < _list202.size; ++_i203)
                {
                  InventoryItem _elem204; // required
                  _elem204 = new InventoryItem();
                  _elem204.read(iprot);
                  this.success.add(_elem204);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (InventoryItem _iter205 : this.success)
          {
            _iter205.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInventoryItemsBySerailNumbers_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanPurchaseBulk_args implements org.apache.thrift.TBase<scanPurchaseBulk_args, scanPurchaseBulk_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanPurchaseBulk_args");

    private static final org.apache.thrift.protocol.TField INVENTORY_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItems", org.apache.thrift.protocol.TType.LIST, (short)1);

    private List<InventoryItem> inventoryItems; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      INVENTORY_ITEMS((short)1, "inventoryItems");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // INVENTORY_ITEMS
            return INVENTORY_ITEMS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.INVENTORY_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("inventoryItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanPurchaseBulk_args.class, metaDataMap);
    }

    public scanPurchaseBulk_args() {
    }

    public scanPurchaseBulk_args(
      List<InventoryItem> inventoryItems)
    {
      this();
      this.inventoryItems = inventoryItems;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanPurchaseBulk_args(scanPurchaseBulk_args other) {
      if (other.isSetInventoryItems()) {
        List<InventoryItem> __this__inventoryItems = new ArrayList<InventoryItem>();
        for (InventoryItem other_element : other.inventoryItems) {
          __this__inventoryItems.add(new InventoryItem(other_element));
        }
        this.inventoryItems = __this__inventoryItems;
      }
    }

    public scanPurchaseBulk_args deepCopy() {
      return new scanPurchaseBulk_args(this);
    }

    @Override
    public void clear() {
      this.inventoryItems = null;
    }

    public int getInventoryItemsSize() {
      return (this.inventoryItems == null) ? 0 : this.inventoryItems.size();
    }

    public java.util.Iterator<InventoryItem> getInventoryItemsIterator() {
      return (this.inventoryItems == null) ? null : this.inventoryItems.iterator();
    }

    public void addToInventoryItems(InventoryItem elem) {
      if (this.inventoryItems == null) {
        this.inventoryItems = new ArrayList<InventoryItem>();
      }
      this.inventoryItems.add(elem);
    }

    public List<InventoryItem> getInventoryItems() {
      return this.inventoryItems;
    }

    public void setInventoryItems(List<InventoryItem> inventoryItems) {
      this.inventoryItems = inventoryItems;
    }

    public void unsetInventoryItems() {
      this.inventoryItems = null;
    }

    /** Returns true if field inventoryItems is set (has been assigned a value) and false otherwise */
    public boolean isSetInventoryItems() {
      return this.inventoryItems != null;
    }

    public void setInventoryItemsIsSet(boolean value) {
      if (!value) {
        this.inventoryItems = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case INVENTORY_ITEMS:
        if (value == null) {
          unsetInventoryItems();
        } else {
          setInventoryItems((List<InventoryItem>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case INVENTORY_ITEMS:
        return getInventoryItems();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case INVENTORY_ITEMS:
        return isSetInventoryItems();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanPurchaseBulk_args)
        return this.equals((scanPurchaseBulk_args)that);
      return false;
    }

    public boolean equals(scanPurchaseBulk_args that) {
      if (that == null)
        return false;

      boolean this_present_inventoryItems = true && this.isSetInventoryItems();
      boolean that_present_inventoryItems = true && that.isSetInventoryItems();
      if (this_present_inventoryItems || that_present_inventoryItems) {
        if (!(this_present_inventoryItems && that_present_inventoryItems))
          return false;
        if (!this.inventoryItems.equals(that.inventoryItems))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanPurchaseBulk_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanPurchaseBulk_args typedOther = (scanPurchaseBulk_args)other;

      lastComparison = Boolean.valueOf(isSetInventoryItems()).compareTo(typedOther.isSetInventoryItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInventoryItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItems, typedOther.inventoryItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // INVENTORY_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list206 = iprot.readListBegin();
                this.inventoryItems = new ArrayList<InventoryItem>(_list206.size);
                for (int _i207 = 0; _i207 < _list206.size; ++_i207)
                {
                  InventoryItem _elem208; // required
                  _elem208 = new InventoryItem();
                  _elem208.read(iprot);
                  this.inventoryItems.add(_elem208);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.inventoryItems != null) {
        oprot.writeFieldBegin(INVENTORY_ITEMS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.inventoryItems.size()));
          for (InventoryItem _iter209 : this.inventoryItems)
          {
            _iter209.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanPurchaseBulk_args(");
      boolean first = true;

      sb.append("inventoryItems:");
      if (this.inventoryItems == null) {
        sb.append("null");
      } else {
        sb.append(this.inventoryItems);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class scanPurchaseBulk_result implements org.apache.thrift.TBase<scanPurchaseBulk_result, scanPurchaseBulk_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scanPurchaseBulk_result");

    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private WarehouseServiceException wex; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      WEX((short)1, "wex");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // WEX
            return WEX;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scanPurchaseBulk_result.class, metaDataMap);
    }

    public scanPurchaseBulk_result() {
    }

    public scanPurchaseBulk_result(
      WarehouseServiceException wex)
    {
      this();
      this.wex = wex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanPurchaseBulk_result(scanPurchaseBulk_result other) {
      if (other.isSetWex()) {
        this.wex = new WarehouseServiceException(other.wex);
      }
    }

    public scanPurchaseBulk_result deepCopy() {
      return new scanPurchaseBulk_result(this);
    }

    @Override
    public void clear() {
      this.wex = null;
    }

    public WarehouseServiceException getWex() {
      return this.wex;
    }

    public void setWex(WarehouseServiceException wex) {
      this.wex = wex;
    }

    public void unsetWex() {
      this.wex = null;
    }

    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
    public boolean isSetWex() {
      return this.wex != null;
    }

    public void setWexIsSet(boolean value) {
      if (!value) {
        this.wex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WEX:
        if (value == null) {
          unsetWex();
        } else {
          setWex((WarehouseServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WEX:
        return getWex();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case WEX:
        return isSetWex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scanPurchaseBulk_result)
        return this.equals((scanPurchaseBulk_result)that);
      return false;
    }

    public boolean equals(scanPurchaseBulk_result that) {
      if (that == null)
        return false;

      boolean this_present_wex = true && this.isSetWex();
      boolean that_present_wex = true && that.isSetWex();
      if (this_present_wex || that_present_wex) {
        if (!(this_present_wex && that_present_wex))
          return false;
        if (!this.wex.equals(that.wex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(scanPurchaseBulk_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      scanPurchaseBulk_result typedOther = (scanPurchaseBulk_result)other;

      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // WEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.wex = new WarehouseServiceException();
              this.wex.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetWex()) {
        oprot.writeFieldBegin(WEX_FIELD_DESC);
        this.wex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scanPurchaseBulk_result(");
      boolean first = true;

      sb.append("wex:");
      if (this.wex == null) {
        sb.append("null");
      } else {
        sb.append(this.wex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

}