Subversion Repositories SmartDukaan

Rev

Rev 7957 | Rev 8717 | Go to most recent revision | 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
     */
    public InventoryItem getNonSeralizedInventoryItem(String itemNumber, long itemId, long fulfilmentWarehouseId) 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 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 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 void 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;

    /**
     * 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;

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

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

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

    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 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, 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 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 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 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 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) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_getNonSeralizedInventoryItem(itemNumber, itemId, fulfilmentWarehouseId);
      return recv_getNonSeralizedInventoryItem();
    }

    public void send_getNonSeralizedInventoryItem(String itemNumber, long itemId, long fulfilmentWarehouseId) throws org.apache.thrift.TException
    {
      getNonSeralizedInventoryItem_args args = new getNonSeralizedInventoryItem_args();
      args.setItemNumber(itemNumber);
      args.setItemId(itemId);
      args.setFulfilmentWarehouseId(fulfilmentWarehouseId);
      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 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<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 void scanForPurchaseReturn(List<InventoryItem> saleReturnItems, long vendorId, long billingWarehouseId) throws WarehouseServiceException, org.apache.thrift.TException
    {
      send_scanForPurchaseReturn(saleReturnItems, vendorId, billingWarehouseId);
      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 void recv_scanForPurchaseReturn() throws WarehouseServiceException, org.apache.thrift.TException
    {
      scanForPurchaseReturn_result result = new scanForPurchaseReturn_result();
      receiveBase(result, "scanForPurchaseReturn");
      if (result.ex != null) {
        throw result.ex;
      }
      return;
    }

    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 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 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, org.apache.thrift.async.AsyncMethodCallback<getNonSeralizedInventoryItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getNonSeralizedInventoryItem_call method_call = new getNonSeralizedInventoryItem_call(itemNumber, itemId, fulfilmentWarehouseId, 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;
      public getNonSeralizedInventoryItem_call(String itemNumber, long itemId, long fulfilmentWarehouseId, 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;
      }

      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.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 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 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 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_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 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 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("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("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("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());
      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);
        } 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 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 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 {
          iface.scanForPurchaseReturn(args.saleReturnItems, args.vendorId, args.billingWarehouseId);
        } 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 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;
      }
    }

  }

  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 String itemNumber; // required
    private long itemId; // required
    private long fulfilmentWarehouseId; // 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");

      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;
          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 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_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)));
      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)
    {
      this();
      this.itemNumber = itemNumber;
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.fulfilmentWarehouseId = fulfilmentWarehouseId;
      setFulfilmentWarehouseIdIsSet(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;
    }

    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;
    }

    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 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;

      }
    }

    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());

      }
      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();
      }
      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;
      }

      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;
        }
      }
      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;
          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.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;
      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 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 {
        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 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 _list20 = iprot.readListBegin();
                this.success = new ArrayList<InvoiceScan>(_list20.size);
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
                {
                  InvoiceScan _elem22; // required
                  _elem22 = new InvoiceScan();
                  _elem22.read(iprot);
                  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.STRUCT, this.success.size()));
          for (InvoiceScan _iter23 : this.success)
          {
            _iter23.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 _list24 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAge>(_list24.size);
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
                {
                  InventoryAge _elem26; // required
                  _elem26 = new InventoryAge();
                  _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 (InventoryAge _iter27 : this.success)
          {
            _iter27.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 {
        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 _list28 = iprot.readListBegin();
                this.success = new ArrayList<Scan>(_list28.size);
                for (int _i29 = 0; _i29 < _list28.size; ++_i29)
                {
                  Scan _elem30; // required
                  _elem30 = new Scan();
                  _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 (Scan _iter31 : this.success)
          {
            _iter31.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 _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("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 _list36 = iprot.readListBegin();
                this.saleReturnItems = new ArrayList<InventoryItem>(_list36.size);
                for (int _i37 = 0; _i37 < _list36.size; ++_i37)
                {
                  InventoryItem _elem38; // required
                  _elem38 = new InventoryItem();
                  _elem38.read(iprot);
                  this.saleReturnItems.add(_elem38);
                }
                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 _iter39 : this.saleReturnItems)
          {
            _iter39.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 {
        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 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(scanForPurchaseReturn_result.class, metaDataMap);
    }

    public scanForPurchaseReturn_result() {
    }

    public scanForPurchaseReturn_result(
      WarehouseServiceException ex)
    {
      this();
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public scanForPurchaseReturn_result(scanForPurchaseReturn_result other) {
      if (other.isSetEx()) {
        this.ex = new WarehouseServiceException(other.ex);
      }
    }

    public scanForPurchaseReturn_result deepCopy() {
      return new scanForPurchaseReturn_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 scanForPurchaseReturn_result)
        return this.equals((scanForPurchaseReturn_result)that);
      return false;
    }

    public boolean equals(scanForPurchaseReturn_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(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(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("scanForPurchaseReturn_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 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 _list40 = iprot.readListBegin();
                this.lostItems = new ArrayList<InventoryItem>(_list40.size);
                for (int _i41 = 0; _i41 < _list40.size; ++_i41)
                {
                  InventoryItem _elem42; // required
                  _elem42 = new InventoryItem();
                  _elem42.read(iprot);
                  this.lostItems.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.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 _iter43 : this.lostItems)
          {
            _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("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 {
        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 _list44 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAvailability>(_list44.size);
                for (int _i45 = 0; _i45 < _list44.size; ++_i45)
                {
                  InventoryAvailability _elem46; // required
                  _elem46 = new InventoryAvailability();
                  _elem46.read(iprot);
                  this.success.add(_elem46);
                }
                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 _iter47 : this.success)
          {
            _iter47.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 _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("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 _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("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 {
        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 _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("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 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 {
        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 {
        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 {
        // 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 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 _list60 = iprot.readListBegin();
                this.success = new ArrayList<InventoryMovement>(_list60.size);
                for (int _i61 = 0; _i61 < _list60.size; ++_i61)
                {
                  InventoryMovement _elem62; // required
                  _elem62 = new InventoryMovement();
                  _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 (InventoryMovement _iter63 : this.success)
          {
            _iter63.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 _list64 = iprot.readListBegin();
                this.success = new ArrayList<InventoryMovement>(_list64.size);
                for (int _i65 = 0; _i65 < _list64.size; ++_i65)
                {
                  InventoryMovement _elem66; // required
                  _elem66 = new InventoryMovement();
                  _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 (InventoryMovement _iter67 : this.success)
          {
            _iter67.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 _list68 = iprot.readListBegin();
                this.success = new ArrayList<InventoryMovement>(_list68.size);
                for (int _i69 = 0; _i69 < _list68.size; ++_i69)
                {
                  InventoryMovement _elem70; // required
                  _elem70 = new InventoryMovement();
                  _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 (InventoryMovement _iter71 : this.success)
          {
            _iter71.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 _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("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 {
        // 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 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 _list76 = iprot.readListBegin();
                this.success = new ArrayList<TransferLot>(_list76.size);
                for (int _i77 = 0; _i77 < _list76.size; ++_i77)
                {
                  TransferLot _elem78; // required
                  _elem78 = new TransferLot();
                  _elem78.read(iprot);
                  this.success.add(_elem78);
                }
                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 _iter79 : this.success)
          {
            _iter79.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 _list80 = iprot.readListBegin();
                this.success = new ArrayList<Long>(_list80.size);
                for (int _i81 = 0; _i81 < _list80.size; ++_i81)
                {
                  long _elem82; // required
                  _elem82 = iprot.readI64();
                  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.I64, this.success.size()));
          for (long _iter83 : this.success)
          {
            oprot.writeI64(_iter83);
          }
          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 _map84 = iprot.readMapBegin();
                this.success = new HashMap<Long,Long>(2*_map84.size);
                for (int _i85 = 0; _i85 < _map84.size; ++_i85)
                {
                  long _key86; // required
                  long _val87; // required
                  _key86 = iprot.readI64();
                  _val87 = iprot.readI64();
                  this.success.put(_key86, _val87);
                }
                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> _iter88 : this.success.entrySet())
          {
            oprot.writeI64(_iter88.getKey());
            oprot.writeI64(_iter88.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 _list89 = iprot.readListBegin();
                this.inventoryItems = new ArrayList<InventoryItem>(_list89.size);
                for (int _i90 = 0; _i90 < _list89.size; ++_i90)
                {
                  InventoryItem _elem91; // required
                  _elem91 = new InventoryItem();
                  _elem91.read(iprot);
                  this.inventoryItems.add(_elem91);
                }
                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 _iter92 : this.inventoryItems)
          {
            _iter92.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 _list93 = iprot.readListBegin();
                this.inventoryItems = new ArrayList<InventoryItem>(_list93.size);
                for (int _i94 = 0; _i94 < _list93.size; ++_i94)
                {
                  InventoryItem _elem95; // required
                  _elem95 = new InventoryItem();
                  _elem95.read(iprot);
                  this.inventoryItems.add(_elem95);
                }
                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 _iter96 : this.inventoryItems)
          {
            _iter96.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 _list97 = iprot.readListBegin();
                this.inventoryItems = new ArrayList<InventoryItem>(_list97.size);
                for (int _i98 = 0; _i98 < _list97.size; ++_i98)
                {
                  InventoryItem _elem99; // required
                  _elem99 = new InventoryItem();
                  _elem99.read(iprot);
                  this.inventoryItems.add(_elem99);
                }
                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 _iter100 : this.inventoryItems)
          {
            _iter100.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 _list101 = iprot.readListBegin();
                this.success = new ArrayList<InTransitInventory>(_list101.size);
                for (int _i102 = 0; _i102 < _list101.size; ++_i102)
                {
                  InTransitInventory _elem103; // required
                  _elem103 = new InTransitInventory();
                  _elem103.read(iprot);
                  this.success.add(_elem103);
                }
                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 _iter104 : this.success)
          {
            _iter104.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 _list105 = iprot.readListBegin();
                this.success = new ArrayList<InventoryAvailability>(_list105.size);
                for (int _i106 = 0; _i106 < _list105.size; ++_i106)
                {
                  InventoryAvailability _elem107; // required
                  _elem107 = new InventoryAvailability();
                  _elem107.read(iprot);
                  this.success.add(_elem107);
                }
                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 _iter108 : this.success)
          {
            _iter108.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);
      }
    }

  }

}