Subversion Repositories SmartDukaan

Rev

Rev 3430 | Blame | 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.model.v1.catalog;

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 InventoryService {

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

    /**
     * Availability and inventory attributes
     * 
     * @param item
     */
    public long addItem(Item item) throws InventoryServiceException, org.apache.thrift.TException;

    public long updateItem(Item item) throws InventoryServiceException, org.apache.thrift.TException;

    public long addWarehouse(Warehouse warehouse) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Checks if the item given to the corresponding itemId is active. If it's active,
     * whether it's risky and if it's risky, its inventory position.
     * 
     * @param itemId
     */
    public ItemShippingInfo isActive(long itemId) throws InventoryServiceException, org.apache.thrift.TException;

    public String getItemStatusDescription(long itemId) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Stores the incremental warehouse updates of items.
     * 
     * @param warehouse_id
     * @param timestamp
     * @param availability
     */
    public void updateInventoryHistory(long warehouse_id, String timestamp, Map<String,Long> availability) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Stores the final inventory stocks of items.
     * 
     * @param warehouse_id
     * @param timestamp
     * @param availability
     */
    public void updateInventory(long warehouse_id, String timestamp, Map<String,Long> availability) throws InventoryServiceException, org.apache.thrift.TException;

    public void retireWarehouse(long warehouse_id) throws InventoryServiceException, org.apache.thrift.TException;

    public void startItemOn(long item_id, long timestamp) throws InventoryServiceException, org.apache.thrift.TException;

    public void retireItemOn(long item_id, long timestamp) throws InventoryServiceException, org.apache.thrift.TException;

    public void changeItemStatus(long item_id, long timestamp, status newstatus) throws InventoryServiceException, org.apache.thrift.TException;

    public Item getItem(long item_id) throws InventoryServiceException, org.apache.thrift.TException;

    public List<Item> getItemsByCatalogId(long catalog_item_id) throws InventoryServiceException, org.apache.thrift.TException;

    public List<Item> getAllItems(boolean isActive) throws InventoryServiceException, org.apache.thrift.TException;

    public List<Item> getAllItemsByStatus(status itemStatus) throws InventoryServiceException, org.apache.thrift.TException;

    public ItemInventory getItemInventory(long item_id) throws InventoryServiceException, org.apache.thrift.TException;

    public ItemInventory getItemInventoryByItemId(long item_id) throws InventoryServiceException, org.apache.thrift.TException;

    public long getItemAvailibilityAtWarehouse(long warehouse_id, long item_id) throws InventoryServiceException, org.apache.thrift.TException;

    public boolean markItemAsContentComplete(long entityId, long category, String brand, String modelName, String modelNumber) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Determines the warehouse that should be used to fulfil an order for the given item.
     * It first checks all the warehouses which are in the logistics location given by the
     * warehouse_loc parameter. If none of the warehouses there have any inventory, then the
     * preferred warehouse for the item is used.
     * 
     * Returns an ordered list of size 4 with following elements in the given order:
     * 1. Logistics location of the warehouse which was finally picked up to ship the order.
     * 2. Id of the warehouse which was finally picked up.
     * 3. Inventory size in the selected warehouse.
     * 4. Expected delay added by the category manager.
     * 
     * @param warehouse_loc
     * @param item_id
     */
    public List<Long> getItemAvailabilityAtLocation(long warehouse_loc, long item_id) throws InventoryServiceException, org.apache.thrift.TException;

    public List<Warehouse> getAllWarehouses(boolean isActive) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Returns the warehouse with the given id.
     * 
     * @param warehouse_id
     */
    public Warehouse getWarehouse(long warehouse_id) throws InventoryServiceException, org.apache.thrift.TException;

    public List<Warehouse> getAllWarehousesForItem(long item_id) throws InventoryServiceException, org.apache.thrift.TException;

    public List<Item> getAllItemsForWarehouse(long warehouse_id) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Increases the reservation count for an item in a warehouse. Should always succeed normally.
     * 
     * @param itemId
     * @param warehouseId
     * @param quantity
     */
    public boolean reserveItemInWarehouse(long itemId, long warehouseId, double quantity) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Decreases the reservation count for an item in a warehouse. Should always succeed normally.
     * 
     * @param itemId
     * @param warehouseId
     * @param quantity
     */
    public boolean reduceReservationCount(long itemId, long warehouseId, double quantity) throws InventoryServiceException, org.apache.thrift.TException;

    public List<Item> getBestSellers() throws InventoryServiceException, org.apache.thrift.TException;

    public List<Long> getBestSellersCatalogIds(long beginIndex, long totalItems, String brand, long category) throws InventoryServiceException, org.apache.thrift.TException;

    public long getBestSellersCount() throws InventoryServiceException, org.apache.thrift.TException;

    public List<Item> getBestDeals() throws InventoryServiceException, org.apache.thrift.TException;

    public List<Long> getBestDealsCatalogIds(long beginIndex, long totalItems, String brand, long category) throws InventoryServiceException, org.apache.thrift.TException;

    public long getBestDealsCount() throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Returns a list of items sorted in the descending order by start date.
     * The list is limited to the 'latest_arrivals_count' configuraiton parameter.
     */
    public List<Item> getLatestArrivals() throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Returns the list of catalog ids of latest arrivals in the given categories of the given brand.
     * To ignore the categories, pass the list as empty. To ignore brand, pass it as null.
     * 
     * @param beginIndex
     * @param totalItems
     * @param brand
     * @param categories
     */
    public List<Long> getLatestArrivalsCatalogIds(long beginIndex, long totalItems, String brand, List<Long> categories) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Get the total number of latest arrivals we are willing to show.
     * The count's upper bound is the 'latest_arrivals_count' configuraiton parameter.
     */
    public long getLatestArrivalsCount() throws InventoryServiceException, org.apache.thrift.TException;

    public long generateNewEntityID() throws org.apache.thrift.TException;

    /**
     * Returns the pricing information of an item associated with the vendor of the given warehouse.
     * Raises an exception if either the item, vendor or the associated pricing information can't be found.
     * 
     * @param itemId
     * @param warehouseId
     */
    public VendorItemPricing getItemPricing(long itemId, long warehouseId) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * All category related functions
     * 
     * @param category
     */
    public boolean addCategory(Category category) throws org.apache.thrift.TException;

    public Category getCategory(long id) throws org.apache.thrift.TException;

    public List<Category> getAllCategories() throws org.apache.thrift.TException;

    /**
     * Returns the list of vendor pricing information of an item.
     * Raises an exception if item not found corresponding to itemId
     * 
     * @param itemId
     */
    public List<VendorItemPricing> getAllItemPricing(long itemId) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Adds vendor prices corresponding to the item. If pricing already exists then updates the prices.
     * Raises an exception if either the item or vendor can't be found corresponding to their ids.
     * 
     * @param vendorItemPricing
     */
    public void addVendorItemPricing(VendorItemPricing vendorItemPricing) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Return list of all vendors
     */
    public List<Vendor> getAllVendors() throws org.apache.thrift.TException;

    /**
     * Checks if the item exists in VendorItemMapping for the given hotspot parameters (ProductGroup,Brand,ModelNumber,Color),
     * vendor and category.
     * Returns true if it exists else false.
     * 
     * @param productGroup
     * @param brand
     * @param modelNumber
     * @param color
     * @param vendor_id
     * @param category
     */
    public boolean itemExists(String productGroup, String brand, String modelNumber, String color, long vendor_id, String category) throws org.apache.thrift.TException;

    /**
     * Adds VendorItemMapping. Updates VendorItemMapping if exists corresponding to the item key.
     * 
     * @param key
     * @param vendorItemMapping
     */
    public void addVendorItemMapping(String key, VendorItemMapping vendorItemMapping) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Returns the list of vendor item mapping corresponding to itemId passed as parameter.
     * Raises an exception if item not found corresponding to itemId
     * 
     * @param itemId
     */
    public List<VendorItemMapping> getVendorItemMappings(long itemId) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Checks if similar item exists (with same ProductGroup, Brand, ModelNumber, Color)
     * If yes, returns the itemId else returns 0
     * 
     * @param productGroup
     * @param brand
     * @param modelNumber
     * @param color
     */
    public long checkSimilarItem(String productGroup, String brand, String modelNumber, String color) throws org.apache.thrift.TException;

    /**
     * Marks/Unmarks an item as risky. This flag is used for automatic marking of an item as INACTIVE in case of zero inventory.
     * 
     * @param itemId
     * @param risky
     */
    public void changeItemRiskyFlag(long itemId, boolean risky) throws org.apache.thrift.TException;

    /**
     * Returns list of items marked as risky.
     */
    public List<Item> getItemsByRiskyFlag() throws org.apache.thrift.TException;

    /**
     * Returns list of items with any status except PHASED_OUT and filtered by vendor category.
     * Raises exception if vendorCategory is null.
     * 
     * @param vendorCategory
     */
    public List<Item> getItemsByVendorCategory(String vendorCategory) throws org.apache.thrift.TException;

    /**
     * Returns list of catalog ids of items with same similarity index as of the given itemId
     * 
     * @param beginIndex
     * @param totalItems
     * @param itemId
     */
    public List<Long> getSimilarItemsCatalogIds(long beginIndex, long totalItems, long itemId) throws org.apache.thrift.TException;

    /**
     * Add user requests for out of stock items. Once user will ask for notify me an entry will
     * 
     * @param itemId
     * @param email
     */
    public boolean addProductNotification(long itemId, String email) throws org.apache.thrift.TException;

    /**
     * Send the product notifications to the users for items which has stock.
     */
    public boolean sendProductNotifications() throws org.apache.thrift.TException;

    /**
     * Returns list of brand names for a given category Id
     * 
     * @param categoryId
     */
    public List<String> getAllBrandsByCategory(long categoryId) throws org.apache.thrift.TException;

    /**
     * Return list of all sources
     */
    public List<Source> getAllSources() throws org.apache.thrift.TException;

    /**
     * Returns the pricing information of an item. If no information is found, exception will be thrown.
     * 
     * @param itemId
     * @param sourceId
     */
    public SourceItemPricing getItemPricingBySource(long itemId, long sourceId) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Adds prices to be displayed corresponding to the item if user comes from a source.
     * If item is not found or source is not found, it will throw exception.
     * 
     * @param sourceItemPricing
     */
    public void addSourceItemPricing(SourceItemPricing sourceItemPricing) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Returns the list of source pricing information of an item.
     * Raises an exception if item not found corresponding to itemId
     * 
     * @param itemId
     */
    public List<SourceItemPricing> getAllSourcePricing(long itemId) throws InventoryServiceException, org.apache.thrift.TException;

    /**
     * Get the item for a given itemId and sourceId. MRP and sellingPrice will be updated for source if we have different prices for source.
     * 
     * @param item_id
     * @param sourceId
     */
    public Item getItemForSource(long item_id, long sourceId) throws InventoryServiceException, org.apache.thrift.TException;

  }

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

    public void addItem(Item item, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addItem_call> resultHandler) throws org.apache.thrift.TException;

    public void updateItem(Item item, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.updateItem_call> resultHandler) throws org.apache.thrift.TException;

    public void addWarehouse(Warehouse warehouse, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addWarehouse_call> resultHandler) throws org.apache.thrift.TException;

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

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

    public void updateInventoryHistory(long warehouse_id, String timestamp, Map<String,Long> availability, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.updateInventoryHistory_call> resultHandler) throws org.apache.thrift.TException;

    public void updateInventory(long warehouse_id, String timestamp, Map<String,Long> availability, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.updateInventory_call> resultHandler) throws org.apache.thrift.TException;

    public void retireWarehouse(long warehouse_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.retireWarehouse_call> resultHandler) throws org.apache.thrift.TException;

    public void startItemOn(long item_id, long timestamp, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.startItemOn_call> resultHandler) throws org.apache.thrift.TException;

    public void retireItemOn(long item_id, long timestamp, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.retireItemOn_call> resultHandler) throws org.apache.thrift.TException;

    public void changeItemStatus(long item_id, long timestamp, status newstatus, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.changeItemStatus_call> resultHandler) throws org.apache.thrift.TException;

    public void getItem(long item_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItem_call> resultHandler) throws org.apache.thrift.TException;

    public void getItemsByCatalogId(long catalog_item_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemsByCatalogId_call> resultHandler) throws org.apache.thrift.TException;

    public void getAllItems(boolean isActive, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllItems_call> resultHandler) throws org.apache.thrift.TException;

    public void getAllItemsByStatus(status itemStatus, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllItemsByStatus_call> resultHandler) throws org.apache.thrift.TException;

    public void getItemInventory(long item_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemInventory_call> resultHandler) throws org.apache.thrift.TException;

    public void getItemInventoryByItemId(long item_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemInventoryByItemId_call> resultHandler) throws org.apache.thrift.TException;

    public void getItemAvailibilityAtWarehouse(long warehouse_id, long item_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemAvailibilityAtWarehouse_call> resultHandler) throws org.apache.thrift.TException;

    public void markItemAsContentComplete(long entityId, long category, String brand, String modelName, String modelNumber, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markItemAsContentComplete_call> resultHandler) throws org.apache.thrift.TException;

    public void getItemAvailabilityAtLocation(long warehouse_loc, long item_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemAvailabilityAtLocation_call> resultHandler) throws org.apache.thrift.TException;

    public void getAllWarehouses(boolean isActive, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllWarehouses_call> resultHandler) throws org.apache.thrift.TException;

    public void getWarehouse(long warehouse_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getWarehouse_call> resultHandler) throws org.apache.thrift.TException;

    public void getAllWarehousesForItem(long item_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllWarehousesForItem_call> resultHandler) throws org.apache.thrift.TException;

    public void getAllItemsForWarehouse(long warehouse_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllItemsForWarehouse_call> resultHandler) throws org.apache.thrift.TException;

    public void reserveItemInWarehouse(long itemId, long warehouseId, double quantity, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.reserveItemInWarehouse_call> resultHandler) throws org.apache.thrift.TException;

    public void reduceReservationCount(long itemId, long warehouseId, double quantity, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.reduceReservationCount_call> resultHandler) throws org.apache.thrift.TException;

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

    public void getBestSellersCatalogIds(long beginIndex, long totalItems, String brand, long category, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getBestSellersCatalogIds_call> resultHandler) throws org.apache.thrift.TException;

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

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

    public void getBestDealsCatalogIds(long beginIndex, long totalItems, String brand, long category, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getBestDealsCatalogIds_call> resultHandler) throws org.apache.thrift.TException;

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

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

    public void getLatestArrivalsCatalogIds(long beginIndex, long totalItems, String brand, List<Long> categories, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getLatestArrivalsCatalogIds_call> resultHandler) throws org.apache.thrift.TException;

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

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

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

    public void addCategory(Category category, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addCategory_call> resultHandler) throws org.apache.thrift.TException;

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

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

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

    public void addVendorItemPricing(VendorItemPricing vendorItemPricing, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVendorItemPricing_call> resultHandler) throws org.apache.thrift.TException;

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

    public void itemExists(String productGroup, String brand, String modelNumber, String color, long vendor_id, String category, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.itemExists_call> resultHandler) throws org.apache.thrift.TException;

    public void addVendorItemMapping(String key, VendorItemMapping vendorItemMapping, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVendorItemMapping_call> resultHandler) throws org.apache.thrift.TException;

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

    public void checkSimilarItem(String productGroup, String brand, String modelNumber, String color, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.checkSimilarItem_call> resultHandler) throws org.apache.thrift.TException;

    public void changeItemRiskyFlag(long itemId, boolean risky, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.changeItemRiskyFlag_call> resultHandler) throws org.apache.thrift.TException;

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

    public void getItemsByVendorCategory(String vendorCategory, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemsByVendorCategory_call> resultHandler) throws org.apache.thrift.TException;

    public void getSimilarItemsCatalogIds(long beginIndex, long totalItems, long itemId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSimilarItemsCatalogIds_call> resultHandler) throws org.apache.thrift.TException;

    public void addProductNotification(long itemId, String email, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addProductNotification_call> resultHandler) throws org.apache.thrift.TException;

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

    public void getAllBrandsByCategory(long categoryId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllBrandsByCategory_call> resultHandler) throws org.apache.thrift.TException;

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

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

    public void addSourceItemPricing(SourceItemPricing sourceItemPricing, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addSourceItemPricing_call> resultHandler) throws org.apache.thrift.TException;

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

    public void getItemForSource(long item_id, long sourceId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemForSource_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 long addItem(Item item) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_addItem(item);
      return recv_addItem();
    }

    public void send_addItem(Item item) throws org.apache.thrift.TException
    {
      addItem_args args = new addItem_args();
      args.setItem(item);
      sendBase("addItem", args);
    }

    public long recv_addItem() throws InventoryServiceException, org.apache.thrift.TException
    {
      addItem_result result = new addItem_result();
      receiveBase(result, "addItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addItem failed: unknown result");
    }

    public long updateItem(Item item) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_updateItem(item);
      return recv_updateItem();
    }

    public void send_updateItem(Item item) throws org.apache.thrift.TException
    {
      updateItem_args args = new updateItem_args();
      args.setItem(item);
      sendBase("updateItem", args);
    }

    public long recv_updateItem() throws InventoryServiceException, org.apache.thrift.TException
    {
      updateItem_result result = new updateItem_result();
      receiveBase(result, "updateItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateItem failed: unknown result");
    }

    public long addWarehouse(Warehouse warehouse) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_addWarehouse(warehouse);
      return recv_addWarehouse();
    }

    public void send_addWarehouse(Warehouse warehouse) throws org.apache.thrift.TException
    {
      addWarehouse_args args = new addWarehouse_args();
      args.setWarehouse(warehouse);
      sendBase("addWarehouse", args);
    }

    public long recv_addWarehouse() throws InventoryServiceException, org.apache.thrift.TException
    {
      addWarehouse_result result = new addWarehouse_result();
      receiveBase(result, "addWarehouse");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addWarehouse failed: unknown result");
    }

    public ItemShippingInfo isActive(long itemId) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_isActive(itemId);
      return recv_isActive();
    }

    public void send_isActive(long itemId) throws org.apache.thrift.TException
    {
      isActive_args args = new isActive_args();
      args.setItemId(itemId);
      sendBase("isActive", args);
    }

    public ItemShippingInfo recv_isActive() throws InventoryServiceException, org.apache.thrift.TException
    {
      isActive_result result = new isActive_result();
      receiveBase(result, "isActive");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.isex != null) {
        throw result.isex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isActive failed: unknown result");
    }

    public String getItemStatusDescription(long itemId) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItemStatusDescription(itemId);
      return recv_getItemStatusDescription();
    }

    public void send_getItemStatusDescription(long itemId) throws org.apache.thrift.TException
    {
      getItemStatusDescription_args args = new getItemStatusDescription_args();
      args.setItemId(itemId);
      sendBase("getItemStatusDescription", args);
    }

    public String recv_getItemStatusDescription() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItemStatusDescription_result result = new getItemStatusDescription_result();
      receiveBase(result, "getItemStatusDescription");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.isex != null) {
        throw result.isex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemStatusDescription failed: unknown result");
    }

    public void updateInventoryHistory(long warehouse_id, String timestamp, Map<String,Long> availability) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_updateInventoryHistory(warehouse_id, timestamp, availability);
      recv_updateInventoryHistory();
    }

    public void send_updateInventoryHistory(long warehouse_id, String timestamp, Map<String,Long> availability) throws org.apache.thrift.TException
    {
      updateInventoryHistory_args args = new updateInventoryHistory_args();
      args.setWarehouse_id(warehouse_id);
      args.setTimestamp(timestamp);
      args.setAvailability(availability);
      sendBase("updateInventoryHistory", args);
    }

    public void recv_updateInventoryHistory() throws InventoryServiceException, org.apache.thrift.TException
    {
      updateInventoryHistory_result result = new updateInventoryHistory_result();
      receiveBase(result, "updateInventoryHistory");
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void updateInventory(long warehouse_id, String timestamp, Map<String,Long> availability) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_updateInventory(warehouse_id, timestamp, availability);
      recv_updateInventory();
    }

    public void send_updateInventory(long warehouse_id, String timestamp, Map<String,Long> availability) throws org.apache.thrift.TException
    {
      updateInventory_args args = new updateInventory_args();
      args.setWarehouse_id(warehouse_id);
      args.setTimestamp(timestamp);
      args.setAvailability(availability);
      sendBase("updateInventory", args);
    }

    public void recv_updateInventory() throws InventoryServiceException, org.apache.thrift.TException
    {
      updateInventory_result result = new updateInventory_result();
      receiveBase(result, "updateInventory");
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void retireWarehouse(long warehouse_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_retireWarehouse(warehouse_id);
      recv_retireWarehouse();
    }

    public void send_retireWarehouse(long warehouse_id) throws org.apache.thrift.TException
    {
      retireWarehouse_args args = new retireWarehouse_args();
      args.setWarehouse_id(warehouse_id);
      sendBase("retireWarehouse", args);
    }

    public void recv_retireWarehouse() throws InventoryServiceException, org.apache.thrift.TException
    {
      retireWarehouse_result result = new retireWarehouse_result();
      receiveBase(result, "retireWarehouse");
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void startItemOn(long item_id, long timestamp) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_startItemOn(item_id, timestamp);
      recv_startItemOn();
    }

    public void send_startItemOn(long item_id, long timestamp) throws org.apache.thrift.TException
    {
      startItemOn_args args = new startItemOn_args();
      args.setItem_id(item_id);
      args.setTimestamp(timestamp);
      sendBase("startItemOn", args);
    }

    public void recv_startItemOn() throws InventoryServiceException, org.apache.thrift.TException
    {
      startItemOn_result result = new startItemOn_result();
      receiveBase(result, "startItemOn");
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void retireItemOn(long item_id, long timestamp) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_retireItemOn(item_id, timestamp);
      recv_retireItemOn();
    }

    public void send_retireItemOn(long item_id, long timestamp) throws org.apache.thrift.TException
    {
      retireItemOn_args args = new retireItemOn_args();
      args.setItem_id(item_id);
      args.setTimestamp(timestamp);
      sendBase("retireItemOn", args);
    }

    public void recv_retireItemOn() throws InventoryServiceException, org.apache.thrift.TException
    {
      retireItemOn_result result = new retireItemOn_result();
      receiveBase(result, "retireItemOn");
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void changeItemStatus(long item_id, long timestamp, status newstatus) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_changeItemStatus(item_id, timestamp, newstatus);
      recv_changeItemStatus();
    }

    public void send_changeItemStatus(long item_id, long timestamp, status newstatus) throws org.apache.thrift.TException
    {
      changeItemStatus_args args = new changeItemStatus_args();
      args.setItem_id(item_id);
      args.setTimestamp(timestamp);
      args.setNewstatus(newstatus);
      sendBase("changeItemStatus", args);
    }

    public void recv_changeItemStatus() throws InventoryServiceException, org.apache.thrift.TException
    {
      changeItemStatus_result result = new changeItemStatus_result();
      receiveBase(result, "changeItemStatus");
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public Item getItem(long item_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItem(item_id);
      return recv_getItem();
    }

    public void send_getItem(long item_id) throws org.apache.thrift.TException
    {
      getItem_args args = new getItem_args();
      args.setItem_id(item_id);
      sendBase("getItem", args);
    }

    public Item recv_getItem() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItem_result result = new getItem_result();
      receiveBase(result, "getItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItem failed: unknown result");
    }

    public List<Item> getItemsByCatalogId(long catalog_item_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItemsByCatalogId(catalog_item_id);
      return recv_getItemsByCatalogId();
    }

    public void send_getItemsByCatalogId(long catalog_item_id) throws org.apache.thrift.TException
    {
      getItemsByCatalogId_args args = new getItemsByCatalogId_args();
      args.setCatalog_item_id(catalog_item_id);
      sendBase("getItemsByCatalogId", args);
    }

    public List<Item> recv_getItemsByCatalogId() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItemsByCatalogId_result result = new getItemsByCatalogId_result();
      receiveBase(result, "getItemsByCatalogId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemsByCatalogId failed: unknown result");
    }

    public List<Item> getAllItems(boolean isActive) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getAllItems(isActive);
      return recv_getAllItems();
    }

    public void send_getAllItems(boolean isActive) throws org.apache.thrift.TException
    {
      getAllItems_args args = new getAllItems_args();
      args.setIsActive(isActive);
      sendBase("getAllItems", args);
    }

    public List<Item> recv_getAllItems() throws InventoryServiceException, org.apache.thrift.TException
    {
      getAllItems_result result = new getAllItems_result();
      receiveBase(result, "getAllItems");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllItems failed: unknown result");
    }

    public List<Item> getAllItemsByStatus(status itemStatus) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getAllItemsByStatus(itemStatus);
      return recv_getAllItemsByStatus();
    }

    public void send_getAllItemsByStatus(status itemStatus) throws org.apache.thrift.TException
    {
      getAllItemsByStatus_args args = new getAllItemsByStatus_args();
      args.setItemStatus(itemStatus);
      sendBase("getAllItemsByStatus", args);
    }

    public List<Item> recv_getAllItemsByStatus() throws InventoryServiceException, org.apache.thrift.TException
    {
      getAllItemsByStatus_result result = new getAllItemsByStatus_result();
      receiveBase(result, "getAllItemsByStatus");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllItemsByStatus failed: unknown result");
    }

    public ItemInventory getItemInventory(long item_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItemInventory(item_id);
      return recv_getItemInventory();
    }

    public void send_getItemInventory(long item_id) throws org.apache.thrift.TException
    {
      getItemInventory_args args = new getItemInventory_args();
      args.setItem_id(item_id);
      sendBase("getItemInventory", args);
    }

    public ItemInventory recv_getItemInventory() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItemInventory_result result = new getItemInventory_result();
      receiveBase(result, "getItemInventory");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemInventory failed: unknown result");
    }

    public ItemInventory getItemInventoryByItemId(long item_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItemInventoryByItemId(item_id);
      return recv_getItemInventoryByItemId();
    }

    public void send_getItemInventoryByItemId(long item_id) throws org.apache.thrift.TException
    {
      getItemInventoryByItemId_args args = new getItemInventoryByItemId_args();
      args.setItem_id(item_id);
      sendBase("getItemInventoryByItemId", args);
    }

    public ItemInventory recv_getItemInventoryByItemId() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItemInventoryByItemId_result result = new getItemInventoryByItemId_result();
      receiveBase(result, "getItemInventoryByItemId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemInventoryByItemId failed: unknown result");
    }

    public long getItemAvailibilityAtWarehouse(long warehouse_id, long item_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItemAvailibilityAtWarehouse(warehouse_id, item_id);
      return recv_getItemAvailibilityAtWarehouse();
    }

    public void send_getItemAvailibilityAtWarehouse(long warehouse_id, long item_id) throws org.apache.thrift.TException
    {
      getItemAvailibilityAtWarehouse_args args = new getItemAvailibilityAtWarehouse_args();
      args.setWarehouse_id(warehouse_id);
      args.setItem_id(item_id);
      sendBase("getItemAvailibilityAtWarehouse", args);
    }

    public long recv_getItemAvailibilityAtWarehouse() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItemAvailibilityAtWarehouse_result result = new getItemAvailibilityAtWarehouse_result();
      receiveBase(result, "getItemAvailibilityAtWarehouse");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemAvailibilityAtWarehouse failed: unknown result");
    }

    public boolean markItemAsContentComplete(long entityId, long category, String brand, String modelName, String modelNumber) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_markItemAsContentComplete(entityId, category, brand, modelName, modelNumber);
      return recv_markItemAsContentComplete();
    }

    public void send_markItemAsContentComplete(long entityId, long category, String brand, String modelName, String modelNumber) throws org.apache.thrift.TException
    {
      markItemAsContentComplete_args args = new markItemAsContentComplete_args();
      args.setEntityId(entityId);
      args.setCategory(category);
      args.setBrand(brand);
      args.setModelName(modelName);
      args.setModelNumber(modelNumber);
      sendBase("markItemAsContentComplete", args);
    }

    public boolean recv_markItemAsContentComplete() throws InventoryServiceException, org.apache.thrift.TException
    {
      markItemAsContentComplete_result result = new markItemAsContentComplete_result();
      receiveBase(result, "markItemAsContentComplete");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markItemAsContentComplete failed: unknown result");
    }

    public List<Long> getItemAvailabilityAtLocation(long warehouse_loc, long item_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItemAvailabilityAtLocation(warehouse_loc, item_id);
      return recv_getItemAvailabilityAtLocation();
    }

    public void send_getItemAvailabilityAtLocation(long warehouse_loc, long item_id) throws org.apache.thrift.TException
    {
      getItemAvailabilityAtLocation_args args = new getItemAvailabilityAtLocation_args();
      args.setWarehouse_loc(warehouse_loc);
      args.setItem_id(item_id);
      sendBase("getItemAvailabilityAtLocation", args);
    }

    public List<Long> recv_getItemAvailabilityAtLocation() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItemAvailabilityAtLocation_result result = new getItemAvailabilityAtLocation_result();
      receiveBase(result, "getItemAvailabilityAtLocation");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.isex != null) {
        throw result.isex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemAvailabilityAtLocation failed: unknown result");
    }

    public List<Warehouse> getAllWarehouses(boolean isActive) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getAllWarehouses(isActive);
      return recv_getAllWarehouses();
    }

    public void send_getAllWarehouses(boolean isActive) throws org.apache.thrift.TException
    {
      getAllWarehouses_args args = new getAllWarehouses_args();
      args.setIsActive(isActive);
      sendBase("getAllWarehouses", args);
    }

    public List<Warehouse> recv_getAllWarehouses() throws InventoryServiceException, org.apache.thrift.TException
    {
      getAllWarehouses_result result = new getAllWarehouses_result();
      receiveBase(result, "getAllWarehouses");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllWarehouses failed: unknown result");
    }

    public Warehouse getWarehouse(long warehouse_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getWarehouse(warehouse_id);
      return recv_getWarehouse();
    }

    public void send_getWarehouse(long warehouse_id) throws org.apache.thrift.TException
    {
      getWarehouse_args args = new getWarehouse_args();
      args.setWarehouse_id(warehouse_id);
      sendBase("getWarehouse", args);
    }

    public Warehouse recv_getWarehouse() throws InventoryServiceException, org.apache.thrift.TException
    {
      getWarehouse_result result = new getWarehouse_result();
      receiveBase(result, "getWarehouse");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getWarehouse failed: unknown result");
    }

    public List<Warehouse> getAllWarehousesForItem(long item_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getAllWarehousesForItem(item_id);
      return recv_getAllWarehousesForItem();
    }

    public void send_getAllWarehousesForItem(long item_id) throws org.apache.thrift.TException
    {
      getAllWarehousesForItem_args args = new getAllWarehousesForItem_args();
      args.setItem_id(item_id);
      sendBase("getAllWarehousesForItem", args);
    }

    public List<Warehouse> recv_getAllWarehousesForItem() throws InventoryServiceException, org.apache.thrift.TException
    {
      getAllWarehousesForItem_result result = new getAllWarehousesForItem_result();
      receiveBase(result, "getAllWarehousesForItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllWarehousesForItem failed: unknown result");
    }

    public List<Item> getAllItemsForWarehouse(long warehouse_id) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getAllItemsForWarehouse(warehouse_id);
      return recv_getAllItemsForWarehouse();
    }

    public void send_getAllItemsForWarehouse(long warehouse_id) throws org.apache.thrift.TException
    {
      getAllItemsForWarehouse_args args = new getAllItemsForWarehouse_args();
      args.setWarehouse_id(warehouse_id);
      sendBase("getAllItemsForWarehouse", args);
    }

    public List<Item> recv_getAllItemsForWarehouse() throws InventoryServiceException, org.apache.thrift.TException
    {
      getAllItemsForWarehouse_result result = new getAllItemsForWarehouse_result();
      receiveBase(result, "getAllItemsForWarehouse");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllItemsForWarehouse failed: unknown result");
    }

    public boolean reserveItemInWarehouse(long itemId, long warehouseId, double quantity) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_reserveItemInWarehouse(itemId, warehouseId, quantity);
      return recv_reserveItemInWarehouse();
    }

    public void send_reserveItemInWarehouse(long itemId, long warehouseId, double quantity) throws org.apache.thrift.TException
    {
      reserveItemInWarehouse_args args = new reserveItemInWarehouse_args();
      args.setItemId(itemId);
      args.setWarehouseId(warehouseId);
      args.setQuantity(quantity);
      sendBase("reserveItemInWarehouse", args);
    }

    public boolean recv_reserveItemInWarehouse() throws InventoryServiceException, org.apache.thrift.TException
    {
      reserveItemInWarehouse_result result = new reserveItemInWarehouse_result();
      receiveBase(result, "reserveItemInWarehouse");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "reserveItemInWarehouse failed: unknown result");
    }

    public boolean reduceReservationCount(long itemId, long warehouseId, double quantity) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_reduceReservationCount(itemId, warehouseId, quantity);
      return recv_reduceReservationCount();
    }

    public void send_reduceReservationCount(long itemId, long warehouseId, double quantity) throws org.apache.thrift.TException
    {
      reduceReservationCount_args args = new reduceReservationCount_args();
      args.setItemId(itemId);
      args.setWarehouseId(warehouseId);
      args.setQuantity(quantity);
      sendBase("reduceReservationCount", args);
    }

    public boolean recv_reduceReservationCount() throws InventoryServiceException, org.apache.thrift.TException
    {
      reduceReservationCount_result result = new reduceReservationCount_result();
      receiveBase(result, "reduceReservationCount");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "reduceReservationCount failed: unknown result");
    }

    public List<Item> getBestSellers() throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getBestSellers();
      return recv_getBestSellers();
    }

    public void send_getBestSellers() throws org.apache.thrift.TException
    {
      getBestSellers_args args = new getBestSellers_args();
      sendBase("getBestSellers", args);
    }

    public List<Item> recv_getBestSellers() throws InventoryServiceException, org.apache.thrift.TException
    {
      getBestSellers_result result = new getBestSellers_result();
      receiveBase(result, "getBestSellers");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.isex != null) {
        throw result.isex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBestSellers failed: unknown result");
    }

    public List<Long> getBestSellersCatalogIds(long beginIndex, long totalItems, String brand, long category) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getBestSellersCatalogIds(beginIndex, totalItems, brand, category);
      return recv_getBestSellersCatalogIds();
    }

    public void send_getBestSellersCatalogIds(long beginIndex, long totalItems, String brand, long category) throws org.apache.thrift.TException
    {
      getBestSellersCatalogIds_args args = new getBestSellersCatalogIds_args();
      args.setBeginIndex(beginIndex);
      args.setTotalItems(totalItems);
      args.setBrand(brand);
      args.setCategory(category);
      sendBase("getBestSellersCatalogIds", args);
    }

    public List<Long> recv_getBestSellersCatalogIds() throws InventoryServiceException, org.apache.thrift.TException
    {
      getBestSellersCatalogIds_result result = new getBestSellersCatalogIds_result();
      receiveBase(result, "getBestSellersCatalogIds");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBestSellersCatalogIds failed: unknown result");
    }

    public long getBestSellersCount() throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getBestSellersCount();
      return recv_getBestSellersCount();
    }

    public void send_getBestSellersCount() throws org.apache.thrift.TException
    {
      getBestSellersCount_args args = new getBestSellersCount_args();
      sendBase("getBestSellersCount", args);
    }

    public long recv_getBestSellersCount() throws InventoryServiceException, org.apache.thrift.TException
    {
      getBestSellersCount_result result = new getBestSellersCount_result();
      receiveBase(result, "getBestSellersCount");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBestSellersCount failed: unknown result");
    }

    public List<Item> getBestDeals() throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getBestDeals();
      return recv_getBestDeals();
    }

    public void send_getBestDeals() throws org.apache.thrift.TException
    {
      getBestDeals_args args = new getBestDeals_args();
      sendBase("getBestDeals", args);
    }

    public List<Item> recv_getBestDeals() throws InventoryServiceException, org.apache.thrift.TException
    {
      getBestDeals_result result = new getBestDeals_result();
      receiveBase(result, "getBestDeals");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.isex != null) {
        throw result.isex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBestDeals failed: unknown result");
    }

    public List<Long> getBestDealsCatalogIds(long beginIndex, long totalItems, String brand, long category) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getBestDealsCatalogIds(beginIndex, totalItems, brand, category);
      return recv_getBestDealsCatalogIds();
    }

    public void send_getBestDealsCatalogIds(long beginIndex, long totalItems, String brand, long category) throws org.apache.thrift.TException
    {
      getBestDealsCatalogIds_args args = new getBestDealsCatalogIds_args();
      args.setBeginIndex(beginIndex);
      args.setTotalItems(totalItems);
      args.setBrand(brand);
      args.setCategory(category);
      sendBase("getBestDealsCatalogIds", args);
    }

    public List<Long> recv_getBestDealsCatalogIds() throws InventoryServiceException, org.apache.thrift.TException
    {
      getBestDealsCatalogIds_result result = new getBestDealsCatalogIds_result();
      receiveBase(result, "getBestDealsCatalogIds");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBestDealsCatalogIds failed: unknown result");
    }

    public long getBestDealsCount() throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getBestDealsCount();
      return recv_getBestDealsCount();
    }

    public void send_getBestDealsCount() throws org.apache.thrift.TException
    {
      getBestDealsCount_args args = new getBestDealsCount_args();
      sendBase("getBestDealsCount", args);
    }

    public long recv_getBestDealsCount() throws InventoryServiceException, org.apache.thrift.TException
    {
      getBestDealsCount_result result = new getBestDealsCount_result();
      receiveBase(result, "getBestDealsCount");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBestDealsCount failed: unknown result");
    }

    public List<Item> getLatestArrivals() throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getLatestArrivals();
      return recv_getLatestArrivals();
    }

    public void send_getLatestArrivals() throws org.apache.thrift.TException
    {
      getLatestArrivals_args args = new getLatestArrivals_args();
      sendBase("getLatestArrivals", args);
    }

    public List<Item> recv_getLatestArrivals() throws InventoryServiceException, org.apache.thrift.TException
    {
      getLatestArrivals_result result = new getLatestArrivals_result();
      receiveBase(result, "getLatestArrivals");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.isex != null) {
        throw result.isex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLatestArrivals failed: unknown result");
    }

    public List<Long> getLatestArrivalsCatalogIds(long beginIndex, long totalItems, String brand, List<Long> categories) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getLatestArrivalsCatalogIds(beginIndex, totalItems, brand, categories);
      return recv_getLatestArrivalsCatalogIds();
    }

    public void send_getLatestArrivalsCatalogIds(long beginIndex, long totalItems, String brand, List<Long> categories) throws org.apache.thrift.TException
    {
      getLatestArrivalsCatalogIds_args args = new getLatestArrivalsCatalogIds_args();
      args.setBeginIndex(beginIndex);
      args.setTotalItems(totalItems);
      args.setBrand(brand);
      args.setCategories(categories);
      sendBase("getLatestArrivalsCatalogIds", args);
    }

    public List<Long> recv_getLatestArrivalsCatalogIds() throws InventoryServiceException, org.apache.thrift.TException
    {
      getLatestArrivalsCatalogIds_result result = new getLatestArrivalsCatalogIds_result();
      receiveBase(result, "getLatestArrivalsCatalogIds");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLatestArrivalsCatalogIds failed: unknown result");
    }

    public long getLatestArrivalsCount() throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getLatestArrivalsCount();
      return recv_getLatestArrivalsCount();
    }

    public void send_getLatestArrivalsCount() throws org.apache.thrift.TException
    {
      getLatestArrivalsCount_args args = new getLatestArrivalsCount_args();
      sendBase("getLatestArrivalsCount", args);
    }

    public long recv_getLatestArrivalsCount() throws InventoryServiceException, org.apache.thrift.TException
    {
      getLatestArrivalsCount_result result = new getLatestArrivalsCount_result();
      receiveBase(result, "getLatestArrivalsCount");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLatestArrivalsCount failed: unknown result");
    }

    public long generateNewEntityID() throws org.apache.thrift.TException
    {
      send_generateNewEntityID();
      return recv_generateNewEntityID();
    }

    public void send_generateNewEntityID() throws org.apache.thrift.TException
    {
      generateNewEntityID_args args = new generateNewEntityID_args();
      sendBase("generateNewEntityID", args);
    }

    public long recv_generateNewEntityID() throws org.apache.thrift.TException
    {
      generateNewEntityID_result result = new generateNewEntityID_result();
      receiveBase(result, "generateNewEntityID");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "generateNewEntityID failed: unknown result");
    }

    public VendorItemPricing getItemPricing(long itemId, long warehouseId) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItemPricing(itemId, warehouseId);
      return recv_getItemPricing();
    }

    public void send_getItemPricing(long itemId, long warehouseId) throws org.apache.thrift.TException
    {
      getItemPricing_args args = new getItemPricing_args();
      args.setItemId(itemId);
      args.setWarehouseId(warehouseId);
      sendBase("getItemPricing", args);
    }

    public VendorItemPricing recv_getItemPricing() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItemPricing_result result = new getItemPricing_result();
      receiveBase(result, "getItemPricing");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemPricing failed: unknown result");
    }

    public boolean addCategory(Category category) throws org.apache.thrift.TException
    {
      send_addCategory(category);
      return recv_addCategory();
    }

    public void send_addCategory(Category category) throws org.apache.thrift.TException
    {
      addCategory_args args = new addCategory_args();
      args.setCategory(category);
      sendBase("addCategory", args);
    }

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

    public Category getCategory(long id) throws org.apache.thrift.TException
    {
      send_getCategory(id);
      return recv_getCategory();
    }

    public void send_getCategory(long id) throws org.apache.thrift.TException
    {
      getCategory_args args = new getCategory_args();
      args.setId(id);
      sendBase("getCategory", args);
    }

    public Category recv_getCategory() throws org.apache.thrift.TException
    {
      getCategory_result result = new getCategory_result();
      receiveBase(result, "getCategory");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCategory failed: unknown result");
    }

    public List<Category> getAllCategories() throws org.apache.thrift.TException
    {
      send_getAllCategories();
      return recv_getAllCategories();
    }

    public void send_getAllCategories() throws org.apache.thrift.TException
    {
      getAllCategories_args args = new getAllCategories_args();
      sendBase("getAllCategories", args);
    }

    public List<Category> recv_getAllCategories() throws org.apache.thrift.TException
    {
      getAllCategories_result result = new getAllCategories_result();
      receiveBase(result, "getAllCategories");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllCategories failed: unknown result");
    }

    public List<VendorItemPricing> getAllItemPricing(long itemId) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getAllItemPricing(itemId);
      return recv_getAllItemPricing();
    }

    public void send_getAllItemPricing(long itemId) throws org.apache.thrift.TException
    {
      getAllItemPricing_args args = new getAllItemPricing_args();
      args.setItemId(itemId);
      sendBase("getAllItemPricing", args);
    }

    public List<VendorItemPricing> recv_getAllItemPricing() throws InventoryServiceException, org.apache.thrift.TException
    {
      getAllItemPricing_result result = new getAllItemPricing_result();
      receiveBase(result, "getAllItemPricing");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllItemPricing failed: unknown result");
    }

    public void addVendorItemPricing(VendorItemPricing vendorItemPricing) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_addVendorItemPricing(vendorItemPricing);
      recv_addVendorItemPricing();
    }

    public void send_addVendorItemPricing(VendorItemPricing vendorItemPricing) throws org.apache.thrift.TException
    {
      addVendorItemPricing_args args = new addVendorItemPricing_args();
      args.setVendorItemPricing(vendorItemPricing);
      sendBase("addVendorItemPricing", args);
    }

    public void recv_addVendorItemPricing() throws InventoryServiceException, org.apache.thrift.TException
    {
      addVendorItemPricing_result result = new addVendorItemPricing_result();
      receiveBase(result, "addVendorItemPricing");
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public List<Vendor> getAllVendors() throws org.apache.thrift.TException
    {
      send_getAllVendors();
      return recv_getAllVendors();
    }

    public void send_getAllVendors() throws org.apache.thrift.TException
    {
      getAllVendors_args args = new getAllVendors_args();
      sendBase("getAllVendors", args);
    }

    public List<Vendor> recv_getAllVendors() throws org.apache.thrift.TException
    {
      getAllVendors_result result = new getAllVendors_result();
      receiveBase(result, "getAllVendors");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllVendors failed: unknown result");
    }

    public boolean itemExists(String productGroup, String brand, String modelNumber, String color, long vendor_id, String category) throws org.apache.thrift.TException
    {
      send_itemExists(productGroup, brand, modelNumber, color, vendor_id, category);
      return recv_itemExists();
    }

    public void send_itemExists(String productGroup, String brand, String modelNumber, String color, long vendor_id, String category) throws org.apache.thrift.TException
    {
      itemExists_args args = new itemExists_args();
      args.setProductGroup(productGroup);
      args.setBrand(brand);
      args.setModelNumber(modelNumber);
      args.setColor(color);
      args.setVendor_id(vendor_id);
      args.setCategory(category);
      sendBase("itemExists", args);
    }

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

    public void addVendorItemMapping(String key, VendorItemMapping vendorItemMapping) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_addVendorItemMapping(key, vendorItemMapping);
      recv_addVendorItemMapping();
    }

    public void send_addVendorItemMapping(String key, VendorItemMapping vendorItemMapping) throws org.apache.thrift.TException
    {
      addVendorItemMapping_args args = new addVendorItemMapping_args();
      args.setKey(key);
      args.setVendorItemMapping(vendorItemMapping);
      sendBase("addVendorItemMapping", args);
    }

    public void recv_addVendorItemMapping() throws InventoryServiceException, org.apache.thrift.TException
    {
      addVendorItemMapping_result result = new addVendorItemMapping_result();
      receiveBase(result, "addVendorItemMapping");
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public List<VendorItemMapping> getVendorItemMappings(long itemId) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getVendorItemMappings(itemId);
      return recv_getVendorItemMappings();
    }

    public void send_getVendorItemMappings(long itemId) throws org.apache.thrift.TException
    {
      getVendorItemMappings_args args = new getVendorItemMappings_args();
      args.setItemId(itemId);
      sendBase("getVendorItemMappings", args);
    }

    public List<VendorItemMapping> recv_getVendorItemMappings() throws InventoryServiceException, org.apache.thrift.TException
    {
      getVendorItemMappings_result result = new getVendorItemMappings_result();
      receiveBase(result, "getVendorItemMappings");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getVendorItemMappings failed: unknown result");
    }

    public long checkSimilarItem(String productGroup, String brand, String modelNumber, String color) throws org.apache.thrift.TException
    {
      send_checkSimilarItem(productGroup, brand, modelNumber, color);
      return recv_checkSimilarItem();
    }

    public void send_checkSimilarItem(String productGroup, String brand, String modelNumber, String color) throws org.apache.thrift.TException
    {
      checkSimilarItem_args args = new checkSimilarItem_args();
      args.setProductGroup(productGroup);
      args.setBrand(brand);
      args.setModelNumber(modelNumber);
      args.setColor(color);
      sendBase("checkSimilarItem", args);
    }

    public long recv_checkSimilarItem() throws org.apache.thrift.TException
    {
      checkSimilarItem_result result = new checkSimilarItem_result();
      receiveBase(result, "checkSimilarItem");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkSimilarItem failed: unknown result");
    }

    public void changeItemRiskyFlag(long itemId, boolean risky) throws org.apache.thrift.TException
    {
      send_changeItemRiskyFlag(itemId, risky);
      recv_changeItemRiskyFlag();
    }

    public void send_changeItemRiskyFlag(long itemId, boolean risky) throws org.apache.thrift.TException
    {
      changeItemRiskyFlag_args args = new changeItemRiskyFlag_args();
      args.setItemId(itemId);
      args.setRisky(risky);
      sendBase("changeItemRiskyFlag", args);
    }

    public void recv_changeItemRiskyFlag() throws org.apache.thrift.TException
    {
      changeItemRiskyFlag_result result = new changeItemRiskyFlag_result();
      receiveBase(result, "changeItemRiskyFlag");
      return;
    }

    public List<Item> getItemsByRiskyFlag() throws org.apache.thrift.TException
    {
      send_getItemsByRiskyFlag();
      return recv_getItemsByRiskyFlag();
    }

    public void send_getItemsByRiskyFlag() throws org.apache.thrift.TException
    {
      getItemsByRiskyFlag_args args = new getItemsByRiskyFlag_args();
      sendBase("getItemsByRiskyFlag", args);
    }

    public List<Item> recv_getItemsByRiskyFlag() throws org.apache.thrift.TException
    {
      getItemsByRiskyFlag_result result = new getItemsByRiskyFlag_result();
      receiveBase(result, "getItemsByRiskyFlag");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemsByRiskyFlag failed: unknown result");
    }

    public List<Item> getItemsByVendorCategory(String vendorCategory) throws org.apache.thrift.TException
    {
      send_getItemsByVendorCategory(vendorCategory);
      return recv_getItemsByVendorCategory();
    }

    public void send_getItemsByVendorCategory(String vendorCategory) throws org.apache.thrift.TException
    {
      getItemsByVendorCategory_args args = new getItemsByVendorCategory_args();
      args.setVendorCategory(vendorCategory);
      sendBase("getItemsByVendorCategory", args);
    }

    public List<Item> recv_getItemsByVendorCategory() throws org.apache.thrift.TException
    {
      getItemsByVendorCategory_result result = new getItemsByVendorCategory_result();
      receiveBase(result, "getItemsByVendorCategory");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemsByVendorCategory failed: unknown result");
    }

    public List<Long> getSimilarItemsCatalogIds(long beginIndex, long totalItems, long itemId) throws org.apache.thrift.TException
    {
      send_getSimilarItemsCatalogIds(beginIndex, totalItems, itemId);
      return recv_getSimilarItemsCatalogIds();
    }

    public void send_getSimilarItemsCatalogIds(long beginIndex, long totalItems, long itemId) throws org.apache.thrift.TException
    {
      getSimilarItemsCatalogIds_args args = new getSimilarItemsCatalogIds_args();
      args.setBeginIndex(beginIndex);
      args.setTotalItems(totalItems);
      args.setItemId(itemId);
      sendBase("getSimilarItemsCatalogIds", args);
    }

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

    public boolean addProductNotification(long itemId, String email) throws org.apache.thrift.TException
    {
      send_addProductNotification(itemId, email);
      return recv_addProductNotification();
    }

    public void send_addProductNotification(long itemId, String email) throws org.apache.thrift.TException
    {
      addProductNotification_args args = new addProductNotification_args();
      args.setItemId(itemId);
      args.setEmail(email);
      sendBase("addProductNotification", args);
    }

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

    public boolean sendProductNotifications() throws org.apache.thrift.TException
    {
      send_sendProductNotifications();
      return recv_sendProductNotifications();
    }

    public void send_sendProductNotifications() throws org.apache.thrift.TException
    {
      sendProductNotifications_args args = new sendProductNotifications_args();
      sendBase("sendProductNotifications", args);
    }

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

    public List<String> getAllBrandsByCategory(long categoryId) throws org.apache.thrift.TException
    {
      send_getAllBrandsByCategory(categoryId);
      return recv_getAllBrandsByCategory();
    }

    public void send_getAllBrandsByCategory(long categoryId) throws org.apache.thrift.TException
    {
      getAllBrandsByCategory_args args = new getAllBrandsByCategory_args();
      args.setCategoryId(categoryId);
      sendBase("getAllBrandsByCategory", args);
    }

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

    public List<Source> getAllSources() throws org.apache.thrift.TException
    {
      send_getAllSources();
      return recv_getAllSources();
    }

    public void send_getAllSources() throws org.apache.thrift.TException
    {
      getAllSources_args args = new getAllSources_args();
      sendBase("getAllSources", args);
    }

    public List<Source> recv_getAllSources() throws org.apache.thrift.TException
    {
      getAllSources_result result = new getAllSources_result();
      receiveBase(result, "getAllSources");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllSources failed: unknown result");
    }

    public SourceItemPricing getItemPricingBySource(long itemId, long sourceId) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItemPricingBySource(itemId, sourceId);
      return recv_getItemPricingBySource();
    }

    public void send_getItemPricingBySource(long itemId, long sourceId) throws org.apache.thrift.TException
    {
      getItemPricingBySource_args args = new getItemPricingBySource_args();
      args.setItemId(itemId);
      args.setSourceId(sourceId);
      sendBase("getItemPricingBySource", args);
    }

    public SourceItemPricing recv_getItemPricingBySource() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItemPricingBySource_result result = new getItemPricingBySource_result();
      receiveBase(result, "getItemPricingBySource");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemPricingBySource failed: unknown result");
    }

    public void addSourceItemPricing(SourceItemPricing sourceItemPricing) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_addSourceItemPricing(sourceItemPricing);
      recv_addSourceItemPricing();
    }

    public void send_addSourceItemPricing(SourceItemPricing sourceItemPricing) throws org.apache.thrift.TException
    {
      addSourceItemPricing_args args = new addSourceItemPricing_args();
      args.setSourceItemPricing(sourceItemPricing);
      sendBase("addSourceItemPricing", args);
    }

    public void recv_addSourceItemPricing() throws InventoryServiceException, org.apache.thrift.TException
    {
      addSourceItemPricing_result result = new addSourceItemPricing_result();
      receiveBase(result, "addSourceItemPricing");
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public List<SourceItemPricing> getAllSourcePricing(long itemId) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getAllSourcePricing(itemId);
      return recv_getAllSourcePricing();
    }

    public void send_getAllSourcePricing(long itemId) throws org.apache.thrift.TException
    {
      getAllSourcePricing_args args = new getAllSourcePricing_args();
      args.setItemId(itemId);
      sendBase("getAllSourcePricing", args);
    }

    public List<SourceItemPricing> recv_getAllSourcePricing() throws InventoryServiceException, org.apache.thrift.TException
    {
      getAllSourcePricing_result result = new getAllSourcePricing_result();
      receiveBase(result, "getAllSourcePricing");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllSourcePricing failed: unknown result");
    }

    public Item getItemForSource(long item_id, long sourceId) throws InventoryServiceException, org.apache.thrift.TException
    {
      send_getItemForSource(item_id, sourceId);
      return recv_getItemForSource();
    }

    public void send_getItemForSource(long item_id, long sourceId) throws org.apache.thrift.TException
    {
      getItemForSource_args args = new getItemForSource_args();
      args.setItem_id(item_id);
      args.setSourceId(sourceId);
      sendBase("getItemForSource", args);
    }

    public Item recv_getItemForSource() throws InventoryServiceException, org.apache.thrift.TException
    {
      getItemForSource_result result = new getItemForSource_result();
      receiveBase(result, "getItemForSource");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemForSource 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 addItem(Item item, org.apache.thrift.async.AsyncMethodCallback<addItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      addItem_call method_call = new addItem_call(item, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class addItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private Item item;
      public addItem_call(Item item, org.apache.thrift.async.AsyncMethodCallback<addItem_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.item = item;
      }

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

      public long getResult() throws InventoryServiceException, 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_addItem();
      }
    }

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

    public static class updateItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private Item item;
      public updateItem_call(Item item, org.apache.thrift.async.AsyncMethodCallback<updateItem_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.item = item;
      }

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

      public long getResult() throws InventoryServiceException, 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_updateItem();
      }
    }

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

    public static class addWarehouse_call extends org.apache.thrift.async.TAsyncMethodCall {
      private Warehouse warehouse;
      public addWarehouse_call(Warehouse warehouse, org.apache.thrift.async.AsyncMethodCallback<addWarehouse_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.warehouse = warehouse;
      }

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

      public long getResult() throws InventoryServiceException, 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_addWarehouse();
      }
    }

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

    public static class isActive_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      public isActive_call(long itemId, org.apache.thrift.async.AsyncMethodCallback<isActive_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("isActive", org.apache.thrift.protocol.TMessageType.CALL, 0));
        isActive_args args = new isActive_args();
        args.setItemId(itemId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public ItemShippingInfo getResult() throws InventoryServiceException, 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_isActive();
      }
    }

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

    public static class getItemStatusDescription_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      public getItemStatusDescription_call(long itemId, org.apache.thrift.async.AsyncMethodCallback<getItemStatusDescription_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("getItemStatusDescription", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemStatusDescription_args args = new getItemStatusDescription_args();
        args.setItemId(itemId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public String getResult() throws InventoryServiceException, 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_getItemStatusDescription();
      }
    }

    public void updateInventoryHistory(long warehouse_id, String timestamp, Map<String,Long> availability, org.apache.thrift.async.AsyncMethodCallback<updateInventoryHistory_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      updateInventoryHistory_call method_call = new updateInventoryHistory_call(warehouse_id, timestamp, availability, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class updateInventoryHistory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long warehouse_id;
      private String timestamp;
      private Map<String,Long> availability;
      public updateInventoryHistory_call(long warehouse_id, String timestamp, Map<String,Long> availability, org.apache.thrift.async.AsyncMethodCallback<updateInventoryHistory_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.warehouse_id = warehouse_id;
        this.timestamp = timestamp;
        this.availability = availability;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateInventoryHistory", org.apache.thrift.protocol.TMessageType.CALL, 0));
        updateInventoryHistory_args args = new updateInventoryHistory_args();
        args.setWarehouse_id(warehouse_id);
        args.setTimestamp(timestamp);
        args.setAvailability(availability);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws InventoryServiceException, 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_updateInventoryHistory();
      }
    }

    public void updateInventory(long warehouse_id, String timestamp, Map<String,Long> availability, org.apache.thrift.async.AsyncMethodCallback<updateInventory_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      updateInventory_call method_call = new updateInventory_call(warehouse_id, timestamp, availability, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class updateInventory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long warehouse_id;
      private String timestamp;
      private Map<String,Long> availability;
      public updateInventory_call(long warehouse_id, String timestamp, Map<String,Long> availability, org.apache.thrift.async.AsyncMethodCallback<updateInventory_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.warehouse_id = warehouse_id;
        this.timestamp = timestamp;
        this.availability = availability;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateInventory", org.apache.thrift.protocol.TMessageType.CALL, 0));
        updateInventory_args args = new updateInventory_args();
        args.setWarehouse_id(warehouse_id);
        args.setTimestamp(timestamp);
        args.setAvailability(availability);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws InventoryServiceException, 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_updateInventory();
      }
    }

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

    public static class retireWarehouse_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long warehouse_id;
      public retireWarehouse_call(long warehouse_id, org.apache.thrift.async.AsyncMethodCallback<retireWarehouse_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.warehouse_id = warehouse_id;
      }

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

      public void getResult() throws InventoryServiceException, 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_retireWarehouse();
      }
    }

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

    public static class startItemOn_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long item_id;
      private long timestamp;
      public startItemOn_call(long item_id, long timestamp, org.apache.thrift.async.AsyncMethodCallback<startItemOn_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.item_id = item_id;
        this.timestamp = timestamp;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startItemOn", org.apache.thrift.protocol.TMessageType.CALL, 0));
        startItemOn_args args = new startItemOn_args();
        args.setItem_id(item_id);
        args.setTimestamp(timestamp);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws InventoryServiceException, 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_startItemOn();
      }
    }

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

    public static class retireItemOn_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long item_id;
      private long timestamp;
      public retireItemOn_call(long item_id, long timestamp, org.apache.thrift.async.AsyncMethodCallback<retireItemOn_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.item_id = item_id;
        this.timestamp = timestamp;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("retireItemOn", org.apache.thrift.protocol.TMessageType.CALL, 0));
        retireItemOn_args args = new retireItemOn_args();
        args.setItem_id(item_id);
        args.setTimestamp(timestamp);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws InventoryServiceException, 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_retireItemOn();
      }
    }

    public void changeItemStatus(long item_id, long timestamp, status newstatus, org.apache.thrift.async.AsyncMethodCallback<changeItemStatus_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      changeItemStatus_call method_call = new changeItemStatus_call(item_id, timestamp, newstatus, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class changeItemStatus_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long item_id;
      private long timestamp;
      private status newstatus;
      public changeItemStatus_call(long item_id, long timestamp, status newstatus, org.apache.thrift.async.AsyncMethodCallback<changeItemStatus_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.item_id = item_id;
        this.timestamp = timestamp;
        this.newstatus = newstatus;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("changeItemStatus", org.apache.thrift.protocol.TMessageType.CALL, 0));
        changeItemStatus_args args = new changeItemStatus_args();
        args.setItem_id(item_id);
        args.setTimestamp(timestamp);
        args.setNewstatus(newstatus);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws InventoryServiceException, 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_changeItemStatus();
      }
    }

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

    public static class getItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long item_id;
      public getItem_call(long item_id, org.apache.thrift.async.AsyncMethodCallback<getItem_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.item_id = item_id;
      }

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

      public Item getResult() throws InventoryServiceException, 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_getItem();
      }
    }

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

    public static class getItemsByCatalogId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long catalog_item_id;
      public getItemsByCatalogId_call(long catalog_item_id, org.apache.thrift.async.AsyncMethodCallback<getItemsByCatalogId_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.catalog_item_id = catalog_item_id;
      }

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

      public List<Item> getResult() throws InventoryServiceException, 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_getItemsByCatalogId();
      }
    }

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

    public static class getAllItems_call extends org.apache.thrift.async.TAsyncMethodCall {
      private boolean isActive;
      public getAllItems_call(boolean isActive, org.apache.thrift.async.AsyncMethodCallback<getAllItems_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.isActive = isActive;
      }

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

      public List<Item> getResult() throws InventoryServiceException, 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_getAllItems();
      }
    }

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

    public static class getAllItemsByStatus_call extends org.apache.thrift.async.TAsyncMethodCall {
      private status itemStatus;
      public getAllItemsByStatus_call(status itemStatus, org.apache.thrift.async.AsyncMethodCallback<getAllItemsByStatus_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.itemStatus = itemStatus;
      }

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

      public List<Item> getResult() throws InventoryServiceException, 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_getAllItemsByStatus();
      }
    }

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

    public static class getItemInventory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long item_id;
      public getItemInventory_call(long item_id, org.apache.thrift.async.AsyncMethodCallback<getItemInventory_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.item_id = item_id;
      }

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

      public ItemInventory getResult() throws InventoryServiceException, 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_getItemInventory();
      }
    }

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

    public static class getItemInventoryByItemId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long item_id;
      public getItemInventoryByItemId_call(long item_id, org.apache.thrift.async.AsyncMethodCallback<getItemInventoryByItemId_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.item_id = item_id;
      }

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

      public ItemInventory getResult() throws InventoryServiceException, 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_getItemInventoryByItemId();
      }
    }

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

    public static class getItemAvailibilityAtWarehouse_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long warehouse_id;
      private long item_id;
      public getItemAvailibilityAtWarehouse_call(long warehouse_id, long item_id, org.apache.thrift.async.AsyncMethodCallback<getItemAvailibilityAtWarehouse_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.warehouse_id = warehouse_id;
        this.item_id = item_id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemAvailibilityAtWarehouse", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemAvailibilityAtWarehouse_args args = new getItemAvailibilityAtWarehouse_args();
        args.setWarehouse_id(warehouse_id);
        args.setItem_id(item_id);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws InventoryServiceException, 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_getItemAvailibilityAtWarehouse();
      }
    }

    public void markItemAsContentComplete(long entityId, long category, String brand, String modelName, String modelNumber, org.apache.thrift.async.AsyncMethodCallback<markItemAsContentComplete_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      markItemAsContentComplete_call method_call = new markItemAsContentComplete_call(entityId, category, brand, modelName, modelNumber, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class markItemAsContentComplete_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long entityId;
      private long category;
      private String brand;
      private String modelName;
      private String modelNumber;
      public markItemAsContentComplete_call(long entityId, long category, String brand, String modelName, String modelNumber, org.apache.thrift.async.AsyncMethodCallback<markItemAsContentComplete_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.entityId = entityId;
        this.category = category;
        this.brand = brand;
        this.modelName = modelName;
        this.modelNumber = modelNumber;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markItemAsContentComplete", org.apache.thrift.protocol.TMessageType.CALL, 0));
        markItemAsContentComplete_args args = new markItemAsContentComplete_args();
        args.setEntityId(entityId);
        args.setCategory(category);
        args.setBrand(brand);
        args.setModelName(modelName);
        args.setModelNumber(modelNumber);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public boolean getResult() throws InventoryServiceException, 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_markItemAsContentComplete();
      }
    }

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

    public static class getItemAvailabilityAtLocation_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long warehouse_loc;
      private long item_id;
      public getItemAvailabilityAtLocation_call(long warehouse_loc, long item_id, org.apache.thrift.async.AsyncMethodCallback<getItemAvailabilityAtLocation_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.warehouse_loc = warehouse_loc;
        this.item_id = item_id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemAvailabilityAtLocation", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemAvailabilityAtLocation_args args = new getItemAvailabilityAtLocation_args();
        args.setWarehouse_loc(warehouse_loc);
        args.setItem_id(item_id);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Long> getResult() throws InventoryServiceException, 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_getItemAvailabilityAtLocation();
      }
    }

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

    public static class getAllWarehouses_call extends org.apache.thrift.async.TAsyncMethodCall {
      private boolean isActive;
      public getAllWarehouses_call(boolean isActive, org.apache.thrift.async.AsyncMethodCallback<getAllWarehouses_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.isActive = isActive;
      }

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

      public List<Warehouse> getResult() throws InventoryServiceException, 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_getAllWarehouses();
      }
    }

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

    public static class getWarehouse_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long warehouse_id;
      public getWarehouse_call(long warehouse_id, org.apache.thrift.async.AsyncMethodCallback<getWarehouse_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.warehouse_id = warehouse_id;
      }

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

      public Warehouse getResult() throws InventoryServiceException, 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_getWarehouse();
      }
    }

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

    public static class getAllWarehousesForItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long item_id;
      public getAllWarehousesForItem_call(long item_id, org.apache.thrift.async.AsyncMethodCallback<getAllWarehousesForItem_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.item_id = item_id;
      }

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

      public List<Warehouse> getResult() throws InventoryServiceException, 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_getAllWarehousesForItem();
      }
    }

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

    public static class getAllItemsForWarehouse_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long warehouse_id;
      public getAllItemsForWarehouse_call(long warehouse_id, org.apache.thrift.async.AsyncMethodCallback<getAllItemsForWarehouse_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.warehouse_id = warehouse_id;
      }

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

      public List<Item> getResult() throws InventoryServiceException, 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_getAllItemsForWarehouse();
      }
    }

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

    public static class reserveItemInWarehouse_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private long warehouseId;
      private double quantity;
      public reserveItemInWarehouse_call(long itemId, long warehouseId, double quantity, org.apache.thrift.async.AsyncMethodCallback<reserveItemInWarehouse_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.warehouseId = warehouseId;
        this.quantity = quantity;
      }

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

      public boolean getResult() throws InventoryServiceException, 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_reserveItemInWarehouse();
      }
    }

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

    public static class reduceReservationCount_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private long warehouseId;
      private double quantity;
      public reduceReservationCount_call(long itemId, long warehouseId, double quantity, org.apache.thrift.async.AsyncMethodCallback<reduceReservationCount_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.warehouseId = warehouseId;
        this.quantity = quantity;
      }

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

      public boolean getResult() throws InventoryServiceException, 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_reduceReservationCount();
      }
    }

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

    public static class getBestSellers_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getBestSellers_call(org.apache.thrift.async.AsyncMethodCallback<getBestSellers_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("getBestSellers", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getBestSellers_args args = new getBestSellers_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Item> getResult() throws InventoryServiceException, 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_getBestSellers();
      }
    }

    public void getBestSellersCatalogIds(long beginIndex, long totalItems, String brand, long category, org.apache.thrift.async.AsyncMethodCallback<getBestSellersCatalogIds_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getBestSellersCatalogIds_call method_call = new getBestSellersCatalogIds_call(beginIndex, totalItems, brand, category, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getBestSellersCatalogIds_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long beginIndex;
      private long totalItems;
      private String brand;
      private long category;
      public getBestSellersCatalogIds_call(long beginIndex, long totalItems, String brand, long category, org.apache.thrift.async.AsyncMethodCallback<getBestSellersCatalogIds_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.beginIndex = beginIndex;
        this.totalItems = totalItems;
        this.brand = brand;
        this.category = category;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getBestSellersCatalogIds", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getBestSellersCatalogIds_args args = new getBestSellersCatalogIds_args();
        args.setBeginIndex(beginIndex);
        args.setTotalItems(totalItems);
        args.setBrand(brand);
        args.setCategory(category);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Long> getResult() throws InventoryServiceException, 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_getBestSellersCatalogIds();
      }
    }

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

    public static class getBestSellersCount_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getBestSellersCount_call(org.apache.thrift.async.AsyncMethodCallback<getBestSellersCount_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("getBestSellersCount", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getBestSellersCount_args args = new getBestSellersCount_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws InventoryServiceException, 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_getBestSellersCount();
      }
    }

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

    public static class getBestDeals_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getBestDeals_call(org.apache.thrift.async.AsyncMethodCallback<getBestDeals_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("getBestDeals", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getBestDeals_args args = new getBestDeals_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Item> getResult() throws InventoryServiceException, 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_getBestDeals();
      }
    }

    public void getBestDealsCatalogIds(long beginIndex, long totalItems, String brand, long category, org.apache.thrift.async.AsyncMethodCallback<getBestDealsCatalogIds_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getBestDealsCatalogIds_call method_call = new getBestDealsCatalogIds_call(beginIndex, totalItems, brand, category, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getBestDealsCatalogIds_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long beginIndex;
      private long totalItems;
      private String brand;
      private long category;
      public getBestDealsCatalogIds_call(long beginIndex, long totalItems, String brand, long category, org.apache.thrift.async.AsyncMethodCallback<getBestDealsCatalogIds_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.beginIndex = beginIndex;
        this.totalItems = totalItems;
        this.brand = brand;
        this.category = category;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getBestDealsCatalogIds", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getBestDealsCatalogIds_args args = new getBestDealsCatalogIds_args();
        args.setBeginIndex(beginIndex);
        args.setTotalItems(totalItems);
        args.setBrand(brand);
        args.setCategory(category);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Long> getResult() throws InventoryServiceException, 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_getBestDealsCatalogIds();
      }
    }

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

    public static class getBestDealsCount_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getBestDealsCount_call(org.apache.thrift.async.AsyncMethodCallback<getBestDealsCount_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("getBestDealsCount", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getBestDealsCount_args args = new getBestDealsCount_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws InventoryServiceException, 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_getBestDealsCount();
      }
    }

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

    public static class getLatestArrivals_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getLatestArrivals_call(org.apache.thrift.async.AsyncMethodCallback<getLatestArrivals_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("getLatestArrivals", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getLatestArrivals_args args = new getLatestArrivals_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Item> getResult() throws InventoryServiceException, 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_getLatestArrivals();
      }
    }

    public void getLatestArrivalsCatalogIds(long beginIndex, long totalItems, String brand, List<Long> categories, org.apache.thrift.async.AsyncMethodCallback<getLatestArrivalsCatalogIds_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getLatestArrivalsCatalogIds_call method_call = new getLatestArrivalsCatalogIds_call(beginIndex, totalItems, brand, categories, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getLatestArrivalsCatalogIds_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long beginIndex;
      private long totalItems;
      private String brand;
      private List<Long> categories;
      public getLatestArrivalsCatalogIds_call(long beginIndex, long totalItems, String brand, List<Long> categories, org.apache.thrift.async.AsyncMethodCallback<getLatestArrivalsCatalogIds_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.beginIndex = beginIndex;
        this.totalItems = totalItems;
        this.brand = brand;
        this.categories = categories;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLatestArrivalsCatalogIds", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getLatestArrivalsCatalogIds_args args = new getLatestArrivalsCatalogIds_args();
        args.setBeginIndex(beginIndex);
        args.setTotalItems(totalItems);
        args.setBrand(brand);
        args.setCategories(categories);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Long> getResult() throws InventoryServiceException, 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_getLatestArrivalsCatalogIds();
      }
    }

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

    public static class getLatestArrivalsCount_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getLatestArrivalsCount_call(org.apache.thrift.async.AsyncMethodCallback<getLatestArrivalsCount_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("getLatestArrivalsCount", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getLatestArrivalsCount_args args = new getLatestArrivalsCount_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws InventoryServiceException, 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_getLatestArrivalsCount();
      }
    }

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

    public static class generateNewEntityID_call extends org.apache.thrift.async.TAsyncMethodCall {
      public generateNewEntityID_call(org.apache.thrift.async.AsyncMethodCallback<generateNewEntityID_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("generateNewEntityID", org.apache.thrift.protocol.TMessageType.CALL, 0));
        generateNewEntityID_args args = new generateNewEntityID_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

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

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

    public static class getItemPricing_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private long warehouseId;
      public getItemPricing_call(long itemId, long warehouseId, org.apache.thrift.async.AsyncMethodCallback<getItemPricing_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.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("getItemPricing", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemPricing_args args = new getItemPricing_args();
        args.setItemId(itemId);
        args.setWarehouseId(warehouseId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public VendorItemPricing getResult() throws InventoryServiceException, 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_getItemPricing();
      }
    }

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

    public static class addCategory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private Category category;
      public addCategory_call(Category category, org.apache.thrift.async.AsyncMethodCallback<addCategory_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.category = category;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addCategory", org.apache.thrift.protocol.TMessageType.CALL, 0));
        addCategory_args args = new addCategory_args();
        args.setCategory(category);
        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_addCategory();
      }
    }

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

    public static class getCategory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      public getCategory_call(long id, org.apache.thrift.async.AsyncMethodCallback<getCategory_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("getCategory", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCategory_args args = new getCategory_args();
        args.setId(id);
        args.write(prot);
        prot.writeMessageEnd();
      }

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

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

    public static class getAllCategories_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getAllCategories_call(org.apache.thrift.async.AsyncMethodCallback<getAllCategories_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("getAllCategories", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllCategories_args args = new getAllCategories_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Category> 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_getAllCategories();
      }
    }

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

    public static class getAllItemPricing_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      public getAllItemPricing_call(long itemId, org.apache.thrift.async.AsyncMethodCallback<getAllItemPricing_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("getAllItemPricing", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllItemPricing_args args = new getAllItemPricing_args();
        args.setItemId(itemId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<VendorItemPricing> getResult() throws InventoryServiceException, 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_getAllItemPricing();
      }
    }

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

    public static class addVendorItemPricing_call extends org.apache.thrift.async.TAsyncMethodCall {
      private VendorItemPricing vendorItemPricing;
      public addVendorItemPricing_call(VendorItemPricing vendorItemPricing, org.apache.thrift.async.AsyncMethodCallback<addVendorItemPricing_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.vendorItemPricing = vendorItemPricing;
      }

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

      public void getResult() throws InventoryServiceException, 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_addVendorItemPricing();
      }
    }

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

    public static class getAllVendors_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getAllVendors_call(org.apache.thrift.async.AsyncMethodCallback<getAllVendors_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("getAllVendors", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllVendors_args args = new getAllVendors_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Vendor> 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_getAllVendors();
      }
    }

    public void itemExists(String productGroup, String brand, String modelNumber, String color, long vendor_id, String category, org.apache.thrift.async.AsyncMethodCallback<itemExists_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      itemExists_call method_call = new itemExists_call(productGroup, brand, modelNumber, color, vendor_id, category, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class itemExists_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String productGroup;
      private String brand;
      private String modelNumber;
      private String color;
      private long vendor_id;
      private String category;
      public itemExists_call(String productGroup, String brand, String modelNumber, String color, long vendor_id, String category, org.apache.thrift.async.AsyncMethodCallback<itemExists_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.productGroup = productGroup;
        this.brand = brand;
        this.modelNumber = modelNumber;
        this.color = color;
        this.vendor_id = vendor_id;
        this.category = category;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("itemExists", org.apache.thrift.protocol.TMessageType.CALL, 0));
        itemExists_args args = new itemExists_args();
        args.setProductGroup(productGroup);
        args.setBrand(brand);
        args.setModelNumber(modelNumber);
        args.setColor(color);
        args.setVendor_id(vendor_id);
        args.setCategory(category);
        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_itemExists();
      }
    }

    public void addVendorItemMapping(String key, VendorItemMapping vendorItemMapping, org.apache.thrift.async.AsyncMethodCallback<addVendorItemMapping_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      addVendorItemMapping_call method_call = new addVendorItemMapping_call(key, vendorItemMapping, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class addVendorItemMapping_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String key;
      private VendorItemMapping vendorItemMapping;
      public addVendorItemMapping_call(String key, VendorItemMapping vendorItemMapping, org.apache.thrift.async.AsyncMethodCallback<addVendorItemMapping_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.key = key;
        this.vendorItemMapping = vendorItemMapping;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVendorItemMapping", org.apache.thrift.protocol.TMessageType.CALL, 0));
        addVendorItemMapping_args args = new addVendorItemMapping_args();
        args.setKey(key);
        args.setVendorItemMapping(vendorItemMapping);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws InventoryServiceException, 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_addVendorItemMapping();
      }
    }

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

    public static class getVendorItemMappings_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      public getVendorItemMappings_call(long itemId, org.apache.thrift.async.AsyncMethodCallback<getVendorItemMappings_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("getVendorItemMappings", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getVendorItemMappings_args args = new getVendorItemMappings_args();
        args.setItemId(itemId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<VendorItemMapping> getResult() throws InventoryServiceException, 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_getVendorItemMappings();
      }
    }

    public void checkSimilarItem(String productGroup, String brand, String modelNumber, String color, org.apache.thrift.async.AsyncMethodCallback<checkSimilarItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      checkSimilarItem_call method_call = new checkSimilarItem_call(productGroup, brand, modelNumber, color, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class checkSimilarItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String productGroup;
      private String brand;
      private String modelNumber;
      private String color;
      public checkSimilarItem_call(String productGroup, String brand, String modelNumber, String color, org.apache.thrift.async.AsyncMethodCallback<checkSimilarItem_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.productGroup = productGroup;
        this.brand = brand;
        this.modelNumber = modelNumber;
        this.color = color;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkSimilarItem", org.apache.thrift.protocol.TMessageType.CALL, 0));
        checkSimilarItem_args args = new checkSimilarItem_args();
        args.setProductGroup(productGroup);
        args.setBrand(brand);
        args.setModelNumber(modelNumber);
        args.setColor(color);
        args.write(prot);
        prot.writeMessageEnd();
      }

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

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

    public static class changeItemRiskyFlag_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private boolean risky;
      public changeItemRiskyFlag_call(long itemId, boolean risky, org.apache.thrift.async.AsyncMethodCallback<changeItemRiskyFlag_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.risky = risky;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("changeItemRiskyFlag", org.apache.thrift.protocol.TMessageType.CALL, 0));
        changeItemRiskyFlag_args args = new changeItemRiskyFlag_args();
        args.setItemId(itemId);
        args.setRisky(risky);
        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_changeItemRiskyFlag();
      }
    }

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

    public static class getItemsByRiskyFlag_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getItemsByRiskyFlag_call(org.apache.thrift.async.AsyncMethodCallback<getItemsByRiskyFlag_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("getItemsByRiskyFlag", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemsByRiskyFlag_args args = new getItemsByRiskyFlag_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Item> 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_getItemsByRiskyFlag();
      }
    }

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

    public static class getItemsByVendorCategory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String vendorCategory;
      public getItemsByVendorCategory_call(String vendorCategory, org.apache.thrift.async.AsyncMethodCallback<getItemsByVendorCategory_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.vendorCategory = vendorCategory;
      }

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

      public List<Item> 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_getItemsByVendorCategory();
      }
    }

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

    public static class getSimilarItemsCatalogIds_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long beginIndex;
      private long totalItems;
      private long itemId;
      public getSimilarItemsCatalogIds_call(long beginIndex, long totalItems, long itemId, org.apache.thrift.async.AsyncMethodCallback<getSimilarItemsCatalogIds_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.beginIndex = beginIndex;
        this.totalItems = totalItems;
        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("getSimilarItemsCatalogIds", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getSimilarItemsCatalogIds_args args = new getSimilarItemsCatalogIds_args();
        args.setBeginIndex(beginIndex);
        args.setTotalItems(totalItems);
        args.setItemId(itemId);
        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_getSimilarItemsCatalogIds();
      }
    }

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

    public static class addProductNotification_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private String email;
      public addProductNotification_call(long itemId, String email, org.apache.thrift.async.AsyncMethodCallback<addProductNotification_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.email = email;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addProductNotification", org.apache.thrift.protocol.TMessageType.CALL, 0));
        addProductNotification_args args = new addProductNotification_args();
        args.setItemId(itemId);
        args.setEmail(email);
        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_addProductNotification();
      }
    }

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

    public static class sendProductNotifications_call extends org.apache.thrift.async.TAsyncMethodCall {
      public sendProductNotifications_call(org.apache.thrift.async.AsyncMethodCallback<sendProductNotifications_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("sendProductNotifications", org.apache.thrift.protocol.TMessageType.CALL, 0));
        sendProductNotifications_args args = new sendProductNotifications_args();
        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_sendProductNotifications();
      }
    }

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

    public static class getAllBrandsByCategory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long categoryId;
      public getAllBrandsByCategory_call(long categoryId, org.apache.thrift.async.AsyncMethodCallback<getAllBrandsByCategory_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.categoryId = categoryId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllBrandsByCategory", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllBrandsByCategory_args args = new getAllBrandsByCategory_args();
        args.setCategoryId(categoryId);
        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_getAllBrandsByCategory();
      }
    }

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

    public static class getAllSources_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getAllSources_call(org.apache.thrift.async.AsyncMethodCallback<getAllSources_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("getAllSources", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllSources_args args = new getAllSources_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Source> 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_getAllSources();
      }
    }

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

    public static class getItemPricingBySource_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      private long sourceId;
      public getItemPricingBySource_call(long itemId, long sourceId, org.apache.thrift.async.AsyncMethodCallback<getItemPricingBySource_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.sourceId = sourceId;
      }

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

      public SourceItemPricing getResult() throws InventoryServiceException, 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_getItemPricingBySource();
      }
    }

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

    public static class addSourceItemPricing_call extends org.apache.thrift.async.TAsyncMethodCall {
      private SourceItemPricing sourceItemPricing;
      public addSourceItemPricing_call(SourceItemPricing sourceItemPricing, org.apache.thrift.async.AsyncMethodCallback<addSourceItemPricing_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.sourceItemPricing = sourceItemPricing;
      }

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

      public void getResult() throws InventoryServiceException, 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_addSourceItemPricing();
      }
    }

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

    public static class getAllSourcePricing_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long itemId;
      public getAllSourcePricing_call(long itemId, org.apache.thrift.async.AsyncMethodCallback<getAllSourcePricing_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("getAllSourcePricing", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllSourcePricing_args args = new getAllSourcePricing_args();
        args.setItemId(itemId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<SourceItemPricing> getResult() throws InventoryServiceException, 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_getAllSourcePricing();
      }
    }

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

    public static class getItemForSource_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long item_id;
      private long sourceId;
      public getItemForSource_call(long item_id, long sourceId, org.apache.thrift.async.AsyncMethodCallback<getItemForSource_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.item_id = item_id;
        this.sourceId = sourceId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemForSource", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getItemForSource_args args = new getItemForSource_args();
        args.setItem_id(item_id);
        args.setSourceId(sourceId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Item getResult() throws InventoryServiceException, 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_getItemForSource();
      }
    }

  }

  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("addItem", new addItem());
      processMap.put("updateItem", new updateItem());
      processMap.put("addWarehouse", new addWarehouse());
      processMap.put("isActive", new isActive());
      processMap.put("getItemStatusDescription", new getItemStatusDescription());
      processMap.put("updateInventoryHistory", new updateInventoryHistory());
      processMap.put("updateInventory", new updateInventory());
      processMap.put("retireWarehouse", new retireWarehouse());
      processMap.put("startItemOn", new startItemOn());
      processMap.put("retireItemOn", new retireItemOn());
      processMap.put("changeItemStatus", new changeItemStatus());
      processMap.put("getItem", new getItem());
      processMap.put("getItemsByCatalogId", new getItemsByCatalogId());
      processMap.put("getAllItems", new getAllItems());
      processMap.put("getAllItemsByStatus", new getAllItemsByStatus());
      processMap.put("getItemInventory", new getItemInventory());
      processMap.put("getItemInventoryByItemId", new getItemInventoryByItemId());
      processMap.put("getItemAvailibilityAtWarehouse", new getItemAvailibilityAtWarehouse());
      processMap.put("markItemAsContentComplete", new markItemAsContentComplete());
      processMap.put("getItemAvailabilityAtLocation", new getItemAvailabilityAtLocation());
      processMap.put("getAllWarehouses", new getAllWarehouses());
      processMap.put("getWarehouse", new getWarehouse());
      processMap.put("getAllWarehousesForItem", new getAllWarehousesForItem());
      processMap.put("getAllItemsForWarehouse", new getAllItemsForWarehouse());
      processMap.put("reserveItemInWarehouse", new reserveItemInWarehouse());
      processMap.put("reduceReservationCount", new reduceReservationCount());
      processMap.put("getBestSellers", new getBestSellers());
      processMap.put("getBestSellersCatalogIds", new getBestSellersCatalogIds());
      processMap.put("getBestSellersCount", new getBestSellersCount());
      processMap.put("getBestDeals", new getBestDeals());
      processMap.put("getBestDealsCatalogIds", new getBestDealsCatalogIds());
      processMap.put("getBestDealsCount", new getBestDealsCount());
      processMap.put("getLatestArrivals", new getLatestArrivals());
      processMap.put("getLatestArrivalsCatalogIds", new getLatestArrivalsCatalogIds());
      processMap.put("getLatestArrivalsCount", new getLatestArrivalsCount());
      processMap.put("generateNewEntityID", new generateNewEntityID());
      processMap.put("getItemPricing", new getItemPricing());
      processMap.put("addCategory", new addCategory());
      processMap.put("getCategory", new getCategory());
      processMap.put("getAllCategories", new getAllCategories());
      processMap.put("getAllItemPricing", new getAllItemPricing());
      processMap.put("addVendorItemPricing", new addVendorItemPricing());
      processMap.put("getAllVendors", new getAllVendors());
      processMap.put("itemExists", new itemExists());
      processMap.put("addVendorItemMapping", new addVendorItemMapping());
      processMap.put("getVendorItemMappings", new getVendorItemMappings());
      processMap.put("checkSimilarItem", new checkSimilarItem());
      processMap.put("changeItemRiskyFlag", new changeItemRiskyFlag());
      processMap.put("getItemsByRiskyFlag", new getItemsByRiskyFlag());
      processMap.put("getItemsByVendorCategory", new getItemsByVendorCategory());
      processMap.put("getSimilarItemsCatalogIds", new getSimilarItemsCatalogIds());
      processMap.put("addProductNotification", new addProductNotification());
      processMap.put("sendProductNotifications", new sendProductNotifications());
      processMap.put("getAllBrandsByCategory", new getAllBrandsByCategory());
      processMap.put("getAllSources", new getAllSources());
      processMap.put("getItemPricingBySource", new getItemPricingBySource());
      processMap.put("addSourceItemPricing", new addSourceItemPricing());
      processMap.put("getAllSourcePricing", new getAllSourcePricing());
      processMap.put("getItemForSource", new getItemForSource());
      return processMap;
    }

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

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

      protected addItem_result getResult(I iface, addItem_args args) throws org.apache.thrift.TException {
        addItem_result result = new addItem_result();
        try {
          result.success = iface.addItem(args.item);
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected updateItem_result getResult(I iface, updateItem_args args) throws org.apache.thrift.TException {
        updateItem_result result = new updateItem_result();
        try {
          result.success = iface.updateItem(args.item);
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected addWarehouse_result getResult(I iface, addWarehouse_args args) throws org.apache.thrift.TException {
        addWarehouse_result result = new addWarehouse_result();
        try {
          result.success = iface.addWarehouse(args.warehouse);
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected isActive_result getResult(I iface, isActive_args args) throws org.apache.thrift.TException {
        isActive_result result = new isActive_result();
        try {
          result.success = iface.isActive(args.itemId);
        } catch (InventoryServiceException isex) {
          result.isex = isex;
        }
        return result;
      }
    }

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

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

      protected getItemStatusDescription_result getResult(I iface, getItemStatusDescription_args args) throws org.apache.thrift.TException {
        getItemStatusDescription_result result = new getItemStatusDescription_result();
        try {
          result.success = iface.getItemStatusDescription(args.itemId);
        } catch (InventoryServiceException isex) {
          result.isex = isex;
        }
        return result;
      }
    }

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

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

      protected updateInventoryHistory_result getResult(I iface, updateInventoryHistory_args args) throws org.apache.thrift.TException {
        updateInventoryHistory_result result = new updateInventoryHistory_result();
        try {
          iface.updateInventoryHistory(args.warehouse_id, args.timestamp, args.availability);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected updateInventory_result getResult(I iface, updateInventory_args args) throws org.apache.thrift.TException {
        updateInventory_result result = new updateInventory_result();
        try {
          iface.updateInventory(args.warehouse_id, args.timestamp, args.availability);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected retireWarehouse_result getResult(I iface, retireWarehouse_args args) throws org.apache.thrift.TException {
        retireWarehouse_result result = new retireWarehouse_result();
        try {
          iface.retireWarehouse(args.warehouse_id);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected startItemOn_result getResult(I iface, startItemOn_args args) throws org.apache.thrift.TException {
        startItemOn_result result = new startItemOn_result();
        try {
          iface.startItemOn(args.item_id, args.timestamp);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected retireItemOn_result getResult(I iface, retireItemOn_args args) throws org.apache.thrift.TException {
        retireItemOn_result result = new retireItemOn_result();
        try {
          iface.retireItemOn(args.item_id, args.timestamp);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected changeItemStatus_result getResult(I iface, changeItemStatus_args args) throws org.apache.thrift.TException {
        changeItemStatus_result result = new changeItemStatus_result();
        try {
          iface.changeItemStatus(args.item_id, args.timestamp, args.newstatus);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getItem_result getResult(I iface, getItem_args args) throws org.apache.thrift.TException {
        getItem_result result = new getItem_result();
        try {
          result.success = iface.getItem(args.item_id);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getItemsByCatalogId_result getResult(I iface, getItemsByCatalogId_args args) throws org.apache.thrift.TException {
        getItemsByCatalogId_result result = new getItemsByCatalogId_result();
        try {
          result.success = iface.getItemsByCatalogId(args.catalog_item_id);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getAllItems_result getResult(I iface, getAllItems_args args) throws org.apache.thrift.TException {
        getAllItems_result result = new getAllItems_result();
        try {
          result.success = iface.getAllItems(args.isActive);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getAllItemsByStatus_result getResult(I iface, getAllItemsByStatus_args args) throws org.apache.thrift.TException {
        getAllItemsByStatus_result result = new getAllItemsByStatus_result();
        try {
          result.success = iface.getAllItemsByStatus(args.itemStatus);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getItemInventory_result getResult(I iface, getItemInventory_args args) throws org.apache.thrift.TException {
        getItemInventory_result result = new getItemInventory_result();
        try {
          result.success = iface.getItemInventory(args.item_id);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getItemInventoryByItemId_result getResult(I iface, getItemInventoryByItemId_args args) throws org.apache.thrift.TException {
        getItemInventoryByItemId_result result = new getItemInventoryByItemId_result();
        try {
          result.success = iface.getItemInventoryByItemId(args.item_id);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getItemAvailibilityAtWarehouse_result getResult(I iface, getItemAvailibilityAtWarehouse_args args) throws org.apache.thrift.TException {
        getItemAvailibilityAtWarehouse_result result = new getItemAvailibilityAtWarehouse_result();
        try {
          result.success = iface.getItemAvailibilityAtWarehouse(args.warehouse_id, args.item_id);
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected markItemAsContentComplete_result getResult(I iface, markItemAsContentComplete_args args) throws org.apache.thrift.TException {
        markItemAsContentComplete_result result = new markItemAsContentComplete_result();
        try {
          result.success = iface.markItemAsContentComplete(args.entityId, args.category, args.brand, args.modelName, args.modelNumber);
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getItemAvailabilityAtLocation_result getResult(I iface, getItemAvailabilityAtLocation_args args) throws org.apache.thrift.TException {
        getItemAvailabilityAtLocation_result result = new getItemAvailabilityAtLocation_result();
        try {
          result.success = iface.getItemAvailabilityAtLocation(args.warehouse_loc, args.item_id);
        } catch (InventoryServiceException isex) {
          result.isex = isex;
        }
        return result;
      }
    }

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

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

      protected getAllWarehouses_result getResult(I iface, getAllWarehouses_args args) throws org.apache.thrift.TException {
        getAllWarehouses_result result = new getAllWarehouses_result();
        try {
          result.success = iface.getAllWarehouses(args.isActive);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getWarehouse_result getResult(I iface, getWarehouse_args args) throws org.apache.thrift.TException {
        getWarehouse_result result = new getWarehouse_result();
        try {
          result.success = iface.getWarehouse(args.warehouse_id);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getAllWarehousesForItem_result getResult(I iface, getAllWarehousesForItem_args args) throws org.apache.thrift.TException {
        getAllWarehousesForItem_result result = new getAllWarehousesForItem_result();
        try {
          result.success = iface.getAllWarehousesForItem(args.item_id);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getAllItemsForWarehouse_result getResult(I iface, getAllItemsForWarehouse_args args) throws org.apache.thrift.TException {
        getAllItemsForWarehouse_result result = new getAllItemsForWarehouse_result();
        try {
          result.success = iface.getAllItemsForWarehouse(args.warehouse_id);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected reserveItemInWarehouse_result getResult(I iface, reserveItemInWarehouse_args args) throws org.apache.thrift.TException {
        reserveItemInWarehouse_result result = new reserveItemInWarehouse_result();
        try {
          result.success = iface.reserveItemInWarehouse(args.itemId, args.warehouseId, args.quantity);
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected reduceReservationCount_result getResult(I iface, reduceReservationCount_args args) throws org.apache.thrift.TException {
        reduceReservationCount_result result = new reduceReservationCount_result();
        try {
          result.success = iface.reduceReservationCount(args.itemId, args.warehouseId, args.quantity);
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getBestSellers_result getResult(I iface, getBestSellers_args args) throws org.apache.thrift.TException {
        getBestSellers_result result = new getBestSellers_result();
        try {
          result.success = iface.getBestSellers();
        } catch (InventoryServiceException isex) {
          result.isex = isex;
        }
        return result;
      }
    }

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

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

      protected getBestSellersCatalogIds_result getResult(I iface, getBestSellersCatalogIds_args args) throws org.apache.thrift.TException {
        getBestSellersCatalogIds_result result = new getBestSellersCatalogIds_result();
        try {
          result.success = iface.getBestSellersCatalogIds(args.beginIndex, args.totalItems, args.brand, args.category);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getBestSellersCount_result getResult(I iface, getBestSellersCount_args args) throws org.apache.thrift.TException {
        getBestSellersCount_result result = new getBestSellersCount_result();
        try {
          result.success = iface.getBestSellersCount();
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getBestDeals_result getResult(I iface, getBestDeals_args args) throws org.apache.thrift.TException {
        getBestDeals_result result = new getBestDeals_result();
        try {
          result.success = iface.getBestDeals();
        } catch (InventoryServiceException isex) {
          result.isex = isex;
        }
        return result;
      }
    }

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

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

      protected getBestDealsCatalogIds_result getResult(I iface, getBestDealsCatalogIds_args args) throws org.apache.thrift.TException {
        getBestDealsCatalogIds_result result = new getBestDealsCatalogIds_result();
        try {
          result.success = iface.getBestDealsCatalogIds(args.beginIndex, args.totalItems, args.brand, args.category);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getBestDealsCount_result getResult(I iface, getBestDealsCount_args args) throws org.apache.thrift.TException {
        getBestDealsCount_result result = new getBestDealsCount_result();
        try {
          result.success = iface.getBestDealsCount();
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getLatestArrivals_result getResult(I iface, getLatestArrivals_args args) throws org.apache.thrift.TException {
        getLatestArrivals_result result = new getLatestArrivals_result();
        try {
          result.success = iface.getLatestArrivals();
        } catch (InventoryServiceException isex) {
          result.isex = isex;
        }
        return result;
      }
    }

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

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

      protected getLatestArrivalsCatalogIds_result getResult(I iface, getLatestArrivalsCatalogIds_args args) throws org.apache.thrift.TException {
        getLatestArrivalsCatalogIds_result result = new getLatestArrivalsCatalogIds_result();
        try {
          result.success = iface.getLatestArrivalsCatalogIds(args.beginIndex, args.totalItems, args.brand, args.categories);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getLatestArrivalsCount_result getResult(I iface, getLatestArrivalsCount_args args) throws org.apache.thrift.TException {
        getLatestArrivalsCount_result result = new getLatestArrivalsCount_result();
        try {
          result.success = iface.getLatestArrivalsCount();
          result.setSuccessIsSet(true);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected generateNewEntityID_result getResult(I iface, generateNewEntityID_args args) throws org.apache.thrift.TException {
        generateNewEntityID_result result = new generateNewEntityID_result();
        result.success = iface.generateNewEntityID();
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected getItemPricing_result getResult(I iface, getItemPricing_args args) throws org.apache.thrift.TException {
        getItemPricing_result result = new getItemPricing_result();
        try {
          result.success = iface.getItemPricing(args.itemId, args.warehouseId);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected addCategory_result getResult(I iface, addCategory_args args) throws org.apache.thrift.TException {
        addCategory_result result = new addCategory_result();
        result.success = iface.addCategory(args.category);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected getCategory_result getResult(I iface, getCategory_args args) throws org.apache.thrift.TException {
        getCategory_result result = new getCategory_result();
        result.success = iface.getCategory(args.id);
        return result;
      }
    }

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

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

      protected getAllCategories_result getResult(I iface, getAllCategories_args args) throws org.apache.thrift.TException {
        getAllCategories_result result = new getAllCategories_result();
        result.success = iface.getAllCategories();
        return result;
      }
    }

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

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

      protected getAllItemPricing_result getResult(I iface, getAllItemPricing_args args) throws org.apache.thrift.TException {
        getAllItemPricing_result result = new getAllItemPricing_result();
        try {
          result.success = iface.getAllItemPricing(args.itemId);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected addVendorItemPricing_result getResult(I iface, addVendorItemPricing_args args) throws org.apache.thrift.TException {
        addVendorItemPricing_result result = new addVendorItemPricing_result();
        try {
          iface.addVendorItemPricing(args.vendorItemPricing);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getAllVendors_result getResult(I iface, getAllVendors_args args) throws org.apache.thrift.TException {
        getAllVendors_result result = new getAllVendors_result();
        result.success = iface.getAllVendors();
        return result;
      }
    }

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

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

      protected itemExists_result getResult(I iface, itemExists_args args) throws org.apache.thrift.TException {
        itemExists_result result = new itemExists_result();
        result.success = iface.itemExists(args.productGroup, args.brand, args.modelNumber, args.color, args.vendor_id, args.category);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected addVendorItemMapping_result getResult(I iface, addVendorItemMapping_args args) throws org.apache.thrift.TException {
        addVendorItemMapping_result result = new addVendorItemMapping_result();
        try {
          iface.addVendorItemMapping(args.key, args.vendorItemMapping);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getVendorItemMappings_result getResult(I iface, getVendorItemMappings_args args) throws org.apache.thrift.TException {
        getVendorItemMappings_result result = new getVendorItemMappings_result();
        try {
          result.success = iface.getVendorItemMappings(args.itemId);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected checkSimilarItem_result getResult(I iface, checkSimilarItem_args args) throws org.apache.thrift.TException {
        checkSimilarItem_result result = new checkSimilarItem_result();
        result.success = iface.checkSimilarItem(args.productGroup, args.brand, args.modelNumber, args.color);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected changeItemRiskyFlag_result getResult(I iface, changeItemRiskyFlag_args args) throws org.apache.thrift.TException {
        changeItemRiskyFlag_result result = new changeItemRiskyFlag_result();
        iface.changeItemRiskyFlag(args.itemId, args.risky);
        return result;
      }
    }

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

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

      protected getItemsByRiskyFlag_result getResult(I iface, getItemsByRiskyFlag_args args) throws org.apache.thrift.TException {
        getItemsByRiskyFlag_result result = new getItemsByRiskyFlag_result();
        result.success = iface.getItemsByRiskyFlag();
        return result;
      }
    }

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

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

      protected getItemsByVendorCategory_result getResult(I iface, getItemsByVendorCategory_args args) throws org.apache.thrift.TException {
        getItemsByVendorCategory_result result = new getItemsByVendorCategory_result();
        result.success = iface.getItemsByVendorCategory(args.vendorCategory);
        return result;
      }
    }

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

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

      protected getSimilarItemsCatalogIds_result getResult(I iface, getSimilarItemsCatalogIds_args args) throws org.apache.thrift.TException {
        getSimilarItemsCatalogIds_result result = new getSimilarItemsCatalogIds_result();
        result.success = iface.getSimilarItemsCatalogIds(args.beginIndex, args.totalItems, args.itemId);
        return result;
      }
    }

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

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

      protected addProductNotification_result getResult(I iface, addProductNotification_args args) throws org.apache.thrift.TException {
        addProductNotification_result result = new addProductNotification_result();
        result.success = iface.addProductNotification(args.itemId, args.email);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected sendProductNotifications_result getResult(I iface, sendProductNotifications_args args) throws org.apache.thrift.TException {
        sendProductNotifications_result result = new sendProductNotifications_result();
        result.success = iface.sendProductNotifications();
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected getAllBrandsByCategory_result getResult(I iface, getAllBrandsByCategory_args args) throws org.apache.thrift.TException {
        getAllBrandsByCategory_result result = new getAllBrandsByCategory_result();
        result.success = iface.getAllBrandsByCategory(args.categoryId);
        return result;
      }
    }

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

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

      protected getAllSources_result getResult(I iface, getAllSources_args args) throws org.apache.thrift.TException {
        getAllSources_result result = new getAllSources_result();
        result.success = iface.getAllSources();
        return result;
      }
    }

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

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

      protected getItemPricingBySource_result getResult(I iface, getItemPricingBySource_args args) throws org.apache.thrift.TException {
        getItemPricingBySource_result result = new getItemPricingBySource_result();
        try {
          result.success = iface.getItemPricingBySource(args.itemId, args.sourceId);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected addSourceItemPricing_result getResult(I iface, addSourceItemPricing_args args) throws org.apache.thrift.TException {
        addSourceItemPricing_result result = new addSourceItemPricing_result();
        try {
          iface.addSourceItemPricing(args.sourceItemPricing);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getAllSourcePricing_result getResult(I iface, getAllSourcePricing_args args) throws org.apache.thrift.TException {
        getAllSourcePricing_result result = new getAllSourcePricing_result();
        try {
          result.success = iface.getAllSourcePricing(args.itemId);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

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

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

      protected getItemForSource_result getResult(I iface, getItemForSource_args args) throws org.apache.thrift.TException {
        getItemForSource_result result = new getItemForSource_result();
        try {
          result.success = iface.getItemForSource(args.item_id, args.sourceId);
        } catch (InventoryServiceException cex) {
          result.cex = cex;
        }
        return result;
      }
    }

  }

  public static class addItem_args implements org.apache.thrift.TBase<addItem_args, addItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addItem_args");

    private static final org.apache.thrift.protocol.TField ITEM_FIELD_DESC = new org.apache.thrift.protocol.TField("item", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Item item; // 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((short)1, "item");

      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
            return ITEM;
          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, new org.apache.thrift.meta_data.FieldMetaData("item", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Item.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addItem_args.class, metaDataMap);
    }

    public addItem_args() {
    }

    public addItem_args(
      Item item)
    {
      this();
      this.item = item;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItem_args(addItem_args other) {
      if (other.isSetItem()) {
        this.item = new Item(other.item);
      }
    }

    public addItem_args deepCopy() {
      return new addItem_args(this);
    }

    @Override
    public void clear() {
      this.item = null;
    }

    public Item getItem() {
      return this.item;
    }

    public void setItem(Item item) {
      this.item = item;
    }

    public void unsetItem() {
      this.item = null;
    }

    /** Returns true if field item is set (has been assigned a value) and false otherwise */
    public boolean isSetItem() {
      return this.item != null;
    }

    public void setItemIsSet(boolean value) {
      if (!value) {
        this.item = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM:
        if (value == null) {
          unsetItem();
        } else {
          setItem((Item)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM:
        return getItem();

      }
      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:
        return isSetItem();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addItem_args)
        return this.equals((addItem_args)that);
      return false;
    }

    public boolean equals(addItem_args that) {
      if (that == null)
        return false;

      boolean this_present_item = true && this.isSetItem();
      boolean that_present_item = true && that.isSetItem();
      if (this_present_item || that_present_item) {
        if (!(this_present_item && that_present_item))
          return false;
        if (!this.item.equals(that.item))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addItem_args typedOther = (addItem_args)other;

      lastComparison = Boolean.valueOf(isSetItem()).compareTo(typedOther.isSetItem());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item, typedOther.item);
        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
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.item = new Item();
              this.item.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.item != null) {
        oprot.writeFieldBegin(ITEM_FIELD_DESC);
        this.item.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addItem_args(");
      boolean first = true;

      sb.append("item:");
      if (this.item == null) {
        sb.append("null");
      } else {
        sb.append(this.item);
      }
      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 addItem_result implements org.apache.thrift.TBase<addItem_result, addItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addItem_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(addItem_result.class, metaDataMap);
    }

    public addItem_result() {
    }

    public addItem_result(
      long success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItem_result(addItem_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public addItem_result deepCopy() {
      return new addItem_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addItem_result)
        return this.equals((addItem_result)that);
      return false;
    }

    public boolean equals(addItem_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addItem_result typedOther = (addItem_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addItem_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 updateItem_args implements org.apache.thrift.TBase<updateItem_args, updateItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateItem_args");

    private static final org.apache.thrift.protocol.TField ITEM_FIELD_DESC = new org.apache.thrift.protocol.TField("item", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Item item; // 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((short)1, "item");

      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
            return ITEM;
          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, new org.apache.thrift.meta_data.FieldMetaData("item", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Item.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateItem_args.class, metaDataMap);
    }

    public updateItem_args() {
    }

    public updateItem_args(
      Item item)
    {
      this();
      this.item = item;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateItem_args(updateItem_args other) {
      if (other.isSetItem()) {
        this.item = new Item(other.item);
      }
    }

    public updateItem_args deepCopy() {
      return new updateItem_args(this);
    }

    @Override
    public void clear() {
      this.item = null;
    }

    public Item getItem() {
      return this.item;
    }

    public void setItem(Item item) {
      this.item = item;
    }

    public void unsetItem() {
      this.item = null;
    }

    /** Returns true if field item is set (has been assigned a value) and false otherwise */
    public boolean isSetItem() {
      return this.item != null;
    }

    public void setItemIsSet(boolean value) {
      if (!value) {
        this.item = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM:
        if (value == null) {
          unsetItem();
        } else {
          setItem((Item)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM:
        return getItem();

      }
      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:
        return isSetItem();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateItem_args)
        return this.equals((updateItem_args)that);
      return false;
    }

    public boolean equals(updateItem_args that) {
      if (that == null)
        return false;

      boolean this_present_item = true && this.isSetItem();
      boolean that_present_item = true && that.isSetItem();
      if (this_present_item || that_present_item) {
        if (!(this_present_item && that_present_item))
          return false;
        if (!this.item.equals(that.item))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateItem_args typedOther = (updateItem_args)other;

      lastComparison = Boolean.valueOf(isSetItem()).compareTo(typedOther.isSetItem());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item, typedOther.item);
        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
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.item = new Item();
              this.item.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.item != null) {
        oprot.writeFieldBegin(ITEM_FIELD_DESC);
        this.item.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateItem_args(");
      boolean first = true;

      sb.append("item:");
      if (this.item == null) {
        sb.append("null");
      } else {
        sb.append(this.item);
      }
      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 updateItem_result implements org.apache.thrift.TBase<updateItem_result, updateItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateItem_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(updateItem_result.class, metaDataMap);
    }

    public updateItem_result() {
    }

    public updateItem_result(
      long success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateItem_result(updateItem_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public updateItem_result deepCopy() {
      return new updateItem_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateItem_result)
        return this.equals((updateItem_result)that);
      return false;
    }

    public boolean equals(updateItem_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateItem_result typedOther = (updateItem_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateItem_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 addWarehouse_args implements org.apache.thrift.TBase<addWarehouse_args, addWarehouse_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addWarehouse_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouse", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Warehouse warehouse; // 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((short)1, "warehouse");

      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
            return WAREHOUSE;
          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.WAREHOUSE, new org.apache.thrift.meta_data.FieldMetaData("warehouse", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Warehouse.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addWarehouse_args.class, metaDataMap);
    }

    public addWarehouse_args() {
    }

    public addWarehouse_args(
      Warehouse warehouse)
    {
      this();
      this.warehouse = warehouse;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addWarehouse_args(addWarehouse_args other) {
      if (other.isSetWarehouse()) {
        this.warehouse = new Warehouse(other.warehouse);
      }
    }

    public addWarehouse_args deepCopy() {
      return new addWarehouse_args(this);
    }

    @Override
    public void clear() {
      this.warehouse = null;
    }

    public Warehouse getWarehouse() {
      return this.warehouse;
    }

    public void setWarehouse(Warehouse warehouse) {
      this.warehouse = warehouse;
    }

    public void unsetWarehouse() {
      this.warehouse = null;
    }

    /** Returns true if field warehouse is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouse() {
      return this.warehouse != null;
    }

    public void setWarehouseIsSet(boolean value) {
      if (!value) {
        this.warehouse = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE:
        if (value == null) {
          unsetWarehouse();
        } else {
          setWarehouse((Warehouse)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE:
        return getWarehouse();

      }
      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:
        return isSetWarehouse();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addWarehouse_args)
        return this.equals((addWarehouse_args)that);
      return false;
    }

    public boolean equals(addWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse = true && this.isSetWarehouse();
      boolean that_present_warehouse = true && that.isSetWarehouse();
      if (this_present_warehouse || that_present_warehouse) {
        if (!(this_present_warehouse && that_present_warehouse))
          return false;
        if (!this.warehouse.equals(that.warehouse))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addWarehouse_args typedOther = (addWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse()).compareTo(typedOther.isSetWarehouse());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouse()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouse, typedOther.warehouse);
        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
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.warehouse = new Warehouse();
              this.warehouse.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.warehouse != null) {
        oprot.writeFieldBegin(WAREHOUSE_FIELD_DESC);
        this.warehouse.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addWarehouse_args(");
      boolean first = true;

      sb.append("warehouse:");
      if (this.warehouse == null) {
        sb.append("null");
      } else {
        sb.append(this.warehouse);
      }
      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 addWarehouse_result implements org.apache.thrift.TBase<addWarehouse_result, addWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addWarehouse_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(addWarehouse_result.class, metaDataMap);
    }

    public addWarehouse_result() {
    }

    public addWarehouse_result(
      long success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addWarehouse_result(addWarehouse_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public addWarehouse_result deepCopy() {
      return new addWarehouse_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addWarehouse_result)
        return this.equals((addWarehouse_result)that);
      return false;
    }

    public boolean equals(addWarehouse_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addWarehouse_result typedOther = (addWarehouse_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addWarehouse_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 isActive_args implements org.apache.thrift.TBase<isActive_args, isActive_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isActive_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(isActive_args.class, metaDataMap);
    }

    public isActive_args() {
    }

    public isActive_args(
      long itemId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public isActive_args(isActive_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
    }

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

    public boolean equals(isActive_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(isActive_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      isActive_args typedOther = (isActive_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("isActive_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 {
        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 isActive_result implements org.apache.thrift.TBase<isActive_result, isActive_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isActive_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 ISEX_FIELD_DESC = new org.apache.thrift.protocol.TField("isex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private ItemShippingInfo success; // required
    private InventoryServiceException isex; // 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"),
      ISEX((short)1, "isex");

      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: // ISEX
            return ISEX;
          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, ItemShippingInfo.class)));
      tmpMap.put(_Fields.ISEX, new org.apache.thrift.meta_data.FieldMetaData("isex", 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(isActive_result.class, metaDataMap);
    }

    public isActive_result() {
    }

    public isActive_result(
      ItemShippingInfo success,
      InventoryServiceException isex)
    {
      this();
      this.success = success;
      this.isex = isex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public isActive_result(isActive_result other) {
      if (other.isSetSuccess()) {
        this.success = new ItemShippingInfo(other.success);
      }
      if (other.isSetIsex()) {
        this.isex = new InventoryServiceException(other.isex);
      }
    }

    public isActive_result deepCopy() {
      return new isActive_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.isex = null;
    }

    public ItemShippingInfo getSuccess() {
      return this.success;
    }

    public void setSuccess(ItemShippingInfo 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 InventoryServiceException getIsex() {
      return this.isex;
    }

    public void setIsex(InventoryServiceException isex) {
      this.isex = isex;
    }

    public void unsetIsex() {
      this.isex = null;
    }

    /** Returns true if field isex is set (has been assigned a value) and false otherwise */
    public boolean isSetIsex() {
      return this.isex != null;
    }

    public void setIsexIsSet(boolean value) {
      if (!value) {
        this.isex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((ItemShippingInfo)value);
        }
        break;

      case ISEX:
        if (value == null) {
          unsetIsex();
        } else {
          setIsex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ISEX:
        return getIsex();

      }
      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 ISEX:
        return isSetIsex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof isActive_result)
        return this.equals((isActive_result)that);
      return false;
    }

    public boolean equals(isActive_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_isex = true && this.isSetIsex();
      boolean that_present_isex = true && that.isSetIsex();
      if (this_present_isex || that_present_isex) {
        if (!(this_present_isex && that_present_isex))
          return false;
        if (!this.isex.equals(that.isex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(isActive_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      isActive_result typedOther = (isActive_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(isSetIsex()).compareTo(typedOther.isSetIsex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isex, typedOther.isex);
        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 ItemShippingInfo();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // ISEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.isex = new InventoryServiceException();
              this.isex.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.isSetIsex()) {
        oprot.writeFieldBegin(ISEX_FIELD_DESC);
        this.isex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("isActive_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("isex:");
      if (this.isex == null) {
        sb.append("null");
      } else {
        sb.append(this.isex);
      }
      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 getItemStatusDescription_args implements org.apache.thrift.TBase<getItemStatusDescription_args, getItemStatusDescription_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemStatusDescription_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(getItemStatusDescription_args.class, metaDataMap);
    }

    public getItemStatusDescription_args() {
    }

    public getItemStatusDescription_args(
      long itemId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemStatusDescription_args(getItemStatusDescription_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
    }

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

    public boolean equals(getItemStatusDescription_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(getItemStatusDescription_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemStatusDescription_args typedOther = (getItemStatusDescription_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("getItemStatusDescription_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 getItemStatusDescription_result implements org.apache.thrift.TBase<getItemStatusDescription_result, getItemStatusDescription_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemStatusDescription_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
    private static final org.apache.thrift.protocol.TField ISEX_FIELD_DESC = new org.apache.thrift.protocol.TField("isex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private String success; // required
    private InventoryServiceException isex; // 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"),
      ISEX((short)1, "isex");

      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: // ISEX
            return ISEX;
          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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.ISEX, new org.apache.thrift.meta_data.FieldMetaData("isex", 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(getItemStatusDescription_result.class, metaDataMap);
    }

    public getItemStatusDescription_result() {
    }

    public getItemStatusDescription_result(
      String success,
      InventoryServiceException isex)
    {
      this();
      this.success = success;
      this.isex = isex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemStatusDescription_result(getItemStatusDescription_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetIsex()) {
        this.isex = new InventoryServiceException(other.isex);
      }
    }

    public getItemStatusDescription_result deepCopy() {
      return new getItemStatusDescription_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.isex = null;
    }

    public String getSuccess() {
      return this.success;
    }

    public void setSuccess(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 InventoryServiceException getIsex() {
      return this.isex;
    }

    public void setIsex(InventoryServiceException isex) {
      this.isex = isex;
    }

    public void unsetIsex() {
      this.isex = null;
    }

    /** Returns true if field isex is set (has been assigned a value) and false otherwise */
    public boolean isSetIsex() {
      return this.isex != null;
    }

    public void setIsexIsSet(boolean value) {
      if (!value) {
        this.isex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((String)value);
        }
        break;

      case ISEX:
        if (value == null) {
          unsetIsex();
        } else {
          setIsex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ISEX:
        return getIsex();

      }
      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 ISEX:
        return isSetIsex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemStatusDescription_result)
        return this.equals((getItemStatusDescription_result)that);
      return false;
    }

    public boolean equals(getItemStatusDescription_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_isex = true && this.isSetIsex();
      boolean that_present_isex = true && that.isSetIsex();
      if (this_present_isex || that_present_isex) {
        if (!(this_present_isex && that_present_isex))
          return false;
        if (!this.isex.equals(that.isex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemStatusDescription_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemStatusDescription_result typedOther = (getItemStatusDescription_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(isSetIsex()).compareTo(typedOther.isSetIsex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isex, typedOther.isex);
        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.STRING) {
              this.success = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // ISEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.isex = new InventoryServiceException();
              this.isex.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.writeString(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetIsex()) {
        oprot.writeFieldBegin(ISEX_FIELD_DESC);
        this.isex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemStatusDescription_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("isex:");
      if (this.isex == null) {
        sb.append("null");
      } else {
        sb.append(this.isex);
      }
      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 updateInventoryHistory_args implements org.apache.thrift.TBase<updateInventoryHistory_args, updateInventoryHistory_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateInventoryHistory_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouse_id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField AVAILABILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("availability", org.apache.thrift.protocol.TType.MAP, (short)3);

    private long warehouse_id; // required
    private String timestamp; // required
    private Map<String,Long> availability; // 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, "warehouse_id"),
      TIMESTAMP((short)2, "timestamp"),
      AVAILABILITY((short)3, "availability");

      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: // TIMESTAMP
            return TIMESTAMP;
          case 3: // AVAILABILITY
            return AVAILABILITY;
          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 __WAREHOUSE_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.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouse_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.AVAILABILITY, new org.apache.thrift.meta_data.FieldMetaData("availability", 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.STRING), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateInventoryHistory_args.class, metaDataMap);
    }

    public updateInventoryHistory_args() {
    }

    public updateInventoryHistory_args(
      long warehouse_id,
      String timestamp,
      Map<String,Long> availability)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      this.timestamp = timestamp;
      this.availability = availability;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateInventoryHistory_args(updateInventoryHistory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
      if (other.isSetTimestamp()) {
        this.timestamp = other.timestamp;
      }
      if (other.isSetAvailability()) {
        Map<String,Long> __this__availability = new HashMap<String,Long>();
        for (Map.Entry<String, Long> other_element : other.availability.entrySet()) {

          String other_element_key = other_element.getKey();
          Long other_element_value = other_element.getValue();

          String __this__availability_copy_key = other_element_key;

          Long __this__availability_copy_value = other_element_value;

          __this__availability.put(__this__availability_copy_key, __this__availability_copy_value);
        }
        this.availability = __this__availability;
      }
    }

    public updateInventoryHistory_args deepCopy() {
      return new updateInventoryHistory_args(this);
    }

    @Override
    public void clear() {
      setWarehouse_idIsSet(false);
      this.warehouse_id = 0;
      this.timestamp = null;
      this.availability = null;
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public void setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public String getTimestamp() {
      return this.timestamp;
    }

    public void setTimestamp(String timestamp) {
      this.timestamp = timestamp;
    }

    public void unsetTimestamp() {
      this.timestamp = null;
    }

    /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return this.timestamp != null;
    }

    public void setTimestampIsSet(boolean value) {
      if (!value) {
        this.timestamp = null;
      }
    }

    public int getAvailabilitySize() {
      return (this.availability == null) ? 0 : this.availability.size();
    }

    public void putToAvailability(String key, long val) {
      if (this.availability == null) {
        this.availability = new HashMap<String,Long>();
      }
      this.availability.put(key, val);
    }

    public Map<String,Long> getAvailability() {
      return this.availability;
    }

    public void setAvailability(Map<String,Long> availability) {
      this.availability = availability;
    }

    public void unsetAvailability() {
      this.availability = null;
    }

    /** Returns true if field availability is set (has been assigned a value) and false otherwise */
    public boolean isSetAvailability() {
      return this.availability != null;
    }

    public void setAvailabilityIsSet(boolean value) {
      if (!value) {
        this.availability = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((String)value);
        }
        break;

      case AVAILABILITY:
        if (value == null) {
          unsetAvailability();
        } else {
          setAvailability((Map<String,Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouse_id());

      case TIMESTAMP:
        return getTimestamp();

      case AVAILABILITY:
        return getAvailability();

      }
      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 isSetWarehouse_id();
      case TIMESTAMP:
        return isSetTimestamp();
      case AVAILABILITY:
        return isSetAvailability();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateInventoryHistory_args)
        return this.equals((updateInventoryHistory_args)that);
      return false;
    }

    public boolean equals(updateInventoryHistory_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      boolean this_present_timestamp = true && this.isSetTimestamp();
      boolean that_present_timestamp = true && that.isSetTimestamp();
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (!this.timestamp.equals(that.timestamp))
          return false;
      }

      boolean this_present_availability = true && this.isSetAvailability();
      boolean that_present_availability = true && that.isSetAvailability();
      if (this_present_availability || that_present_availability) {
        if (!(this_present_availability && that_present_availability))
          return false;
        if (!this.availability.equals(that.availability))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateInventoryHistory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateInventoryHistory_args typedOther = (updateInventoryHistory_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(typedOther.isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouse_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouse_id, typedOther.warehouse_id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTimestamp()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAvailability()).compareTo(typedOther.isSetAvailability());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAvailability()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.availability, typedOther.availability);
        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.warehouse_id = iprot.readI64();
              setWarehouse_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TIMESTAMP
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.timestamp = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // AVAILABILITY
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map14 = iprot.readMapBegin();
                this.availability = new HashMap<String,Long>(2*_map14.size);
                for (int _i15 = 0; _i15 < _map14.size; ++_i15)
                {
                  String _key16; // required
                  long _val17; // required
                  _key16 = iprot.readString();
                  _val17 = iprot.readI64();
                  this.availability.put(_key16, _val17);
                }
                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 {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouse_id);
      oprot.writeFieldEnd();
      if (this.timestamp != null) {
        oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
        oprot.writeString(this.timestamp);
        oprot.writeFieldEnd();
      }
      if (this.availability != null) {
        oprot.writeFieldBegin(AVAILABILITY_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, this.availability.size()));
          for (Map.Entry<String, Long> _iter18 : this.availability.entrySet())
          {
            oprot.writeString(_iter18.getKey());
            oprot.writeI64(_iter18.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateInventoryHistory_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      if (this.timestamp == null) {
        sb.append("null");
      } else {
        sb.append(this.timestamp);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("availability:");
      if (this.availability == null) {
        sb.append("null");
      } else {
        sb.append(this.availability);
      }
      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 updateInventoryHistory_result implements org.apache.thrift.TBase<updateInventoryHistory_result, updateInventoryHistory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateInventoryHistory_result");

    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryServiceException cex; // 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 {
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(updateInventoryHistory_result.class, metaDataMap);
    }

    public updateInventoryHistory_result() {
    }

    public updateInventoryHistory_result(
      InventoryServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateInventoryHistory_result(updateInventoryHistory_result other) {
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public updateInventoryHistory_result deepCopy() {
      return new updateInventoryHistory_result(this);
    }

    @Override
    public void clear() {
      this.cex = null;
    }

    public InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateInventoryHistory_result)
        return this.equals((updateInventoryHistory_result)that);
      return false;
    }

    public boolean equals(updateInventoryHistory_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateInventoryHistory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateInventoryHistory_result typedOther = (updateInventoryHistory_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateInventoryHistory_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 updateInventory_args implements org.apache.thrift.TBase<updateInventory_args, updateInventory_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateInventory_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouse_id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField AVAILABILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("availability", org.apache.thrift.protocol.TType.MAP, (short)3);

    private long warehouse_id; // required
    private String timestamp; // required
    private Map<String,Long> availability; // 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, "warehouse_id"),
      TIMESTAMP((short)2, "timestamp"),
      AVAILABILITY((short)3, "availability");

      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: // TIMESTAMP
            return TIMESTAMP;
          case 3: // AVAILABILITY
            return AVAILABILITY;
          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 __WAREHOUSE_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.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouse_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.AVAILABILITY, new org.apache.thrift.meta_data.FieldMetaData("availability", 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.STRING), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateInventory_args.class, metaDataMap);
    }

    public updateInventory_args() {
    }

    public updateInventory_args(
      long warehouse_id,
      String timestamp,
      Map<String,Long> availability)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      this.timestamp = timestamp;
      this.availability = availability;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateInventory_args(updateInventory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
      if (other.isSetTimestamp()) {
        this.timestamp = other.timestamp;
      }
      if (other.isSetAvailability()) {
        Map<String,Long> __this__availability = new HashMap<String,Long>();
        for (Map.Entry<String, Long> other_element : other.availability.entrySet()) {

          String other_element_key = other_element.getKey();
          Long other_element_value = other_element.getValue();

          String __this__availability_copy_key = other_element_key;

          Long __this__availability_copy_value = other_element_value;

          __this__availability.put(__this__availability_copy_key, __this__availability_copy_value);
        }
        this.availability = __this__availability;
      }
    }

    public updateInventory_args deepCopy() {
      return new updateInventory_args(this);
    }

    @Override
    public void clear() {
      setWarehouse_idIsSet(false);
      this.warehouse_id = 0;
      this.timestamp = null;
      this.availability = null;
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public void setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public String getTimestamp() {
      return this.timestamp;
    }

    public void setTimestamp(String timestamp) {
      this.timestamp = timestamp;
    }

    public void unsetTimestamp() {
      this.timestamp = null;
    }

    /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return this.timestamp != null;
    }

    public void setTimestampIsSet(boolean value) {
      if (!value) {
        this.timestamp = null;
      }
    }

    public int getAvailabilitySize() {
      return (this.availability == null) ? 0 : this.availability.size();
    }

    public void putToAvailability(String key, long val) {
      if (this.availability == null) {
        this.availability = new HashMap<String,Long>();
      }
      this.availability.put(key, val);
    }

    public Map<String,Long> getAvailability() {
      return this.availability;
    }

    public void setAvailability(Map<String,Long> availability) {
      this.availability = availability;
    }

    public void unsetAvailability() {
      this.availability = null;
    }

    /** Returns true if field availability is set (has been assigned a value) and false otherwise */
    public boolean isSetAvailability() {
      return this.availability != null;
    }

    public void setAvailabilityIsSet(boolean value) {
      if (!value) {
        this.availability = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((String)value);
        }
        break;

      case AVAILABILITY:
        if (value == null) {
          unsetAvailability();
        } else {
          setAvailability((Map<String,Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouse_id());

      case TIMESTAMP:
        return getTimestamp();

      case AVAILABILITY:
        return getAvailability();

      }
      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 isSetWarehouse_id();
      case TIMESTAMP:
        return isSetTimestamp();
      case AVAILABILITY:
        return isSetAvailability();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateInventory_args)
        return this.equals((updateInventory_args)that);
      return false;
    }

    public boolean equals(updateInventory_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      boolean this_present_timestamp = true && this.isSetTimestamp();
      boolean that_present_timestamp = true && that.isSetTimestamp();
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (!this.timestamp.equals(that.timestamp))
          return false;
      }

      boolean this_present_availability = true && this.isSetAvailability();
      boolean that_present_availability = true && that.isSetAvailability();
      if (this_present_availability || that_present_availability) {
        if (!(this_present_availability && that_present_availability))
          return false;
        if (!this.availability.equals(that.availability))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateInventory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateInventory_args typedOther = (updateInventory_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(typedOther.isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouse_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouse_id, typedOther.warehouse_id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTimestamp()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAvailability()).compareTo(typedOther.isSetAvailability());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAvailability()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.availability, typedOther.availability);
        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.warehouse_id = iprot.readI64();
              setWarehouse_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TIMESTAMP
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.timestamp = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // AVAILABILITY
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map19 = iprot.readMapBegin();
                this.availability = new HashMap<String,Long>(2*_map19.size);
                for (int _i20 = 0; _i20 < _map19.size; ++_i20)
                {
                  String _key21; // required
                  long _val22; // required
                  _key21 = iprot.readString();
                  _val22 = iprot.readI64();
                  this.availability.put(_key21, _val22);
                }
                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 {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouse_id);
      oprot.writeFieldEnd();
      if (this.timestamp != null) {
        oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
        oprot.writeString(this.timestamp);
        oprot.writeFieldEnd();
      }
      if (this.availability != null) {
        oprot.writeFieldBegin(AVAILABILITY_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, this.availability.size()));
          for (Map.Entry<String, Long> _iter23 : this.availability.entrySet())
          {
            oprot.writeString(_iter23.getKey());
            oprot.writeI64(_iter23.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateInventory_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      if (this.timestamp == null) {
        sb.append("null");
      } else {
        sb.append(this.timestamp);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("availability:");
      if (this.availability == null) {
        sb.append("null");
      } else {
        sb.append(this.availability);
      }
      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 updateInventory_result implements org.apache.thrift.TBase<updateInventory_result, updateInventory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateInventory_result");

    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryServiceException cex; // 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 {
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(updateInventory_result.class, metaDataMap);
    }

    public updateInventory_result() {
    }

    public updateInventory_result(
      InventoryServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateInventory_result(updateInventory_result other) {
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public updateInventory_result deepCopy() {
      return new updateInventory_result(this);
    }

    @Override
    public void clear() {
      this.cex = null;
    }

    public InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateInventory_result)
        return this.equals((updateInventory_result)that);
      return false;
    }

    public boolean equals(updateInventory_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateInventory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateInventory_result typedOther = (updateInventory_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateInventory_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 retireWarehouse_args implements org.apache.thrift.TBase<retireWarehouse_args, retireWarehouse_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("retireWarehouse_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouse_id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long warehouse_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 {
      WAREHOUSE_ID((short)1, "warehouse_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: // 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 __WAREHOUSE_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.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouse_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(retireWarehouse_args.class, metaDataMap);
    }

    public retireWarehouse_args() {
    }

    public retireWarehouse_args(
      long warehouse_id)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireWarehouse_args(retireWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
    }

    public retireWarehouse_args deepCopy() {
      return new retireWarehouse_args(this);
    }

    @Override
    public void clear() {
      setWarehouse_idIsSet(false);
      this.warehouse_id = 0;
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public void setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouse_id());

      }
      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 isSetWarehouse_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireWarehouse_args)
        return this.equals((retireWarehouse_args)that);
      return false;
    }

    public boolean equals(retireWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireWarehouse_args typedOther = (retireWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(typedOther.isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouse_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouse_id, typedOther.warehouse_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: // WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.warehouse_id = iprot.readI64();
              setWarehouse_idIsSet(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.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireWarehouse_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_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 retireWarehouse_result implements org.apache.thrift.TBase<retireWarehouse_result, retireWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("retireWarehouse_result");

    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryServiceException cex; // 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 {
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(retireWarehouse_result.class, metaDataMap);
    }

    public retireWarehouse_result() {
    }

    public retireWarehouse_result(
      InventoryServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireWarehouse_result(retireWarehouse_result other) {
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public retireWarehouse_result deepCopy() {
      return new retireWarehouse_result(this);
    }

    @Override
    public void clear() {
      this.cex = null;
    }

    public InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireWarehouse_result)
        return this.equals((retireWarehouse_result)that);
      return false;
    }

    public boolean equals(retireWarehouse_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireWarehouse_result typedOther = (retireWarehouse_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireWarehouse_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 startItemOn_args implements org.apache.thrift.TBase<startItemOn_args, startItemOn_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startItemOn_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2);

    private long item_id; // required
    private long timestamp; // 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, "item_id"),
      TIMESTAMP((short)2, "timestamp");

      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: // TIMESTAMP
            return TIMESTAMP;
          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 __ITEM_ID_ISSET_ID = 0;
    private static final int __TIMESTAMP_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("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", 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(startItemOn_args.class, metaDataMap);
    }

    public startItemOn_args() {
    }

    public startItemOn_args(
      long item_id,
      long timestamp)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public startItemOn_args(startItemOn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      this.timestamp = other.timestamp;
    }

    public startItemOn_args deepCopy() {
      return new startItemOn_args(this);
    }

    @Override
    public void clear() {
      setItem_idIsSet(false);
      this.item_id = 0;
      setTimestampIsSet(false);
      this.timestamp = 0;
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public void setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItem_id());

      case TIMESTAMP:
        return Long.valueOf(getTimestamp());

      }
      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 isSetItem_id();
      case TIMESTAMP:
        return isSetTimestamp();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof startItemOn_args)
        return this.equals((startItemOn_args)that);
      return false;
    }

    public boolean equals(startItemOn_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(startItemOn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      startItemOn_args typedOther = (startItemOn_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTimestamp()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
        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.item_id = iprot.readI64();
              setItem_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TIMESTAMP
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.timestamp = iprot.readI64();
              setTimestampIsSet(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.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("startItemOn_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      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 startItemOn_result implements org.apache.thrift.TBase<startItemOn_result, startItemOn_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startItemOn_result");

    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryServiceException cex; // 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 {
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(startItemOn_result.class, metaDataMap);
    }

    public startItemOn_result() {
    }

    public startItemOn_result(
      InventoryServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public startItemOn_result(startItemOn_result other) {
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public startItemOn_result deepCopy() {
      return new startItemOn_result(this);
    }

    @Override
    public void clear() {
      this.cex = null;
    }

    public InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof startItemOn_result)
        return this.equals((startItemOn_result)that);
      return false;
    }

    public boolean equals(startItemOn_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(startItemOn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      startItemOn_result typedOther = (startItemOn_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("startItemOn_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 retireItemOn_args implements org.apache.thrift.TBase<retireItemOn_args, retireItemOn_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("retireItemOn_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2);

    private long item_id; // required
    private long timestamp; // 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, "item_id"),
      TIMESTAMP((short)2, "timestamp");

      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: // TIMESTAMP
            return TIMESTAMP;
          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 __ITEM_ID_ISSET_ID = 0;
    private static final int __TIMESTAMP_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("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", 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(retireItemOn_args.class, metaDataMap);
    }

    public retireItemOn_args() {
    }

    public retireItemOn_args(
      long item_id,
      long timestamp)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireItemOn_args(retireItemOn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      this.timestamp = other.timestamp;
    }

    public retireItemOn_args deepCopy() {
      return new retireItemOn_args(this);
    }

    @Override
    public void clear() {
      setItem_idIsSet(false);
      this.item_id = 0;
      setTimestampIsSet(false);
      this.timestamp = 0;
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public void setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItem_id());

      case TIMESTAMP:
        return Long.valueOf(getTimestamp());

      }
      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 isSetItem_id();
      case TIMESTAMP:
        return isSetTimestamp();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireItemOn_args)
        return this.equals((retireItemOn_args)that);
      return false;
    }

    public boolean equals(retireItemOn_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireItemOn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireItemOn_args typedOther = (retireItemOn_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTimestamp()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
        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.item_id = iprot.readI64();
              setItem_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TIMESTAMP
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.timestamp = iprot.readI64();
              setTimestampIsSet(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.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireItemOn_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      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 retireItemOn_result implements org.apache.thrift.TBase<retireItemOn_result, retireItemOn_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("retireItemOn_result");

    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryServiceException cex; // 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 {
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(retireItemOn_result.class, metaDataMap);
    }

    public retireItemOn_result() {
    }

    public retireItemOn_result(
      InventoryServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireItemOn_result(retireItemOn_result other) {
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public retireItemOn_result deepCopy() {
      return new retireItemOn_result(this);
    }

    @Override
    public void clear() {
      this.cex = null;
    }

    public InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireItemOn_result)
        return this.equals((retireItemOn_result)that);
      return false;
    }

    public boolean equals(retireItemOn_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireItemOn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireItemOn_result typedOther = (retireItemOn_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireItemOn_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 changeItemStatus_args implements org.apache.thrift.TBase<changeItemStatus_args, changeItemStatus_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("changeItemStatus_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField NEWSTATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("newstatus", org.apache.thrift.protocol.TType.I32, (short)3);

    private long item_id; // required
    private long timestamp; // required
    private status newstatus; // 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, "item_id"),
      TIMESTAMP((short)2, "timestamp"),
      /**
       * 
       * @see status
       */
      NEWSTATUS((short)3, "newstatus");

      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: // TIMESTAMP
            return TIMESTAMP;
          case 3: // NEWSTATUS
            return NEWSTATUS;
          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 __ITEM_ID_ISSET_ID = 0;
    private static final int __TIMESTAMP_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("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.NEWSTATUS, new org.apache.thrift.meta_data.FieldMetaData("newstatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, status.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(changeItemStatus_args.class, metaDataMap);
    }

    public changeItemStatus_args() {
    }

    public changeItemStatus_args(
      long item_id,
      long timestamp,
      status newstatus)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      this.newstatus = newstatus;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeItemStatus_args(changeItemStatus_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      this.timestamp = other.timestamp;
      if (other.isSetNewstatus()) {
        this.newstatus = other.newstatus;
      }
    }

    public changeItemStatus_args deepCopy() {
      return new changeItemStatus_args(this);
    }

    @Override
    public void clear() {
      setItem_idIsSet(false);
      this.item_id = 0;
      setTimestampIsSet(false);
      this.timestamp = 0;
      this.newstatus = null;
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public void setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    /**
     * 
     * @see status
     */
    public status getNewstatus() {
      return this.newstatus;
    }

    /**
     * 
     * @see status
     */
    public void setNewstatus(status newstatus) {
      this.newstatus = newstatus;
    }

    public void unsetNewstatus() {
      this.newstatus = null;
    }

    /** Returns true if field newstatus is set (has been assigned a value) and false otherwise */
    public boolean isSetNewstatus() {
      return this.newstatus != null;
    }

    public void setNewstatusIsSet(boolean value) {
      if (!value) {
        this.newstatus = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      case NEWSTATUS:
        if (value == null) {
          unsetNewstatus();
        } else {
          setNewstatus((status)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItem_id());

      case TIMESTAMP:
        return Long.valueOf(getTimestamp());

      case NEWSTATUS:
        return getNewstatus();

      }
      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 isSetItem_id();
      case TIMESTAMP:
        return isSetTimestamp();
      case NEWSTATUS:
        return isSetNewstatus();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof changeItemStatus_args)
        return this.equals((changeItemStatus_args)that);
      return false;
    }

    public boolean equals(changeItemStatus_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      boolean this_present_newstatus = true && this.isSetNewstatus();
      boolean that_present_newstatus = true && that.isSetNewstatus();
      if (this_present_newstatus || that_present_newstatus) {
        if (!(this_present_newstatus && that_present_newstatus))
          return false;
        if (!this.newstatus.equals(that.newstatus))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(changeItemStatus_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      changeItemStatus_args typedOther = (changeItemStatus_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTimestamp()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetNewstatus()).compareTo(typedOther.isSetNewstatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetNewstatus()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newstatus, typedOther.newstatus);
        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.item_id = iprot.readI64();
              setItem_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TIMESTAMP
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.timestamp = iprot.readI64();
              setTimestampIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // NEWSTATUS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.newstatus = status.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(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      if (this.newstatus != null) {
        oprot.writeFieldBegin(NEWSTATUS_FIELD_DESC);
        oprot.writeI32(this.newstatus.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("changeItemStatus_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
      if (!first) sb.append(", ");
      sb.append("newstatus:");
      if (this.newstatus == null) {
        sb.append("null");
      } else {
        sb.append(this.newstatus);
      }
      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 changeItemStatus_result implements org.apache.thrift.TBase<changeItemStatus_result, changeItemStatus_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("changeItemStatus_result");

    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryServiceException cex; // 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 {
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(changeItemStatus_result.class, metaDataMap);
    }

    public changeItemStatus_result() {
    }

    public changeItemStatus_result(
      InventoryServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeItemStatus_result(changeItemStatus_result other) {
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public changeItemStatus_result deepCopy() {
      return new changeItemStatus_result(this);
    }

    @Override
    public void clear() {
      this.cex = null;
    }

    public InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof changeItemStatus_result)
        return this.equals((changeItemStatus_result)that);
      return false;
    }

    public boolean equals(changeItemStatus_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(changeItemStatus_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      changeItemStatus_result typedOther = (changeItemStatus_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("changeItemStatus_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getItem_args implements org.apache.thrift.TBase<getItem_args, getItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItem_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long item_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 {
      ITEM_ID((short)1, "item_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: // 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 __ITEM_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.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_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(getItem_args.class, metaDataMap);
    }

    public getItem_args() {
    }

    public getItem_args(
      long item_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItem_args(getItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
    }

    public getItem_args deepCopy() {
      return new getItem_args(this);
    }

    @Override
    public void clear() {
      setItem_idIsSet(false);
      this.item_id = 0;
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItem_id());

      }
      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 isSetItem_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItem_args)
        return this.equals((getItem_args)that);
      return false;
    }

    public boolean equals(getItem_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItem_args typedOther = (getItem_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_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: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.item_id = iprot.readI64();
              setItem_idIsSet(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.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItem_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_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 getItem_result implements org.apache.thrift.TBase<getItem_result, getItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItem_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Item success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, Item.class)));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getItem_result.class, metaDataMap);
    }

    public getItem_result() {
    }

    public getItem_result(
      Item success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItem_result(getItem_result other) {
      if (other.isSetSuccess()) {
        this.success = new Item(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getItem_result deepCopy() {
      return new getItem_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public Item getSuccess() {
      return this.success;
    }

    public void setSuccess(Item 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Item)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItem_result)
        return this.equals((getItem_result)that);
      return false;
    }

    public boolean equals(getItem_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItem_result typedOther = (getItem_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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 Item();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItem_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getItemsByCatalogId_args implements org.apache.thrift.TBase<getItemsByCatalogId_args, getItemsByCatalogId_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsByCatalogId_args");

    private static final org.apache.thrift.protocol.TField CATALOG_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("catalog_item_id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long catalog_item_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 {
      CATALOG_ITEM_ID((short)1, "catalog_item_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: // CATALOG_ITEM_ID
            return CATALOG_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 __CATALOG_ITEM_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.CATALOG_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("catalog_item_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(getItemsByCatalogId_args.class, metaDataMap);
    }

    public getItemsByCatalogId_args() {
    }

    public getItemsByCatalogId_args(
      long catalog_item_id)
    {
      this();
      this.catalog_item_id = catalog_item_id;
      setCatalog_item_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsByCatalogId_args(getItemsByCatalogId_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.catalog_item_id = other.catalog_item_id;
    }

    public getItemsByCatalogId_args deepCopy() {
      return new getItemsByCatalogId_args(this);
    }

    @Override
    public void clear() {
      setCatalog_item_idIsSet(false);
      this.catalog_item_id = 0;
    }

    public long getCatalog_item_id() {
      return this.catalog_item_id;
    }

    public void setCatalog_item_id(long catalog_item_id) {
      this.catalog_item_id = catalog_item_id;
      setCatalog_item_idIsSet(true);
    }

    public void unsetCatalog_item_id() {
      __isset_bit_vector.clear(__CATALOG_ITEM_ID_ISSET_ID);
    }

    /** Returns true if field catalog_item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetCatalog_item_id() {
      return __isset_bit_vector.get(__CATALOG_ITEM_ID_ISSET_ID);
    }

    public void setCatalog_item_idIsSet(boolean value) {
      __isset_bit_vector.set(__CATALOG_ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CATALOG_ITEM_ID:
        if (value == null) {
          unsetCatalog_item_id();
        } else {
          setCatalog_item_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CATALOG_ITEM_ID:
        return Long.valueOf(getCatalog_item_id());

      }
      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 CATALOG_ITEM_ID:
        return isSetCatalog_item_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemsByCatalogId_args)
        return this.equals((getItemsByCatalogId_args)that);
      return false;
    }

    public boolean equals(getItemsByCatalogId_args that) {
      if (that == null)
        return false;

      boolean this_present_catalog_item_id = true;
      boolean that_present_catalog_item_id = true;
      if (this_present_catalog_item_id || that_present_catalog_item_id) {
        if (!(this_present_catalog_item_id && that_present_catalog_item_id))
          return false;
        if (this.catalog_item_id != that.catalog_item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemsByCatalogId_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsByCatalogId_args typedOther = (getItemsByCatalogId_args)other;

      lastComparison = Boolean.valueOf(isSetCatalog_item_id()).compareTo(typedOther.isSetCatalog_item_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCatalog_item_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalog_item_id, typedOther.catalog_item_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: // CATALOG_ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.catalog_item_id = iprot.readI64();
              setCatalog_item_idIsSet(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(CATALOG_ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.catalog_item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemsByCatalogId_args(");
      boolean first = true;

      sb.append("catalog_item_id:");
      sb.append(this.catalog_item_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 getItemsByCatalogId_result implements org.apache.thrift.TBase<getItemsByCatalogId_result, getItemsByCatalogId_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsByCatalogId_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Item> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, Item.class))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getItemsByCatalogId_result.class, metaDataMap);
    }

    public getItemsByCatalogId_result() {
    }

    public getItemsByCatalogId_result(
      List<Item> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsByCatalogId_result(getItemsByCatalogId_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getItemsByCatalogId_result deepCopy() {
      return new getItemsByCatalogId_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Item> 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemsByCatalogId_result)
        return this.equals((getItemsByCatalogId_result)that);
      return false;
    }

    public boolean equals(getItemsByCatalogId_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemsByCatalogId_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsByCatalogId_result typedOther = (getItemsByCatalogId_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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<Item>(_list24.size);
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
                {
                  Item _elem26; // required
                  _elem26 = new Item();
                  _elem26.read(iprot);
                  this.success.add(_elem26);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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 (Item _iter27 : this.success)
          {
            _iter27.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemsByCatalogId_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getAllItems_args implements org.apache.thrift.TBase<getAllItems_args, getAllItems_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllItems_args");

    private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)1);

    private boolean isActive; // 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 {
      IS_ACTIVE((short)1, "isActive");

      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: // IS_ACTIVE
            return IS_ACTIVE;
          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 __ISACTIVE_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.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", 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(getAllItems_args.class, metaDataMap);
    }

    public getAllItems_args() {
    }

    public getAllItems_args(
      boolean isActive)
    {
      this();
      this.isActive = isActive;
      setIsActiveIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItems_args(getAllItems_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.isActive = other.isActive;
    }

    public getAllItems_args deepCopy() {
      return new getAllItems_args(this);
    }

    @Override
    public void clear() {
      setIsActiveIsSet(false);
      this.isActive = false;
    }

    public boolean isIsActive() {
      return this.isActive;
    }

    public void setIsActive(boolean isActive) {
      this.isActive = isActive;
      setIsActiveIsSet(true);
    }

    public void unsetIsActive() {
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
    }

    /** Returns true if field isActive is set (has been assigned a value) and false otherwise */
    public boolean isSetIsActive() {
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
    }

    public void setIsActiveIsSet(boolean value) {
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case IS_ACTIVE:
        if (value == null) {
          unsetIsActive();
        } else {
          setIsActive((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return Boolean.valueOf(isIsActive());

      }
      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 IS_ACTIVE:
        return isSetIsActive();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItems_args)
        return this.equals((getAllItems_args)that);
      return false;
    }

    public boolean equals(getAllItems_args that) {
      if (that == null)
        return false;

      boolean this_present_isActive = true;
      boolean that_present_isActive = true;
      if (this_present_isActive || that_present_isActive) {
        if (!(this_present_isActive && that_present_isActive))
          return false;
        if (this.isActive != that.isActive)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItems_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItems_args typedOther = (getAllItems_args)other;

      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(typedOther.isSetIsActive());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsActive()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, typedOther.isActive);
        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: // IS_ACTIVE
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.isActive = iprot.readBool();
              setIsActiveIsSet(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(IS_ACTIVE_FIELD_DESC);
      oprot.writeBool(this.isActive);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItems_args(");
      boolean first = true;

      sb.append("isActive:");
      sb.append(this.isActive);
      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 getAllItems_result implements org.apache.thrift.TBase<getAllItems_result, getAllItems_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllItems_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Item> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, Item.class))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getAllItems_result.class, metaDataMap);
    }

    public getAllItems_result() {
    }

    public getAllItems_result(
      List<Item> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItems_result(getAllItems_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getAllItems_result deepCopy() {
      return new getAllItems_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Item> 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItems_result)
        return this.equals((getAllItems_result)that);
      return false;
    }

    public boolean equals(getAllItems_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItems_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItems_result typedOther = (getAllItems_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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<Item>(_list28.size);
                for (int _i29 = 0; _i29 < _list28.size; ++_i29)
                {
                  Item _elem30; // required
                  _elem30 = new Item();
                  _elem30.read(iprot);
                  this.success.add(_elem30);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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 (Item _iter31 : this.success)
          {
            _iter31.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItems_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getAllItemsByStatus_args implements org.apache.thrift.TBase<getAllItemsByStatus_args, getAllItemsByStatus_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllItemsByStatus_args");

    private static final org.apache.thrift.protocol.TField ITEM_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("itemStatus", org.apache.thrift.protocol.TType.I32, (short)1);

    private status itemStatus; // 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 status
       */
      ITEM_STATUS((short)1, "itemStatus");

      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_STATUS
            return ITEM_STATUS;
          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_STATUS, new org.apache.thrift.meta_data.FieldMetaData("itemStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, status.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllItemsByStatus_args.class, metaDataMap);
    }

    public getAllItemsByStatus_args() {
    }

    public getAllItemsByStatus_args(
      status itemStatus)
    {
      this();
      this.itemStatus = itemStatus;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsByStatus_args(getAllItemsByStatus_args other) {
      if (other.isSetItemStatus()) {
        this.itemStatus = other.itemStatus;
      }
    }

    public getAllItemsByStatus_args deepCopy() {
      return new getAllItemsByStatus_args(this);
    }

    @Override
    public void clear() {
      this.itemStatus = null;
    }

    /**
     * 
     * @see status
     */
    public status getItemStatus() {
      return this.itemStatus;
    }

    /**
     * 
     * @see status
     */
    public void setItemStatus(status itemStatus) {
      this.itemStatus = itemStatus;
    }

    public void unsetItemStatus() {
      this.itemStatus = null;
    }

    /** Returns true if field itemStatus is set (has been assigned a value) and false otherwise */
    public boolean isSetItemStatus() {
      return this.itemStatus != null;
    }

    public void setItemStatusIsSet(boolean value) {
      if (!value) {
        this.itemStatus = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_STATUS:
        if (value == null) {
          unsetItemStatus();
        } else {
          setItemStatus((status)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_STATUS:
        return getItemStatus();

      }
      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_STATUS:
        return isSetItemStatus();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsByStatus_args)
        return this.equals((getAllItemsByStatus_args)that);
      return false;
    }

    public boolean equals(getAllItemsByStatus_args that) {
      if (that == null)
        return false;

      boolean this_present_itemStatus = true && this.isSetItemStatus();
      boolean that_present_itemStatus = true && that.isSetItemStatus();
      if (this_present_itemStatus || that_present_itemStatus) {
        if (!(this_present_itemStatus && that_present_itemStatus))
          return false;
        if (!this.itemStatus.equals(that.itemStatus))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItemsByStatus_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItemsByStatus_args typedOther = (getAllItemsByStatus_args)other;

      lastComparison = Boolean.valueOf(isSetItemStatus()).compareTo(typedOther.isSetItemStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItemStatus()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemStatus, typedOther.itemStatus);
        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_STATUS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.itemStatus = status.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.itemStatus != null) {
        oprot.writeFieldBegin(ITEM_STATUS_FIELD_DESC);
        oprot.writeI32(this.itemStatus.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsByStatus_args(");
      boolean first = true;

      sb.append("itemStatus:");
      if (this.itemStatus == null) {
        sb.append("null");
      } else {
        sb.append(this.itemStatus);
      }
      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 getAllItemsByStatus_result implements org.apache.thrift.TBase<getAllItemsByStatus_result, getAllItemsByStatus_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllItemsByStatus_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Item> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, Item.class))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getAllItemsByStatus_result.class, metaDataMap);
    }

    public getAllItemsByStatus_result() {
    }

    public getAllItemsByStatus_result(
      List<Item> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsByStatus_result(getAllItemsByStatus_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getAllItemsByStatus_result deepCopy() {
      return new getAllItemsByStatus_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Item> 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsByStatus_result)
        return this.equals((getAllItemsByStatus_result)that);
      return false;
    }

    public boolean equals(getAllItemsByStatus_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItemsByStatus_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItemsByStatus_result typedOther = (getAllItemsByStatus_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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<Item>(_list32.size);
                for (int _i33 = 0; _i33 < _list32.size; ++_i33)
                {
                  Item _elem34; // required
                  _elem34 = new Item();
                  _elem34.read(iprot);
                  this.success.add(_elem34);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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 (Item _iter35 : this.success)
          {
            _iter35.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsByStatus_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getItemInventory_args implements org.apache.thrift.TBase<getItemInventory_args, getItemInventory_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemInventory_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long item_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 {
      ITEM_ID((short)1, "item_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: // 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 __ITEM_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.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_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(getItemInventory_args.class, metaDataMap);
    }

    public getItemInventory_args() {
    }

    public getItemInventory_args(
      long item_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemInventory_args(getItemInventory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
    }

    public getItemInventory_args deepCopy() {
      return new getItemInventory_args(this);
    }

    @Override
    public void clear() {
      setItem_idIsSet(false);
      this.item_id = 0;
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItem_id());

      }
      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 isSetItem_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemInventory_args)
        return this.equals((getItemInventory_args)that);
      return false;
    }

    public boolean equals(getItemInventory_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemInventory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemInventory_args typedOther = (getItemInventory_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_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: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.item_id = iprot.readI64();
              setItem_idIsSet(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.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemInventory_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_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 getItemInventory_result implements org.apache.thrift.TBase<getItemInventory_result, getItemInventory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemInventory_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private ItemInventory success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, ItemInventory.class)));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getItemInventory_result.class, metaDataMap);
    }

    public getItemInventory_result() {
    }

    public getItemInventory_result(
      ItemInventory success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemInventory_result(getItemInventory_result other) {
      if (other.isSetSuccess()) {
        this.success = new ItemInventory(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getItemInventory_result deepCopy() {
      return new getItemInventory_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public ItemInventory getSuccess() {
      return this.success;
    }

    public void setSuccess(ItemInventory 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((ItemInventory)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemInventory_result)
        return this.equals((getItemInventory_result)that);
      return false;
    }

    public boolean equals(getItemInventory_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemInventory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemInventory_result typedOther = (getItemInventory_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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 ItemInventory();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemInventory_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getItemInventoryByItemId_args implements org.apache.thrift.TBase<getItemInventoryByItemId_args, getItemInventoryByItemId_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemInventoryByItemId_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long item_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 {
      ITEM_ID((short)1, "item_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: // 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 __ITEM_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.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_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(getItemInventoryByItemId_args.class, metaDataMap);
    }

    public getItemInventoryByItemId_args() {
    }

    public getItemInventoryByItemId_args(
      long item_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemInventoryByItemId_args(getItemInventoryByItemId_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
    }

    public getItemInventoryByItemId_args deepCopy() {
      return new getItemInventoryByItemId_args(this);
    }

    @Override
    public void clear() {
      setItem_idIsSet(false);
      this.item_id = 0;
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItem_id());

      }
      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 isSetItem_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemInventoryByItemId_args)
        return this.equals((getItemInventoryByItemId_args)that);
      return false;
    }

    public boolean equals(getItemInventoryByItemId_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemInventoryByItemId_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemInventoryByItemId_args typedOther = (getItemInventoryByItemId_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_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: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.item_id = iprot.readI64();
              setItem_idIsSet(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.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemInventoryByItemId_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_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 getItemInventoryByItemId_result implements org.apache.thrift.TBase<getItemInventoryByItemId_result, getItemInventoryByItemId_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemInventoryByItemId_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private ItemInventory success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, ItemInventory.class)));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getItemInventoryByItemId_result.class, metaDataMap);
    }

    public getItemInventoryByItemId_result() {
    }

    public getItemInventoryByItemId_result(
      ItemInventory success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemInventoryByItemId_result(getItemInventoryByItemId_result other) {
      if (other.isSetSuccess()) {
        this.success = new ItemInventory(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getItemInventoryByItemId_result deepCopy() {
      return new getItemInventoryByItemId_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public ItemInventory getSuccess() {
      return this.success;
    }

    public void setSuccess(ItemInventory 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((ItemInventory)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemInventoryByItemId_result)
        return this.equals((getItemInventoryByItemId_result)that);
      return false;
    }

    public boolean equals(getItemInventoryByItemId_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemInventoryByItemId_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemInventoryByItemId_result typedOther = (getItemInventoryByItemId_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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 ItemInventory();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemInventoryByItemId_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getItemAvailibilityAtWarehouse_args implements org.apache.thrift.TBase<getItemAvailibilityAtWarehouse_args, getItemAvailibilityAtWarehouse_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemAvailibilityAtWarehouse_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouse_id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)2);

    private long warehouse_id; // required
    private long item_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 {
      WAREHOUSE_ID((short)1, "warehouse_id"),
      ITEM_ID((short)2, "item_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: // WAREHOUSE_ID
            return WAREHOUSE_ID;
          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 __WAREHOUSE_ID_ISSET_ID = 0;
    private static final int __ITEM_ID_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("warehouse_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_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(getItemAvailibilityAtWarehouse_args.class, metaDataMap);
    }

    public getItemAvailibilityAtWarehouse_args() {
    }

    public getItemAvailibilityAtWarehouse_args(
      long warehouse_id,
      long item_id)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemAvailibilityAtWarehouse_args(getItemAvailibilityAtWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
      this.item_id = other.item_id;
    }

    public getItemAvailibilityAtWarehouse_args deepCopy() {
      return new getItemAvailibilityAtWarehouse_args(this);
    }

    @Override
    public void clear() {
      setWarehouse_idIsSet(false);
      this.warehouse_id = 0;
      setItem_idIsSet(false);
      this.item_id = 0;
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public void setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouse_id());

      case ITEM_ID:
        return Long.valueOf(getItem_id());

      }
      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 isSetWarehouse_id();
      case ITEM_ID:
        return isSetItem_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemAvailibilityAtWarehouse_args)
        return this.equals((getItemAvailibilityAtWarehouse_args)that);
      return false;
    }

    public boolean equals(getItemAvailibilityAtWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemAvailibilityAtWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemAvailibilityAtWarehouse_args typedOther = (getItemAvailibilityAtWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(typedOther.isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouse_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouse_id, typedOther.warehouse_id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_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: // WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.warehouse_id = iprot.readI64();
              setWarehouse_idIsSet(true);
            } 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.item_id = iprot.readI64();
              setItem_idIsSet(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.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemAvailibilityAtWarehouse_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("item_id:");
      sb.append(this.item_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 getItemAvailibilityAtWarehouse_result implements org.apache.thrift.TBase<getItemAvailibilityAtWarehouse_result, getItemAvailibilityAtWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemAvailibilityAtWarehouse_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getItemAvailibilityAtWarehouse_result.class, metaDataMap);
    }

    public getItemAvailibilityAtWarehouse_result() {
    }

    public getItemAvailibilityAtWarehouse_result(
      long success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemAvailibilityAtWarehouse_result(getItemAvailibilityAtWarehouse_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getItemAvailibilityAtWarehouse_result deepCopy() {
      return new getItemAvailibilityAtWarehouse_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemAvailibilityAtWarehouse_result)
        return this.equals((getItemAvailibilityAtWarehouse_result)that);
      return false;
    }

    public boolean equals(getItemAvailibilityAtWarehouse_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemAvailibilityAtWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemAvailibilityAtWarehouse_result typedOther = (getItemAvailibilityAtWarehouse_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemAvailibilityAtWarehouse_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 markItemAsContentComplete_args implements org.apache.thrift.TBase<markItemAsContentComplete_args, markItemAsContentComplete_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markItemAsContentComplete_args");

    private static final org.apache.thrift.protocol.TField ENTITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("category", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField BRAND_FIELD_DESC = new org.apache.thrift.protocol.TField("brand", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField MODEL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("modelName", org.apache.thrift.protocol.TType.STRING, (short)4);
    private static final org.apache.thrift.protocol.TField MODEL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("modelNumber", org.apache.thrift.protocol.TType.STRING, (short)5);

    private long entityId; // required
    private long category; // required
    private String brand; // required
    private String modelName; // required
    private String modelNumber; // 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 {
      ENTITY_ID((short)1, "entityId"),
      CATEGORY((short)2, "category"),
      BRAND((short)3, "brand"),
      MODEL_NAME((short)4, "modelName"),
      MODEL_NUMBER((short)5, "modelNumber");

      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: // ENTITY_ID
            return ENTITY_ID;
          case 2: // CATEGORY
            return CATEGORY;
          case 3: // BRAND
            return BRAND;
          case 4: // MODEL_NAME
            return MODEL_NAME;
          case 5: // MODEL_NUMBER
            return MODEL_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 __ENTITYID_ISSET_ID = 0;
    private static final int __CATEGORY_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.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("category", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BRAND, new org.apache.thrift.meta_data.FieldMetaData("brand", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.MODEL_NAME, new org.apache.thrift.meta_data.FieldMetaData("modelName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.MODEL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("modelNumber", 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(markItemAsContentComplete_args.class, metaDataMap);
    }

    public markItemAsContentComplete_args() {
    }

    public markItemAsContentComplete_args(
      long entityId,
      long category,
      String brand,
      String modelName,
      String modelNumber)
    {
      this();
      this.entityId = entityId;
      setEntityIdIsSet(true);
      this.category = category;
      setCategoryIsSet(true);
      this.brand = brand;
      this.modelName = modelName;
      this.modelNumber = modelNumber;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markItemAsContentComplete_args(markItemAsContentComplete_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.entityId = other.entityId;
      this.category = other.category;
      if (other.isSetBrand()) {
        this.brand = other.brand;
      }
      if (other.isSetModelName()) {
        this.modelName = other.modelName;
      }
      if (other.isSetModelNumber()) {
        this.modelNumber = other.modelNumber;
      }
    }

    public markItemAsContentComplete_args deepCopy() {
      return new markItemAsContentComplete_args(this);
    }

    @Override
    public void clear() {
      setEntityIdIsSet(false);
      this.entityId = 0;
      setCategoryIsSet(false);
      this.category = 0;
      this.brand = null;
      this.modelName = null;
      this.modelNumber = null;
    }

    public long getEntityId() {
      return this.entityId;
    }

    public void setEntityId(long entityId) {
      this.entityId = entityId;
      setEntityIdIsSet(true);
    }

    public void unsetEntityId() {
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
    }

    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
    public boolean isSetEntityId() {
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
    }

    public void setEntityIdIsSet(boolean value) {
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
    }

    public long getCategory() {
      return this.category;
    }

    public void setCategory(long category) {
      this.category = category;
      setCategoryIsSet(true);
    }

    public void unsetCategory() {
      __isset_bit_vector.clear(__CATEGORY_ISSET_ID);
    }

    /** Returns true if field category is set (has been assigned a value) and false otherwise */
    public boolean isSetCategory() {
      return __isset_bit_vector.get(__CATEGORY_ISSET_ID);
    }

    public void setCategoryIsSet(boolean value) {
      __isset_bit_vector.set(__CATEGORY_ISSET_ID, value);
    }

    public String getBrand() {
      return this.brand;
    }

    public void setBrand(String brand) {
      this.brand = brand;
    }

    public void unsetBrand() {
      this.brand = null;
    }

    /** Returns true if field brand is set (has been assigned a value) and false otherwise */
    public boolean isSetBrand() {
      return this.brand != null;
    }

    public void setBrandIsSet(boolean value) {
      if (!value) {
        this.brand = null;
      }
    }

    public String getModelName() {
      return this.modelName;
    }

    public void setModelName(String modelName) {
      this.modelName = modelName;
    }

    public void unsetModelName() {
      this.modelName = null;
    }

    /** Returns true if field modelName is set (has been assigned a value) and false otherwise */
    public boolean isSetModelName() {
      return this.modelName != null;
    }

    public void setModelNameIsSet(boolean value) {
      if (!value) {
        this.modelName = null;
      }
    }

    public String getModelNumber() {
      return this.modelNumber;
    }

    public void setModelNumber(String modelNumber) {
      this.modelNumber = modelNumber;
    }

    public void unsetModelNumber() {
      this.modelNumber = null;
    }

    /** Returns true if field modelNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetModelNumber() {
      return this.modelNumber != null;
    }

    public void setModelNumberIsSet(boolean value) {
      if (!value) {
        this.modelNumber = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ENTITY_ID:
        if (value == null) {
          unsetEntityId();
        } else {
          setEntityId((Long)value);
        }
        break;

      case CATEGORY:
        if (value == null) {
          unsetCategory();
        } else {
          setCategory((Long)value);
        }
        break;

      case BRAND:
        if (value == null) {
          unsetBrand();
        } else {
          setBrand((String)value);
        }
        break;

      case MODEL_NAME:
        if (value == null) {
          unsetModelName();
        } else {
          setModelName((String)value);
        }
        break;

      case MODEL_NUMBER:
        if (value == null) {
          unsetModelNumber();
        } else {
          setModelNumber((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ENTITY_ID:
        return Long.valueOf(getEntityId());

      case CATEGORY:
        return Long.valueOf(getCategory());

      case BRAND:
        return getBrand();

      case MODEL_NAME:
        return getModelName();

      case MODEL_NUMBER:
        return getModelNumber();

      }
      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 ENTITY_ID:
        return isSetEntityId();
      case CATEGORY:
        return isSetCategory();
      case BRAND:
        return isSetBrand();
      case MODEL_NAME:
        return isSetModelName();
      case MODEL_NUMBER:
        return isSetModelNumber();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markItemAsContentComplete_args)
        return this.equals((markItemAsContentComplete_args)that);
      return false;
    }

    public boolean equals(markItemAsContentComplete_args that) {
      if (that == null)
        return false;

      boolean this_present_entityId = true;
      boolean that_present_entityId = true;
      if (this_present_entityId || that_present_entityId) {
        if (!(this_present_entityId && that_present_entityId))
          return false;
        if (this.entityId != that.entityId)
          return false;
      }

      boolean this_present_category = true;
      boolean that_present_category = true;
      if (this_present_category || that_present_category) {
        if (!(this_present_category && that_present_category))
          return false;
        if (this.category != that.category)
          return false;
      }

      boolean this_present_brand = true && this.isSetBrand();
      boolean that_present_brand = true && that.isSetBrand();
      if (this_present_brand || that_present_brand) {
        if (!(this_present_brand && that_present_brand))
          return false;
        if (!this.brand.equals(that.brand))
          return false;
      }

      boolean this_present_modelName = true && this.isSetModelName();
      boolean that_present_modelName = true && that.isSetModelName();
      if (this_present_modelName || that_present_modelName) {
        if (!(this_present_modelName && that_present_modelName))
          return false;
        if (!this.modelName.equals(that.modelName))
          return false;
      }

      boolean this_present_modelNumber = true && this.isSetModelNumber();
      boolean that_present_modelNumber = true && that.isSetModelNumber();
      if (this_present_modelNumber || that_present_modelNumber) {
        if (!(this_present_modelNumber && that_present_modelNumber))
          return false;
        if (!this.modelNumber.equals(that.modelNumber))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markItemAsContentComplete_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markItemAsContentComplete_args typedOther = (markItemAsContentComplete_args)other;

      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCategory()).compareTo(typedOther.isSetCategory());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCategory()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.category, typedOther.category);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBrand()).compareTo(typedOther.isSetBrand());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBrand()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.brand, typedOther.brand);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetModelName()).compareTo(typedOther.isSetModelName());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetModelName()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelName, typedOther.modelName);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetModelNumber()).compareTo(typedOther.isSetModelNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetModelNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelNumber, typedOther.modelNumber);
        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: // ENTITY_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.entityId = iprot.readI64();
              setEntityIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // CATEGORY
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.category = iprot.readI64();
              setCategoryIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // BRAND
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.brand = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // MODEL_NAME
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.modelName = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // MODEL_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.modelNumber = 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(ENTITY_ID_FIELD_DESC);
      oprot.writeI64(this.entityId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
      oprot.writeI64(this.category);
      oprot.writeFieldEnd();
      if (this.brand != null) {
        oprot.writeFieldBegin(BRAND_FIELD_DESC);
        oprot.writeString(this.brand);
        oprot.writeFieldEnd();
      }
      if (this.modelName != null) {
        oprot.writeFieldBegin(MODEL_NAME_FIELD_DESC);
        oprot.writeString(this.modelName);
        oprot.writeFieldEnd();
      }
      if (this.modelNumber != null) {
        oprot.writeFieldBegin(MODEL_NUMBER_FIELD_DESC);
        oprot.writeString(this.modelNumber);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markItemAsContentComplete_args(");
      boolean first = true;

      sb.append("entityId:");
      sb.append(this.entityId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("category:");
      sb.append(this.category);
      first = false;
      if (!first) sb.append(", ");
      sb.append("brand:");
      if (this.brand == null) {
        sb.append("null");
      } else {
        sb.append(this.brand);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("modelName:");
      if (this.modelName == null) {
        sb.append("null");
      } else {
        sb.append(this.modelName);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("modelNumber:");
      if (this.modelNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.modelNumber);
      }
      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 markItemAsContentComplete_result implements org.apache.thrift.TBase<markItemAsContentComplete_result, markItemAsContentComplete_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markItemAsContentComplete_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private boolean success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(markItemAsContentComplete_result.class, metaDataMap);
    }

    public markItemAsContentComplete_result() {
    }

    public markItemAsContentComplete_result(
      boolean success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markItemAsContentComplete_result(markItemAsContentComplete_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public markItemAsContentComplete_result deepCopy() {
      return new markItemAsContentComplete_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Boolean.valueOf(isSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markItemAsContentComplete_result)
        return this.equals((markItemAsContentComplete_result)that);
      return false;
    }

    public boolean equals(markItemAsContentComplete_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markItemAsContentComplete_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markItemAsContentComplete_result typedOther = (markItemAsContentComplete_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markItemAsContentComplete_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getItemAvailabilityAtLocation_args implements org.apache.thrift.TBase<getItemAvailabilityAtLocation_args, getItemAvailabilityAtLocation_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemAvailabilityAtLocation_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_LOC_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouse_loc", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)2);

    private long warehouse_loc; // required
    private long item_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 {
      WAREHOUSE_LOC((short)1, "warehouse_loc"),
      ITEM_ID((short)2, "item_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: // WAREHOUSE_LOC
            return WAREHOUSE_LOC;
          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 __WAREHOUSE_LOC_ISSET_ID = 0;
    private static final int __ITEM_ID_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_LOC, new org.apache.thrift.meta_data.FieldMetaData("warehouse_loc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_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(getItemAvailabilityAtLocation_args.class, metaDataMap);
    }

    public getItemAvailabilityAtLocation_args() {
    }

    public getItemAvailabilityAtLocation_args(
      long warehouse_loc,
      long item_id)
    {
      this();
      this.warehouse_loc = warehouse_loc;
      setWarehouse_locIsSet(true);
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemAvailabilityAtLocation_args(getItemAvailabilityAtLocation_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_loc = other.warehouse_loc;
      this.item_id = other.item_id;
    }

    public getItemAvailabilityAtLocation_args deepCopy() {
      return new getItemAvailabilityAtLocation_args(this);
    }

    @Override
    public void clear() {
      setWarehouse_locIsSet(false);
      this.warehouse_loc = 0;
      setItem_idIsSet(false);
      this.item_id = 0;
    }

    public long getWarehouse_loc() {
      return this.warehouse_loc;
    }

    public void setWarehouse_loc(long warehouse_loc) {
      this.warehouse_loc = warehouse_loc;
      setWarehouse_locIsSet(true);
    }

    public void unsetWarehouse_loc() {
      __isset_bit_vector.clear(__WAREHOUSE_LOC_ISSET_ID);
    }

    /** Returns true if field warehouse_loc is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouse_loc() {
      return __isset_bit_vector.get(__WAREHOUSE_LOC_ISSET_ID);
    }

    public void setWarehouse_locIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_LOC_ISSET_ID, value);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_LOC:
        if (value == null) {
          unsetWarehouse_loc();
        } else {
          setWarehouse_loc((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_LOC:
        return Long.valueOf(getWarehouse_loc());

      case ITEM_ID:
        return Long.valueOf(getItem_id());

      }
      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_LOC:
        return isSetWarehouse_loc();
      case ITEM_ID:
        return isSetItem_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemAvailabilityAtLocation_args)
        return this.equals((getItemAvailabilityAtLocation_args)that);
      return false;
    }

    public boolean equals(getItemAvailabilityAtLocation_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_loc = true;
      boolean that_present_warehouse_loc = true;
      if (this_present_warehouse_loc || that_present_warehouse_loc) {
        if (!(this_present_warehouse_loc && that_present_warehouse_loc))
          return false;
        if (this.warehouse_loc != that.warehouse_loc)
          return false;
      }

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemAvailabilityAtLocation_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemAvailabilityAtLocation_args typedOther = (getItemAvailabilityAtLocation_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_loc()).compareTo(typedOther.isSetWarehouse_loc());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouse_loc()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouse_loc, typedOther.warehouse_loc);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_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: // WAREHOUSE_LOC
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.warehouse_loc = iprot.readI64();
              setWarehouse_locIsSet(true);
            } 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.item_id = iprot.readI64();
              setItem_idIsSet(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_LOC_FIELD_DESC);
      oprot.writeI64(this.warehouse_loc);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemAvailabilityAtLocation_args(");
      boolean first = true;

      sb.append("warehouse_loc:");
      sb.append(this.warehouse_loc);
      first = false;
      if (!first) sb.append(", ");
      sb.append("item_id:");
      sb.append(this.item_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 {
        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 getItemAvailabilityAtLocation_result implements org.apache.thrift.TBase<getItemAvailabilityAtLocation_result, getItemAvailabilityAtLocation_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemAvailabilityAtLocation_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 ISEX_FIELD_DESC = new org.apache.thrift.protocol.TField("isex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Long> success; // required
    private InventoryServiceException isex; // 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"),
      ISEX((short)1, "isex");

      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: // ISEX
            return ISEX;
          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))));
      tmpMap.put(_Fields.ISEX, new org.apache.thrift.meta_data.FieldMetaData("isex", 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(getItemAvailabilityAtLocation_result.class, metaDataMap);
    }

    public getItemAvailabilityAtLocation_result() {
    }

    public getItemAvailabilityAtLocation_result(
      List<Long> success,
      InventoryServiceException isex)
    {
      this();
      this.success = success;
      this.isex = isex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemAvailabilityAtLocation_result(getItemAvailabilityAtLocation_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;
      }
      if (other.isSetIsex()) {
        this.isex = new InventoryServiceException(other.isex);
      }
    }

    public getItemAvailabilityAtLocation_result deepCopy() {
      return new getItemAvailabilityAtLocation_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.isex = 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 InventoryServiceException getIsex() {
      return this.isex;
    }

    public void setIsex(InventoryServiceException isex) {
      this.isex = isex;
    }

    public void unsetIsex() {
      this.isex = null;
    }

    /** Returns true if field isex is set (has been assigned a value) and false otherwise */
    public boolean isSetIsex() {
      return this.isex != null;
    }

    public void setIsexIsSet(boolean value) {
      if (!value) {
        this.isex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Long>)value);
        }
        break;

      case ISEX:
        if (value == null) {
          unsetIsex();
        } else {
          setIsex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ISEX:
        return getIsex();

      }
      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 ISEX:
        return isSetIsex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemAvailabilityAtLocation_result)
        return this.equals((getItemAvailabilityAtLocation_result)that);
      return false;
    }

    public boolean equals(getItemAvailabilityAtLocation_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_isex = true && this.isSetIsex();
      boolean that_present_isex = true && that.isSetIsex();
      if (this_present_isex || that_present_isex) {
        if (!(this_present_isex && that_present_isex))
          return false;
        if (!this.isex.equals(that.isex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemAvailabilityAtLocation_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemAvailabilityAtLocation_result typedOther = (getItemAvailabilityAtLocation_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(isSetIsex()).compareTo(typedOther.isSetIsex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isex, typedOther.isex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list36 = iprot.readListBegin();
                this.success = new ArrayList<Long>(_list36.size);
                for (int _i37 = 0; _i37 < _list36.size; ++_i37)
                {
                  long _elem38; // required
                  _elem38 = iprot.readI64();
                  this.success.add(_elem38);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // ISEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.isex = new InventoryServiceException();
              this.isex.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.I64, this.success.size()));
          for (long _iter39 : this.success)
          {
            oprot.writeI64(_iter39);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetIsex()) {
        oprot.writeFieldBegin(ISEX_FIELD_DESC);
        this.isex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemAvailabilityAtLocation_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("isex:");
      if (this.isex == null) {
        sb.append("null");
      } else {
        sb.append(this.isex);
      }
      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 getAllWarehouses_args implements org.apache.thrift.TBase<getAllWarehouses_args, getAllWarehouses_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllWarehouses_args");

    private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)1);

    private boolean isActive; // 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 {
      IS_ACTIVE((short)1, "isActive");

      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: // IS_ACTIVE
            return IS_ACTIVE;
          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 __ISACTIVE_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.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", 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(getAllWarehouses_args.class, metaDataMap);
    }

    public getAllWarehouses_args() {
    }

    public getAllWarehouses_args(
      boolean isActive)
    {
      this();
      this.isActive = isActive;
      setIsActiveIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllWarehouses_args(getAllWarehouses_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.isActive = other.isActive;
    }

    public getAllWarehouses_args deepCopy() {
      return new getAllWarehouses_args(this);
    }

    @Override
    public void clear() {
      setIsActiveIsSet(false);
      this.isActive = false;
    }

    public boolean isIsActive() {
      return this.isActive;
    }

    public void setIsActive(boolean isActive) {
      this.isActive = isActive;
      setIsActiveIsSet(true);
    }

    public void unsetIsActive() {
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
    }

    /** Returns true if field isActive is set (has been assigned a value) and false otherwise */
    public boolean isSetIsActive() {
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
    }

    public void setIsActiveIsSet(boolean value) {
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case IS_ACTIVE:
        if (value == null) {
          unsetIsActive();
        } else {
          setIsActive((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return Boolean.valueOf(isIsActive());

      }
      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 IS_ACTIVE:
        return isSetIsActive();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllWarehouses_args)
        return this.equals((getAllWarehouses_args)that);
      return false;
    }

    public boolean equals(getAllWarehouses_args that) {
      if (that == null)
        return false;

      boolean this_present_isActive = true;
      boolean that_present_isActive = true;
      if (this_present_isActive || that_present_isActive) {
        if (!(this_present_isActive && that_present_isActive))
          return false;
        if (this.isActive != that.isActive)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllWarehouses_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllWarehouses_args typedOther = (getAllWarehouses_args)other;

      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(typedOther.isSetIsActive());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsActive()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, typedOther.isActive);
        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: // IS_ACTIVE
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.isActive = iprot.readBool();
              setIsActiveIsSet(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(IS_ACTIVE_FIELD_DESC);
      oprot.writeBool(this.isActive);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllWarehouses_args(");
      boolean first = true;

      sb.append("isActive:");
      sb.append(this.isActive);
      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 getAllWarehouses_result implements org.apache.thrift.TBase<getAllWarehouses_result, getAllWarehouses_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllWarehouses_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Warehouse> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, Warehouse.class))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getAllWarehouses_result.class, metaDataMap);
    }

    public getAllWarehouses_result() {
    }

    public getAllWarehouses_result(
      List<Warehouse> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllWarehouses_result(getAllWarehouses_result other) {
      if (other.isSetSuccess()) {
        List<Warehouse> __this__success = new ArrayList<Warehouse>();
        for (Warehouse other_element : other.success) {
          __this__success.add(new Warehouse(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getAllWarehouses_result deepCopy() {
      return new getAllWarehouses_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Warehouse> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Warehouse elem) {
      if (this.success == null) {
        this.success = new ArrayList<Warehouse>();
      }
      this.success.add(elem);
    }

    public List<Warehouse> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Warehouse> 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Warehouse>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllWarehouses_result)
        return this.equals((getAllWarehouses_result)that);
      return false;
    }

    public boolean equals(getAllWarehouses_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllWarehouses_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllWarehouses_result typedOther = (getAllWarehouses_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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 _list40 = iprot.readListBegin();
                this.success = new ArrayList<Warehouse>(_list40.size);
                for (int _i41 = 0; _i41 < _list40.size; ++_i41)
                {
                  Warehouse _elem42; // required
                  _elem42 = new Warehouse();
                  _elem42.read(iprot);
                  this.success.add(_elem42);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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 (Warehouse _iter43 : this.success)
          {
            _iter43.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllWarehouses_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getWarehouse_args implements org.apache.thrift.TBase<getWarehouse_args, getWarehouse_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getWarehouse_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouse_id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long warehouse_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 {
      WAREHOUSE_ID((short)1, "warehouse_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: // 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 __WAREHOUSE_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.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouse_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(getWarehouse_args.class, metaDataMap);
    }

    public getWarehouse_args() {
    }

    public getWarehouse_args(
      long warehouse_id)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getWarehouse_args(getWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
    }

    public getWarehouse_args deepCopy() {
      return new getWarehouse_args(this);
    }

    @Override
    public void clear() {
      setWarehouse_idIsSet(false);
      this.warehouse_id = 0;
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public void setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouse_id());

      }
      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 isSetWarehouse_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getWarehouse_args)
        return this.equals((getWarehouse_args)that);
      return false;
    }

    public boolean equals(getWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getWarehouse_args typedOther = (getWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(typedOther.isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouse_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouse_id, typedOther.warehouse_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: // WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.warehouse_id = iprot.readI64();
              setWarehouse_idIsSet(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.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getWarehouse_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_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 getWarehouse_result implements org.apache.thrift.TBase<getWarehouse_result, getWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getWarehouse_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Warehouse success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, Warehouse.class)));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getWarehouse_result.class, metaDataMap);
    }

    public getWarehouse_result() {
    }

    public getWarehouse_result(
      Warehouse success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getWarehouse_result(getWarehouse_result other) {
      if (other.isSetSuccess()) {
        this.success = new Warehouse(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getWarehouse_result deepCopy() {
      return new getWarehouse_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public Warehouse getSuccess() {
      return this.success;
    }

    public void setSuccess(Warehouse 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Warehouse)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getWarehouse_result)
        return this.equals((getWarehouse_result)that);
      return false;
    }

    public boolean equals(getWarehouse_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getWarehouse_result typedOther = (getWarehouse_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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 Warehouse();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getWarehouse_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getAllWarehousesForItem_args implements org.apache.thrift.TBase<getAllWarehousesForItem_args, getAllWarehousesForItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllWarehousesForItem_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long item_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 {
      ITEM_ID((short)1, "item_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: // 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 __ITEM_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.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_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(getAllWarehousesForItem_args.class, metaDataMap);
    }

    public getAllWarehousesForItem_args() {
    }

    public getAllWarehousesForItem_args(
      long item_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllWarehousesForItem_args(getAllWarehousesForItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
    }

    public getAllWarehousesForItem_args deepCopy() {
      return new getAllWarehousesForItem_args(this);
    }

    @Override
    public void clear() {
      setItem_idIsSet(false);
      this.item_id = 0;
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItem_id());

      }
      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 isSetItem_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllWarehousesForItem_args)
        return this.equals((getAllWarehousesForItem_args)that);
      return false;
    }

    public boolean equals(getAllWarehousesForItem_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllWarehousesForItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllWarehousesForItem_args typedOther = (getAllWarehousesForItem_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_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: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.item_id = iprot.readI64();
              setItem_idIsSet(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.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllWarehousesForItem_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_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 getAllWarehousesForItem_result implements org.apache.thrift.TBase<getAllWarehousesForItem_result, getAllWarehousesForItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllWarehousesForItem_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Warehouse> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, Warehouse.class))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getAllWarehousesForItem_result.class, metaDataMap);
    }

    public getAllWarehousesForItem_result() {
    }

    public getAllWarehousesForItem_result(
      List<Warehouse> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllWarehousesForItem_result(getAllWarehousesForItem_result other) {
      if (other.isSetSuccess()) {
        List<Warehouse> __this__success = new ArrayList<Warehouse>();
        for (Warehouse other_element : other.success) {
          __this__success.add(new Warehouse(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getAllWarehousesForItem_result deepCopy() {
      return new getAllWarehousesForItem_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Warehouse> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Warehouse elem) {
      if (this.success == null) {
        this.success = new ArrayList<Warehouse>();
      }
      this.success.add(elem);
    }

    public List<Warehouse> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Warehouse> 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Warehouse>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllWarehousesForItem_result)
        return this.equals((getAllWarehousesForItem_result)that);
      return false;
    }

    public boolean equals(getAllWarehousesForItem_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllWarehousesForItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllWarehousesForItem_result typedOther = (getAllWarehousesForItem_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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<Warehouse>(_list44.size);
                for (int _i45 = 0; _i45 < _list44.size; ++_i45)
                {
                  Warehouse _elem46; // required
                  _elem46 = new Warehouse();
                  _elem46.read(iprot);
                  this.success.add(_elem46);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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 (Warehouse _iter47 : this.success)
          {
            _iter47.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllWarehousesForItem_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getAllItemsForWarehouse_args implements org.apache.thrift.TBase<getAllItemsForWarehouse_args, getAllItemsForWarehouse_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllItemsForWarehouse_args");

    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouse_id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long warehouse_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 {
      WAREHOUSE_ID((short)1, "warehouse_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: // 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 __WAREHOUSE_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.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouse_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(getAllItemsForWarehouse_args.class, metaDataMap);
    }

    public getAllItemsForWarehouse_args() {
    }

    public getAllItemsForWarehouse_args(
      long warehouse_id)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsForWarehouse_args(getAllItemsForWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
    }

    public getAllItemsForWarehouse_args deepCopy() {
      return new getAllItemsForWarehouse_args(this);
    }

    @Override
    public void clear() {
      setWarehouse_idIsSet(false);
      this.warehouse_id = 0;
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public void setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been assigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouse_id());

      }
      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 isSetWarehouse_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsForWarehouse_args)
        return this.equals((getAllItemsForWarehouse_args)that);
      return false;
    }

    public boolean equals(getAllItemsForWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItemsForWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItemsForWarehouse_args typedOther = (getAllItemsForWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(typedOther.isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWarehouse_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouse_id, typedOther.warehouse_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: // WAREHOUSE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.warehouse_id = iprot.readI64();
              setWarehouse_idIsSet(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.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsForWarehouse_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_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 getAllItemsForWarehouse_result implements org.apache.thrift.TBase<getAllItemsForWarehouse_result, getAllItemsForWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllItemsForWarehouse_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Item> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, Item.class))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getAllItemsForWarehouse_result.class, metaDataMap);
    }

    public getAllItemsForWarehouse_result() {
    }

    public getAllItemsForWarehouse_result(
      List<Item> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsForWarehouse_result(getAllItemsForWarehouse_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getAllItemsForWarehouse_result deepCopy() {
      return new getAllItemsForWarehouse_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Item> 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsForWarehouse_result)
        return this.equals((getAllItemsForWarehouse_result)that);
      return false;
    }

    public boolean equals(getAllItemsForWarehouse_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItemsForWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItemsForWarehouse_result typedOther = (getAllItemsForWarehouse_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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<Item>(_list48.size);
                for (int _i49 = 0; _i49 < _list48.size; ++_i49)
                {
                  Item _elem50; // required
                  _elem50 = new Item();
                  _elem50.read(iprot);
                  this.success.add(_elem50);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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 (Item _iter51 : this.success)
          {
            _iter51.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsForWarehouse_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 reserveItemInWarehouse_args implements org.apache.thrift.TBase<reserveItemInWarehouse_args, reserveItemInWarehouse_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("reserveItemInWarehouse_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 WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (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.DOUBLE, (short)3);

    private long itemId; // required
    private long warehouseId; // required
    private double quantity; // 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"),
      WAREHOUSE_ID((short)2, "warehouseId"),
      QUANTITY((short)3, "quantity");

      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: // WAREHOUSE_ID
            return WAREHOUSE_ID;
          case 3: // QUANTITY
            return QUANTITY;
          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 __QUANTITY_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.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.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)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(reserveItemInWarehouse_args.class, metaDataMap);
    }

    public reserveItemInWarehouse_args() {
    }

    public reserveItemInWarehouse_args(
      long itemId,
      long warehouseId,
      double quantity)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
      this.quantity = quantity;
      setQuantityIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public reserveItemInWarehouse_args(reserveItemInWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      this.warehouseId = other.warehouseId;
      this.quantity = other.quantity;
    }

    public reserveItemInWarehouse_args deepCopy() {
      return new reserveItemInWarehouse_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      setWarehouseIdIsSet(false);
      this.warehouseId = 0;
      setQuantityIsSet(false);
      this.quantity = 0.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 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 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 void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouseId();
        } else {
          setWarehouseId((Long)value);
        }
        break;

      case QUANTITY:
        if (value == null) {
          unsetQuantity();
        } else {
          setQuantity((Double)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouseId());

      case QUANTITY:
        return Double.valueOf(getQuantity());

      }
      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 WAREHOUSE_ID:
        return isSetWarehouseId();
      case QUANTITY:
        return isSetQuantity();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof reserveItemInWarehouse_args)
        return this.equals((reserveItemInWarehouse_args)that);
      return false;
    }

    public boolean equals(reserveItemInWarehouse_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_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_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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(reserveItemInWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      reserveItemInWarehouse_args typedOther = (reserveItemInWarehouse_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(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(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;
        }
      }
      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: // 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 3: // 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;
          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(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
      oprot.writeDouble(this.quantity);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("reserveItemInWarehouse_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("warehouseId:");
      sb.append(this.warehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("quantity:");
      sb.append(this.quantity);
      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 reserveItemInWarehouse_result implements org.apache.thrift.TBase<reserveItemInWarehouse_result, reserveItemInWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("reserveItemInWarehouse_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private boolean success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(reserveItemInWarehouse_result.class, metaDataMap);
    }

    public reserveItemInWarehouse_result() {
    }

    public reserveItemInWarehouse_result(
      boolean success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public reserveItemInWarehouse_result(reserveItemInWarehouse_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public reserveItemInWarehouse_result deepCopy() {
      return new reserveItemInWarehouse_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Boolean.valueOf(isSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof reserveItemInWarehouse_result)
        return this.equals((reserveItemInWarehouse_result)that);
      return false;
    }

    public boolean equals(reserveItemInWarehouse_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(reserveItemInWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      reserveItemInWarehouse_result typedOther = (reserveItemInWarehouse_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("reserveItemInWarehouse_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 reduceReservationCount_args implements org.apache.thrift.TBase<reduceReservationCount_args, reduceReservationCount_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("reduceReservationCount_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 WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (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.DOUBLE, (short)3);

    private long itemId; // required
    private long warehouseId; // required
    private double quantity; // 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"),
      WAREHOUSE_ID((short)2, "warehouseId"),
      QUANTITY((short)3, "quantity");

      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: // WAREHOUSE_ID
            return WAREHOUSE_ID;
          case 3: // QUANTITY
            return QUANTITY;
          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 __QUANTITY_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.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.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)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(reduceReservationCount_args.class, metaDataMap);
    }

    public reduceReservationCount_args() {
    }

    public reduceReservationCount_args(
      long itemId,
      long warehouseId,
      double quantity)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
      this.quantity = quantity;
      setQuantityIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public reduceReservationCount_args(reduceReservationCount_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      this.warehouseId = other.warehouseId;
      this.quantity = other.quantity;
    }

    public reduceReservationCount_args deepCopy() {
      return new reduceReservationCount_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      setWarehouseIdIsSet(false);
      this.warehouseId = 0;
      setQuantityIsSet(false);
      this.quantity = 0.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 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 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 void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouseId();
        } else {
          setWarehouseId((Long)value);
        }
        break;

      case QUANTITY:
        if (value == null) {
          unsetQuantity();
        } else {
          setQuantity((Double)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case WAREHOUSE_ID:
        return Long.valueOf(getWarehouseId());

      case QUANTITY:
        return Double.valueOf(getQuantity());

      }
      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 WAREHOUSE_ID:
        return isSetWarehouseId();
      case QUANTITY:
        return isSetQuantity();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof reduceReservationCount_args)
        return this.equals((reduceReservationCount_args)that);
      return false;
    }

    public boolean equals(reduceReservationCount_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_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_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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(reduceReservationCount_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      reduceReservationCount_args typedOther = (reduceReservationCount_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(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(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;
        }
      }
      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: // 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 3: // 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;
          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(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
      oprot.writeDouble(this.quantity);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("reduceReservationCount_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("warehouseId:");
      sb.append(this.warehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("quantity:");
      sb.append(this.quantity);
      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 reduceReservationCount_result implements org.apache.thrift.TBase<reduceReservationCount_result, reduceReservationCount_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("reduceReservationCount_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private boolean success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(reduceReservationCount_result.class, metaDataMap);
    }

    public reduceReservationCount_result() {
    }

    public reduceReservationCount_result(
      boolean success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public reduceReservationCount_result(reduceReservationCount_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public reduceReservationCount_result deepCopy() {
      return new reduceReservationCount_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Boolean.valueOf(isSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof reduceReservationCount_result)
        return this.equals((reduceReservationCount_result)that);
      return false;
    }

    public boolean equals(reduceReservationCount_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(reduceReservationCount_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      reduceReservationCount_result typedOther = (reduceReservationCount_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("reduceReservationCount_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getBestSellers_args implements org.apache.thrift.TBase<getBestSellers_args, getBestSellers_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestSellers_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(getBestSellers_args.class, metaDataMap);
    }

    public getBestSellers_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestSellers_args(getBestSellers_args other) {
    }

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

    public boolean equals(getBestSellers_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestSellers_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestSellers_args typedOther = (getBestSellers_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("getBestSellers_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 getBestSellers_result implements org.apache.thrift.TBase<getBestSellers_result, getBestSellers_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestSellers_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 ISEX_FIELD_DESC = new org.apache.thrift.protocol.TField("isex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Item> success; // required
    private InventoryServiceException isex; // 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"),
      ISEX((short)1, "isex");

      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: // ISEX
            return ISEX;
          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, Item.class))));
      tmpMap.put(_Fields.ISEX, new org.apache.thrift.meta_data.FieldMetaData("isex", 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(getBestSellers_result.class, metaDataMap);
    }

    public getBestSellers_result() {
    }

    public getBestSellers_result(
      List<Item> success,
      InventoryServiceException isex)
    {
      this();
      this.success = success;
      this.isex = isex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestSellers_result(getBestSellers_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetIsex()) {
        this.isex = new InventoryServiceException(other.isex);
      }
    }

    public getBestSellers_result deepCopy() {
      return new getBestSellers_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.isex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Item> 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 InventoryServiceException getIsex() {
      return this.isex;
    }

    public void setIsex(InventoryServiceException isex) {
      this.isex = isex;
    }

    public void unsetIsex() {
      this.isex = null;
    }

    /** Returns true if field isex is set (has been assigned a value) and false otherwise */
    public boolean isSetIsex() {
      return this.isex != null;
    }

    public void setIsexIsSet(boolean value) {
      if (!value) {
        this.isex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case ISEX:
        if (value == null) {
          unsetIsex();
        } else {
          setIsex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ISEX:
        return getIsex();

      }
      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 ISEX:
        return isSetIsex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestSellers_result)
        return this.equals((getBestSellers_result)that);
      return false;
    }

    public boolean equals(getBestSellers_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_isex = true && this.isSetIsex();
      boolean that_present_isex = true && that.isSetIsex();
      if (this_present_isex || that_present_isex) {
        if (!(this_present_isex && that_present_isex))
          return false;
        if (!this.isex.equals(that.isex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestSellers_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestSellers_result typedOther = (getBestSellers_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(isSetIsex()).compareTo(typedOther.isSetIsex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isex, typedOther.isex);
        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<Item>(_list52.size);
                for (int _i53 = 0; _i53 < _list52.size; ++_i53)
                {
                  Item _elem54; // required
                  _elem54 = new Item();
                  _elem54.read(iprot);
                  this.success.add(_elem54);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // ISEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.isex = new InventoryServiceException();
              this.isex.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 (Item _iter55 : this.success)
          {
            _iter55.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetIsex()) {
        oprot.writeFieldBegin(ISEX_FIELD_DESC);
        this.isex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestSellers_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("isex:");
      if (this.isex == null) {
        sb.append("null");
      } else {
        sb.append(this.isex);
      }
      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 getBestSellersCatalogIds_args implements org.apache.thrift.TBase<getBestSellersCatalogIds_args, getBestSellersCatalogIds_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestSellersCatalogIds_args");

    private static final org.apache.thrift.protocol.TField BEGIN_INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("beginIndex", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOTAL_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("totalItems", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField BRAND_FIELD_DESC = new org.apache.thrift.protocol.TField("brand", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("category", org.apache.thrift.protocol.TType.I64, (short)4);

    private long beginIndex; // required
    private long totalItems; // required
    private String brand; // required
    private long category; // 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 {
      BEGIN_INDEX((short)1, "beginIndex"),
      TOTAL_ITEMS((short)2, "totalItems"),
      BRAND((short)3, "brand"),
      CATEGORY((short)4, "category");

      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: // BEGIN_INDEX
            return BEGIN_INDEX;
          case 2: // TOTAL_ITEMS
            return TOTAL_ITEMS;
          case 3: // BRAND
            return BRAND;
          case 4: // CATEGORY
            return CATEGORY;
          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 __BEGININDEX_ISSET_ID = 0;
    private static final int __TOTALITEMS_ISSET_ID = 1;
    private static final int __CATEGORY_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.BEGIN_INDEX, new org.apache.thrift.meta_data.FieldMetaData("beginIndex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOTAL_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("totalItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BRAND, new org.apache.thrift.meta_data.FieldMetaData("brand", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("category", 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(getBestSellersCatalogIds_args.class, metaDataMap);
    }

    public getBestSellersCatalogIds_args() {
    }

    public getBestSellersCatalogIds_args(
      long beginIndex,
      long totalItems,
      String brand,
      long category)
    {
      this();
      this.beginIndex = beginIndex;
      setBeginIndexIsSet(true);
      this.totalItems = totalItems;
      setTotalItemsIsSet(true);
      this.brand = brand;
      this.category = category;
      setCategoryIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestSellersCatalogIds_args(getBestSellersCatalogIds_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.beginIndex = other.beginIndex;
      this.totalItems = other.totalItems;
      if (other.isSetBrand()) {
        this.brand = other.brand;
      }
      this.category = other.category;
    }

    public getBestSellersCatalogIds_args deepCopy() {
      return new getBestSellersCatalogIds_args(this);
    }

    @Override
    public void clear() {
      setBeginIndexIsSet(false);
      this.beginIndex = 0;
      setTotalItemsIsSet(false);
      this.totalItems = 0;
      this.brand = null;
      setCategoryIsSet(false);
      this.category = 0;
    }

    public long getBeginIndex() {
      return this.beginIndex;
    }

    public void setBeginIndex(long beginIndex) {
      this.beginIndex = beginIndex;
      setBeginIndexIsSet(true);
    }

    public void unsetBeginIndex() {
      __isset_bit_vector.clear(__BEGININDEX_ISSET_ID);
    }

    /** Returns true if field beginIndex is set (has been assigned a value) and false otherwise */
    public boolean isSetBeginIndex() {
      return __isset_bit_vector.get(__BEGININDEX_ISSET_ID);
    }

    public void setBeginIndexIsSet(boolean value) {
      __isset_bit_vector.set(__BEGININDEX_ISSET_ID, value);
    }

    public long getTotalItems() {
      return this.totalItems;
    }

    public void setTotalItems(long totalItems) {
      this.totalItems = totalItems;
      setTotalItemsIsSet(true);
    }

    public void unsetTotalItems() {
      __isset_bit_vector.clear(__TOTALITEMS_ISSET_ID);
    }

    /** Returns true if field totalItems is set (has been assigned a value) and false otherwise */
    public boolean isSetTotalItems() {
      return __isset_bit_vector.get(__TOTALITEMS_ISSET_ID);
    }

    public void setTotalItemsIsSet(boolean value) {
      __isset_bit_vector.set(__TOTALITEMS_ISSET_ID, value);
    }

    public String getBrand() {
      return this.brand;
    }

    public void setBrand(String brand) {
      this.brand = brand;
    }

    public void unsetBrand() {
      this.brand = null;
    }

    /** Returns true if field brand is set (has been assigned a value) and false otherwise */
    public boolean isSetBrand() {
      return this.brand != null;
    }

    public void setBrandIsSet(boolean value) {
      if (!value) {
        this.brand = null;
      }
    }

    public long getCategory() {
      return this.category;
    }

    public void setCategory(long category) {
      this.category = category;
      setCategoryIsSet(true);
    }

    public void unsetCategory() {
      __isset_bit_vector.clear(__CATEGORY_ISSET_ID);
    }

    /** Returns true if field category is set (has been assigned a value) and false otherwise */
    public boolean isSetCategory() {
      return __isset_bit_vector.get(__CATEGORY_ISSET_ID);
    }

    public void setCategoryIsSet(boolean value) {
      __isset_bit_vector.set(__CATEGORY_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BEGIN_INDEX:
        if (value == null) {
          unsetBeginIndex();
        } else {
          setBeginIndex((Long)value);
        }
        break;

      case TOTAL_ITEMS:
        if (value == null) {
          unsetTotalItems();
        } else {
          setTotalItems((Long)value);
        }
        break;

      case BRAND:
        if (value == null) {
          unsetBrand();
        } else {
          setBrand((String)value);
        }
        break;

      case CATEGORY:
        if (value == null) {
          unsetCategory();
        } else {
          setCategory((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BEGIN_INDEX:
        return Long.valueOf(getBeginIndex());

      case TOTAL_ITEMS:
        return Long.valueOf(getTotalItems());

      case BRAND:
        return getBrand();

      case CATEGORY:
        return Long.valueOf(getCategory());

      }
      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 BEGIN_INDEX:
        return isSetBeginIndex();
      case TOTAL_ITEMS:
        return isSetTotalItems();
      case BRAND:
        return isSetBrand();
      case CATEGORY:
        return isSetCategory();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestSellersCatalogIds_args)
        return this.equals((getBestSellersCatalogIds_args)that);
      return false;
    }

    public boolean equals(getBestSellersCatalogIds_args that) {
      if (that == null)
        return false;

      boolean this_present_beginIndex = true;
      boolean that_present_beginIndex = true;
      if (this_present_beginIndex || that_present_beginIndex) {
        if (!(this_present_beginIndex && that_present_beginIndex))
          return false;
        if (this.beginIndex != that.beginIndex)
          return false;
      }

      boolean this_present_totalItems = true;
      boolean that_present_totalItems = true;
      if (this_present_totalItems || that_present_totalItems) {
        if (!(this_present_totalItems && that_present_totalItems))
          return false;
        if (this.totalItems != that.totalItems)
          return false;
      }

      boolean this_present_brand = true && this.isSetBrand();
      boolean that_present_brand = true && that.isSetBrand();
      if (this_present_brand || that_present_brand) {
        if (!(this_present_brand && that_present_brand))
          return false;
        if (!this.brand.equals(that.brand))
          return false;
      }

      boolean this_present_category = true;
      boolean that_present_category = true;
      if (this_present_category || that_present_category) {
        if (!(this_present_category && that_present_category))
          return false;
        if (this.category != that.category)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestSellersCatalogIds_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestSellersCatalogIds_args typedOther = (getBestSellersCatalogIds_args)other;

      lastComparison = Boolean.valueOf(isSetBeginIndex()).compareTo(typedOther.isSetBeginIndex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBeginIndex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.beginIndex, typedOther.beginIndex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTotalItems()).compareTo(typedOther.isSetTotalItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTotalItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalItems, typedOther.totalItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBrand()).compareTo(typedOther.isSetBrand());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBrand()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.brand, typedOther.brand);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCategory()).compareTo(typedOther.isSetCategory());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCategory()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.category, typedOther.category);
        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: // BEGIN_INDEX
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.beginIndex = iprot.readI64();
              setBeginIndexIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TOTAL_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.totalItems = iprot.readI64();
              setTotalItemsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // BRAND
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.brand = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // CATEGORY
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.category = iprot.readI64();
              setCategoryIsSet(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(BEGIN_INDEX_FIELD_DESC);
      oprot.writeI64(this.beginIndex);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TOTAL_ITEMS_FIELD_DESC);
      oprot.writeI64(this.totalItems);
      oprot.writeFieldEnd();
      if (this.brand != null) {
        oprot.writeFieldBegin(BRAND_FIELD_DESC);
        oprot.writeString(this.brand);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
      oprot.writeI64(this.category);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestSellersCatalogIds_args(");
      boolean first = true;

      sb.append("beginIndex:");
      sb.append(this.beginIndex);
      first = false;
      if (!first) sb.append(", ");
      sb.append("totalItems:");
      sb.append(this.totalItems);
      first = false;
      if (!first) sb.append(", ");
      sb.append("brand:");
      if (this.brand == null) {
        sb.append("null");
      } else {
        sb.append(this.brand);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("category:");
      sb.append(this.category);
      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 getBestSellersCatalogIds_result implements org.apache.thrift.TBase<getBestSellersCatalogIds_result, getBestSellersCatalogIds_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestSellersCatalogIds_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Long> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getBestSellersCatalogIds_result.class, metaDataMap);
    }

    public getBestSellersCatalogIds_result() {
    }

    public getBestSellersCatalogIds_result(
      List<Long> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestSellersCatalogIds_result(getBestSellersCatalogIds_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;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getBestSellersCatalogIds_result deepCopy() {
      return new getBestSellersCatalogIds_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Long>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestSellersCatalogIds_result)
        return this.equals((getBestSellersCatalogIds_result)that);
      return false;
    }

    public boolean equals(getBestSellersCatalogIds_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestSellersCatalogIds_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestSellersCatalogIds_result typedOther = (getBestSellersCatalogIds_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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<Long>(_list56.size);
                for (int _i57 = 0; _i57 < _list56.size; ++_i57)
                {
                  long _elem58; // required
                  _elem58 = iprot.readI64();
                  this.success.add(_elem58);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.I64, this.success.size()));
          for (long _iter59 : this.success)
          {
            oprot.writeI64(_iter59);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestSellersCatalogIds_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getBestSellersCount_args implements org.apache.thrift.TBase<getBestSellersCount_args, getBestSellersCount_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestSellersCount_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(getBestSellersCount_args.class, metaDataMap);
    }

    public getBestSellersCount_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestSellersCount_args(getBestSellersCount_args other) {
    }

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

    public boolean equals(getBestSellersCount_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestSellersCount_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestSellersCount_args typedOther = (getBestSellersCount_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("getBestSellersCount_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 getBestSellersCount_result implements org.apache.thrift.TBase<getBestSellersCount_result, getBestSellersCount_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestSellersCount_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getBestSellersCount_result.class, metaDataMap);
    }

    public getBestSellersCount_result() {
    }

    public getBestSellersCount_result(
      long success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestSellersCount_result(getBestSellersCount_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getBestSellersCount_result deepCopy() {
      return new getBestSellersCount_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestSellersCount_result)
        return this.equals((getBestSellersCount_result)that);
      return false;
    }

    public boolean equals(getBestSellersCount_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestSellersCount_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestSellersCount_result typedOther = (getBestSellersCount_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestSellersCount_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getBestDeals_args implements org.apache.thrift.TBase<getBestDeals_args, getBestDeals_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestDeals_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(getBestDeals_args.class, metaDataMap);
    }

    public getBestDeals_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestDeals_args(getBestDeals_args other) {
    }

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

    public boolean equals(getBestDeals_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestDeals_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestDeals_args typedOther = (getBestDeals_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("getBestDeals_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 getBestDeals_result implements org.apache.thrift.TBase<getBestDeals_result, getBestDeals_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestDeals_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 ISEX_FIELD_DESC = new org.apache.thrift.protocol.TField("isex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Item> success; // required
    private InventoryServiceException isex; // 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"),
      ISEX((short)1, "isex");

      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: // ISEX
            return ISEX;
          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, Item.class))));
      tmpMap.put(_Fields.ISEX, new org.apache.thrift.meta_data.FieldMetaData("isex", 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(getBestDeals_result.class, metaDataMap);
    }

    public getBestDeals_result() {
    }

    public getBestDeals_result(
      List<Item> success,
      InventoryServiceException isex)
    {
      this();
      this.success = success;
      this.isex = isex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestDeals_result(getBestDeals_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetIsex()) {
        this.isex = new InventoryServiceException(other.isex);
      }
    }

    public getBestDeals_result deepCopy() {
      return new getBestDeals_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.isex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Item> 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 InventoryServiceException getIsex() {
      return this.isex;
    }

    public void setIsex(InventoryServiceException isex) {
      this.isex = isex;
    }

    public void unsetIsex() {
      this.isex = null;
    }

    /** Returns true if field isex is set (has been assigned a value) and false otherwise */
    public boolean isSetIsex() {
      return this.isex != null;
    }

    public void setIsexIsSet(boolean value) {
      if (!value) {
        this.isex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case ISEX:
        if (value == null) {
          unsetIsex();
        } else {
          setIsex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ISEX:
        return getIsex();

      }
      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 ISEX:
        return isSetIsex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestDeals_result)
        return this.equals((getBestDeals_result)that);
      return false;
    }

    public boolean equals(getBestDeals_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_isex = true && this.isSetIsex();
      boolean that_present_isex = true && that.isSetIsex();
      if (this_present_isex || that_present_isex) {
        if (!(this_present_isex && that_present_isex))
          return false;
        if (!this.isex.equals(that.isex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestDeals_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestDeals_result typedOther = (getBestDeals_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(isSetIsex()).compareTo(typedOther.isSetIsex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isex, typedOther.isex);
        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<Item>(_list60.size);
                for (int _i61 = 0; _i61 < _list60.size; ++_i61)
                {
                  Item _elem62; // required
                  _elem62 = new Item();
                  _elem62.read(iprot);
                  this.success.add(_elem62);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // ISEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.isex = new InventoryServiceException();
              this.isex.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 (Item _iter63 : this.success)
          {
            _iter63.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetIsex()) {
        oprot.writeFieldBegin(ISEX_FIELD_DESC);
        this.isex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestDeals_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("isex:");
      if (this.isex == null) {
        sb.append("null");
      } else {
        sb.append(this.isex);
      }
      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 getBestDealsCatalogIds_args implements org.apache.thrift.TBase<getBestDealsCatalogIds_args, getBestDealsCatalogIds_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestDealsCatalogIds_args");

    private static final org.apache.thrift.protocol.TField BEGIN_INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("beginIndex", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOTAL_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("totalItems", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField BRAND_FIELD_DESC = new org.apache.thrift.protocol.TField("brand", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("category", org.apache.thrift.protocol.TType.I64, (short)4);

    private long beginIndex; // required
    private long totalItems; // required
    private String brand; // required
    private long category; // 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 {
      BEGIN_INDEX((short)1, "beginIndex"),
      TOTAL_ITEMS((short)2, "totalItems"),
      BRAND((short)3, "brand"),
      CATEGORY((short)4, "category");

      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: // BEGIN_INDEX
            return BEGIN_INDEX;
          case 2: // TOTAL_ITEMS
            return TOTAL_ITEMS;
          case 3: // BRAND
            return BRAND;
          case 4: // CATEGORY
            return CATEGORY;
          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 __BEGININDEX_ISSET_ID = 0;
    private static final int __TOTALITEMS_ISSET_ID = 1;
    private static final int __CATEGORY_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.BEGIN_INDEX, new org.apache.thrift.meta_data.FieldMetaData("beginIndex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOTAL_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("totalItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BRAND, new org.apache.thrift.meta_data.FieldMetaData("brand", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("category", 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(getBestDealsCatalogIds_args.class, metaDataMap);
    }

    public getBestDealsCatalogIds_args() {
    }

    public getBestDealsCatalogIds_args(
      long beginIndex,
      long totalItems,
      String brand,
      long category)
    {
      this();
      this.beginIndex = beginIndex;
      setBeginIndexIsSet(true);
      this.totalItems = totalItems;
      setTotalItemsIsSet(true);
      this.brand = brand;
      this.category = category;
      setCategoryIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestDealsCatalogIds_args(getBestDealsCatalogIds_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.beginIndex = other.beginIndex;
      this.totalItems = other.totalItems;
      if (other.isSetBrand()) {
        this.brand = other.brand;
      }
      this.category = other.category;
    }

    public getBestDealsCatalogIds_args deepCopy() {
      return new getBestDealsCatalogIds_args(this);
    }

    @Override
    public void clear() {
      setBeginIndexIsSet(false);
      this.beginIndex = 0;
      setTotalItemsIsSet(false);
      this.totalItems = 0;
      this.brand = null;
      setCategoryIsSet(false);
      this.category = 0;
    }

    public long getBeginIndex() {
      return this.beginIndex;
    }

    public void setBeginIndex(long beginIndex) {
      this.beginIndex = beginIndex;
      setBeginIndexIsSet(true);
    }

    public void unsetBeginIndex() {
      __isset_bit_vector.clear(__BEGININDEX_ISSET_ID);
    }

    /** Returns true if field beginIndex is set (has been assigned a value) and false otherwise */
    public boolean isSetBeginIndex() {
      return __isset_bit_vector.get(__BEGININDEX_ISSET_ID);
    }

    public void setBeginIndexIsSet(boolean value) {
      __isset_bit_vector.set(__BEGININDEX_ISSET_ID, value);
    }

    public long getTotalItems() {
      return this.totalItems;
    }

    public void setTotalItems(long totalItems) {
      this.totalItems = totalItems;
      setTotalItemsIsSet(true);
    }

    public void unsetTotalItems() {
      __isset_bit_vector.clear(__TOTALITEMS_ISSET_ID);
    }

    /** Returns true if field totalItems is set (has been assigned a value) and false otherwise */
    public boolean isSetTotalItems() {
      return __isset_bit_vector.get(__TOTALITEMS_ISSET_ID);
    }

    public void setTotalItemsIsSet(boolean value) {
      __isset_bit_vector.set(__TOTALITEMS_ISSET_ID, value);
    }

    public String getBrand() {
      return this.brand;
    }

    public void setBrand(String brand) {
      this.brand = brand;
    }

    public void unsetBrand() {
      this.brand = null;
    }

    /** Returns true if field brand is set (has been assigned a value) and false otherwise */
    public boolean isSetBrand() {
      return this.brand != null;
    }

    public void setBrandIsSet(boolean value) {
      if (!value) {
        this.brand = null;
      }
    }

    public long getCategory() {
      return this.category;
    }

    public void setCategory(long category) {
      this.category = category;
      setCategoryIsSet(true);
    }

    public void unsetCategory() {
      __isset_bit_vector.clear(__CATEGORY_ISSET_ID);
    }

    /** Returns true if field category is set (has been assigned a value) and false otherwise */
    public boolean isSetCategory() {
      return __isset_bit_vector.get(__CATEGORY_ISSET_ID);
    }

    public void setCategoryIsSet(boolean value) {
      __isset_bit_vector.set(__CATEGORY_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BEGIN_INDEX:
        if (value == null) {
          unsetBeginIndex();
        } else {
          setBeginIndex((Long)value);
        }
        break;

      case TOTAL_ITEMS:
        if (value == null) {
          unsetTotalItems();
        } else {
          setTotalItems((Long)value);
        }
        break;

      case BRAND:
        if (value == null) {
          unsetBrand();
        } else {
          setBrand((String)value);
        }
        break;

      case CATEGORY:
        if (value == null) {
          unsetCategory();
        } else {
          setCategory((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BEGIN_INDEX:
        return Long.valueOf(getBeginIndex());

      case TOTAL_ITEMS:
        return Long.valueOf(getTotalItems());

      case BRAND:
        return getBrand();

      case CATEGORY:
        return Long.valueOf(getCategory());

      }
      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 BEGIN_INDEX:
        return isSetBeginIndex();
      case TOTAL_ITEMS:
        return isSetTotalItems();
      case BRAND:
        return isSetBrand();
      case CATEGORY:
        return isSetCategory();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestDealsCatalogIds_args)
        return this.equals((getBestDealsCatalogIds_args)that);
      return false;
    }

    public boolean equals(getBestDealsCatalogIds_args that) {
      if (that == null)
        return false;

      boolean this_present_beginIndex = true;
      boolean that_present_beginIndex = true;
      if (this_present_beginIndex || that_present_beginIndex) {
        if (!(this_present_beginIndex && that_present_beginIndex))
          return false;
        if (this.beginIndex != that.beginIndex)
          return false;
      }

      boolean this_present_totalItems = true;
      boolean that_present_totalItems = true;
      if (this_present_totalItems || that_present_totalItems) {
        if (!(this_present_totalItems && that_present_totalItems))
          return false;
        if (this.totalItems != that.totalItems)
          return false;
      }

      boolean this_present_brand = true && this.isSetBrand();
      boolean that_present_brand = true && that.isSetBrand();
      if (this_present_brand || that_present_brand) {
        if (!(this_present_brand && that_present_brand))
          return false;
        if (!this.brand.equals(that.brand))
          return false;
      }

      boolean this_present_category = true;
      boolean that_present_category = true;
      if (this_present_category || that_present_category) {
        if (!(this_present_category && that_present_category))
          return false;
        if (this.category != that.category)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestDealsCatalogIds_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestDealsCatalogIds_args typedOther = (getBestDealsCatalogIds_args)other;

      lastComparison = Boolean.valueOf(isSetBeginIndex()).compareTo(typedOther.isSetBeginIndex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBeginIndex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.beginIndex, typedOther.beginIndex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTotalItems()).compareTo(typedOther.isSetTotalItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTotalItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalItems, typedOther.totalItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBrand()).compareTo(typedOther.isSetBrand());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBrand()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.brand, typedOther.brand);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCategory()).compareTo(typedOther.isSetCategory());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCategory()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.category, typedOther.category);
        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: // BEGIN_INDEX
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.beginIndex = iprot.readI64();
              setBeginIndexIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TOTAL_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.totalItems = iprot.readI64();
              setTotalItemsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // BRAND
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.brand = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // CATEGORY
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.category = iprot.readI64();
              setCategoryIsSet(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(BEGIN_INDEX_FIELD_DESC);
      oprot.writeI64(this.beginIndex);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TOTAL_ITEMS_FIELD_DESC);
      oprot.writeI64(this.totalItems);
      oprot.writeFieldEnd();
      if (this.brand != null) {
        oprot.writeFieldBegin(BRAND_FIELD_DESC);
        oprot.writeString(this.brand);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
      oprot.writeI64(this.category);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestDealsCatalogIds_args(");
      boolean first = true;

      sb.append("beginIndex:");
      sb.append(this.beginIndex);
      first = false;
      if (!first) sb.append(", ");
      sb.append("totalItems:");
      sb.append(this.totalItems);
      first = false;
      if (!first) sb.append(", ");
      sb.append("brand:");
      if (this.brand == null) {
        sb.append("null");
      } else {
        sb.append(this.brand);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("category:");
      sb.append(this.category);
      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 getBestDealsCatalogIds_result implements org.apache.thrift.TBase<getBestDealsCatalogIds_result, getBestDealsCatalogIds_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestDealsCatalogIds_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Long> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getBestDealsCatalogIds_result.class, metaDataMap);
    }

    public getBestDealsCatalogIds_result() {
    }

    public getBestDealsCatalogIds_result(
      List<Long> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestDealsCatalogIds_result(getBestDealsCatalogIds_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;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getBestDealsCatalogIds_result deepCopy() {
      return new getBestDealsCatalogIds_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Long>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestDealsCatalogIds_result)
        return this.equals((getBestDealsCatalogIds_result)that);
      return false;
    }

    public boolean equals(getBestDealsCatalogIds_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestDealsCatalogIds_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestDealsCatalogIds_result typedOther = (getBestDealsCatalogIds_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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<Long>(_list64.size);
                for (int _i65 = 0; _i65 < _list64.size; ++_i65)
                {
                  long _elem66; // required
                  _elem66 = iprot.readI64();
                  this.success.add(_elem66);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.I64, this.success.size()));
          for (long _iter67 : this.success)
          {
            oprot.writeI64(_iter67);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestDealsCatalogIds_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getBestDealsCount_args implements org.apache.thrift.TBase<getBestDealsCount_args, getBestDealsCount_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestDealsCount_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(getBestDealsCount_args.class, metaDataMap);
    }

    public getBestDealsCount_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestDealsCount_args(getBestDealsCount_args other) {
    }

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

    public boolean equals(getBestDealsCount_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestDealsCount_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestDealsCount_args typedOther = (getBestDealsCount_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("getBestDealsCount_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 getBestDealsCount_result implements org.apache.thrift.TBase<getBestDealsCount_result, getBestDealsCount_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestDealsCount_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getBestDealsCount_result.class, metaDataMap);
    }

    public getBestDealsCount_result() {
    }

    public getBestDealsCount_result(
      long success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBestDealsCount_result(getBestDealsCount_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getBestDealsCount_result deepCopy() {
      return new getBestDealsCount_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestDealsCount_result)
        return this.equals((getBestDealsCount_result)that);
      return false;
    }

    public boolean equals(getBestDealsCount_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBestDealsCount_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBestDealsCount_result typedOther = (getBestDealsCount_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestDealsCount_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getLatestArrivals_args implements org.apache.thrift.TBase<getLatestArrivals_args, getLatestArrivals_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLatestArrivals_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(getLatestArrivals_args.class, metaDataMap);
    }

    public getLatestArrivals_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLatestArrivals_args(getLatestArrivals_args other) {
    }

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

    public boolean equals(getLatestArrivals_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getLatestArrivals_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getLatestArrivals_args typedOther = (getLatestArrivals_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("getLatestArrivals_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 getLatestArrivals_result implements org.apache.thrift.TBase<getLatestArrivals_result, getLatestArrivals_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLatestArrivals_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 ISEX_FIELD_DESC = new org.apache.thrift.protocol.TField("isex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Item> success; // required
    private InventoryServiceException isex; // 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"),
      ISEX((short)1, "isex");

      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: // ISEX
            return ISEX;
          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, Item.class))));
      tmpMap.put(_Fields.ISEX, new org.apache.thrift.meta_data.FieldMetaData("isex", 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(getLatestArrivals_result.class, metaDataMap);
    }

    public getLatestArrivals_result() {
    }

    public getLatestArrivals_result(
      List<Item> success,
      InventoryServiceException isex)
    {
      this();
      this.success = success;
      this.isex = isex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLatestArrivals_result(getLatestArrivals_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetIsex()) {
        this.isex = new InventoryServiceException(other.isex);
      }
    }

    public getLatestArrivals_result deepCopy() {
      return new getLatestArrivals_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.isex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Item> 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 InventoryServiceException getIsex() {
      return this.isex;
    }

    public void setIsex(InventoryServiceException isex) {
      this.isex = isex;
    }

    public void unsetIsex() {
      this.isex = null;
    }

    /** Returns true if field isex is set (has been assigned a value) and false otherwise */
    public boolean isSetIsex() {
      return this.isex != null;
    }

    public void setIsexIsSet(boolean value) {
      if (!value) {
        this.isex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case ISEX:
        if (value == null) {
          unsetIsex();
        } else {
          setIsex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ISEX:
        return getIsex();

      }
      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 ISEX:
        return isSetIsex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getLatestArrivals_result)
        return this.equals((getLatestArrivals_result)that);
      return false;
    }

    public boolean equals(getLatestArrivals_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_isex = true && this.isSetIsex();
      boolean that_present_isex = true && that.isSetIsex();
      if (this_present_isex || that_present_isex) {
        if (!(this_present_isex && that_present_isex))
          return false;
        if (!this.isex.equals(that.isex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getLatestArrivals_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getLatestArrivals_result typedOther = (getLatestArrivals_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(isSetIsex()).compareTo(typedOther.isSetIsex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isex, typedOther.isex);
        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<Item>(_list68.size);
                for (int _i69 = 0; _i69 < _list68.size; ++_i69)
                {
                  Item _elem70; // required
                  _elem70 = new Item();
                  _elem70.read(iprot);
                  this.success.add(_elem70);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // ISEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.isex = new InventoryServiceException();
              this.isex.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 (Item _iter71 : this.success)
          {
            _iter71.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetIsex()) {
        oprot.writeFieldBegin(ISEX_FIELD_DESC);
        this.isex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getLatestArrivals_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("isex:");
      if (this.isex == null) {
        sb.append("null");
      } else {
        sb.append(this.isex);
      }
      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 getLatestArrivalsCatalogIds_args implements org.apache.thrift.TBase<getLatestArrivalsCatalogIds_args, getLatestArrivalsCatalogIds_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLatestArrivalsCatalogIds_args");

    private static final org.apache.thrift.protocol.TField BEGIN_INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("beginIndex", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOTAL_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("totalItems", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField BRAND_FIELD_DESC = new org.apache.thrift.protocol.TField("brand", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField CATEGORIES_FIELD_DESC = new org.apache.thrift.protocol.TField("categories", org.apache.thrift.protocol.TType.LIST, (short)4);

    private long beginIndex; // required
    private long totalItems; // required
    private String brand; // required
    private List<Long> categories; // 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 {
      BEGIN_INDEX((short)1, "beginIndex"),
      TOTAL_ITEMS((short)2, "totalItems"),
      BRAND((short)3, "brand"),
      CATEGORIES((short)4, "categories");

      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: // BEGIN_INDEX
            return BEGIN_INDEX;
          case 2: // TOTAL_ITEMS
            return TOTAL_ITEMS;
          case 3: // BRAND
            return BRAND;
          case 4: // CATEGORIES
            return CATEGORIES;
          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 __BEGININDEX_ISSET_ID = 0;
    private static final int __TOTALITEMS_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.BEGIN_INDEX, new org.apache.thrift.meta_data.FieldMetaData("beginIndex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOTAL_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("totalItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.BRAND, new org.apache.thrift.meta_data.FieldMetaData("brand", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.CATEGORIES, new org.apache.thrift.meta_data.FieldMetaData("categories", 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(getLatestArrivalsCatalogIds_args.class, metaDataMap);
    }

    public getLatestArrivalsCatalogIds_args() {
    }

    public getLatestArrivalsCatalogIds_args(
      long beginIndex,
      long totalItems,
      String brand,
      List<Long> categories)
    {
      this();
      this.beginIndex = beginIndex;
      setBeginIndexIsSet(true);
      this.totalItems = totalItems;
      setTotalItemsIsSet(true);
      this.brand = brand;
      this.categories = categories;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLatestArrivalsCatalogIds_args(getLatestArrivalsCatalogIds_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.beginIndex = other.beginIndex;
      this.totalItems = other.totalItems;
      if (other.isSetBrand()) {
        this.brand = other.brand;
      }
      if (other.isSetCategories()) {
        List<Long> __this__categories = new ArrayList<Long>();
        for (Long other_element : other.categories) {
          __this__categories.add(other_element);
        }
        this.categories = __this__categories;
      }
    }

    public getLatestArrivalsCatalogIds_args deepCopy() {
      return new getLatestArrivalsCatalogIds_args(this);
    }

    @Override
    public void clear() {
      setBeginIndexIsSet(false);
      this.beginIndex = 0;
      setTotalItemsIsSet(false);
      this.totalItems = 0;
      this.brand = null;
      this.categories = null;
    }

    public long getBeginIndex() {
      return this.beginIndex;
    }

    public void setBeginIndex(long beginIndex) {
      this.beginIndex = beginIndex;
      setBeginIndexIsSet(true);
    }

    public void unsetBeginIndex() {
      __isset_bit_vector.clear(__BEGININDEX_ISSET_ID);
    }

    /** Returns true if field beginIndex is set (has been assigned a value) and false otherwise */
    public boolean isSetBeginIndex() {
      return __isset_bit_vector.get(__BEGININDEX_ISSET_ID);
    }

    public void setBeginIndexIsSet(boolean value) {
      __isset_bit_vector.set(__BEGININDEX_ISSET_ID, value);
    }

    public long getTotalItems() {
      return this.totalItems;
    }

    public void setTotalItems(long totalItems) {
      this.totalItems = totalItems;
      setTotalItemsIsSet(true);
    }

    public void unsetTotalItems() {
      __isset_bit_vector.clear(__TOTALITEMS_ISSET_ID);
    }

    /** Returns true if field totalItems is set (has been assigned a value) and false otherwise */
    public boolean isSetTotalItems() {
      return __isset_bit_vector.get(__TOTALITEMS_ISSET_ID);
    }

    public void setTotalItemsIsSet(boolean value) {
      __isset_bit_vector.set(__TOTALITEMS_ISSET_ID, value);
    }

    public String getBrand() {
      return this.brand;
    }

    public void setBrand(String brand) {
      this.brand = brand;
    }

    public void unsetBrand() {
      this.brand = null;
    }

    /** Returns true if field brand is set (has been assigned a value) and false otherwise */
    public boolean isSetBrand() {
      return this.brand != null;
    }

    public void setBrandIsSet(boolean value) {
      if (!value) {
        this.brand = null;
      }
    }

    public int getCategoriesSize() {
      return (this.categories == null) ? 0 : this.categories.size();
    }

    public java.util.Iterator<Long> getCategoriesIterator() {
      return (this.categories == null) ? null : this.categories.iterator();
    }

    public void addToCategories(long elem) {
      if (this.categories == null) {
        this.categories = new ArrayList<Long>();
      }
      this.categories.add(elem);
    }

    public List<Long> getCategories() {
      return this.categories;
    }

    public void setCategories(List<Long> categories) {
      this.categories = categories;
    }

    public void unsetCategories() {
      this.categories = null;
    }

    /** Returns true if field categories is set (has been assigned a value) and false otherwise */
    public boolean isSetCategories() {
      return this.categories != null;
    }

    public void setCategoriesIsSet(boolean value) {
      if (!value) {
        this.categories = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BEGIN_INDEX:
        if (value == null) {
          unsetBeginIndex();
        } else {
          setBeginIndex((Long)value);
        }
        break;

      case TOTAL_ITEMS:
        if (value == null) {
          unsetTotalItems();
        } else {
          setTotalItems((Long)value);
        }
        break;

      case BRAND:
        if (value == null) {
          unsetBrand();
        } else {
          setBrand((String)value);
        }
        break;

      case CATEGORIES:
        if (value == null) {
          unsetCategories();
        } else {
          setCategories((List<Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BEGIN_INDEX:
        return Long.valueOf(getBeginIndex());

      case TOTAL_ITEMS:
        return Long.valueOf(getTotalItems());

      case BRAND:
        return getBrand();

      case CATEGORIES:
        return getCategories();

      }
      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 BEGIN_INDEX:
        return isSetBeginIndex();
      case TOTAL_ITEMS:
        return isSetTotalItems();
      case BRAND:
        return isSetBrand();
      case CATEGORIES:
        return isSetCategories();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getLatestArrivalsCatalogIds_args)
        return this.equals((getLatestArrivalsCatalogIds_args)that);
      return false;
    }

    public boolean equals(getLatestArrivalsCatalogIds_args that) {
      if (that == null)
        return false;

      boolean this_present_beginIndex = true;
      boolean that_present_beginIndex = true;
      if (this_present_beginIndex || that_present_beginIndex) {
        if (!(this_present_beginIndex && that_present_beginIndex))
          return false;
        if (this.beginIndex != that.beginIndex)
          return false;
      }

      boolean this_present_totalItems = true;
      boolean that_present_totalItems = true;
      if (this_present_totalItems || that_present_totalItems) {
        if (!(this_present_totalItems && that_present_totalItems))
          return false;
        if (this.totalItems != that.totalItems)
          return false;
      }

      boolean this_present_brand = true && this.isSetBrand();
      boolean that_present_brand = true && that.isSetBrand();
      if (this_present_brand || that_present_brand) {
        if (!(this_present_brand && that_present_brand))
          return false;
        if (!this.brand.equals(that.brand))
          return false;
      }

      boolean this_present_categories = true && this.isSetCategories();
      boolean that_present_categories = true && that.isSetCategories();
      if (this_present_categories || that_present_categories) {
        if (!(this_present_categories && that_present_categories))
          return false;
        if (!this.categories.equals(that.categories))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getLatestArrivalsCatalogIds_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getLatestArrivalsCatalogIds_args typedOther = (getLatestArrivalsCatalogIds_args)other;

      lastComparison = Boolean.valueOf(isSetBeginIndex()).compareTo(typedOther.isSetBeginIndex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBeginIndex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.beginIndex, typedOther.beginIndex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTotalItems()).compareTo(typedOther.isSetTotalItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTotalItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalItems, typedOther.totalItems);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBrand()).compareTo(typedOther.isSetBrand());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBrand()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.brand, typedOther.brand);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCategories()).compareTo(typedOther.isSetCategories());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCategories()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.categories, typedOther.categories);
        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: // BEGIN_INDEX
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.beginIndex = iprot.readI64();
              setBeginIndexIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TOTAL_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.totalItems = iprot.readI64();
              setTotalItemsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // BRAND
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.brand = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // CATEGORIES
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list72 = iprot.readListBegin();
                this.categories = new ArrayList<Long>(_list72.size);
                for (int _i73 = 0; _i73 < _list72.size; ++_i73)
                {
                  long _elem74; // required
                  _elem74 = iprot.readI64();
                  this.categories.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 {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(BEGIN_INDEX_FIELD_DESC);
      oprot.writeI64(this.beginIndex);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TOTAL_ITEMS_FIELD_DESC);
      oprot.writeI64(this.totalItems);
      oprot.writeFieldEnd();
      if (this.brand != null) {
        oprot.writeFieldBegin(BRAND_FIELD_DESC);
        oprot.writeString(this.brand);
        oprot.writeFieldEnd();
      }
      if (this.categories != null) {
        oprot.writeFieldBegin(CATEGORIES_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.categories.size()));
          for (long _iter75 : this.categories)
          {
            oprot.writeI64(_iter75);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getLatestArrivalsCatalogIds_args(");
      boolean first = true;

      sb.append("beginIndex:");
      sb.append(this.beginIndex);
      first = false;
      if (!first) sb.append(", ");
      sb.append("totalItems:");
      sb.append(this.totalItems);
      first = false;
      if (!first) sb.append(", ");
      sb.append("brand:");
      if (this.brand == null) {
        sb.append("null");
      } else {
        sb.append(this.brand);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("categories:");
      if (this.categories == null) {
        sb.append("null");
      } else {
        sb.append(this.categories);
      }
      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 getLatestArrivalsCatalogIds_result implements org.apache.thrift.TBase<getLatestArrivalsCatalogIds_result, getLatestArrivalsCatalogIds_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLatestArrivalsCatalogIds_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Long> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getLatestArrivalsCatalogIds_result.class, metaDataMap);
    }

    public getLatestArrivalsCatalogIds_result() {
    }

    public getLatestArrivalsCatalogIds_result(
      List<Long> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLatestArrivalsCatalogIds_result(getLatestArrivalsCatalogIds_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;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getLatestArrivalsCatalogIds_result deepCopy() {
      return new getLatestArrivalsCatalogIds_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Long>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getLatestArrivalsCatalogIds_result)
        return this.equals((getLatestArrivalsCatalogIds_result)that);
      return false;
    }

    public boolean equals(getLatestArrivalsCatalogIds_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getLatestArrivalsCatalogIds_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getLatestArrivalsCatalogIds_result typedOther = (getLatestArrivalsCatalogIds_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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<Long>(_list76.size);
                for (int _i77 = 0; _i77 < _list76.size; ++_i77)
                {
                  long _elem78; // required
                  _elem78 = iprot.readI64();
                  this.success.add(_elem78);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.I64, this.success.size()));
          for (long _iter79 : this.success)
          {
            oprot.writeI64(_iter79);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getLatestArrivalsCatalogIds_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getLatestArrivalsCount_args implements org.apache.thrift.TBase<getLatestArrivalsCount_args, getLatestArrivalsCount_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLatestArrivalsCount_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(getLatestArrivalsCount_args.class, metaDataMap);
    }

    public getLatestArrivalsCount_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLatestArrivalsCount_args(getLatestArrivalsCount_args other) {
    }

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

    public boolean equals(getLatestArrivalsCount_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getLatestArrivalsCount_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getLatestArrivalsCount_args typedOther = (getLatestArrivalsCount_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("getLatestArrivalsCount_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 getLatestArrivalsCount_result implements org.apache.thrift.TBase<getLatestArrivalsCount_result, getLatestArrivalsCount_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLatestArrivalsCount_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getLatestArrivalsCount_result.class, metaDataMap);
    }

    public getLatestArrivalsCount_result() {
    }

    public getLatestArrivalsCount_result(
      long success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLatestArrivalsCount_result(getLatestArrivalsCount_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getLatestArrivalsCount_result deepCopy() {
      return new getLatestArrivalsCount_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.cex = 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getLatestArrivalsCount_result)
        return this.equals((getLatestArrivalsCount_result)that);
      return false;
    }

    public boolean equals(getLatestArrivalsCount_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getLatestArrivalsCount_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getLatestArrivalsCount_result typedOther = (getLatestArrivalsCount_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getLatestArrivalsCount_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 generateNewEntityID_args implements org.apache.thrift.TBase<generateNewEntityID_args, generateNewEntityID_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateNewEntityID_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(generateNewEntityID_args.class, metaDataMap);
    }

    public generateNewEntityID_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public generateNewEntityID_args(generateNewEntityID_args other) {
    }

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

    public boolean equals(generateNewEntityID_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(generateNewEntityID_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      generateNewEntityID_args typedOther = (generateNewEntityID_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("generateNewEntityID_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 generateNewEntityID_result implements org.apache.thrift.TBase<generateNewEntityID_result, generateNewEntityID_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateNewEntityID_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 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
    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)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateNewEntityID_result.class, metaDataMap);
    }

    public generateNewEntityID_result() {
    }

    public generateNewEntityID_result(
      long success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public generateNewEntityID_result(generateNewEntityID_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
    }

    public generateNewEntityID_result deepCopy() {
      return new generateNewEntityID_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
    }

    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 void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(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 generateNewEntityID_result)
        return this.equals((generateNewEntityID_result)that);
      return false;
    }

    public boolean equals(generateNewEntityID_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(generateNewEntityID_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      generateNewEntityID_result typedOther = (generateNewEntityID_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.I64) {
              this.success = iprot.readI64();
              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.writeI64(this.success);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("generateNewEntityID_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 getItemPricing_args implements org.apache.thrift.TBase<getItemPricing_args, getItemPricing_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemPricing_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 WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)2);

    private long itemId; // 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"),
      WAREHOUSE_ID((short)2, "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: // 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.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(getItemPricing_args.class, metaDataMap);
    }

    public getItemPricing_args() {
    }

    public getItemPricing_args(
      long itemId,
      long warehouseId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemPricing_args(getItemPricing_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      this.warehouseId = other.warehouseId;
    }

    public getItemPricing_args deepCopy() {
      return new getItemPricing_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      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 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 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 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 WAREHOUSE_ID:
        return isSetWarehouseId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemPricing_args)
        return this.equals((getItemPricing_args)that);
      return false;
    }

    public boolean equals(getItemPricing_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_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(getItemPricing_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemPricing_args typedOther = (getItemPricing_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(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: // 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();
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemPricing_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      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 {
        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 getItemPricing_result implements org.apache.thrift.TBase<getItemPricing_result, getItemPricing_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemPricing_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private VendorItemPricing success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, VendorItemPricing.class)));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getItemPricing_result.class, metaDataMap);
    }

    public getItemPricing_result() {
    }

    public getItemPricing_result(
      VendorItemPricing success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemPricing_result(getItemPricing_result other) {
      if (other.isSetSuccess()) {
        this.success = new VendorItemPricing(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getItemPricing_result deepCopy() {
      return new getItemPricing_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public VendorItemPricing getSuccess() {
      return this.success;
    }

    public void setSuccess(VendorItemPricing 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((VendorItemPricing)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemPricing_result)
        return this.equals((getItemPricing_result)that);
      return false;
    }

    public boolean equals(getItemPricing_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemPricing_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemPricing_result typedOther = (getItemPricing_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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 VendorItemPricing();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemPricing_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 addCategory_args implements org.apache.thrift.TBase<addCategory_args, addCategory_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addCategory_args");

    private static final org.apache.thrift.protocol.TField CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("category", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Category category; // 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 {
      CATEGORY((short)1, "category");

      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: // CATEGORY
            return CATEGORY;
          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.CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("category", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Category.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addCategory_args.class, metaDataMap);
    }

    public addCategory_args() {
    }

    public addCategory_args(
      Category category)
    {
      this();
      this.category = category;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addCategory_args(addCategory_args other) {
      if (other.isSetCategory()) {
        this.category = new Category(other.category);
      }
    }

    public addCategory_args deepCopy() {
      return new addCategory_args(this);
    }

    @Override
    public void clear() {
      this.category = null;
    }

    public Category getCategory() {
      return this.category;
    }

    public void setCategory(Category category) {
      this.category = category;
    }

    public void unsetCategory() {
      this.category = null;
    }

    /** Returns true if field category is set (has been assigned a value) and false otherwise */
    public boolean isSetCategory() {
      return this.category != null;
    }

    public void setCategoryIsSet(boolean value) {
      if (!value) {
        this.category = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CATEGORY:
        if (value == null) {
          unsetCategory();
        } else {
          setCategory((Category)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CATEGORY:
        return getCategory();

      }
      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 CATEGORY:
        return isSetCategory();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addCategory_args)
        return this.equals((addCategory_args)that);
      return false;
    }

    public boolean equals(addCategory_args that) {
      if (that == null)
        return false;

      boolean this_present_category = true && this.isSetCategory();
      boolean that_present_category = true && that.isSetCategory();
      if (this_present_category || that_present_category) {
        if (!(this_present_category && that_present_category))
          return false;
        if (!this.category.equals(that.category))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addCategory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addCategory_args typedOther = (addCategory_args)other;

      lastComparison = Boolean.valueOf(isSetCategory()).compareTo(typedOther.isSetCategory());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCategory()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.category, typedOther.category);
        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: // CATEGORY
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.category = new Category();
              this.category.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.category != null) {
        oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
        this.category.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addCategory_args(");
      boolean first = true;

      sb.append("category:");
      if (this.category == null) {
        sb.append("null");
      } else {
        sb.append(this.category);
      }
      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 addCategory_result implements org.apache.thrift.TBase<addCategory_result, addCategory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addCategory_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(addCategory_result.class, metaDataMap);
    }

    public addCategory_result() {
    }

    public addCategory_result(
      boolean success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addCategory_result(addCategory_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
    }

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

    public boolean equals(addCategory_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(addCategory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addCategory_result typedOther = (addCategory_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("addCategory_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 getCategory_args implements org.apache.thrift.TBase<getCategory_args, getCategory_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCategory_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(getCategory_args.class, metaDataMap);
    }

    public getCategory_args() {
    }

    public getCategory_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCategory_args(getCategory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

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

    public boolean equals(getCategory_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(getCategory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCategory_args typedOther = (getCategory_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("getCategory_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 getCategory_result implements org.apache.thrift.TBase<getCategory_result, getCategory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCategory_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 Category 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Category.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCategory_result.class, metaDataMap);
    }

    public getCategory_result() {
    }

    public getCategory_result(
      Category success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCategory_result(getCategory_result other) {
      if (other.isSetSuccess()) {
        this.success = new Category(other.success);
      }
    }

    public getCategory_result deepCopy() {
      return new getCategory_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public Category getSuccess() {
      return this.success;
    }

    public void setSuccess(Category 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((Category)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 getCategory_result)
        return this.equals((getCategory_result)that);
      return false;
    }

    public boolean equals(getCategory_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(getCategory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCategory_result typedOther = (getCategory_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.STRUCT) {
              this.success = new Category();
              this.success.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();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCategory_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 getAllCategories_args implements org.apache.thrift.TBase<getAllCategories_args, getAllCategories_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCategories_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(getAllCategories_args.class, metaDataMap);
    }

    public getAllCategories_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllCategories_args(getAllCategories_args other) {
    }

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

    public boolean equals(getAllCategories_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllCategories_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllCategories_args typedOther = (getAllCategories_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("getAllCategories_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 getAllCategories_result implements org.apache.thrift.TBase<getAllCategories_result, getAllCategories_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCategories_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<Category> 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, Category.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCategories_result.class, metaDataMap);
    }

    public getAllCategories_result() {
    }

    public getAllCategories_result(
      List<Category> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllCategories_result(getAllCategories_result other) {
      if (other.isSetSuccess()) {
        List<Category> __this__success = new ArrayList<Category>();
        for (Category other_element : other.success) {
          __this__success.add(new Category(other_element));
        }
        this.success = __this__success;
      }
    }

    public getAllCategories_result deepCopy() {
      return new getAllCategories_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Category> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Category elem) {
      if (this.success == null) {
        this.success = new ArrayList<Category>();
      }
      this.success.add(elem);
    }

    public List<Category> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Category> 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<Category>)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 getAllCategories_result)
        return this.equals((getAllCategories_result)that);
      return false;
    }

    public boolean equals(getAllCategories_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(getAllCategories_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllCategories_result typedOther = (getAllCategories_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<Category>(_list80.size);
                for (int _i81 = 0; _i81 < _list80.size; ++_i81)
                {
                  Category _elem82; // required
                  _elem82 = new Category();
                  _elem82.read(iprot);
                  this.success.add(_elem82);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Category _iter83 : this.success)
          {
            _iter83.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllCategories_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 getAllItemPricing_args implements org.apache.thrift.TBase<getAllItemPricing_args, getAllItemPricing_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllItemPricing_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(getAllItemPricing_args.class, metaDataMap);
    }

    public getAllItemPricing_args() {
    }

    public getAllItemPricing_args(
      long itemId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemPricing_args(getAllItemPricing_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
    }

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

    public boolean equals(getAllItemPricing_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(getAllItemPricing_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItemPricing_args typedOther = (getAllItemPricing_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("getAllItemPricing_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 {
        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 getAllItemPricing_result implements org.apache.thrift.TBase<getAllItemPricing_result, getAllItemPricing_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllItemPricing_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<VendorItemPricing> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, VendorItemPricing.class))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getAllItemPricing_result.class, metaDataMap);
    }

    public getAllItemPricing_result() {
    }

    public getAllItemPricing_result(
      List<VendorItemPricing> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemPricing_result(getAllItemPricing_result other) {
      if (other.isSetSuccess()) {
        List<VendorItemPricing> __this__success = new ArrayList<VendorItemPricing>();
        for (VendorItemPricing other_element : other.success) {
          __this__success.add(new VendorItemPricing(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getAllItemPricing_result deepCopy() {
      return new getAllItemPricing_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<VendorItemPricing> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(VendorItemPricing elem) {
      if (this.success == null) {
        this.success = new ArrayList<VendorItemPricing>();
      }
      this.success.add(elem);
    }

    public List<VendorItemPricing> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<VendorItemPricing> 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<VendorItemPricing>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemPricing_result)
        return this.equals((getAllItemPricing_result)that);
      return false;
    }

    public boolean equals(getAllItemPricing_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItemPricing_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItemPricing_result typedOther = (getAllItemPricing_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list84 = iprot.readListBegin();
                this.success = new ArrayList<VendorItemPricing>(_list84.size);
                for (int _i85 = 0; _i85 < _list84.size; ++_i85)
                {
                  VendorItemPricing _elem86; // required
                  _elem86 = new VendorItemPricing();
                  _elem86.read(iprot);
                  this.success.add(_elem86);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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 (VendorItemPricing _iter87 : this.success)
          {
            _iter87.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemPricing_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 addVendorItemPricing_args implements org.apache.thrift.TBase<addVendorItemPricing_args, addVendorItemPricing_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVendorItemPricing_args");

    private static final org.apache.thrift.protocol.TField VENDOR_ITEM_PRICING_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorItemPricing", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private VendorItemPricing vendorItemPricing; // 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 {
      VENDOR_ITEM_PRICING((short)1, "vendorItemPricing");

      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: // VENDOR_ITEM_PRICING
            return VENDOR_ITEM_PRICING;
          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.VENDOR_ITEM_PRICING, new org.apache.thrift.meta_data.FieldMetaData("vendorItemPricing", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, VendorItemPricing.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVendorItemPricing_args.class, metaDataMap);
    }

    public addVendorItemPricing_args() {
    }

    public addVendorItemPricing_args(
      VendorItemPricing vendorItemPricing)
    {
      this();
      this.vendorItemPricing = vendorItemPricing;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addVendorItemPricing_args(addVendorItemPricing_args other) {
      if (other.isSetVendorItemPricing()) {
        this.vendorItemPricing = new VendorItemPricing(other.vendorItemPricing);
      }
    }

    public addVendorItemPricing_args deepCopy() {
      return new addVendorItemPricing_args(this);
    }

    @Override
    public void clear() {
      this.vendorItemPricing = null;
    }

    public VendorItemPricing getVendorItemPricing() {
      return this.vendorItemPricing;
    }

    public void setVendorItemPricing(VendorItemPricing vendorItemPricing) {
      this.vendorItemPricing = vendorItemPricing;
    }

    public void unsetVendorItemPricing() {
      this.vendorItemPricing = null;
    }

    /** Returns true if field vendorItemPricing is set (has been assigned a value) and false otherwise */
    public boolean isSetVendorItemPricing() {
      return this.vendorItemPricing != null;
    }

    public void setVendorItemPricingIsSet(boolean value) {
      if (!value) {
        this.vendorItemPricing = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case VENDOR_ITEM_PRICING:
        if (value == null) {
          unsetVendorItemPricing();
        } else {
          setVendorItemPricing((VendorItemPricing)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case VENDOR_ITEM_PRICING:
        return getVendorItemPricing();

      }
      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 VENDOR_ITEM_PRICING:
        return isSetVendorItemPricing();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addVendorItemPricing_args)
        return this.equals((addVendorItemPricing_args)that);
      return false;
    }

    public boolean equals(addVendorItemPricing_args that) {
      if (that == null)
        return false;

      boolean this_present_vendorItemPricing = true && this.isSetVendorItemPricing();
      boolean that_present_vendorItemPricing = true && that.isSetVendorItemPricing();
      if (this_present_vendorItemPricing || that_present_vendorItemPricing) {
        if (!(this_present_vendorItemPricing && that_present_vendorItemPricing))
          return false;
        if (!this.vendorItemPricing.equals(that.vendorItemPricing))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addVendorItemPricing_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addVendorItemPricing_args typedOther = (addVendorItemPricing_args)other;

      lastComparison = Boolean.valueOf(isSetVendorItemPricing()).compareTo(typedOther.isSetVendorItemPricing());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetVendorItemPricing()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vendorItemPricing, typedOther.vendorItemPricing);
        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: // VENDOR_ITEM_PRICING
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.vendorItemPricing = new VendorItemPricing();
              this.vendorItemPricing.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.vendorItemPricing != null) {
        oprot.writeFieldBegin(VENDOR_ITEM_PRICING_FIELD_DESC);
        this.vendorItemPricing.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addVendorItemPricing_args(");
      boolean first = true;

      sb.append("vendorItemPricing:");
      if (this.vendorItemPricing == null) {
        sb.append("null");
      } else {
        sb.append(this.vendorItemPricing);
      }
      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 addVendorItemPricing_result implements org.apache.thrift.TBase<addVendorItemPricing_result, addVendorItemPricing_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVendorItemPricing_result");

    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryServiceException cex; // 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 {
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(addVendorItemPricing_result.class, metaDataMap);
    }

    public addVendorItemPricing_result() {
    }

    public addVendorItemPricing_result(
      InventoryServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addVendorItemPricing_result(addVendorItemPricing_result other) {
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public addVendorItemPricing_result deepCopy() {
      return new addVendorItemPricing_result(this);
    }

    @Override
    public void clear() {
      this.cex = null;
    }

    public InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addVendorItemPricing_result)
        return this.equals((addVendorItemPricing_result)that);
      return false;
    }

    public boolean equals(addVendorItemPricing_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addVendorItemPricing_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addVendorItemPricing_result typedOther = (addVendorItemPricing_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addVendorItemPricing_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getAllVendors_args implements org.apache.thrift.TBase<getAllVendors_args, getAllVendors_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllVendors_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(getAllVendors_args.class, metaDataMap);
    }

    public getAllVendors_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllVendors_args(getAllVendors_args other) {
    }

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

    public boolean equals(getAllVendors_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllVendors_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllVendors_args typedOther = (getAllVendors_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("getAllVendors_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 getAllVendors_result implements org.apache.thrift.TBase<getAllVendors_result, getAllVendors_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllVendors_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<Vendor> 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, Vendor.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllVendors_result.class, metaDataMap);
    }

    public getAllVendors_result() {
    }

    public getAllVendors_result(
      List<Vendor> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllVendors_result(getAllVendors_result other) {
      if (other.isSetSuccess()) {
        List<Vendor> __this__success = new ArrayList<Vendor>();
        for (Vendor other_element : other.success) {
          __this__success.add(new Vendor(other_element));
        }
        this.success = __this__success;
      }
    }

    public getAllVendors_result deepCopy() {
      return new getAllVendors_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Vendor> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Vendor elem) {
      if (this.success == null) {
        this.success = new ArrayList<Vendor>();
      }
      this.success.add(elem);
    }

    public List<Vendor> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Vendor> 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<Vendor>)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 getAllVendors_result)
        return this.equals((getAllVendors_result)that);
      return false;
    }

    public boolean equals(getAllVendors_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(getAllVendors_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllVendors_result typedOther = (getAllVendors_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 _list88 = iprot.readListBegin();
                this.success = new ArrayList<Vendor>(_list88.size);
                for (int _i89 = 0; _i89 < _list88.size; ++_i89)
                {
                  Vendor _elem90; // required
                  _elem90 = new Vendor();
                  _elem90.read(iprot);
                  this.success.add(_elem90);
                }
                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 (Vendor _iter91 : this.success)
          {
            _iter91.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllVendors_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 itemExists_args implements org.apache.thrift.TBase<itemExists_args, itemExists_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("itemExists_args");

    private static final org.apache.thrift.protocol.TField PRODUCT_GROUP_FIELD_DESC = new org.apache.thrift.protocol.TField("productGroup", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField BRAND_FIELD_DESC = new org.apache.thrift.protocol.TField("brand", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField MODEL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("modelNumber", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField COLOR_FIELD_DESC = new org.apache.thrift.protocol.TField("color", org.apache.thrift.protocol.TType.STRING, (short)4);
    private static final org.apache.thrift.protocol.TField VENDOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("vendor_id", org.apache.thrift.protocol.TType.I64, (short)5);
    private static final org.apache.thrift.protocol.TField CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("category", org.apache.thrift.protocol.TType.STRING, (short)6);

    private String productGroup; // required
    private String brand; // required
    private String modelNumber; // required
    private String color; // required
    private long vendor_id; // required
    private String category; // 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 {
      PRODUCT_GROUP((short)1, "productGroup"),
      BRAND((short)2, "brand"),
      MODEL_NUMBER((short)3, "modelNumber"),
      COLOR((short)4, "color"),
      VENDOR_ID((short)5, "vendor_id"),
      CATEGORY((short)6, "category");

      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: // PRODUCT_GROUP
            return PRODUCT_GROUP;
          case 2: // BRAND
            return BRAND;
          case 3: // MODEL_NUMBER
            return MODEL_NUMBER;
          case 4: // COLOR
            return COLOR;
          case 5: // VENDOR_ID
            return VENDOR_ID;
          case 6: // CATEGORY
            return CATEGORY;
          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 __VENDOR_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.PRODUCT_GROUP, new org.apache.thrift.meta_data.FieldMetaData("productGroup", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.BRAND, new org.apache.thrift.meta_data.FieldMetaData("brand", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.MODEL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("modelNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.COLOR, new org.apache.thrift.meta_data.FieldMetaData("color", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.VENDOR_ID, new org.apache.thrift.meta_data.FieldMetaData("vendor_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("category", 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(itemExists_args.class, metaDataMap);
    }

    public itemExists_args() {
    }

    public itemExists_args(
      String productGroup,
      String brand,
      String modelNumber,
      String color,
      long vendor_id,
      String category)
    {
      this();
      this.productGroup = productGroup;
      this.brand = brand;
      this.modelNumber = modelNumber;
      this.color = color;
      this.vendor_id = vendor_id;
      setVendor_idIsSet(true);
      this.category = category;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public itemExists_args(itemExists_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetProductGroup()) {
        this.productGroup = other.productGroup;
      }
      if (other.isSetBrand()) {
        this.brand = other.brand;
      }
      if (other.isSetModelNumber()) {
        this.modelNumber = other.modelNumber;
      }
      if (other.isSetColor()) {
        this.color = other.color;
      }
      this.vendor_id = other.vendor_id;
      if (other.isSetCategory()) {
        this.category = other.category;
      }
    }

    public itemExists_args deepCopy() {
      return new itemExists_args(this);
    }

    @Override
    public void clear() {
      this.productGroup = null;
      this.brand = null;
      this.modelNumber = null;
      this.color = null;
      setVendor_idIsSet(false);
      this.vendor_id = 0;
      this.category = null;
    }

    public String getProductGroup() {
      return this.productGroup;
    }

    public void setProductGroup(String productGroup) {
      this.productGroup = productGroup;
    }

    public void unsetProductGroup() {
      this.productGroup = null;
    }

    /** Returns true if field productGroup is set (has been assigned a value) and false otherwise */
    public boolean isSetProductGroup() {
      return this.productGroup != null;
    }

    public void setProductGroupIsSet(boolean value) {
      if (!value) {
        this.productGroup = null;
      }
    }

    public String getBrand() {
      return this.brand;
    }

    public void setBrand(String brand) {
      this.brand = brand;
    }

    public void unsetBrand() {
      this.brand = null;
    }

    /** Returns true if field brand is set (has been assigned a value) and false otherwise */
    public boolean isSetBrand() {
      return this.brand != null;
    }

    public void setBrandIsSet(boolean value) {
      if (!value) {
        this.brand = null;
      }
    }

    public String getModelNumber() {
      return this.modelNumber;
    }

    public void setModelNumber(String modelNumber) {
      this.modelNumber = modelNumber;
    }

    public void unsetModelNumber() {
      this.modelNumber = null;
    }

    /** Returns true if field modelNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetModelNumber() {
      return this.modelNumber != null;
    }

    public void setModelNumberIsSet(boolean value) {
      if (!value) {
        this.modelNumber = null;
      }
    }

    public String getColor() {
      return this.color;
    }

    public void setColor(String color) {
      this.color = color;
    }

    public void unsetColor() {
      this.color = null;
    }

    /** Returns true if field color is set (has been assigned a value) and false otherwise */
    public boolean isSetColor() {
      return this.color != null;
    }

    public void setColorIsSet(boolean value) {
      if (!value) {
        this.color = null;
      }
    }

    public long getVendor_id() {
      return this.vendor_id;
    }

    public void setVendor_id(long vendor_id) {
      this.vendor_id = vendor_id;
      setVendor_idIsSet(true);
    }

    public void unsetVendor_id() {
      __isset_bit_vector.clear(__VENDOR_ID_ISSET_ID);
    }

    /** Returns true if field vendor_id is set (has been assigned a value) and false otherwise */
    public boolean isSetVendor_id() {
      return __isset_bit_vector.get(__VENDOR_ID_ISSET_ID);
    }

    public void setVendor_idIsSet(boolean value) {
      __isset_bit_vector.set(__VENDOR_ID_ISSET_ID, value);
    }

    public String getCategory() {
      return this.category;
    }

    public void setCategory(String category) {
      this.category = category;
    }

    public void unsetCategory() {
      this.category = null;
    }

    /** Returns true if field category is set (has been assigned a value) and false otherwise */
    public boolean isSetCategory() {
      return this.category != null;
    }

    public void setCategoryIsSet(boolean value) {
      if (!value) {
        this.category = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PRODUCT_GROUP:
        if (value == null) {
          unsetProductGroup();
        } else {
          setProductGroup((String)value);
        }
        break;

      case BRAND:
        if (value == null) {
          unsetBrand();
        } else {
          setBrand((String)value);
        }
        break;

      case MODEL_NUMBER:
        if (value == null) {
          unsetModelNumber();
        } else {
          setModelNumber((String)value);
        }
        break;

      case COLOR:
        if (value == null) {
          unsetColor();
        } else {
          setColor((String)value);
        }
        break;

      case VENDOR_ID:
        if (value == null) {
          unsetVendor_id();
        } else {
          setVendor_id((Long)value);
        }
        break;

      case CATEGORY:
        if (value == null) {
          unsetCategory();
        } else {
          setCategory((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PRODUCT_GROUP:
        return getProductGroup();

      case BRAND:
        return getBrand();

      case MODEL_NUMBER:
        return getModelNumber();

      case COLOR:
        return getColor();

      case VENDOR_ID:
        return Long.valueOf(getVendor_id());

      case CATEGORY:
        return getCategory();

      }
      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 PRODUCT_GROUP:
        return isSetProductGroup();
      case BRAND:
        return isSetBrand();
      case MODEL_NUMBER:
        return isSetModelNumber();
      case COLOR:
        return isSetColor();
      case VENDOR_ID:
        return isSetVendor_id();
      case CATEGORY:
        return isSetCategory();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof itemExists_args)
        return this.equals((itemExists_args)that);
      return false;
    }

    public boolean equals(itemExists_args that) {
      if (that == null)
        return false;

      boolean this_present_productGroup = true && this.isSetProductGroup();
      boolean that_present_productGroup = true && that.isSetProductGroup();
      if (this_present_productGroup || that_present_productGroup) {
        if (!(this_present_productGroup && that_present_productGroup))
          return false;
        if (!this.productGroup.equals(that.productGroup))
          return false;
      }

      boolean this_present_brand = true && this.isSetBrand();
      boolean that_present_brand = true && that.isSetBrand();
      if (this_present_brand || that_present_brand) {
        if (!(this_present_brand && that_present_brand))
          return false;
        if (!this.brand.equals(that.brand))
          return false;
      }

      boolean this_present_modelNumber = true && this.isSetModelNumber();
      boolean that_present_modelNumber = true && that.isSetModelNumber();
      if (this_present_modelNumber || that_present_modelNumber) {
        if (!(this_present_modelNumber && that_present_modelNumber))
          return false;
        if (!this.modelNumber.equals(that.modelNumber))
          return false;
      }

      boolean this_present_color = true && this.isSetColor();
      boolean that_present_color = true && that.isSetColor();
      if (this_present_color || that_present_color) {
        if (!(this_present_color && that_present_color))
          return false;
        if (!this.color.equals(that.color))
          return false;
      }

      boolean this_present_vendor_id = true;
      boolean that_present_vendor_id = true;
      if (this_present_vendor_id || that_present_vendor_id) {
        if (!(this_present_vendor_id && that_present_vendor_id))
          return false;
        if (this.vendor_id != that.vendor_id)
          return false;
      }

      boolean this_present_category = true && this.isSetCategory();
      boolean that_present_category = true && that.isSetCategory();
      if (this_present_category || that_present_category) {
        if (!(this_present_category && that_present_category))
          return false;
        if (!this.category.equals(that.category))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(itemExists_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      itemExists_args typedOther = (itemExists_args)other;

      lastComparison = Boolean.valueOf(isSetProductGroup()).compareTo(typedOther.isSetProductGroup());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetProductGroup()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productGroup, typedOther.productGroup);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBrand()).compareTo(typedOther.isSetBrand());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBrand()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.brand, typedOther.brand);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetModelNumber()).compareTo(typedOther.isSetModelNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetModelNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelNumber, typedOther.modelNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetColor()).compareTo(typedOther.isSetColor());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetColor()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.color, typedOther.color);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetVendor_id()).compareTo(typedOther.isSetVendor_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetVendor_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vendor_id, typedOther.vendor_id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCategory()).compareTo(typedOther.isSetCategory());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCategory()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.category, typedOther.category);
        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: // PRODUCT_GROUP
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.productGroup = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // BRAND
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.brand = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // MODEL_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.modelNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // COLOR
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.color = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // VENDOR_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.vendor_id = iprot.readI64();
              setVendor_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 6: // CATEGORY
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.category = 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.productGroup != null) {
        oprot.writeFieldBegin(PRODUCT_GROUP_FIELD_DESC);
        oprot.writeString(this.productGroup);
        oprot.writeFieldEnd();
      }
      if (this.brand != null) {
        oprot.writeFieldBegin(BRAND_FIELD_DESC);
        oprot.writeString(this.brand);
        oprot.writeFieldEnd();
      }
      if (this.modelNumber != null) {
        oprot.writeFieldBegin(MODEL_NUMBER_FIELD_DESC);
        oprot.writeString(this.modelNumber);
        oprot.writeFieldEnd();
      }
      if (this.color != null) {
        oprot.writeFieldBegin(COLOR_FIELD_DESC);
        oprot.writeString(this.color);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(VENDOR_ID_FIELD_DESC);
      oprot.writeI64(this.vendor_id);
      oprot.writeFieldEnd();
      if (this.category != null) {
        oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
        oprot.writeString(this.category);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("itemExists_args(");
      boolean first = true;

      sb.append("productGroup:");
      if (this.productGroup == null) {
        sb.append("null");
      } else {
        sb.append(this.productGroup);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("brand:");
      if (this.brand == null) {
        sb.append("null");
      } else {
        sb.append(this.brand);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("modelNumber:");
      if (this.modelNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.modelNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("color:");
      if (this.color == null) {
        sb.append("null");
      } else {
        sb.append(this.color);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("vendor_id:");
      sb.append(this.vendor_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("category:");
      if (this.category == null) {
        sb.append("null");
      } else {
        sb.append(this.category);
      }
      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 itemExists_result implements org.apache.thrift.TBase<itemExists_result, itemExists_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("itemExists_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(itemExists_result.class, metaDataMap);
    }

    public itemExists_result() {
    }

    public itemExists_result(
      boolean success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public itemExists_result(itemExists_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
    }

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

    public boolean equals(itemExists_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(itemExists_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      itemExists_result typedOther = (itemExists_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("itemExists_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 addVendorItemMapping_args implements org.apache.thrift.TBase<addVendorItemMapping_args, addVendorItemMapping_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVendorItemMapping_args");

    private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField VENDOR_ITEM_MAPPING_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorItemMapping", org.apache.thrift.protocol.TType.STRUCT, (short)2);

    private String key; // required
    private VendorItemMapping vendorItemMapping; // 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 {
      KEY((short)1, "key"),
      VENDOR_ITEM_MAPPING((short)2, "vendorItemMapping");

      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: // KEY
            return KEY;
          case 2: // VENDOR_ITEM_MAPPING
            return VENDOR_ITEM_MAPPING;
          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.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.VENDOR_ITEM_MAPPING, new org.apache.thrift.meta_data.FieldMetaData("vendorItemMapping", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, VendorItemMapping.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVendorItemMapping_args.class, metaDataMap);
    }

    public addVendorItemMapping_args() {
    }

    public addVendorItemMapping_args(
      String key,
      VendorItemMapping vendorItemMapping)
    {
      this();
      this.key = key;
      this.vendorItemMapping = vendorItemMapping;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addVendorItemMapping_args(addVendorItemMapping_args other) {
      if (other.isSetKey()) {
        this.key = other.key;
      }
      if (other.isSetVendorItemMapping()) {
        this.vendorItemMapping = new VendorItemMapping(other.vendorItemMapping);
      }
    }

    public addVendorItemMapping_args deepCopy() {
      return new addVendorItemMapping_args(this);
    }

    @Override
    public void clear() {
      this.key = null;
      this.vendorItemMapping = null;
    }

    public String getKey() {
      return this.key;
    }

    public void setKey(String key) {
      this.key = key;
    }

    public void unsetKey() {
      this.key = null;
    }

    /** Returns true if field key is set (has been assigned a value) and false otherwise */
    public boolean isSetKey() {
      return this.key != null;
    }

    public void setKeyIsSet(boolean value) {
      if (!value) {
        this.key = null;
      }
    }

    public VendorItemMapping getVendorItemMapping() {
      return this.vendorItemMapping;
    }

    public void setVendorItemMapping(VendorItemMapping vendorItemMapping) {
      this.vendorItemMapping = vendorItemMapping;
    }

    public void unsetVendorItemMapping() {
      this.vendorItemMapping = null;
    }

    /** Returns true if field vendorItemMapping is set (has been assigned a value) and false otherwise */
    public boolean isSetVendorItemMapping() {
      return this.vendorItemMapping != null;
    }

    public void setVendorItemMappingIsSet(boolean value) {
      if (!value) {
        this.vendorItemMapping = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case KEY:
        if (value == null) {
          unsetKey();
        } else {
          setKey((String)value);
        }
        break;

      case VENDOR_ITEM_MAPPING:
        if (value == null) {
          unsetVendorItemMapping();
        } else {
          setVendorItemMapping((VendorItemMapping)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case KEY:
        return getKey();

      case VENDOR_ITEM_MAPPING:
        return getVendorItemMapping();

      }
      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 KEY:
        return isSetKey();
      case VENDOR_ITEM_MAPPING:
        return isSetVendorItemMapping();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addVendorItemMapping_args)
        return this.equals((addVendorItemMapping_args)that);
      return false;
    }

    public boolean equals(addVendorItemMapping_args that) {
      if (that == null)
        return false;

      boolean this_present_key = true && this.isSetKey();
      boolean that_present_key = true && that.isSetKey();
      if (this_present_key || that_present_key) {
        if (!(this_present_key && that_present_key))
          return false;
        if (!this.key.equals(that.key))
          return false;
      }

      boolean this_present_vendorItemMapping = true && this.isSetVendorItemMapping();
      boolean that_present_vendorItemMapping = true && that.isSetVendorItemMapping();
      if (this_present_vendorItemMapping || that_present_vendorItemMapping) {
        if (!(this_present_vendorItemMapping && that_present_vendorItemMapping))
          return false;
        if (!this.vendorItemMapping.equals(that.vendorItemMapping))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addVendorItemMapping_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addVendorItemMapping_args typedOther = (addVendorItemMapping_args)other;

      lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetKey()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetVendorItemMapping()).compareTo(typedOther.isSetVendorItemMapping());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetVendorItemMapping()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vendorItemMapping, typedOther.vendorItemMapping);
        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: // KEY
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.key = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // VENDOR_ITEM_MAPPING
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.vendorItemMapping = new VendorItemMapping();
              this.vendorItemMapping.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.key != null) {
        oprot.writeFieldBegin(KEY_FIELD_DESC);
        oprot.writeString(this.key);
        oprot.writeFieldEnd();
      }
      if (this.vendorItemMapping != null) {
        oprot.writeFieldBegin(VENDOR_ITEM_MAPPING_FIELD_DESC);
        this.vendorItemMapping.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addVendorItemMapping_args(");
      boolean first = true;

      sb.append("key:");
      if (this.key == null) {
        sb.append("null");
      } else {
        sb.append(this.key);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("vendorItemMapping:");
      if (this.vendorItemMapping == null) {
        sb.append("null");
      } else {
        sb.append(this.vendorItemMapping);
      }
      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 addVendorItemMapping_result implements org.apache.thrift.TBase<addVendorItemMapping_result, addVendorItemMapping_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVendorItemMapping_result");

    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryServiceException cex; // 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 {
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(addVendorItemMapping_result.class, metaDataMap);
    }

    public addVendorItemMapping_result() {
    }

    public addVendorItemMapping_result(
      InventoryServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addVendorItemMapping_result(addVendorItemMapping_result other) {
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public addVendorItemMapping_result deepCopy() {
      return new addVendorItemMapping_result(this);
    }

    @Override
    public void clear() {
      this.cex = null;
    }

    public InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addVendorItemMapping_result)
        return this.equals((addVendorItemMapping_result)that);
      return false;
    }

    public boolean equals(addVendorItemMapping_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addVendorItemMapping_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addVendorItemMapping_result typedOther = (addVendorItemMapping_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addVendorItemMapping_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getVendorItemMappings_args implements org.apache.thrift.TBase<getVendorItemMappings_args, getVendorItemMappings_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getVendorItemMappings_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(getVendorItemMappings_args.class, metaDataMap);
    }

    public getVendorItemMappings_args() {
    }

    public getVendorItemMappings_args(
      long itemId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getVendorItemMappings_args(getVendorItemMappings_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
    }

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

    public boolean equals(getVendorItemMappings_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(getVendorItemMappings_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getVendorItemMappings_args typedOther = (getVendorItemMappings_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("getVendorItemMappings_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 {
        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 getVendorItemMappings_result implements org.apache.thrift.TBase<getVendorItemMappings_result, getVendorItemMappings_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getVendorItemMappings_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<VendorItemMapping> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, VendorItemMapping.class))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getVendorItemMappings_result.class, metaDataMap);
    }

    public getVendorItemMappings_result() {
    }

    public getVendorItemMappings_result(
      List<VendorItemMapping> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getVendorItemMappings_result(getVendorItemMappings_result other) {
      if (other.isSetSuccess()) {
        List<VendorItemMapping> __this__success = new ArrayList<VendorItemMapping>();
        for (VendorItemMapping other_element : other.success) {
          __this__success.add(new VendorItemMapping(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getVendorItemMappings_result deepCopy() {
      return new getVendorItemMappings_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<VendorItemMapping> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(VendorItemMapping elem) {
      if (this.success == null) {
        this.success = new ArrayList<VendorItemMapping>();
      }
      this.success.add(elem);
    }

    public List<VendorItemMapping> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<VendorItemMapping> 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<VendorItemMapping>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getVendorItemMappings_result)
        return this.equals((getVendorItemMappings_result)that);
      return false;
    }

    public boolean equals(getVendorItemMappings_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getVendorItemMappings_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getVendorItemMappings_result typedOther = (getVendorItemMappings_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list92 = iprot.readListBegin();
                this.success = new ArrayList<VendorItemMapping>(_list92.size);
                for (int _i93 = 0; _i93 < _list92.size; ++_i93)
                {
                  VendorItemMapping _elem94; // required
                  _elem94 = new VendorItemMapping();
                  _elem94.read(iprot);
                  this.success.add(_elem94);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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 (VendorItemMapping _iter95 : this.success)
          {
            _iter95.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getVendorItemMappings_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 checkSimilarItem_args implements org.apache.thrift.TBase<checkSimilarItem_args, checkSimilarItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkSimilarItem_args");

    private static final org.apache.thrift.protocol.TField PRODUCT_GROUP_FIELD_DESC = new org.apache.thrift.protocol.TField("productGroup", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField BRAND_FIELD_DESC = new org.apache.thrift.protocol.TField("brand", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField MODEL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("modelNumber", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField COLOR_FIELD_DESC = new org.apache.thrift.protocol.TField("color", org.apache.thrift.protocol.TType.STRING, (short)4);

    private String productGroup; // required
    private String brand; // required
    private String modelNumber; // required
    private String color; // 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 {
      PRODUCT_GROUP((short)1, "productGroup"),
      BRAND((short)2, "brand"),
      MODEL_NUMBER((short)3, "modelNumber"),
      COLOR((short)4, "color");

      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: // PRODUCT_GROUP
            return PRODUCT_GROUP;
          case 2: // BRAND
            return BRAND;
          case 3: // MODEL_NUMBER
            return MODEL_NUMBER;
          case 4: // COLOR
            return COLOR;
          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.PRODUCT_GROUP, new org.apache.thrift.meta_data.FieldMetaData("productGroup", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.BRAND, new org.apache.thrift.meta_data.FieldMetaData("brand", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.MODEL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("modelNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.COLOR, new org.apache.thrift.meta_data.FieldMetaData("color", 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(checkSimilarItem_args.class, metaDataMap);
    }

    public checkSimilarItem_args() {
    }

    public checkSimilarItem_args(
      String productGroup,
      String brand,
      String modelNumber,
      String color)
    {
      this();
      this.productGroup = productGroup;
      this.brand = brand;
      this.modelNumber = modelNumber;
      this.color = color;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public checkSimilarItem_args(checkSimilarItem_args other) {
      if (other.isSetProductGroup()) {
        this.productGroup = other.productGroup;
      }
      if (other.isSetBrand()) {
        this.brand = other.brand;
      }
      if (other.isSetModelNumber()) {
        this.modelNumber = other.modelNumber;
      }
      if (other.isSetColor()) {
        this.color = other.color;
      }
    }

    public checkSimilarItem_args deepCopy() {
      return new checkSimilarItem_args(this);
    }

    @Override
    public void clear() {
      this.productGroup = null;
      this.brand = null;
      this.modelNumber = null;
      this.color = null;
    }

    public String getProductGroup() {
      return this.productGroup;
    }

    public void setProductGroup(String productGroup) {
      this.productGroup = productGroup;
    }

    public void unsetProductGroup() {
      this.productGroup = null;
    }

    /** Returns true if field productGroup is set (has been assigned a value) and false otherwise */
    public boolean isSetProductGroup() {
      return this.productGroup != null;
    }

    public void setProductGroupIsSet(boolean value) {
      if (!value) {
        this.productGroup = null;
      }
    }

    public String getBrand() {
      return this.brand;
    }

    public void setBrand(String brand) {
      this.brand = brand;
    }

    public void unsetBrand() {
      this.brand = null;
    }

    /** Returns true if field brand is set (has been assigned a value) and false otherwise */
    public boolean isSetBrand() {
      return this.brand != null;
    }

    public void setBrandIsSet(boolean value) {
      if (!value) {
        this.brand = null;
      }
    }

    public String getModelNumber() {
      return this.modelNumber;
    }

    public void setModelNumber(String modelNumber) {
      this.modelNumber = modelNumber;
    }

    public void unsetModelNumber() {
      this.modelNumber = null;
    }

    /** Returns true if field modelNumber is set (has been assigned a value) and false otherwise */
    public boolean isSetModelNumber() {
      return this.modelNumber != null;
    }

    public void setModelNumberIsSet(boolean value) {
      if (!value) {
        this.modelNumber = null;
      }
    }

    public String getColor() {
      return this.color;
    }

    public void setColor(String color) {
      this.color = color;
    }

    public void unsetColor() {
      this.color = null;
    }

    /** Returns true if field color is set (has been assigned a value) and false otherwise */
    public boolean isSetColor() {
      return this.color != null;
    }

    public void setColorIsSet(boolean value) {
      if (!value) {
        this.color = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PRODUCT_GROUP:
        if (value == null) {
          unsetProductGroup();
        } else {
          setProductGroup((String)value);
        }
        break;

      case BRAND:
        if (value == null) {
          unsetBrand();
        } else {
          setBrand((String)value);
        }
        break;

      case MODEL_NUMBER:
        if (value == null) {
          unsetModelNumber();
        } else {
          setModelNumber((String)value);
        }
        break;

      case COLOR:
        if (value == null) {
          unsetColor();
        } else {
          setColor((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PRODUCT_GROUP:
        return getProductGroup();

      case BRAND:
        return getBrand();

      case MODEL_NUMBER:
        return getModelNumber();

      case COLOR:
        return getColor();

      }
      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 PRODUCT_GROUP:
        return isSetProductGroup();
      case BRAND:
        return isSetBrand();
      case MODEL_NUMBER:
        return isSetModelNumber();
      case COLOR:
        return isSetColor();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof checkSimilarItem_args)
        return this.equals((checkSimilarItem_args)that);
      return false;
    }

    public boolean equals(checkSimilarItem_args that) {
      if (that == null)
        return false;

      boolean this_present_productGroup = true && this.isSetProductGroup();
      boolean that_present_productGroup = true && that.isSetProductGroup();
      if (this_present_productGroup || that_present_productGroup) {
        if (!(this_present_productGroup && that_present_productGroup))
          return false;
        if (!this.productGroup.equals(that.productGroup))
          return false;
      }

      boolean this_present_brand = true && this.isSetBrand();
      boolean that_present_brand = true && that.isSetBrand();
      if (this_present_brand || that_present_brand) {
        if (!(this_present_brand && that_present_brand))
          return false;
        if (!this.brand.equals(that.brand))
          return false;
      }

      boolean this_present_modelNumber = true && this.isSetModelNumber();
      boolean that_present_modelNumber = true && that.isSetModelNumber();
      if (this_present_modelNumber || that_present_modelNumber) {
        if (!(this_present_modelNumber && that_present_modelNumber))
          return false;
        if (!this.modelNumber.equals(that.modelNumber))
          return false;
      }

      boolean this_present_color = true && this.isSetColor();
      boolean that_present_color = true && that.isSetColor();
      if (this_present_color || that_present_color) {
        if (!(this_present_color && that_present_color))
          return false;
        if (!this.color.equals(that.color))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(checkSimilarItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      checkSimilarItem_args typedOther = (checkSimilarItem_args)other;

      lastComparison = Boolean.valueOf(isSetProductGroup()).compareTo(typedOther.isSetProductGroup());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetProductGroup()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productGroup, typedOther.productGroup);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetBrand()).compareTo(typedOther.isSetBrand());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBrand()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.brand, typedOther.brand);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetModelNumber()).compareTo(typedOther.isSetModelNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetModelNumber()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelNumber, typedOther.modelNumber);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetColor()).compareTo(typedOther.isSetColor());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetColor()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.color, typedOther.color);
        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: // PRODUCT_GROUP
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.productGroup = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // BRAND
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.brand = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // MODEL_NUMBER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.modelNumber = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // COLOR
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.color = 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.productGroup != null) {
        oprot.writeFieldBegin(PRODUCT_GROUP_FIELD_DESC);
        oprot.writeString(this.productGroup);
        oprot.writeFieldEnd();
      }
      if (this.brand != null) {
        oprot.writeFieldBegin(BRAND_FIELD_DESC);
        oprot.writeString(this.brand);
        oprot.writeFieldEnd();
      }
      if (this.modelNumber != null) {
        oprot.writeFieldBegin(MODEL_NUMBER_FIELD_DESC);
        oprot.writeString(this.modelNumber);
        oprot.writeFieldEnd();
      }
      if (this.color != null) {
        oprot.writeFieldBegin(COLOR_FIELD_DESC);
        oprot.writeString(this.color);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("checkSimilarItem_args(");
      boolean first = true;

      sb.append("productGroup:");
      if (this.productGroup == null) {
        sb.append("null");
      } else {
        sb.append(this.productGroup);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("brand:");
      if (this.brand == null) {
        sb.append("null");
      } else {
        sb.append(this.brand);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("modelNumber:");
      if (this.modelNumber == null) {
        sb.append("null");
      } else {
        sb.append(this.modelNumber);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("color:");
      if (this.color == null) {
        sb.append("null");
      } else {
        sb.append(this.color);
      }
      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 checkSimilarItem_result implements org.apache.thrift.TBase<checkSimilarItem_result, checkSimilarItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkSimilarItem_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 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
    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)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkSimilarItem_result.class, metaDataMap);
    }

    public checkSimilarItem_result() {
    }

    public checkSimilarItem_result(
      long success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public checkSimilarItem_result(checkSimilarItem_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
    }

    public checkSimilarItem_result deepCopy() {
      return new checkSimilarItem_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
    }

    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 void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(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 checkSimilarItem_result)
        return this.equals((checkSimilarItem_result)that);
      return false;
    }

    public boolean equals(checkSimilarItem_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(checkSimilarItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      checkSimilarItem_result typedOther = (checkSimilarItem_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.I64) {
              this.success = iprot.readI64();
              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.writeI64(this.success);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("checkSimilarItem_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 changeItemRiskyFlag_args implements org.apache.thrift.TBase<changeItemRiskyFlag_args, changeItemRiskyFlag_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("changeItemRiskyFlag_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 RISKY_FIELD_DESC = new org.apache.thrift.protocol.TField("risky", org.apache.thrift.protocol.TType.BOOL, (short)2);

    private long itemId; // required
    private boolean risky; // 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"),
      RISKY((short)2, "risky");

      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: // RISKY
            return RISKY;
          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 __RISKY_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.RISKY, new org.apache.thrift.meta_data.FieldMetaData("risky", 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(changeItemRiskyFlag_args.class, metaDataMap);
    }

    public changeItemRiskyFlag_args() {
    }

    public changeItemRiskyFlag_args(
      long itemId,
      boolean risky)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.risky = risky;
      setRiskyIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeItemRiskyFlag_args(changeItemRiskyFlag_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      this.risky = other.risky;
    }

    public changeItemRiskyFlag_args deepCopy() {
      return new changeItemRiskyFlag_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      setRiskyIsSet(false);
      this.risky = false;
    }

    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 boolean isRisky() {
      return this.risky;
    }

    public void setRisky(boolean risky) {
      this.risky = risky;
      setRiskyIsSet(true);
    }

    public void unsetRisky() {
      __isset_bit_vector.clear(__RISKY_ISSET_ID);
    }

    /** Returns true if field risky is set (has been assigned a value) and false otherwise */
    public boolean isSetRisky() {
      return __isset_bit_vector.get(__RISKY_ISSET_ID);
    }

    public void setRiskyIsSet(boolean value) {
      __isset_bit_vector.set(__RISKY_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 RISKY:
        if (value == null) {
          unsetRisky();
        } else {
          setRisky((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case RISKY:
        return Boolean.valueOf(isRisky());

      }
      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 RISKY:
        return isSetRisky();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof changeItemRiskyFlag_args)
        return this.equals((changeItemRiskyFlag_args)that);
      return false;
    }

    public boolean equals(changeItemRiskyFlag_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_risky = true;
      boolean that_present_risky = true;
      if (this_present_risky || that_present_risky) {
        if (!(this_present_risky && that_present_risky))
          return false;
        if (this.risky != that.risky)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(changeItemRiskyFlag_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      changeItemRiskyFlag_args typedOther = (changeItemRiskyFlag_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(isSetRisky()).compareTo(typedOther.isSetRisky());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRisky()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.risky, typedOther.risky);
        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: // RISKY
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.risky = iprot.readBool();
              setRiskyIsSet(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(RISKY_FIELD_DESC);
      oprot.writeBool(this.risky);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("changeItemRiskyFlag_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("risky:");
      sb.append(this.risky);
      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 changeItemRiskyFlag_result implements org.apache.thrift.TBase<changeItemRiskyFlag_result, changeItemRiskyFlag_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("changeItemRiskyFlag_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(changeItemRiskyFlag_result.class, metaDataMap);
    }

    public changeItemRiskyFlag_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeItemRiskyFlag_result(changeItemRiskyFlag_result other) {
    }

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

    public boolean equals(changeItemRiskyFlag_result that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(changeItemRiskyFlag_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      changeItemRiskyFlag_result typedOther = (changeItemRiskyFlag_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("changeItemRiskyFlag_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 getItemsByRiskyFlag_args implements org.apache.thrift.TBase<getItemsByRiskyFlag_args, getItemsByRiskyFlag_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsByRiskyFlag_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(getItemsByRiskyFlag_args.class, metaDataMap);
    }

    public getItemsByRiskyFlag_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsByRiskyFlag_args(getItemsByRiskyFlag_args other) {
    }

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

    public boolean equals(getItemsByRiskyFlag_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemsByRiskyFlag_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsByRiskyFlag_args typedOther = (getItemsByRiskyFlag_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("getItemsByRiskyFlag_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 getItemsByRiskyFlag_result implements org.apache.thrift.TBase<getItemsByRiskyFlag_result, getItemsByRiskyFlag_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsByRiskyFlag_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<Item> 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, Item.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemsByRiskyFlag_result.class, metaDataMap);
    }

    public getItemsByRiskyFlag_result() {
    }

    public getItemsByRiskyFlag_result(
      List<Item> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsByRiskyFlag_result(getItemsByRiskyFlag_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
    }

    public getItemsByRiskyFlag_result deepCopy() {
      return new getItemsByRiskyFlag_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Item> 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<Item>)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 getItemsByRiskyFlag_result)
        return this.equals((getItemsByRiskyFlag_result)that);
      return false;
    }

    public boolean equals(getItemsByRiskyFlag_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(getItemsByRiskyFlag_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsByRiskyFlag_result typedOther = (getItemsByRiskyFlag_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 _list96 = iprot.readListBegin();
                this.success = new ArrayList<Item>(_list96.size);
                for (int _i97 = 0; _i97 < _list96.size; ++_i97)
                {
                  Item _elem98; // required
                  _elem98 = new Item();
                  _elem98.read(iprot);
                  this.success.add(_elem98);
                }
                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 (Item _iter99 : this.success)
          {
            _iter99.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemsByRiskyFlag_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 getItemsByVendorCategory_args implements org.apache.thrift.TBase<getItemsByVendorCategory_args, getItemsByVendorCategory_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsByVendorCategory_args");

    private static final org.apache.thrift.protocol.TField VENDOR_CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorCategory", org.apache.thrift.protocol.TType.STRING, (short)1);

    private String vendorCategory; // 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 {
      VENDOR_CATEGORY((short)1, "vendorCategory");

      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: // VENDOR_CATEGORY
            return VENDOR_CATEGORY;
          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.VENDOR_CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("vendorCategory", 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(getItemsByVendorCategory_args.class, metaDataMap);
    }

    public getItemsByVendorCategory_args() {
    }

    public getItemsByVendorCategory_args(
      String vendorCategory)
    {
      this();
      this.vendorCategory = vendorCategory;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsByVendorCategory_args(getItemsByVendorCategory_args other) {
      if (other.isSetVendorCategory()) {
        this.vendorCategory = other.vendorCategory;
      }
    }

    public getItemsByVendorCategory_args deepCopy() {
      return new getItemsByVendorCategory_args(this);
    }

    @Override
    public void clear() {
      this.vendorCategory = null;
    }

    public String getVendorCategory() {
      return this.vendorCategory;
    }

    public void setVendorCategory(String vendorCategory) {
      this.vendorCategory = vendorCategory;
    }

    public void unsetVendorCategory() {
      this.vendorCategory = null;
    }

    /** Returns true if field vendorCategory is set (has been assigned a value) and false otherwise */
    public boolean isSetVendorCategory() {
      return this.vendorCategory != null;
    }

    public void setVendorCategoryIsSet(boolean value) {
      if (!value) {
        this.vendorCategory = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case VENDOR_CATEGORY:
        if (value == null) {
          unsetVendorCategory();
        } else {
          setVendorCategory((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case VENDOR_CATEGORY:
        return getVendorCategory();

      }
      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 VENDOR_CATEGORY:
        return isSetVendorCategory();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemsByVendorCategory_args)
        return this.equals((getItemsByVendorCategory_args)that);
      return false;
    }

    public boolean equals(getItemsByVendorCategory_args that) {
      if (that == null)
        return false;

      boolean this_present_vendorCategory = true && this.isSetVendorCategory();
      boolean that_present_vendorCategory = true && that.isSetVendorCategory();
      if (this_present_vendorCategory || that_present_vendorCategory) {
        if (!(this_present_vendorCategory && that_present_vendorCategory))
          return false;
        if (!this.vendorCategory.equals(that.vendorCategory))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemsByVendorCategory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsByVendorCategory_args typedOther = (getItemsByVendorCategory_args)other;

      lastComparison = Boolean.valueOf(isSetVendorCategory()).compareTo(typedOther.isSetVendorCategory());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetVendorCategory()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vendorCategory, typedOther.vendorCategory);
        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: // VENDOR_CATEGORY
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.vendorCategory = 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.vendorCategory != null) {
        oprot.writeFieldBegin(VENDOR_CATEGORY_FIELD_DESC);
        oprot.writeString(this.vendorCategory);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemsByVendorCategory_args(");
      boolean first = true;

      sb.append("vendorCategory:");
      if (this.vendorCategory == null) {
        sb.append("null");
      } else {
        sb.append(this.vendorCategory);
      }
      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 getItemsByVendorCategory_result implements org.apache.thrift.TBase<getItemsByVendorCategory_result, getItemsByVendorCategory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemsByVendorCategory_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<Item> 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, Item.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemsByVendorCategory_result.class, metaDataMap);
    }

    public getItemsByVendorCategory_result() {
    }

    public getItemsByVendorCategory_result(
      List<Item> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemsByVendorCategory_result(getItemsByVendorCategory_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
    }

    public getItemsByVendorCategory_result deepCopy() {
      return new getItemsByVendorCategory_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Item> 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<Item>)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 getItemsByVendorCategory_result)
        return this.equals((getItemsByVendorCategory_result)that);
      return false;
    }

    public boolean equals(getItemsByVendorCategory_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(getItemsByVendorCategory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemsByVendorCategory_result typedOther = (getItemsByVendorCategory_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 _list100 = iprot.readListBegin();
                this.success = new ArrayList<Item>(_list100.size);
                for (int _i101 = 0; _i101 < _list100.size; ++_i101)
                {
                  Item _elem102; // required
                  _elem102 = new Item();
                  _elem102.read(iprot);
                  this.success.add(_elem102);
                }
                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 (Item _iter103 : this.success)
          {
            _iter103.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemsByVendorCategory_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 getSimilarItemsCatalogIds_args implements org.apache.thrift.TBase<getSimilarItemsCatalogIds_args, getSimilarItemsCatalogIds_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSimilarItemsCatalogIds_args");

    private static final org.apache.thrift.protocol.TField BEGIN_INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("beginIndex", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOTAL_ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("totalItems", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)3);

    private long beginIndex; // required
    private long totalItems; // 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 {
      BEGIN_INDEX((short)1, "beginIndex"),
      TOTAL_ITEMS((short)2, "totalItems"),
      ITEM_ID((short)3, "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: // BEGIN_INDEX
            return BEGIN_INDEX;
          case 2: // TOTAL_ITEMS
            return TOTAL_ITEMS;
          case 3: // 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 __BEGININDEX_ISSET_ID = 0;
    private static final int __TOTALITEMS_ISSET_ID = 1;
    private static final int __ITEMID_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.BEGIN_INDEX, new org.apache.thrift.meta_data.FieldMetaData("beginIndex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOTAL_ITEMS, new org.apache.thrift.meta_data.FieldMetaData("totalItems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      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(getSimilarItemsCatalogIds_args.class, metaDataMap);
    }

    public getSimilarItemsCatalogIds_args() {
    }

    public getSimilarItemsCatalogIds_args(
      long beginIndex,
      long totalItems,
      long itemId)
    {
      this();
      this.beginIndex = beginIndex;
      setBeginIndexIsSet(true);
      this.totalItems = totalItems;
      setTotalItemsIsSet(true);
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getSimilarItemsCatalogIds_args(getSimilarItemsCatalogIds_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.beginIndex = other.beginIndex;
      this.totalItems = other.totalItems;
      this.itemId = other.itemId;
    }

    public getSimilarItemsCatalogIds_args deepCopy() {
      return new getSimilarItemsCatalogIds_args(this);
    }

    @Override
    public void clear() {
      setBeginIndexIsSet(false);
      this.beginIndex = 0;
      setTotalItemsIsSet(false);
      this.totalItems = 0;
      setItemIdIsSet(false);
      this.itemId = 0;
    }

    public long getBeginIndex() {
      return this.beginIndex;
    }

    public void setBeginIndex(long beginIndex) {
      this.beginIndex = beginIndex;
      setBeginIndexIsSet(true);
    }

    public void unsetBeginIndex() {
      __isset_bit_vector.clear(__BEGININDEX_ISSET_ID);
    }

    /** Returns true if field beginIndex is set (has been assigned a value) and false otherwise */
    public boolean isSetBeginIndex() {
      return __isset_bit_vector.get(__BEGININDEX_ISSET_ID);
    }

    public void setBeginIndexIsSet(boolean value) {
      __isset_bit_vector.set(__BEGININDEX_ISSET_ID, value);
    }

    public long getTotalItems() {
      return this.totalItems;
    }

    public void setTotalItems(long totalItems) {
      this.totalItems = totalItems;
      setTotalItemsIsSet(true);
    }

    public void unsetTotalItems() {
      __isset_bit_vector.clear(__TOTALITEMS_ISSET_ID);
    }

    /** Returns true if field totalItems is set (has been assigned a value) and false otherwise */
    public boolean isSetTotalItems() {
      return __isset_bit_vector.get(__TOTALITEMS_ISSET_ID);
    }

    public void setTotalItemsIsSet(boolean value) {
      __isset_bit_vector.set(__TOTALITEMS_ISSET_ID, value);
    }

    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 BEGIN_INDEX:
        if (value == null) {
          unsetBeginIndex();
        } else {
          setBeginIndex((Long)value);
        }
        break;

      case TOTAL_ITEMS:
        if (value == null) {
          unsetTotalItems();
        } else {
          setTotalItems((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BEGIN_INDEX:
        return Long.valueOf(getBeginIndex());

      case TOTAL_ITEMS:
        return Long.valueOf(getTotalItems());

      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 BEGIN_INDEX:
        return isSetBeginIndex();
      case TOTAL_ITEMS:
        return isSetTotalItems();
      case ITEM_ID:
        return isSetItemId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getSimilarItemsCatalogIds_args)
        return this.equals((getSimilarItemsCatalogIds_args)that);
      return false;
    }

    public boolean equals(getSimilarItemsCatalogIds_args that) {
      if (that == null)
        return false;

      boolean this_present_beginIndex = true;
      boolean that_present_beginIndex = true;
      if (this_present_beginIndex || that_present_beginIndex) {
        if (!(this_present_beginIndex && that_present_beginIndex))
          return false;
        if (this.beginIndex != that.beginIndex)
          return false;
      }

      boolean this_present_totalItems = true;
      boolean that_present_totalItems = true;
      if (this_present_totalItems || that_present_totalItems) {
        if (!(this_present_totalItems && that_present_totalItems))
          return false;
        if (this.totalItems != that.totalItems)
          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(getSimilarItemsCatalogIds_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getSimilarItemsCatalogIds_args typedOther = (getSimilarItemsCatalogIds_args)other;

      lastComparison = Boolean.valueOf(isSetBeginIndex()).compareTo(typedOther.isSetBeginIndex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBeginIndex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.beginIndex, typedOther.beginIndex);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTotalItems()).compareTo(typedOther.isSetTotalItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTotalItems()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalItems, typedOther.totalItems);
        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: // BEGIN_INDEX
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.beginIndex = iprot.readI64();
              setBeginIndexIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TOTAL_ITEMS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.totalItems = iprot.readI64();
              setTotalItemsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // ITEM_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.itemId = iprot.readI64();
              setItemIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          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(BEGIN_INDEX_FIELD_DESC);
      oprot.writeI64(this.beginIndex);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TOTAL_ITEMS_FIELD_DESC);
      oprot.writeI64(this.totalItems);
      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("getSimilarItemsCatalogIds_args(");
      boolean first = true;

      sb.append("beginIndex:");
      sb.append(this.beginIndex);
      first = false;
      if (!first) sb.append(", ");
      sb.append("totalItems:");
      sb.append(this.totalItems);
      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 {
        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 getSimilarItemsCatalogIds_result implements org.apache.thrift.TBase<getSimilarItemsCatalogIds_result, getSimilarItemsCatalogIds_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSimilarItemsCatalogIds_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(getSimilarItemsCatalogIds_result.class, metaDataMap);
    }

    public getSimilarItemsCatalogIds_result() {
    }

    public getSimilarItemsCatalogIds_result(
      List<Long> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getSimilarItemsCatalogIds_result(getSimilarItemsCatalogIds_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 getSimilarItemsCatalogIds_result deepCopy() {
      return new getSimilarItemsCatalogIds_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 getSimilarItemsCatalogIds_result)
        return this.equals((getSimilarItemsCatalogIds_result)that);
      return false;
    }

    public boolean equals(getSimilarItemsCatalogIds_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(getSimilarItemsCatalogIds_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getSimilarItemsCatalogIds_result typedOther = (getSimilarItemsCatalogIds_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 _list104 = iprot.readListBegin();
                this.success = new ArrayList<Long>(_list104.size);
                for (int _i105 = 0; _i105 < _list104.size; ++_i105)
                {
                  long _elem106; // required
                  _elem106 = iprot.readI64();
                  this.success.add(_elem106);
                }
                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 _iter107 : this.success)
          {
            oprot.writeI64(_iter107);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getSimilarItemsCatalogIds_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 addProductNotification_args implements org.apache.thrift.TBase<addProductNotification_args, addProductNotification_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addProductNotification_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 EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("email", org.apache.thrift.protocol.TType.STRING, (short)-2);

    private long itemId; // required
    private String email; // 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"),
      EMAIL((short)-2, "email");

      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: // EMAIL
            return EMAIL;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEMID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", 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(addProductNotification_args.class, metaDataMap);
    }

    public addProductNotification_args() {
    }

    public addProductNotification_args(
      long itemId,
      String email)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.email = email;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addProductNotification_args(addProductNotification_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      if (other.isSetEmail()) {
        this.email = other.email;
      }
    }

    public addProductNotification_args deepCopy() {
      return new addProductNotification_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      this.email = 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 String getEmail() {
      return this.email;
    }

    public void setEmail(String email) {
      this.email = email;
    }

    public void unsetEmail() {
      this.email = null;
    }

    /** Returns true if field email is set (has been assigned a value) and false otherwise */
    public boolean isSetEmail() {
      return this.email != null;
    }

    public void setEmailIsSet(boolean value) {
      if (!value) {
        this.email = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case EMAIL:
        if (value == null) {
          unsetEmail();
        } else {
          setEmail((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case EMAIL:
        return getEmail();

      }
      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 EMAIL:
        return isSetEmail();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addProductNotification_args)
        return this.equals((addProductNotification_args)that);
      return false;
    }

    public boolean equals(addProductNotification_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_email = true && this.isSetEmail();
      boolean that_present_email = true && that.isSetEmail();
      if (this_present_email || that_present_email) {
        if (!(this_present_email && that_present_email))
          return false;
        if (!this.email.equals(that.email))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addProductNotification_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addProductNotification_args typedOther = (addProductNotification_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(isSetEmail()).compareTo(typedOther.isSetEmail());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEmail()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
        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: // EMAIL
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.email = 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.email != null) {
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
        oprot.writeString(this.email);
        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("addProductNotification_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("email:");
      if (this.email == null) {
        sb.append("null");
      } else {
        sb.append(this.email);
      }
      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 addProductNotification_result implements org.apache.thrift.TBase<addProductNotification_result, addProductNotification_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addProductNotification_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(addProductNotification_result.class, metaDataMap);
    }

    public addProductNotification_result() {
    }

    public addProductNotification_result(
      boolean success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addProductNotification_result(addProductNotification_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
    }

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

    public boolean equals(addProductNotification_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(addProductNotification_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addProductNotification_result typedOther = (addProductNotification_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("addProductNotification_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 sendProductNotifications_args implements org.apache.thrift.TBase<sendProductNotifications_args, sendProductNotifications_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendProductNotifications_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(sendProductNotifications_args.class, metaDataMap);
    }

    public sendProductNotifications_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public sendProductNotifications_args(sendProductNotifications_args other) {
    }

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

    public boolean equals(sendProductNotifications_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(sendProductNotifications_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      sendProductNotifications_args typedOther = (sendProductNotifications_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("sendProductNotifications_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 sendProductNotifications_result implements org.apache.thrift.TBase<sendProductNotifications_result, sendProductNotifications_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendProductNotifications_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(sendProductNotifications_result.class, metaDataMap);
    }

    public sendProductNotifications_result() {
    }

    public sendProductNotifications_result(
      boolean success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public sendProductNotifications_result(sendProductNotifications_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
    }

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

    public boolean equals(sendProductNotifications_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(sendProductNotifications_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      sendProductNotifications_result typedOther = (sendProductNotifications_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("sendProductNotifications_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 getAllBrandsByCategory_args implements org.apache.thrift.TBase<getAllBrandsByCategory_args, getAllBrandsByCategory_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllBrandsByCategory_args");

    private static final org.apache.thrift.protocol.TField CATEGORY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("categoryId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long categoryId; // 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 {
      CATEGORY_ID((short)1, "categoryId");

      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: // CATEGORY_ID
            return CATEGORY_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 __CATEGORYID_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.CATEGORY_ID, new org.apache.thrift.meta_data.FieldMetaData("categoryId", 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(getAllBrandsByCategory_args.class, metaDataMap);
    }

    public getAllBrandsByCategory_args() {
    }

    public getAllBrandsByCategory_args(
      long categoryId)
    {
      this();
      this.categoryId = categoryId;
      setCategoryIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllBrandsByCategory_args(getAllBrandsByCategory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.categoryId = other.categoryId;
    }

    public getAllBrandsByCategory_args deepCopy() {
      return new getAllBrandsByCategory_args(this);
    }

    @Override
    public void clear() {
      setCategoryIdIsSet(false);
      this.categoryId = 0;
    }

    public long getCategoryId() {
      return this.categoryId;
    }

    public void setCategoryId(long categoryId) {
      this.categoryId = categoryId;
      setCategoryIdIsSet(true);
    }

    public void unsetCategoryId() {
      __isset_bit_vector.clear(__CATEGORYID_ISSET_ID);
    }

    /** Returns true if field categoryId is set (has been assigned a value) and false otherwise */
    public boolean isSetCategoryId() {
      return __isset_bit_vector.get(__CATEGORYID_ISSET_ID);
    }

    public void setCategoryIdIsSet(boolean value) {
      __isset_bit_vector.set(__CATEGORYID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CATEGORY_ID:
        if (value == null) {
          unsetCategoryId();
        } else {
          setCategoryId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CATEGORY_ID:
        return Long.valueOf(getCategoryId());

      }
      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 CATEGORY_ID:
        return isSetCategoryId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllBrandsByCategory_args)
        return this.equals((getAllBrandsByCategory_args)that);
      return false;
    }

    public boolean equals(getAllBrandsByCategory_args that) {
      if (that == null)
        return false;

      boolean this_present_categoryId = true;
      boolean that_present_categoryId = true;
      if (this_present_categoryId || that_present_categoryId) {
        if (!(this_present_categoryId && that_present_categoryId))
          return false;
        if (this.categoryId != that.categoryId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllBrandsByCategory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllBrandsByCategory_args typedOther = (getAllBrandsByCategory_args)other;

      lastComparison = Boolean.valueOf(isSetCategoryId()).compareTo(typedOther.isSetCategoryId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCategoryId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.categoryId, typedOther.categoryId);
        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: // CATEGORY_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.categoryId = iprot.readI64();
              setCategoryIdIsSet(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(CATEGORY_ID_FIELD_DESC);
      oprot.writeI64(this.categoryId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllBrandsByCategory_args(");
      boolean first = true;

      sb.append("categoryId:");
      sb.append(this.categoryId);
      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 getAllBrandsByCategory_result implements org.apache.thrift.TBase<getAllBrandsByCategory_result, getAllBrandsByCategory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllBrandsByCategory_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(getAllBrandsByCategory_result.class, metaDataMap);
    }

    public getAllBrandsByCategory_result() {
    }

    public getAllBrandsByCategory_result(
      List<String> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllBrandsByCategory_result(getAllBrandsByCategory_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 getAllBrandsByCategory_result deepCopy() {
      return new getAllBrandsByCategory_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 getAllBrandsByCategory_result)
        return this.equals((getAllBrandsByCategory_result)that);
      return false;
    }

    public boolean equals(getAllBrandsByCategory_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(getAllBrandsByCategory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllBrandsByCategory_result typedOther = (getAllBrandsByCategory_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 _list108 = iprot.readListBegin();
                this.success = new ArrayList<String>(_list108.size);
                for (int _i109 = 0; _i109 < _list108.size; ++_i109)
                {
                  String _elem110; // required
                  _elem110 = iprot.readString();
                  this.success.add(_elem110);
                }
                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 _iter111 : this.success)
          {
            oprot.writeString(_iter111);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllBrandsByCategory_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 getAllSources_args implements org.apache.thrift.TBase<getAllSources_args, getAllSources_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSources_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(getAllSources_args.class, metaDataMap);
    }

    public getAllSources_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllSources_args(getAllSources_args other) {
    }

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

    public boolean equals(getAllSources_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllSources_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllSources_args typedOther = (getAllSources_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("getAllSources_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 getAllSources_result implements org.apache.thrift.TBase<getAllSources_result, getAllSources_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSources_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<Source> 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, Source.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllSources_result.class, metaDataMap);
    }

    public getAllSources_result() {
    }

    public getAllSources_result(
      List<Source> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllSources_result(getAllSources_result other) {
      if (other.isSetSuccess()) {
        List<Source> __this__success = new ArrayList<Source>();
        for (Source other_element : other.success) {
          __this__success.add(new Source(other_element));
        }
        this.success = __this__success;
      }
    }

    public getAllSources_result deepCopy() {
      return new getAllSources_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Source> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Source elem) {
      if (this.success == null) {
        this.success = new ArrayList<Source>();
      }
      this.success.add(elem);
    }

    public List<Source> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Source> 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<Source>)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 getAllSources_result)
        return this.equals((getAllSources_result)that);
      return false;
    }

    public boolean equals(getAllSources_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(getAllSources_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllSources_result typedOther = (getAllSources_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 _list112 = iprot.readListBegin();
                this.success = new ArrayList<Source>(_list112.size);
                for (int _i113 = 0; _i113 < _list112.size; ++_i113)
                {
                  Source _elem114; // required
                  _elem114 = new Source();
                  _elem114.read(iprot);
                  this.success.add(_elem114);
                }
                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 (Source _iter115 : this.success)
          {
            _iter115.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllSources_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 getItemPricingBySource_args implements org.apache.thrift.TBase<getItemPricingBySource_args, getItemPricingBySource_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemPricingBySource_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 SOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sourceId", org.apache.thrift.protocol.TType.I64, (short)2);

    private long itemId; // required
    private long sourceId; // 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"),
      SOURCE_ID((short)2, "sourceId");

      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: // SOURCE_ID
            return SOURCE_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 __SOURCEID_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.SOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("sourceId", 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(getItemPricingBySource_args.class, metaDataMap);
    }

    public getItemPricingBySource_args() {
    }

    public getItemPricingBySource_args(
      long itemId,
      long sourceId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.sourceId = sourceId;
      setSourceIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemPricingBySource_args(getItemPricingBySource_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
      this.sourceId = other.sourceId;
    }

    public getItemPricingBySource_args deepCopy() {
      return new getItemPricingBySource_args(this);
    }

    @Override
    public void clear() {
      setItemIdIsSet(false);
      this.itemId = 0;
      setSourceIdIsSet(false);
      this.sourceId = 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 getSourceId() {
      return this.sourceId;
    }

    public void setSourceId(long sourceId) {
      this.sourceId = sourceId;
      setSourceIdIsSet(true);
    }

    public void unsetSourceId() {
      __isset_bit_vector.clear(__SOURCEID_ISSET_ID);
    }

    /** Returns true if field sourceId is set (has been assigned a value) and false otherwise */
    public boolean isSetSourceId() {
      return __isset_bit_vector.get(__SOURCEID_ISSET_ID);
    }

    public void setSourceIdIsSet(boolean value) {
      __isset_bit_vector.set(__SOURCEID_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 SOURCE_ID:
        if (value == null) {
          unsetSourceId();
        } else {
          setSourceId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItemId());

      case SOURCE_ID:
        return Long.valueOf(getSourceId());

      }
      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 SOURCE_ID:
        return isSetSourceId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemPricingBySource_args)
        return this.equals((getItemPricingBySource_args)that);
      return false;
    }

    public boolean equals(getItemPricingBySource_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_sourceId = true;
      boolean that_present_sourceId = true;
      if (this_present_sourceId || that_present_sourceId) {
        if (!(this_present_sourceId && that_present_sourceId))
          return false;
        if (this.sourceId != that.sourceId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemPricingBySource_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemPricingBySource_args typedOther = (getItemPricingBySource_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(isSetSourceId()).compareTo(typedOther.isSetSourceId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSourceId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sourceId, typedOther.sourceId);
        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: // SOURCE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.sourceId = iprot.readI64();
              setSourceIdIsSet(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(SOURCE_ID_FIELD_DESC);
      oprot.writeI64(this.sourceId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemPricingBySource_args(");
      boolean first = true;

      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("sourceId:");
      sb.append(this.sourceId);
      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 getItemPricingBySource_result implements org.apache.thrift.TBase<getItemPricingBySource_result, getItemPricingBySource_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemPricingBySource_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private SourceItemPricing success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, SourceItemPricing.class)));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getItemPricingBySource_result.class, metaDataMap);
    }

    public getItemPricingBySource_result() {
    }

    public getItemPricingBySource_result(
      SourceItemPricing success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemPricingBySource_result(getItemPricingBySource_result other) {
      if (other.isSetSuccess()) {
        this.success = new SourceItemPricing(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getItemPricingBySource_result deepCopy() {
      return new getItemPricingBySource_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public SourceItemPricing getSuccess() {
      return this.success;
    }

    public void setSuccess(SourceItemPricing 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((SourceItemPricing)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemPricingBySource_result)
        return this.equals((getItemPricingBySource_result)that);
      return false;
    }

    public boolean equals(getItemPricingBySource_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemPricingBySource_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemPricingBySource_result typedOther = (getItemPricingBySource_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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 SourceItemPricing();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemPricingBySource_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 addSourceItemPricing_args implements org.apache.thrift.TBase<addSourceItemPricing_args, addSourceItemPricing_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addSourceItemPricing_args");

    private static final org.apache.thrift.protocol.TField SOURCE_ITEM_PRICING_FIELD_DESC = new org.apache.thrift.protocol.TField("sourceItemPricing", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private SourceItemPricing sourceItemPricing; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SOURCE_ITEM_PRICING((short)1, "sourceItemPricing");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SOURCE_ITEM_PRICING
            return SOURCE_ITEM_PRICING;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SOURCE_ITEM_PRICING, new org.apache.thrift.meta_data.FieldMetaData("sourceItemPricing", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SourceItemPricing.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addSourceItemPricing_args.class, metaDataMap);
    }

    public addSourceItemPricing_args() {
    }

    public addSourceItemPricing_args(
      SourceItemPricing sourceItemPricing)
    {
      this();
      this.sourceItemPricing = sourceItemPricing;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addSourceItemPricing_args(addSourceItemPricing_args other) {
      if (other.isSetSourceItemPricing()) {
        this.sourceItemPricing = new SourceItemPricing(other.sourceItemPricing);
      }
    }

    public addSourceItemPricing_args deepCopy() {
      return new addSourceItemPricing_args(this);
    }

    @Override
    public void clear() {
      this.sourceItemPricing = null;
    }

    public SourceItemPricing getSourceItemPricing() {
      return this.sourceItemPricing;
    }

    public void setSourceItemPricing(SourceItemPricing sourceItemPricing) {
      this.sourceItemPricing = sourceItemPricing;
    }

    public void unsetSourceItemPricing() {
      this.sourceItemPricing = null;
    }

    /** Returns true if field sourceItemPricing is set (has been assigned a value) and false otherwise */
    public boolean isSetSourceItemPricing() {
      return this.sourceItemPricing != null;
    }

    public void setSourceItemPricingIsSet(boolean value) {
      if (!value) {
        this.sourceItemPricing = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SOURCE_ITEM_PRICING:
        if (value == null) {
          unsetSourceItemPricing();
        } else {
          setSourceItemPricing((SourceItemPricing)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SOURCE_ITEM_PRICING:
        return getSourceItemPricing();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SOURCE_ITEM_PRICING:
        return isSetSourceItemPricing();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addSourceItemPricing_args)
        return this.equals((addSourceItemPricing_args)that);
      return false;
    }

    public boolean equals(addSourceItemPricing_args that) {
      if (that == null)
        return false;

      boolean this_present_sourceItemPricing = true && this.isSetSourceItemPricing();
      boolean that_present_sourceItemPricing = true && that.isSetSourceItemPricing();
      if (this_present_sourceItemPricing || that_present_sourceItemPricing) {
        if (!(this_present_sourceItemPricing && that_present_sourceItemPricing))
          return false;
        if (!this.sourceItemPricing.equals(that.sourceItemPricing))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addSourceItemPricing_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addSourceItemPricing_args typedOther = (addSourceItemPricing_args)other;

      lastComparison = Boolean.valueOf(isSetSourceItemPricing()).compareTo(typedOther.isSetSourceItemPricing());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSourceItemPricing()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sourceItemPricing, typedOther.sourceItemPricing);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SOURCE_ITEM_PRICING
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.sourceItemPricing = new SourceItemPricing();
              this.sourceItemPricing.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.sourceItemPricing != null) {
        oprot.writeFieldBegin(SOURCE_ITEM_PRICING_FIELD_DESC);
        this.sourceItemPricing.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addSourceItemPricing_args(");
      boolean first = true;

      sb.append("sourceItemPricing:");
      if (this.sourceItemPricing == null) {
        sb.append("null");
      } else {
        sb.append(this.sourceItemPricing);
      }
      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 addSourceItemPricing_result implements org.apache.thrift.TBase<addSourceItemPricing_result, addSourceItemPricing_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addSourceItemPricing_result");

    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private InventoryServiceException cex; // 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 {
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(addSourceItemPricing_result.class, metaDataMap);
    }

    public addSourceItemPricing_result() {
    }

    public addSourceItemPricing_result(
      InventoryServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addSourceItemPricing_result(addSourceItemPricing_result other) {
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public addSourceItemPricing_result deepCopy() {
      return new addSourceItemPricing_result(this);
    }

    @Override
    public void clear() {
      this.cex = null;
    }

    public InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addSourceItemPricing_result)
        return this.equals((addSourceItemPricing_result)that);
      return false;
    }

    public boolean equals(addSourceItemPricing_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addSourceItemPricing_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addSourceItemPricing_result typedOther = (addSourceItemPricing_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addSourceItemPricing_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getAllSourcePricing_args implements org.apache.thrift.TBase<getAllSourcePricing_args, getAllSourcePricing_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSourcePricing_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(getAllSourcePricing_args.class, metaDataMap);
    }

    public getAllSourcePricing_args() {
    }

    public getAllSourcePricing_args(
      long itemId)
    {
      this();
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllSourcePricing_args(getAllSourcePricing_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.itemId = other.itemId;
    }

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

    public boolean equals(getAllSourcePricing_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(getAllSourcePricing_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllSourcePricing_args typedOther = (getAllSourcePricing_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("getAllSourcePricing_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 {
        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 getAllSourcePricing_result implements org.apache.thrift.TBase<getAllSourcePricing_result, getAllSourcePricing_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSourcePricing_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<SourceItemPricing> success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, SourceItemPricing.class))));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getAllSourcePricing_result.class, metaDataMap);
    }

    public getAllSourcePricing_result() {
    }

    public getAllSourcePricing_result(
      List<SourceItemPricing> success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllSourcePricing_result(getAllSourcePricing_result other) {
      if (other.isSetSuccess()) {
        List<SourceItemPricing> __this__success = new ArrayList<SourceItemPricing>();
        for (SourceItemPricing other_element : other.success) {
          __this__success.add(new SourceItemPricing(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getAllSourcePricing_result deepCopy() {
      return new getAllSourcePricing_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<SourceItemPricing> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(SourceItemPricing elem) {
      if (this.success == null) {
        this.success = new ArrayList<SourceItemPricing>();
      }
      this.success.add(elem);
    }

    public List<SourceItemPricing> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<SourceItemPricing> 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<SourceItemPricing>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllSourcePricing_result)
        return this.equals((getAllSourcePricing_result)that);
      return false;
    }

    public boolean equals(getAllSourcePricing_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllSourcePricing_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllSourcePricing_result typedOther = (getAllSourcePricing_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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 _list116 = iprot.readListBegin();
                this.success = new ArrayList<SourceItemPricing>(_list116.size);
                for (int _i117 = 0; _i117 < _list116.size; ++_i117)
                {
                  SourceItemPricing _elem118; // required
                  _elem118 = new SourceItemPricing();
                  _elem118.read(iprot);
                  this.success.add(_elem118);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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 (SourceItemPricing _iter119 : this.success)
          {
            _iter119.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllSourcePricing_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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 getItemForSource_args implements org.apache.thrift.TBase<getItemForSource_args, getItemForSource_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemForSource_args");

    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sourceId", org.apache.thrift.protocol.TType.I64, (short)2);

    private long item_id; // required
    private long sourceId; // 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, "item_id"),
      SOURCE_ID((short)2, "sourceId");

      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: // SOURCE_ID
            return SOURCE_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 __ITEM_ID_ISSET_ID = 0;
    private static final int __SOURCEID_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("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("sourceId", 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(getItemForSource_args.class, metaDataMap);
    }

    public getItemForSource_args() {
    }

    public getItemForSource_args(
      long item_id,
      long sourceId)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.sourceId = sourceId;
      setSourceIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemForSource_args(getItemForSource_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      this.sourceId = other.sourceId;
    }

    public getItemForSource_args deepCopy() {
      return new getItemForSource_args(this);
    }

    @Override
    public void clear() {
      setItem_idIsSet(false);
      this.item_id = 0;
      setSourceIdIsSet(false);
      this.sourceId = 0;
    }

    public long getItem_id() {
      return this.item_id;
    }

    public void setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getSourceId() {
      return this.sourceId;
    }

    public void setSourceId(long sourceId) {
      this.sourceId = sourceId;
      setSourceIdIsSet(true);
    }

    public void unsetSourceId() {
      __isset_bit_vector.clear(__SOURCEID_ISSET_ID);
    }

    /** Returns true if field sourceId is set (has been assigned a value) and false otherwise */
    public boolean isSetSourceId() {
      return __isset_bit_vector.get(__SOURCEID_ISSET_ID);
    }

    public void setSourceIdIsSet(boolean value) {
      __isset_bit_vector.set(__SOURCEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case SOURCE_ID:
        if (value == null) {
          unsetSourceId();
        } else {
          setSourceId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return Long.valueOf(getItem_id());

      case SOURCE_ID:
        return Long.valueOf(getSourceId());

      }
      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 isSetItem_id();
      case SOURCE_ID:
        return isSetSourceId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemForSource_args)
        return this.equals((getItemForSource_args)that);
      return false;
    }

    public boolean equals(getItemForSource_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_sourceId = true;
      boolean that_present_sourceId = true;
      if (this_present_sourceId || that_present_sourceId) {
        if (!(this_present_sourceId && that_present_sourceId))
          return false;
        if (this.sourceId != that.sourceId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemForSource_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemForSource_args typedOther = (getItemForSource_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetItem_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSourceId()).compareTo(typedOther.isSetSourceId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSourceId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sourceId, typedOther.sourceId);
        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.item_id = iprot.readI64();
              setItem_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // SOURCE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.sourceId = iprot.readI64();
              setSourceIdIsSet(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.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(SOURCE_ID_FIELD_DESC);
      oprot.writeI64(this.sourceId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemForSource_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("sourceId:");
      sb.append(this.sourceId);
      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 getItemForSource_result implements org.apache.thrift.TBase<getItemForSource_result, getItemForSource_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemForSource_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 CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Item success; // required
    private InventoryServiceException cex; // 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"),
      CEX((short)1, "cex");

      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: // CEX
            return CEX;
          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, Item.class)));
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", 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(getItemForSource_result.class, metaDataMap);
    }

    public getItemForSource_result() {
    }

    public getItemForSource_result(
      Item success,
      InventoryServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemForSource_result(getItemForSource_result other) {
      if (other.isSetSuccess()) {
        this.success = new Item(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new InventoryServiceException(other.cex);
      }
    }

    public getItemForSource_result deepCopy() {
      return new getItemForSource_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cex = null;
    }

    public Item getSuccess() {
      return this.success;
    }

    public void setSuccess(Item 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 InventoryServiceException getCex() {
      return this.cex;
    }

    public void setCex(InventoryServiceException cex) {
      this.cex = cex;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Item)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((InventoryServiceException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      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 CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemForSource_result)
        return this.equals((getItemForSource_result)that);
      return false;
    }

    public boolean equals(getItemForSource_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_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemForSource_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemForSource_result typedOther = (getItemForSource_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(isSetCex()).compareTo(typedOther.isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCex()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
        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 Item();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // CEX
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.cex = new InventoryServiceException();
              this.cex.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.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemForSource_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("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      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);
      }
    }

  }

}