Subversion Repositories SmartDukaan

Rev

Rev 1731 | Rev 2383 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.model.v1.order;

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.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;

public class TransactionService {

  public interface Iface {

    /**
     * For closing the open session in sqlalchemy
     */
    public void closeSession() throws TException;

    public long createTransaction(Transaction transaction) throws TransactionServiceException, TException;

    public Transaction getTransaction(long id) throws TransactionServiceException, TException;

    public List<Transaction> getTransactionsForCustomer(long customerId, long from_date, long to_date, TransactionStatus status) throws TransactionServiceException, TException;

    public List<Transaction> getTransactionsForShoppingCartId(long shoppingCartId) throws TransactionServiceException, TException;

    public TransactionStatus getTransactionStatus(long transactionId) throws TransactionServiceException, TException;

    public boolean changeTransactionStatus(long transactionId, TransactionStatus status, String description) throws TransactionServiceException, TException;

    public boolean enqueueTransactionInfoEmail(long transactionId) throws TransactionServiceException, TException;

    public List<Order> getAllOrders(OrderStatus status, long from_date, long to_date, long warehouse_id) throws TransactionServiceException, TException;

    /**
     * Returns orders within a range of their billing dates
     * 
     * @param status
     * @param start_billing_date
     * @param end_billing_date
     * @param warehouse_id
     */
    public List<Order> getOrdersByBillingDate(OrderStatus status, long start_billing_date, long end_billing_date, long warehouse_id) throws TransactionServiceException, TException;

    /**
     * Returns order ids for orders which can be returned
     * 
     * @param customer_id
     * @param limit
     */
    public List<Long> getReturnableOrdersForCustomer(long customer_id, long limit) throws TransactionServiceException, TException;

    /**
     * Returns order ids for orders which can be cancelled
     * 
     * @param customer_id
     * @param limit
     */
    public List<Long> getCancellableOrdersForCustomer(long customer_id, long limit) throws TransactionServiceException, TException;

    public boolean changeOrderStatus(long orderId, OrderStatus status, String description) throws TransactionServiceException, TException;

    /**
     * Add billing details such as the bill number and the biller to the Order.
     * 
     * @param orderId
     * @param invoice_number
     * @param billed_by
     */
    public boolean addBillingDetails(long orderId, String invoice_number, String billed_by) throws TransactionServiceException, TException;

    /**
     * Adds jacket number to the order. Return false if it doesn't find the order with the given ID.
     * 
     * @param orderId
     * @param jacketNumber
     */
    public boolean addJacketNumber(long orderId, long jacketNumber) throws TransactionServiceException, TException;

    public boolean acceptOrder(long orderId) throws TransactionServiceException, TException;

    public boolean billOrder(long orderId) throws TransactionServiceException, TException;

    /**
     * Returns list of orders for given transaction Id. Also filters based on customer Id so that
     * only user who owns the transaction can view its order details.
     * 
     * @param transactionId
     * @param customerId
     */
    public List<Order> getOrdersForTransaction(long transactionId, long customerId) throws TransactionServiceException, TException;

    public List<Order> getOrdersForCustomer(long customerId, long from_date, long to_date, OrderStatus status) throws TransactionServiceException, TException;

    public long createOrder(Order order) throws TransactionServiceException, TException;

    public Order getOrder(long id) throws TransactionServiceException, TException;

    public List<LineItem> getLineItemsForOrder(long orderId) throws TransactionServiceException, TException;

    /**
     * Returns an order for the order Id. Also checks if the order belongs to the customer whose Id is passed.
     * Throws exception if either order Id is invalid or order does not below to the customer whose Id is passed.
     * 
     * @param orderId
     * @param customerId
     */
    public Order getOrderForCustomer(long orderId, long customerId) throws TransactionServiceException, TException;

    /**
     * Create a batch of all the pending orders for the given warehouse.
     * The returned list is orderd by created_timestamp.
     * If there are no pending orders, an empty list is returned.
     * 
     * @param warehouseId
     */
    public List<Order> batchOrders(long warehouseId) throws TransactionServiceException, TException;

    /**
     * Mark the given order as out of stock. Throws an exception if the order with the given Id couldn't be found.
     * 
     * @param orderId
     */
    public boolean markOrderAsOutOfStock(long orderId) throws TransactionServiceException, TException;

    /**
     * Marks all BILLED orders for a warehouse and a provider as SHIPPED_FROM_WH
     * 
     * @param warehouseId
     * @param providerId
     */
    public boolean markOrdersAsManifested(long warehouseId, long providerId) throws TransactionServiceException, TException;

    /**
     * Marks all SHIPPED_FROM_WH orders of the previous day for a provider as SHIPPED_TO_LOGISTICS.
     * Returns a list of orders that were shipped from warehouse but did not appear in the pick-up report.
     * Raises an exception if we encounter report for an AWB number that we did not ship.
     * 
     * @param providerId
     * @param pickupDetails
     */
    public List<Order> markOrdersAsPickedUp(long providerId, Map<String,String> pickupDetails) throws TransactionServiceException, TException;

    /**
     * Marks all orders with AWBs in the given map as delivered. Also sets the delivery timestamp and
     * the name of the receiver.
     * Raises an exception if we encounter report for an AWB number that we did not ship.
     * 
     * @param providerId
     * @param deliveredOrders
     */
    public void markOrdersAsDelivered(long providerId, Map<String,String> deliveredOrders) throws TransactionServiceException, TException;

    /**
     * Mark all orders with AWBs in the given map as failed. Also sets the delivery timestamp.
     * Raises an exception if we encounter report for an AWB number that we did not ship.
     * 
     * @param providerId
     * @param returnedOrders
     */
    public void markOrdersAsFailed(long providerId, Map<String,String> returnedOrders) throws TransactionServiceException, TException;

    /**
     * Update the status description of orders whose AWB numbers are keys of the Map.
     * 
     * @param providerId
     * @param undeliveredOrders
     */
    public void updateNonDeliveryReason(long providerId, Map<String,String> undeliveredOrders) throws TransactionServiceException, TException;

    /**
     * Returns the list of orders whose delivery time has passed but have not been
     * delivered yet for the given provider and warehouse. To get a complete list of
     * undelivered orders, pass them as -1.
     * Returns an empty list if no such orders exist.
     * 
     * @param providerId
     * @param warehouseId
     */
    public List<Order> getUndeliveredOrders(long providerId, long warehouseId) throws TException;

    public List<Alert> getAlerts(long orderId, boolean valid) throws TException;

    public void setAlert(long orderId, boolean unset, long type, String comment) throws TException;

    /**
     * Return the number of valid orders. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
     */
    public long getValidOrderCount() throws TException;

    /**
     * Returns the number of distinct customers who have done successful transactions
     */
    public long getNoOfCustomersWithSuccessfulTransaction() throws TException;

    /**
     * Returns the minimum and maximum amounts of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
     * List contains two values, first minimum amount and second maximum amount.
     */
    public List<Double> getValidOrdersAmountRange() throws TException;

    /**
     * Returns list of Orders in descending order by Order creation date. List is restricted to limit Orders.
     * If limit is passed as 0, then all valid Orders are returned.
     * 
     * @param limit
     */
    public List<Order> getValidOrders(long limit) throws TException;

  }

  public static class Client implements Iface {
    public Client(TProtocol prot)
    {
      this(prot, prot);
    }

    public Client(TProtocol iprot, TProtocol oprot)
    {
      iprot_ = iprot;
      oprot_ = oprot;
    }

    protected TProtocol iprot_;
    protected TProtocol oprot_;

    protected int seqid_;

    public TProtocol getInputProtocol()
    {
      return this.iprot_;
    }

    public TProtocol getOutputProtocol()
    {
      return this.oprot_;
    }

    public void closeSession() throws TException
    {
      send_closeSession();
      recv_closeSession();
    }

    public void send_closeSession() throws TException
    {
      oprot_.writeMessageBegin(new TMessage("closeSession", TMessageType.CALL, seqid_));
      closeSession_args args = new closeSession_args();
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_closeSession() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      closeSession_result result = new closeSession_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      return;
    }

    public long createTransaction(Transaction transaction) throws TransactionServiceException, TException
    {
      send_createTransaction(transaction);
      return recv_createTransaction();
    }

    public void send_createTransaction(Transaction transaction) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("createTransaction", TMessageType.CALL, seqid_));
      createTransaction_args args = new createTransaction_args();
      args.transaction = transaction;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_createTransaction() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      createTransaction_result result = new createTransaction_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createTransaction failed: unknown result");
    }

    public Transaction getTransaction(long id) throws TransactionServiceException, TException
    {
      send_getTransaction(id);
      return recv_getTransaction();
    }

    public void send_getTransaction(long id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getTransaction", TMessageType.CALL, seqid_));
      getTransaction_args args = new getTransaction_args();
      args.id = id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Transaction recv_getTransaction() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getTransaction_result result = new getTransaction_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTransaction failed: unknown result");
    }

    public List<Transaction> getTransactionsForCustomer(long customerId, long from_date, long to_date, TransactionStatus status) throws TransactionServiceException, TException
    {
      send_getTransactionsForCustomer(customerId, from_date, to_date, status);
      return recv_getTransactionsForCustomer();
    }

    public void send_getTransactionsForCustomer(long customerId, long from_date, long to_date, TransactionStatus status) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getTransactionsForCustomer", TMessageType.CALL, seqid_));
      getTransactionsForCustomer_args args = new getTransactionsForCustomer_args();
      args.customerId = customerId;
      args.from_date = from_date;
      args.to_date = to_date;
      args.status = status;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Transaction> recv_getTransactionsForCustomer() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getTransactionsForCustomer_result result = new getTransactionsForCustomer_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTransactionsForCustomer failed: unknown result");
    }

    public List<Transaction> getTransactionsForShoppingCartId(long shoppingCartId) throws TransactionServiceException, TException
    {
      send_getTransactionsForShoppingCartId(shoppingCartId);
      return recv_getTransactionsForShoppingCartId();
    }

    public void send_getTransactionsForShoppingCartId(long shoppingCartId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getTransactionsForShoppingCartId", TMessageType.CALL, seqid_));
      getTransactionsForShoppingCartId_args args = new getTransactionsForShoppingCartId_args();
      args.shoppingCartId = shoppingCartId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Transaction> recv_getTransactionsForShoppingCartId() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getTransactionsForShoppingCartId_result result = new getTransactionsForShoppingCartId_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTransactionsForShoppingCartId failed: unknown result");
    }

    public TransactionStatus getTransactionStatus(long transactionId) throws TransactionServiceException, TException
    {
      send_getTransactionStatus(transactionId);
      return recv_getTransactionStatus();
    }

    public void send_getTransactionStatus(long transactionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getTransactionStatus", TMessageType.CALL, seqid_));
      getTransactionStatus_args args = new getTransactionStatus_args();
      args.transactionId = transactionId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public TransactionStatus recv_getTransactionStatus() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getTransactionStatus_result result = new getTransactionStatus_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTransactionStatus failed: unknown result");
    }

    public boolean changeTransactionStatus(long transactionId, TransactionStatus status, String description) throws TransactionServiceException, TException
    {
      send_changeTransactionStatus(transactionId, status, description);
      return recv_changeTransactionStatus();
    }

    public void send_changeTransactionStatus(long transactionId, TransactionStatus status, String description) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("changeTransactionStatus", TMessageType.CALL, seqid_));
      changeTransactionStatus_args args = new changeTransactionStatus_args();
      args.transactionId = transactionId;
      args.status = status;
      args.description = description;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_changeTransactionStatus() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      changeTransactionStatus_result result = new changeTransactionStatus_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "changeTransactionStatus failed: unknown result");
    }

    public boolean enqueueTransactionInfoEmail(long transactionId) throws TransactionServiceException, TException
    {
      send_enqueueTransactionInfoEmail(transactionId);
      return recv_enqueueTransactionInfoEmail();
    }

    public void send_enqueueTransactionInfoEmail(long transactionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("enqueueTransactionInfoEmail", TMessageType.CALL, seqid_));
      enqueueTransactionInfoEmail_args args = new enqueueTransactionInfoEmail_args();
      args.transactionId = transactionId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_enqueueTransactionInfoEmail() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      enqueueTransactionInfoEmail_result result = new enqueueTransactionInfoEmail_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "enqueueTransactionInfoEmail failed: unknown result");
    }

    public List<Order> getAllOrders(OrderStatus status, long from_date, long to_date, long warehouse_id) throws TransactionServiceException, TException
    {
      send_getAllOrders(status, from_date, to_date, warehouse_id);
      return recv_getAllOrders();
    }

    public void send_getAllOrders(OrderStatus status, long from_date, long to_date, long warehouse_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllOrders", TMessageType.CALL, seqid_));
      getAllOrders_args args = new getAllOrders_args();
      args.status = status;
      args.from_date = from_date;
      args.to_date = to_date;
      args.warehouse_id = warehouse_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Order> recv_getAllOrders() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllOrders_result result = new getAllOrders_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllOrders failed: unknown result");
    }

    public List<Order> getOrdersByBillingDate(OrderStatus status, long start_billing_date, long end_billing_date, long warehouse_id) throws TransactionServiceException, TException
    {
      send_getOrdersByBillingDate(status, start_billing_date, end_billing_date, warehouse_id);
      return recv_getOrdersByBillingDate();
    }

    public void send_getOrdersByBillingDate(OrderStatus status, long start_billing_date, long end_billing_date, long warehouse_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getOrdersByBillingDate", TMessageType.CALL, seqid_));
      getOrdersByBillingDate_args args = new getOrdersByBillingDate_args();
      args.status = status;
      args.start_billing_date = start_billing_date;
      args.end_billing_date = end_billing_date;
      args.warehouse_id = warehouse_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Order> recv_getOrdersByBillingDate() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getOrdersByBillingDate_result result = new getOrdersByBillingDate_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getOrdersByBillingDate failed: unknown result");
    }

    public List<Long> getReturnableOrdersForCustomer(long customer_id, long limit) throws TransactionServiceException, TException
    {
      send_getReturnableOrdersForCustomer(customer_id, limit);
      return recv_getReturnableOrdersForCustomer();
    }

    public void send_getReturnableOrdersForCustomer(long customer_id, long limit) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getReturnableOrdersForCustomer", TMessageType.CALL, seqid_));
      getReturnableOrdersForCustomer_args args = new getReturnableOrdersForCustomer_args();
      args.customer_id = customer_id;
      args.limit = limit;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Long> recv_getReturnableOrdersForCustomer() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getReturnableOrdersForCustomer_result result = new getReturnableOrdersForCustomer_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getReturnableOrdersForCustomer failed: unknown result");
    }

    public List<Long> getCancellableOrdersForCustomer(long customer_id, long limit) throws TransactionServiceException, TException
    {
      send_getCancellableOrdersForCustomer(customer_id, limit);
      return recv_getCancellableOrdersForCustomer();
    }

    public void send_getCancellableOrdersForCustomer(long customer_id, long limit) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getCancellableOrdersForCustomer", TMessageType.CALL, seqid_));
      getCancellableOrdersForCustomer_args args = new getCancellableOrdersForCustomer_args();
      args.customer_id = customer_id;
      args.limit = limit;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Long> recv_getCancellableOrdersForCustomer() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getCancellableOrdersForCustomer_result result = new getCancellableOrdersForCustomer_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCancellableOrdersForCustomer failed: unknown result");
    }

    public boolean changeOrderStatus(long orderId, OrderStatus status, String description) throws TransactionServiceException, TException
    {
      send_changeOrderStatus(orderId, status, description);
      return recv_changeOrderStatus();
    }

    public void send_changeOrderStatus(long orderId, OrderStatus status, String description) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("changeOrderStatus", TMessageType.CALL, seqid_));
      changeOrderStatus_args args = new changeOrderStatus_args();
      args.orderId = orderId;
      args.status = status;
      args.description = description;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_changeOrderStatus() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      changeOrderStatus_result result = new changeOrderStatus_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "changeOrderStatus failed: unknown result");
    }

    public boolean addBillingDetails(long orderId, String invoice_number, String billed_by) throws TransactionServiceException, TException
    {
      send_addBillingDetails(orderId, invoice_number, billed_by);
      return recv_addBillingDetails();
    }

    public void send_addBillingDetails(long orderId, String invoice_number, String billed_by) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addBillingDetails", TMessageType.CALL, seqid_));
      addBillingDetails_args args = new addBillingDetails_args();
      args.orderId = orderId;
      args.invoice_number = invoice_number;
      args.billed_by = billed_by;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_addBillingDetails() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addBillingDetails_result result = new addBillingDetails_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addBillingDetails failed: unknown result");
    }

    public boolean addJacketNumber(long orderId, long jacketNumber) throws TransactionServiceException, TException
    {
      send_addJacketNumber(orderId, jacketNumber);
      return recv_addJacketNumber();
    }

    public void send_addJacketNumber(long orderId, long jacketNumber) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addJacketNumber", TMessageType.CALL, seqid_));
      addJacketNumber_args args = new addJacketNumber_args();
      args.orderId = orderId;
      args.jacketNumber = jacketNumber;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_addJacketNumber() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addJacketNumber_result result = new addJacketNumber_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addJacketNumber failed: unknown result");
    }

    public boolean acceptOrder(long orderId) throws TransactionServiceException, TException
    {
      send_acceptOrder(orderId);
      return recv_acceptOrder();
    }

    public void send_acceptOrder(long orderId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("acceptOrder", TMessageType.CALL, seqid_));
      acceptOrder_args args = new acceptOrder_args();
      args.orderId = orderId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_acceptOrder() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      acceptOrder_result result = new acceptOrder_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "acceptOrder failed: unknown result");
    }

    public boolean billOrder(long orderId) throws TransactionServiceException, TException
    {
      send_billOrder(orderId);
      return recv_billOrder();
    }

    public void send_billOrder(long orderId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("billOrder", TMessageType.CALL, seqid_));
      billOrder_args args = new billOrder_args();
      args.orderId = orderId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_billOrder() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      billOrder_result result = new billOrder_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "billOrder failed: unknown result");
    }

    public List<Order> getOrdersForTransaction(long transactionId, long customerId) throws TransactionServiceException, TException
    {
      send_getOrdersForTransaction(transactionId, customerId);
      return recv_getOrdersForTransaction();
    }

    public void send_getOrdersForTransaction(long transactionId, long customerId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getOrdersForTransaction", TMessageType.CALL, seqid_));
      getOrdersForTransaction_args args = new getOrdersForTransaction_args();
      args.transactionId = transactionId;
      args.customerId = customerId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Order> recv_getOrdersForTransaction() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getOrdersForTransaction_result result = new getOrdersForTransaction_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getOrdersForTransaction failed: unknown result");
    }

    public List<Order> getOrdersForCustomer(long customerId, long from_date, long to_date, OrderStatus status) throws TransactionServiceException, TException
    {
      send_getOrdersForCustomer(customerId, from_date, to_date, status);
      return recv_getOrdersForCustomer();
    }

    public void send_getOrdersForCustomer(long customerId, long from_date, long to_date, OrderStatus status) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getOrdersForCustomer", TMessageType.CALL, seqid_));
      getOrdersForCustomer_args args = new getOrdersForCustomer_args();
      args.customerId = customerId;
      args.from_date = from_date;
      args.to_date = to_date;
      args.status = status;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Order> recv_getOrdersForCustomer() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getOrdersForCustomer_result result = new getOrdersForCustomer_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getOrdersForCustomer failed: unknown result");
    }

    public long createOrder(Order order) throws TransactionServiceException, TException
    {
      send_createOrder(order);
      return recv_createOrder();
    }

    public void send_createOrder(Order order) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("createOrder", TMessageType.CALL, seqid_));
      createOrder_args args = new createOrder_args();
      args.order = order;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_createOrder() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      createOrder_result result = new createOrder_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createOrder failed: unknown result");
    }

    public Order getOrder(long id) throws TransactionServiceException, TException
    {
      send_getOrder(id);
      return recv_getOrder();
    }

    public void send_getOrder(long id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getOrder", TMessageType.CALL, seqid_));
      getOrder_args args = new getOrder_args();
      args.id = id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Order recv_getOrder() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getOrder_result result = new getOrder_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getOrder failed: unknown result");
    }

    public List<LineItem> getLineItemsForOrder(long orderId) throws TransactionServiceException, TException
    {
      send_getLineItemsForOrder(orderId);
      return recv_getLineItemsForOrder();
    }

    public void send_getLineItemsForOrder(long orderId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getLineItemsForOrder", TMessageType.CALL, seqid_));
      getLineItemsForOrder_args args = new getLineItemsForOrder_args();
      args.orderId = orderId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<LineItem> recv_getLineItemsForOrder() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getLineItemsForOrder_result result = new getLineItemsForOrder_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getLineItemsForOrder failed: unknown result");
    }

    public Order getOrderForCustomer(long orderId, long customerId) throws TransactionServiceException, TException
    {
      send_getOrderForCustomer(orderId, customerId);
      return recv_getOrderForCustomer();
    }

    public void send_getOrderForCustomer(long orderId, long customerId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getOrderForCustomer", TMessageType.CALL, seqid_));
      getOrderForCustomer_args args = new getOrderForCustomer_args();
      args.orderId = orderId;
      args.customerId = customerId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Order recv_getOrderForCustomer() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getOrderForCustomer_result result = new getOrderForCustomer_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getOrderForCustomer failed: unknown result");
    }

    public List<Order> batchOrders(long warehouseId) throws TransactionServiceException, TException
    {
      send_batchOrders(warehouseId);
      return recv_batchOrders();
    }

    public void send_batchOrders(long warehouseId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("batchOrders", TMessageType.CALL, seqid_));
      batchOrders_args args = new batchOrders_args();
      args.warehouseId = warehouseId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Order> recv_batchOrders() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      batchOrders_result result = new batchOrders_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "batchOrders failed: unknown result");
    }

    public boolean markOrderAsOutOfStock(long orderId) throws TransactionServiceException, TException
    {
      send_markOrderAsOutOfStock(orderId);
      return recv_markOrderAsOutOfStock();
    }

    public void send_markOrderAsOutOfStock(long orderId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("markOrderAsOutOfStock", TMessageType.CALL, seqid_));
      markOrderAsOutOfStock_args args = new markOrderAsOutOfStock_args();
      args.orderId = orderId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_markOrderAsOutOfStock() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      markOrderAsOutOfStock_result result = new markOrderAsOutOfStock_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "markOrderAsOutOfStock failed: unknown result");
    }

    public boolean markOrdersAsManifested(long warehouseId, long providerId) throws TransactionServiceException, TException
    {
      send_markOrdersAsManifested(warehouseId, providerId);
      return recv_markOrdersAsManifested();
    }

    public void send_markOrdersAsManifested(long warehouseId, long providerId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("markOrdersAsManifested", TMessageType.CALL, seqid_));
      markOrdersAsManifested_args args = new markOrdersAsManifested_args();
      args.warehouseId = warehouseId;
      args.providerId = providerId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_markOrdersAsManifested() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      markOrdersAsManifested_result result = new markOrdersAsManifested_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "markOrdersAsManifested failed: unknown result");
    }

    public List<Order> markOrdersAsPickedUp(long providerId, Map<String,String> pickupDetails) throws TransactionServiceException, TException
    {
      send_markOrdersAsPickedUp(providerId, pickupDetails);
      return recv_markOrdersAsPickedUp();
    }

    public void send_markOrdersAsPickedUp(long providerId, Map<String,String> pickupDetails) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("markOrdersAsPickedUp", TMessageType.CALL, seqid_));
      markOrdersAsPickedUp_args args = new markOrdersAsPickedUp_args();
      args.providerId = providerId;
      args.pickupDetails = pickupDetails;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Order> recv_markOrdersAsPickedUp() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      markOrdersAsPickedUp_result result = new markOrdersAsPickedUp_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex != null) {
        throw result.ex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "markOrdersAsPickedUp failed: unknown result");
    }

    public void markOrdersAsDelivered(long providerId, Map<String,String> deliveredOrders) throws TransactionServiceException, TException
    {
      send_markOrdersAsDelivered(providerId, deliveredOrders);
      recv_markOrdersAsDelivered();
    }

    public void send_markOrdersAsDelivered(long providerId, Map<String,String> deliveredOrders) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("markOrdersAsDelivered", TMessageType.CALL, seqid_));
      markOrdersAsDelivered_args args = new markOrdersAsDelivered_args();
      args.providerId = providerId;
      args.deliveredOrders = deliveredOrders;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_markOrdersAsDelivered() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      markOrdersAsDelivered_result result = new markOrdersAsDelivered_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.ex != null) {
        throw result.ex;
      }
      return;
    }

    public void markOrdersAsFailed(long providerId, Map<String,String> returnedOrders) throws TransactionServiceException, TException
    {
      send_markOrdersAsFailed(providerId, returnedOrders);
      recv_markOrdersAsFailed();
    }

    public void send_markOrdersAsFailed(long providerId, Map<String,String> returnedOrders) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("markOrdersAsFailed", TMessageType.CALL, seqid_));
      markOrdersAsFailed_args args = new markOrdersAsFailed_args();
      args.providerId = providerId;
      args.returnedOrders = returnedOrders;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_markOrdersAsFailed() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      markOrdersAsFailed_result result = new markOrdersAsFailed_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.ex != null) {
        throw result.ex;
      }
      return;
    }

    public void updateNonDeliveryReason(long providerId, Map<String,String> undeliveredOrders) throws TransactionServiceException, TException
    {
      send_updateNonDeliveryReason(providerId, undeliveredOrders);
      recv_updateNonDeliveryReason();
    }

    public void send_updateNonDeliveryReason(long providerId, Map<String,String> undeliveredOrders) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateNonDeliveryReason", TMessageType.CALL, seqid_));
      updateNonDeliveryReason_args args = new updateNonDeliveryReason_args();
      args.providerId = providerId;
      args.undeliveredOrders = undeliveredOrders;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_updateNonDeliveryReason() throws TransactionServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      updateNonDeliveryReason_result result = new updateNonDeliveryReason_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.ex != null) {
        throw result.ex;
      }
      return;
    }

    public List<Order> getUndeliveredOrders(long providerId, long warehouseId) throws TException
    {
      send_getUndeliveredOrders(providerId, warehouseId);
      return recv_getUndeliveredOrders();
    }

    public void send_getUndeliveredOrders(long providerId, long warehouseId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getUndeliveredOrders", TMessageType.CALL, seqid_));
      getUndeliveredOrders_args args = new getUndeliveredOrders_args();
      args.providerId = providerId;
      args.warehouseId = warehouseId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Order> recv_getUndeliveredOrders() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getUndeliveredOrders_result result = new getUndeliveredOrders_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getUndeliveredOrders failed: unknown result");
    }

    public List<Alert> getAlerts(long orderId, boolean valid) throws TException
    {
      send_getAlerts(orderId, valid);
      return recv_getAlerts();
    }

    public void send_getAlerts(long orderId, boolean valid) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAlerts", TMessageType.CALL, seqid_));
      getAlerts_args args = new getAlerts_args();
      args.orderId = orderId;
      args.valid = valid;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Alert> recv_getAlerts() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAlerts_result result = new getAlerts_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAlerts failed: unknown result");
    }

    public void setAlert(long orderId, boolean unset, long type, String comment) throws TException
    {
      send_setAlert(orderId, unset, type, comment);
      recv_setAlert();
    }

    public void send_setAlert(long orderId, boolean unset, long type, String comment) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("setAlert", TMessageType.CALL, seqid_));
      setAlert_args args = new setAlert_args();
      args.orderId = orderId;
      args.unset = unset;
      args.type = type;
      args.comment = comment;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_setAlert() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      setAlert_result result = new setAlert_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      return;
    }

    public long getValidOrderCount() throws TException
    {
      send_getValidOrderCount();
      return recv_getValidOrderCount();
    }

    public void send_getValidOrderCount() throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getValidOrderCount", TMessageType.CALL, seqid_));
      getValidOrderCount_args args = new getValidOrderCount_args();
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_getValidOrderCount() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getValidOrderCount_result result = new getValidOrderCount_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getValidOrderCount failed: unknown result");
    }

    public long getNoOfCustomersWithSuccessfulTransaction() throws TException
    {
      send_getNoOfCustomersWithSuccessfulTransaction();
      return recv_getNoOfCustomersWithSuccessfulTransaction();
    }

    public void send_getNoOfCustomersWithSuccessfulTransaction() throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getNoOfCustomersWithSuccessfulTransaction", TMessageType.CALL, seqid_));
      getNoOfCustomersWithSuccessfulTransaction_args args = new getNoOfCustomersWithSuccessfulTransaction_args();
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_getNoOfCustomersWithSuccessfulTransaction() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getNoOfCustomersWithSuccessfulTransaction_result result = new getNoOfCustomersWithSuccessfulTransaction_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getNoOfCustomersWithSuccessfulTransaction failed: unknown result");
    }

    public List<Double> getValidOrdersAmountRange() throws TException
    {
      send_getValidOrdersAmountRange();
      return recv_getValidOrdersAmountRange();
    }

    public void send_getValidOrdersAmountRange() throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getValidOrdersAmountRange", TMessageType.CALL, seqid_));
      getValidOrdersAmountRange_args args = new getValidOrdersAmountRange_args();
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Double> recv_getValidOrdersAmountRange() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getValidOrdersAmountRange_result result = new getValidOrdersAmountRange_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getValidOrdersAmountRange failed: unknown result");
    }

    public List<Order> getValidOrders(long limit) throws TException
    {
      send_getValidOrders(limit);
      return recv_getValidOrders();
    }

    public void send_getValidOrders(long limit) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getValidOrders", TMessageType.CALL, seqid_));
      getValidOrders_args args = new getValidOrders_args();
      args.limit = limit;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Order> recv_getValidOrders() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getValidOrders_result result = new getValidOrders_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getValidOrders failed: unknown result");
    }

  }
  public static class Processor implements TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(Iface iface)
    {
      iface_ = iface;
      processMap_.put("closeSession", new closeSession());
      processMap_.put("createTransaction", new createTransaction());
      processMap_.put("getTransaction", new getTransaction());
      processMap_.put("getTransactionsForCustomer", new getTransactionsForCustomer());
      processMap_.put("getTransactionsForShoppingCartId", new getTransactionsForShoppingCartId());
      processMap_.put("getTransactionStatus", new getTransactionStatus());
      processMap_.put("changeTransactionStatus", new changeTransactionStatus());
      processMap_.put("enqueueTransactionInfoEmail", new enqueueTransactionInfoEmail());
      processMap_.put("getAllOrders", new getAllOrders());
      processMap_.put("getOrdersByBillingDate", new getOrdersByBillingDate());
      processMap_.put("getReturnableOrdersForCustomer", new getReturnableOrdersForCustomer());
      processMap_.put("getCancellableOrdersForCustomer", new getCancellableOrdersForCustomer());
      processMap_.put("changeOrderStatus", new changeOrderStatus());
      processMap_.put("addBillingDetails", new addBillingDetails());
      processMap_.put("addJacketNumber", new addJacketNumber());
      processMap_.put("acceptOrder", new acceptOrder());
      processMap_.put("billOrder", new billOrder());
      processMap_.put("getOrdersForTransaction", new getOrdersForTransaction());
      processMap_.put("getOrdersForCustomer", new getOrdersForCustomer());
      processMap_.put("createOrder", new createOrder());
      processMap_.put("getOrder", new getOrder());
      processMap_.put("getLineItemsForOrder", new getLineItemsForOrder());
      processMap_.put("getOrderForCustomer", new getOrderForCustomer());
      processMap_.put("batchOrders", new batchOrders());
      processMap_.put("markOrderAsOutOfStock", new markOrderAsOutOfStock());
      processMap_.put("markOrdersAsManifested", new markOrdersAsManifested());
      processMap_.put("markOrdersAsPickedUp", new markOrdersAsPickedUp());
      processMap_.put("markOrdersAsDelivered", new markOrdersAsDelivered());
      processMap_.put("markOrdersAsFailed", new markOrdersAsFailed());
      processMap_.put("updateNonDeliveryReason", new updateNonDeliveryReason());
      processMap_.put("getUndeliveredOrders", new getUndeliveredOrders());
      processMap_.put("getAlerts", new getAlerts());
      processMap_.put("setAlert", new setAlert());
      processMap_.put("getValidOrderCount", new getValidOrderCount());
      processMap_.put("getNoOfCustomersWithSuccessfulTransaction", new getNoOfCustomersWithSuccessfulTransaction());
      processMap_.put("getValidOrdersAmountRange", new getValidOrdersAmountRange());
      processMap_.put("getValidOrders", new getValidOrders());
    }

    protected static interface ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
    }

    private Iface iface_;
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();

    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
    {
      TMessage msg = iprot.readMessageBegin();
      ProcessFunction fn = processMap_.get(msg.name);
      if (fn == null) {
        TProtocolUtil.skip(iprot, TType.STRUCT);
        iprot.readMessageEnd();
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
        x.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
        return true;
      }
      fn.process(msg.seqid, iprot, oprot);
      return true;
    }

    private class closeSession implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        closeSession_args args = new closeSession_args();
        args.read(iprot);
        iprot.readMessageEnd();
        closeSession_result result = new closeSession_result();
        iface_.closeSession();
        oprot.writeMessageBegin(new TMessage("closeSession", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class createTransaction implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        createTransaction_args args = new createTransaction_args();
        args.read(iprot);
        iprot.readMessageEnd();
        createTransaction_result result = new createTransaction_result();
        try {
          result.success = iface_.createTransaction(args.transaction);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing createTransaction", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing createTransaction");
          oprot.writeMessageBegin(new TMessage("createTransaction", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("createTransaction", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getTransaction implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getTransaction_args args = new getTransaction_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getTransaction_result result = new getTransaction_result();
        try {
          result.success = iface_.getTransaction(args.id);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getTransaction", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getTransaction");
          oprot.writeMessageBegin(new TMessage("getTransaction", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getTransaction", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getTransactionsForCustomer implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getTransactionsForCustomer_args args = new getTransactionsForCustomer_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getTransactionsForCustomer_result result = new getTransactionsForCustomer_result();
        try {
          result.success = iface_.getTransactionsForCustomer(args.customerId, args.from_date, args.to_date, args.status);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getTransactionsForCustomer", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getTransactionsForCustomer");
          oprot.writeMessageBegin(new TMessage("getTransactionsForCustomer", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getTransactionsForCustomer", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getTransactionsForShoppingCartId implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getTransactionsForShoppingCartId_args args = new getTransactionsForShoppingCartId_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getTransactionsForShoppingCartId_result result = new getTransactionsForShoppingCartId_result();
        try {
          result.success = iface_.getTransactionsForShoppingCartId(args.shoppingCartId);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getTransactionsForShoppingCartId", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getTransactionsForShoppingCartId");
          oprot.writeMessageBegin(new TMessage("getTransactionsForShoppingCartId", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getTransactionsForShoppingCartId", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getTransactionStatus implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getTransactionStatus_args args = new getTransactionStatus_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getTransactionStatus_result result = new getTransactionStatus_result();
        try {
          result.success = iface_.getTransactionStatus(args.transactionId);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getTransactionStatus", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getTransactionStatus");
          oprot.writeMessageBegin(new TMessage("getTransactionStatus", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getTransactionStatus", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class changeTransactionStatus implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        changeTransactionStatus_args args = new changeTransactionStatus_args();
        args.read(iprot);
        iprot.readMessageEnd();
        changeTransactionStatus_result result = new changeTransactionStatus_result();
        try {
          result.success = iface_.changeTransactionStatus(args.transactionId, args.status, args.description);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing changeTransactionStatus", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing changeTransactionStatus");
          oprot.writeMessageBegin(new TMessage("changeTransactionStatus", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("changeTransactionStatus", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class enqueueTransactionInfoEmail implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        enqueueTransactionInfoEmail_args args = new enqueueTransactionInfoEmail_args();
        args.read(iprot);
        iprot.readMessageEnd();
        enqueueTransactionInfoEmail_result result = new enqueueTransactionInfoEmail_result();
        try {
          result.success = iface_.enqueueTransactionInfoEmail(args.transactionId);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing enqueueTransactionInfoEmail", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing enqueueTransactionInfoEmail");
          oprot.writeMessageBegin(new TMessage("enqueueTransactionInfoEmail", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("enqueueTransactionInfoEmail", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAllOrders implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAllOrders_args args = new getAllOrders_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAllOrders_result result = new getAllOrders_result();
        try {
          result.success = iface_.getAllOrders(args.status, args.from_date, args.to_date, args.warehouse_id);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getAllOrders", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllOrders");
          oprot.writeMessageBegin(new TMessage("getAllOrders", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getAllOrders", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getOrdersByBillingDate implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getOrdersByBillingDate_args args = new getOrdersByBillingDate_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getOrdersByBillingDate_result result = new getOrdersByBillingDate_result();
        try {
          result.success = iface_.getOrdersByBillingDate(args.status, args.start_billing_date, args.end_billing_date, args.warehouse_id);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getOrdersByBillingDate", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getOrdersByBillingDate");
          oprot.writeMessageBegin(new TMessage("getOrdersByBillingDate", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getOrdersByBillingDate", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getReturnableOrdersForCustomer implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getReturnableOrdersForCustomer_args args = new getReturnableOrdersForCustomer_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getReturnableOrdersForCustomer_result result = new getReturnableOrdersForCustomer_result();
        try {
          result.success = iface_.getReturnableOrdersForCustomer(args.customer_id, args.limit);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getReturnableOrdersForCustomer", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getReturnableOrdersForCustomer");
          oprot.writeMessageBegin(new TMessage("getReturnableOrdersForCustomer", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getReturnableOrdersForCustomer", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getCancellableOrdersForCustomer implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getCancellableOrdersForCustomer_args args = new getCancellableOrdersForCustomer_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getCancellableOrdersForCustomer_result result = new getCancellableOrdersForCustomer_result();
        try {
          result.success = iface_.getCancellableOrdersForCustomer(args.customer_id, args.limit);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getCancellableOrdersForCustomer", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getCancellableOrdersForCustomer");
          oprot.writeMessageBegin(new TMessage("getCancellableOrdersForCustomer", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getCancellableOrdersForCustomer", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class changeOrderStatus implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        changeOrderStatus_args args = new changeOrderStatus_args();
        args.read(iprot);
        iprot.readMessageEnd();
        changeOrderStatus_result result = new changeOrderStatus_result();
        try {
          result.success = iface_.changeOrderStatus(args.orderId, args.status, args.description);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing changeOrderStatus", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing changeOrderStatus");
          oprot.writeMessageBegin(new TMessage("changeOrderStatus", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("changeOrderStatus", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addBillingDetails implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addBillingDetails_args args = new addBillingDetails_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addBillingDetails_result result = new addBillingDetails_result();
        try {
          result.success = iface_.addBillingDetails(args.orderId, args.invoice_number, args.billed_by);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addBillingDetails", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addBillingDetails");
          oprot.writeMessageBegin(new TMessage("addBillingDetails", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addBillingDetails", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addJacketNumber implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addJacketNumber_args args = new addJacketNumber_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addJacketNumber_result result = new addJacketNumber_result();
        try {
          result.success = iface_.addJacketNumber(args.orderId, args.jacketNumber);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addJacketNumber", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addJacketNumber");
          oprot.writeMessageBegin(new TMessage("addJacketNumber", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addJacketNumber", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class acceptOrder implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        acceptOrder_args args = new acceptOrder_args();
        args.read(iprot);
        iprot.readMessageEnd();
        acceptOrder_result result = new acceptOrder_result();
        try {
          result.success = iface_.acceptOrder(args.orderId);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing acceptOrder", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing acceptOrder");
          oprot.writeMessageBegin(new TMessage("acceptOrder", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("acceptOrder", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class billOrder implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        billOrder_args args = new billOrder_args();
        args.read(iprot);
        iprot.readMessageEnd();
        billOrder_result result = new billOrder_result();
        try {
          result.success = iface_.billOrder(args.orderId);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing billOrder", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing billOrder");
          oprot.writeMessageBegin(new TMessage("billOrder", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("billOrder", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getOrdersForTransaction implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getOrdersForTransaction_args args = new getOrdersForTransaction_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getOrdersForTransaction_result result = new getOrdersForTransaction_result();
        try {
          result.success = iface_.getOrdersForTransaction(args.transactionId, args.customerId);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getOrdersForTransaction", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getOrdersForTransaction");
          oprot.writeMessageBegin(new TMessage("getOrdersForTransaction", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getOrdersForTransaction", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getOrdersForCustomer implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getOrdersForCustomer_args args = new getOrdersForCustomer_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getOrdersForCustomer_result result = new getOrdersForCustomer_result();
        try {
          result.success = iface_.getOrdersForCustomer(args.customerId, args.from_date, args.to_date, args.status);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getOrdersForCustomer", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getOrdersForCustomer");
          oprot.writeMessageBegin(new TMessage("getOrdersForCustomer", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getOrdersForCustomer", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class createOrder implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        createOrder_args args = new createOrder_args();
        args.read(iprot);
        iprot.readMessageEnd();
        createOrder_result result = new createOrder_result();
        try {
          result.success = iface_.createOrder(args.order);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing createOrder", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing createOrder");
          oprot.writeMessageBegin(new TMessage("createOrder", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("createOrder", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getOrder implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getOrder_args args = new getOrder_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getOrder_result result = new getOrder_result();
        try {
          result.success = iface_.getOrder(args.id);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getOrder", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getOrder");
          oprot.writeMessageBegin(new TMessage("getOrder", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getOrder", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getLineItemsForOrder implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getLineItemsForOrder_args args = new getLineItemsForOrder_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getLineItemsForOrder_result result = new getLineItemsForOrder_result();
        try {
          result.success = iface_.getLineItemsForOrder(args.orderId);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getLineItemsForOrder", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getLineItemsForOrder");
          oprot.writeMessageBegin(new TMessage("getLineItemsForOrder", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getLineItemsForOrder", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getOrderForCustomer implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getOrderForCustomer_args args = new getOrderForCustomer_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getOrderForCustomer_result result = new getOrderForCustomer_result();
        try {
          result.success = iface_.getOrderForCustomer(args.orderId, args.customerId);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getOrderForCustomer", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getOrderForCustomer");
          oprot.writeMessageBegin(new TMessage("getOrderForCustomer", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getOrderForCustomer", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class batchOrders implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        batchOrders_args args = new batchOrders_args();
        args.read(iprot);
        iprot.readMessageEnd();
        batchOrders_result result = new batchOrders_result();
        try {
          result.success = iface_.batchOrders(args.warehouseId);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing batchOrders", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing batchOrders");
          oprot.writeMessageBegin(new TMessage("batchOrders", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("batchOrders", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class markOrderAsOutOfStock implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        markOrderAsOutOfStock_args args = new markOrderAsOutOfStock_args();
        args.read(iprot);
        iprot.readMessageEnd();
        markOrderAsOutOfStock_result result = new markOrderAsOutOfStock_result();
        try {
          result.success = iface_.markOrderAsOutOfStock(args.orderId);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing markOrderAsOutOfStock", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing markOrderAsOutOfStock");
          oprot.writeMessageBegin(new TMessage("markOrderAsOutOfStock", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("markOrderAsOutOfStock", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class markOrdersAsManifested implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        markOrdersAsManifested_args args = new markOrdersAsManifested_args();
        args.read(iprot);
        iprot.readMessageEnd();
        markOrdersAsManifested_result result = new markOrdersAsManifested_result();
        try {
          result.success = iface_.markOrdersAsManifested(args.warehouseId, args.providerId);
          result.setSuccessIsSet(true);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing markOrdersAsManifested", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing markOrdersAsManifested");
          oprot.writeMessageBegin(new TMessage("markOrdersAsManifested", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("markOrdersAsManifested", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class markOrdersAsPickedUp implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        markOrdersAsPickedUp_args args = new markOrdersAsPickedUp_args();
        args.read(iprot);
        iprot.readMessageEnd();
        markOrdersAsPickedUp_result result = new markOrdersAsPickedUp_result();
        try {
          result.success = iface_.markOrdersAsPickedUp(args.providerId, args.pickupDetails);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing markOrdersAsPickedUp", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing markOrdersAsPickedUp");
          oprot.writeMessageBegin(new TMessage("markOrdersAsPickedUp", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("markOrdersAsPickedUp", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class markOrdersAsDelivered implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        markOrdersAsDelivered_args args = new markOrdersAsDelivered_args();
        args.read(iprot);
        iprot.readMessageEnd();
        markOrdersAsDelivered_result result = new markOrdersAsDelivered_result();
        try {
          iface_.markOrdersAsDelivered(args.providerId, args.deliveredOrders);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing markOrdersAsDelivered", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing markOrdersAsDelivered");
          oprot.writeMessageBegin(new TMessage("markOrdersAsDelivered", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("markOrdersAsDelivered", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class markOrdersAsFailed implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        markOrdersAsFailed_args args = new markOrdersAsFailed_args();
        args.read(iprot);
        iprot.readMessageEnd();
        markOrdersAsFailed_result result = new markOrdersAsFailed_result();
        try {
          iface_.markOrdersAsFailed(args.providerId, args.returnedOrders);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing markOrdersAsFailed", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing markOrdersAsFailed");
          oprot.writeMessageBegin(new TMessage("markOrdersAsFailed", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("markOrdersAsFailed", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class updateNonDeliveryReason implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        updateNonDeliveryReason_args args = new updateNonDeliveryReason_args();
        args.read(iprot);
        iprot.readMessageEnd();
        updateNonDeliveryReason_result result = new updateNonDeliveryReason_result();
        try {
          iface_.updateNonDeliveryReason(args.providerId, args.undeliveredOrders);
        } catch (TransactionServiceException ex) {
          result.ex = ex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing updateNonDeliveryReason", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing updateNonDeliveryReason");
          oprot.writeMessageBegin(new TMessage("updateNonDeliveryReason", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("updateNonDeliveryReason", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getUndeliveredOrders implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getUndeliveredOrders_args args = new getUndeliveredOrders_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getUndeliveredOrders_result result = new getUndeliveredOrders_result();
        result.success = iface_.getUndeliveredOrders(args.providerId, args.warehouseId);
        oprot.writeMessageBegin(new TMessage("getUndeliveredOrders", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAlerts implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAlerts_args args = new getAlerts_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAlerts_result result = new getAlerts_result();
        result.success = iface_.getAlerts(args.orderId, args.valid);
        oprot.writeMessageBegin(new TMessage("getAlerts", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class setAlert implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        setAlert_args args = new setAlert_args();
        args.read(iprot);
        iprot.readMessageEnd();
        setAlert_result result = new setAlert_result();
        iface_.setAlert(args.orderId, args.unset, args.type, args.comment);
        oprot.writeMessageBegin(new TMessage("setAlert", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getValidOrderCount implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getValidOrderCount_args args = new getValidOrderCount_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getValidOrderCount_result result = new getValidOrderCount_result();
        result.success = iface_.getValidOrderCount();
        result.setSuccessIsSet(true);
        oprot.writeMessageBegin(new TMessage("getValidOrderCount", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getNoOfCustomersWithSuccessfulTransaction implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getNoOfCustomersWithSuccessfulTransaction_args args = new getNoOfCustomersWithSuccessfulTransaction_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getNoOfCustomersWithSuccessfulTransaction_result result = new getNoOfCustomersWithSuccessfulTransaction_result();
        result.success = iface_.getNoOfCustomersWithSuccessfulTransaction();
        result.setSuccessIsSet(true);
        oprot.writeMessageBegin(new TMessage("getNoOfCustomersWithSuccessfulTransaction", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getValidOrdersAmountRange implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getValidOrdersAmountRange_args args = new getValidOrdersAmountRange_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getValidOrdersAmountRange_result result = new getValidOrdersAmountRange_result();
        result.success = iface_.getValidOrdersAmountRange();
        oprot.writeMessageBegin(new TMessage("getValidOrdersAmountRange", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getValidOrders implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getValidOrders_args args = new getValidOrders_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getValidOrders_result result = new getValidOrders_result();
        result.success = iface_.getValidOrders(args.limit);
        oprot.writeMessageBegin(new TMessage("getValidOrders", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

  }

  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(closeSession_args.class, metaDataMap);
    }

    public closeSession_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public closeSession_args(closeSession_args other) {
    }

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

    @Deprecated
    public closeSession_args clone() {
      return new closeSession_args(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      return true;
    }

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

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

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

      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class closeSession_result implements TBase<closeSession_result._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_result");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(closeSession_result.class, metaDataMap);
    }

    public closeSession_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public closeSession_result(closeSession_result other) {
    }

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

    @Deprecated
    public closeSession_result clone() {
      return new closeSession_result(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      return true;
    }

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

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

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

      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class createTransaction_args implements TBase<createTransaction_args._Fields>, java.io.Serializable, Cloneable, Comparable<createTransaction_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("createTransaction_args");

    private static final TField TRANSACTION_FIELD_DESC = new TField("transaction", TType.STRUCT, (short)1);

    private Transaction transaction;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      TRANSACTION((short)1, "transaction");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.TRANSACTION, new FieldMetaData("transaction", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Transaction.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(createTransaction_args.class, metaDataMap);
    }

    public createTransaction_args() {
    }

    public createTransaction_args(
      Transaction transaction)
    {
      this();
      this.transaction = transaction;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createTransaction_args(createTransaction_args other) {
      if (other.isSetTransaction()) {
        this.transaction = new Transaction(other.transaction);
      }
    }

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

    @Deprecated
    public createTransaction_args clone() {
      return new createTransaction_args(this);
    }

    public Transaction getTransaction() {
      return this.transaction;
    }

    public createTransaction_args setTransaction(Transaction transaction) {
      this.transaction = transaction;
      return this;
    }

    public void unsetTransaction() {
      this.transaction = null;
    }

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

    public void setTransactionIsSet(boolean value) {
      if (!value) {
        this.transaction = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TRANSACTION:
        if (value == null) {
          unsetTransaction();
        } else {
          setTransaction((Transaction)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TRANSACTION:
        return getTransaction();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case TRANSACTION:
        return isSetTransaction();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_transaction = true && this.isSetTransaction();
      boolean that_present_transaction = true && that.isSetTransaction();
      if (this_present_transaction || that_present_transaction) {
        if (!(this_present_transaction && that_present_transaction))
          return false;
        if (!this.transaction.equals(that.transaction))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetTransaction()).compareTo(isSetTransaction());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(transaction, typedOther.transaction);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case TRANSACTION:
              if (field.type == TType.STRUCT) {
                this.transaction = new Transaction();
                this.transaction.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

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

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

      sb.append("transaction:");
      if (this.transaction == null) {
        sb.append("null");
      } else {
        sb.append(this.transaction);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class createTransaction_result implements TBase<createTransaction_result._Fields>, java.io.Serializable, Cloneable, Comparable<createTransaction_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("createTransaction_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private long success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(createTransaction_result.class, metaDataMap);
    }

    public createTransaction_result() {
    }

    public createTransaction_result(
      long success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createTransaction_result(createTransaction_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public createTransaction_result clone() {
      return new createTransaction_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public createTransaction_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public createTransaction_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getTransaction_args implements TBase<getTransaction_args._Fields>, java.io.Serializable, Cloneable, Comparable<getTransaction_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getTransaction_args");

    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);

    private long id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ID((short)1, "id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getTransaction_args.class, metaDataMap);
    }

    public getTransaction_args() {
    }

    public getTransaction_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransaction_args(getTransaction_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

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

    @Deprecated
    public getTransaction_args clone() {
      return new getTransaction_args(this);
    }

    public long getId() {
      return this.id;
    }

    public getTransaction_args setId(long id) {
      this.id = id;
      setIdIsSet(true);
      return this;
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been asigned 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 void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return new Long(getId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getTransaction_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(getTransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ID:
              if (field.type == TType.I64) {
                this.id = iprot.readI64();
                setIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws 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("getTransaction_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getTransaction_result implements TBase<getTransaction_result._Fields>, java.io.Serializable, Cloneable, Comparable<getTransaction_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getTransaction_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private Transaction success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Transaction.class)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getTransaction_result.class, metaDataMap);
    }

    public getTransaction_result() {
    }

    public getTransaction_result(
      Transaction success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransaction_result(getTransaction_result other) {
      if (other.isSetSuccess()) {
        this.success = new Transaction(other.success);
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getTransaction_result clone() {
      return new getTransaction_result(this);
    }

    public Transaction getSuccess() {
      return this.success;
    }

    public getTransaction_result setSuccess(Transaction success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getTransaction_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new Transaction();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getTransactionsForCustomer_args implements TBase<getTransactionsForCustomer_args._Fields>, java.io.Serializable, Cloneable, Comparable<getTransactionsForCustomer_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getTransactionsForCustomer_args");

    private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customerId", TType.I64, (short)1);
    private static final TField FROM_DATE_FIELD_DESC = new TField("from_date", TType.I64, (short)2);
    private static final TField TO_DATE_FIELD_DESC = new TField("to_date", TType.I64, (short)3);
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)4);

    private long customerId;
    private long from_date;
    private long to_date;
    private TransactionStatus status;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CUSTOMER_ID((short)1, "customerId"),
      FROM_DATE((short)2, "from_date"),
      TO_DATE((short)3, "to_date"),
      /**
       * 
       * @see TransactionStatus
       */
      STATUS((short)4, "status");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __CUSTOMERID_ISSET_ID = 0;
    private static final int __FROM_DATE_ISSET_ID = 1;
    private static final int __TO_DATE_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CUSTOMER_ID, new FieldMetaData("customerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.FROM_DATE, new FieldMetaData("from_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TO_DATE, new FieldMetaData("to_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, TransactionStatus.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getTransactionsForCustomer_args.class, metaDataMap);
    }

    public getTransactionsForCustomer_args() {
    }

    public getTransactionsForCustomer_args(
      long customerId,
      long from_date,
      long to_date,
      TransactionStatus status)
    {
      this();
      this.customerId = customerId;
      setCustomerIdIsSet(true);
      this.from_date = from_date;
      setFrom_dateIsSet(true);
      this.to_date = to_date;
      setTo_dateIsSet(true);
      this.status = status;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransactionsForCustomer_args(getTransactionsForCustomer_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.customerId = other.customerId;
      this.from_date = other.from_date;
      this.to_date = other.to_date;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
    }

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

    @Deprecated
    public getTransactionsForCustomer_args clone() {
      return new getTransactionsForCustomer_args(this);
    }

    public long getCustomerId() {
      return this.customerId;
    }

    public getTransactionsForCustomer_args setCustomerId(long customerId) {
      this.customerId = customerId;
      setCustomerIdIsSet(true);
      return this;
    }

    public void unsetCustomerId() {
      __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
    }

    /** Returns true if field customerId is set (has been asigned a value) and false otherwise */
    public boolean isSetCustomerId() {
      return __isset_bit_vector.get(__CUSTOMERID_ISSET_ID);
    }

    public void setCustomerIdIsSet(boolean value) {
      __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
    }

    public long getFrom_date() {
      return this.from_date;
    }

    public getTransactionsForCustomer_args setFrom_date(long from_date) {
      this.from_date = from_date;
      setFrom_dateIsSet(true);
      return this;
    }

    public void unsetFrom_date() {
      __isset_bit_vector.clear(__FROM_DATE_ISSET_ID);
    }

    /** Returns true if field from_date is set (has been asigned a value) and false otherwise */
    public boolean isSetFrom_date() {
      return __isset_bit_vector.get(__FROM_DATE_ISSET_ID);
    }

    public void setFrom_dateIsSet(boolean value) {
      __isset_bit_vector.set(__FROM_DATE_ISSET_ID, value);
    }

    public long getTo_date() {
      return this.to_date;
    }

    public getTransactionsForCustomer_args setTo_date(long to_date) {
      this.to_date = to_date;
      setTo_dateIsSet(true);
      return this;
    }

    public void unsetTo_date() {
      __isset_bit_vector.clear(__TO_DATE_ISSET_ID);
    }

    /** Returns true if field to_date is set (has been asigned a value) and false otherwise */
    public boolean isSetTo_date() {
      return __isset_bit_vector.get(__TO_DATE_ISSET_ID);
    }

    public void setTo_dateIsSet(boolean value) {
      __isset_bit_vector.set(__TO_DATE_ISSET_ID, value);
    }

    /**
     * 
     * @see TransactionStatus
     */
    public TransactionStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see TransactionStatus
     */
    public getTransactionsForCustomer_args setStatus(TransactionStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CUSTOMER_ID:
        if (value == null) {
          unsetCustomerId();
        } else {
          setCustomerId((Long)value);
        }
        break;

      case FROM_DATE:
        if (value == null) {
          unsetFrom_date();
        } else {
          setFrom_date((Long)value);
        }
        break;

      case TO_DATE:
        if (value == null) {
          unsetTo_date();
        } else {
          setTo_date((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((TransactionStatus)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return new Long(getCustomerId());

      case FROM_DATE:
        return new Long(getFrom_date());

      case TO_DATE:
        return new Long(getTo_date());

      case STATUS:
        return getStatus();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return isSetCustomerId();
      case FROM_DATE:
        return isSetFrom_date();
      case TO_DATE:
        return isSetTo_date();
      case STATUS:
        return isSetStatus();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_customerId = true;
      boolean that_present_customerId = true;
      if (this_present_customerId || that_present_customerId) {
        if (!(this_present_customerId && that_present_customerId))
          return false;
        if (this.customerId != that.customerId)
          return false;
      }

      boolean this_present_from_date = true;
      boolean that_present_from_date = true;
      if (this_present_from_date || that_present_from_date) {
        if (!(this_present_from_date && that_present_from_date))
          return false;
        if (this.from_date != that.from_date)
          return false;
      }

      boolean this_present_to_date = true;
      boolean that_present_to_date = true;
      if (this_present_to_date || that_present_to_date) {
        if (!(this_present_to_date && that_present_to_date))
          return false;
        if (this.to_date != that.to_date)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(isSetCustomerId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(customerId, typedOther.customerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetFrom_date()).compareTo(isSetFrom_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(from_date, typedOther.from_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTo_date()).compareTo(isSetTo_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(to_date, typedOther.to_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CUSTOMER_ID:
              if (field.type == TType.I64) {
                this.customerId = iprot.readI64();
                setCustomerIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case FROM_DATE:
              if (field.type == TType.I64) {
                this.from_date = iprot.readI64();
                setFrom_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TO_DATE:
              if (field.type == TType.I64) {
                this.to_date = iprot.readI64();
                setTo_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case STATUS:
              if (field.type == TType.I32) {
                this.status = TransactionStatus.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
      oprot.writeI64(this.customerId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FROM_DATE_FIELD_DESC);
      oprot.writeI64(this.from_date);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_DATE_FIELD_DESC);
      oprot.writeI64(this.to_date);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("customerId:");
      sb.append(this.customerId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("from_date:");
      sb.append(this.from_date);
      first = false;
      if (!first) sb.append(", ");
      sb.append("to_date:");
      sb.append(this.to_date);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getTransactionsForCustomer_result implements TBase<getTransactionsForCustomer_result._Fields>, java.io.Serializable, Cloneable, Comparable<getTransactionsForCustomer_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getTransactionsForCustomer_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Transaction> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Transaction.class))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getTransactionsForCustomer_result.class, metaDataMap);
    }

    public getTransactionsForCustomer_result() {
    }

    public getTransactionsForCustomer_result(
      List<Transaction> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransactionsForCustomer_result(getTransactionsForCustomer_result other) {
      if (other.isSetSuccess()) {
        List<Transaction> __this__success = new ArrayList<Transaction>();
        for (Transaction other_element : other.success) {
          __this__success.add(new Transaction(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getTransactionsForCustomer_result clone() {
      return new getTransactionsForCustomer_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Transaction> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Transaction elem) {
      if (this.success == null) {
        this.success = new ArrayList<Transaction>();
      }
      this.success.add(elem);
    }

    public List<Transaction> getSuccess() {
      return this.success;
    }

    public getTransactionsForCustomer_result setSuccess(List<Transaction> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getTransactionsForCustomer_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list8 = iprot.readListBegin();
                  this.success = new ArrayList<Transaction>(_list8.size);
                  for (int _i9 = 0; _i9 < _list8.size; ++_i9)
                  {
                    Transaction _elem10;
                    _elem10 = new Transaction();
                    _elem10.read(iprot);
                    this.success.add(_elem10);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Transaction _iter11 : this.success)
          {
            _iter11.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getTransactionsForShoppingCartId_args implements TBase<getTransactionsForShoppingCartId_args._Fields>, java.io.Serializable, Cloneable, Comparable<getTransactionsForShoppingCartId_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getTransactionsForShoppingCartId_args");

    private static final TField SHOPPING_CART_ID_FIELD_DESC = new TField("shoppingCartId", TType.I64, (short)1);

    private long shoppingCartId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SHOPPING_CART_ID((short)1, "shoppingCartId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __SHOPPINGCARTID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SHOPPING_CART_ID, new FieldMetaData("shoppingCartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getTransactionsForShoppingCartId_args.class, metaDataMap);
    }

    public getTransactionsForShoppingCartId_args() {
    }

    public getTransactionsForShoppingCartId_args(
      long shoppingCartId)
    {
      this();
      this.shoppingCartId = shoppingCartId;
      setShoppingCartIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransactionsForShoppingCartId_args(getTransactionsForShoppingCartId_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.shoppingCartId = other.shoppingCartId;
    }

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

    @Deprecated
    public getTransactionsForShoppingCartId_args clone() {
      return new getTransactionsForShoppingCartId_args(this);
    }

    public long getShoppingCartId() {
      return this.shoppingCartId;
    }

    public getTransactionsForShoppingCartId_args setShoppingCartId(long shoppingCartId) {
      this.shoppingCartId = shoppingCartId;
      setShoppingCartIdIsSet(true);
      return this;
    }

    public void unsetShoppingCartId() {
      __isset_bit_vector.clear(__SHOPPINGCARTID_ISSET_ID);
    }

    /** Returns true if field shoppingCartId is set (has been asigned a value) and false otherwise */
    public boolean isSetShoppingCartId() {
      return __isset_bit_vector.get(__SHOPPINGCARTID_ISSET_ID);
    }

    public void setShoppingCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__SHOPPINGCARTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SHOPPING_CART_ID:
        if (value == null) {
          unsetShoppingCartId();
        } else {
          setShoppingCartId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SHOPPING_CART_ID:
        return new Long(getShoppingCartId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SHOPPING_CART_ID:
        return isSetShoppingCartId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_shoppingCartId = true;
      boolean that_present_shoppingCartId = true;
      if (this_present_shoppingCartId || that_present_shoppingCartId) {
        if (!(this_present_shoppingCartId && that_present_shoppingCartId))
          return false;
        if (this.shoppingCartId != that.shoppingCartId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetShoppingCartId()).compareTo(isSetShoppingCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(shoppingCartId, typedOther.shoppingCartId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SHOPPING_CART_ID:
              if (field.type == TType.I64) {
                this.shoppingCartId = iprot.readI64();
                setShoppingCartIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(SHOPPING_CART_ID_FIELD_DESC);
      oprot.writeI64(this.shoppingCartId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("shoppingCartId:");
      sb.append(this.shoppingCartId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getTransactionsForShoppingCartId_result implements TBase<getTransactionsForShoppingCartId_result._Fields>, java.io.Serializable, Cloneable, Comparable<getTransactionsForShoppingCartId_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getTransactionsForShoppingCartId_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Transaction> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Transaction.class))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getTransactionsForShoppingCartId_result.class, metaDataMap);
    }

    public getTransactionsForShoppingCartId_result() {
    }

    public getTransactionsForShoppingCartId_result(
      List<Transaction> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransactionsForShoppingCartId_result(getTransactionsForShoppingCartId_result other) {
      if (other.isSetSuccess()) {
        List<Transaction> __this__success = new ArrayList<Transaction>();
        for (Transaction other_element : other.success) {
          __this__success.add(new Transaction(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getTransactionsForShoppingCartId_result clone() {
      return new getTransactionsForShoppingCartId_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Transaction> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Transaction elem) {
      if (this.success == null) {
        this.success = new ArrayList<Transaction>();
      }
      this.success.add(elem);
    }

    public List<Transaction> getSuccess() {
      return this.success;
    }

    public getTransactionsForShoppingCartId_result setSuccess(List<Transaction> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getTransactionsForShoppingCartId_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list12 = iprot.readListBegin();
                  this.success = new ArrayList<Transaction>(_list12.size);
                  for (int _i13 = 0; _i13 < _list12.size; ++_i13)
                  {
                    Transaction _elem14;
                    _elem14 = new Transaction();
                    _elem14.read(iprot);
                    this.success.add(_elem14);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Transaction _iter15 : this.success)
          {
            _iter15.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getTransactionStatus_args implements TBase<getTransactionStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<getTransactionStatus_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getTransactionStatus_args");

    private static final TField TRANSACTION_ID_FIELD_DESC = new TField("transactionId", TType.I64, (short)1);

    private long transactionId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      TRANSACTION_ID((short)1, "transactionId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __TRANSACTIONID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.TRANSACTION_ID, new FieldMetaData("transactionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getTransactionStatus_args.class, metaDataMap);
    }

    public getTransactionStatus_args() {
    }

    public getTransactionStatus_args(
      long transactionId)
    {
      this();
      this.transactionId = transactionId;
      setTransactionIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getTransactionStatus_args(getTransactionStatus_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.transactionId = other.transactionId;
    }

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

    @Deprecated
    public getTransactionStatus_args clone() {
      return new getTransactionStatus_args(this);
    }

    public long getTransactionId() {
      return this.transactionId;
    }

    public getTransactionStatus_args setTransactionId(long transactionId) {
      this.transactionId = transactionId;
      setTransactionIdIsSet(true);
      return this;
    }

    public void unsetTransactionId() {
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
    }

    /** Returns true if field transactionId is set (has been asigned a value) and false otherwise */
    public boolean isSetTransactionId() {
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
    }

    public void setTransactionIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TRANSACTION_ID:
        if (value == null) {
          unsetTransactionId();
        } else {
          setTransactionId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TRANSACTION_ID:
        return new Long(getTransactionId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case TRANSACTION_ID:
        return isSetTransactionId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_transactionId = true;
      boolean that_present_transactionId = true;
      if (this_present_transactionId || that_present_transactionId) {
        if (!(this_present_transactionId && that_present_transactionId))
          return false;
        if (this.transactionId != that.transactionId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(isSetTransactionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(transactionId, typedOther.transactionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case TRANSACTION_ID:
              if (field.type == TType.I64) {
                this.transactionId = iprot.readI64();
                setTransactionIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
      oprot.writeI64(this.transactionId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("transactionId:");
      sb.append(this.transactionId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getTransactionStatus_result implements TBase<getTransactionStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<getTransactionStatus_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getTransactionStatus_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private TransactionStatus success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      /**
       * 
       * @see TransactionStatus
       */
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, TransactionStatus.class)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getTransactionStatus_result.class, metaDataMap);
    }

    public getTransactionStatus_result() {
    }

    public getTransactionStatus_result(
      TransactionStatus success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

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

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

    @Deprecated
    public getTransactionStatus_result clone() {
      return new getTransactionStatus_result(this);
    }

    /**
     * 
     * @see TransactionStatus
     */
    public TransactionStatus getSuccess() {
      return this.success;
    }

    /**
     * 
     * @see TransactionStatus
     */
    public getTransactionStatus_result setSuccess(TransactionStatus success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getTransactionStatus_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I32) {
                this.success = TransactionStatus.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI32(this.success.getValue());
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        String success_name = success.name();
        if (success_name != null) {
          sb.append(success_name);
          sb.append(" (");
        }
        sb.append(this.success);
        if (success_name != null) {
          sb.append(")");
        }
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class changeTransactionStatus_args implements TBase<changeTransactionStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<changeTransactionStatus_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("changeTransactionStatus_args");

    private static final TField TRANSACTION_ID_FIELD_DESC = new TField("transactionId", TType.I64, (short)1);
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)2);
    private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)3);

    private long transactionId;
    private TransactionStatus status;
    private String description;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      TRANSACTION_ID((short)1, "transactionId"),
      /**
       * 
       * @see TransactionStatus
       */
      STATUS((short)2, "status"),
      DESCRIPTION((short)3, "description");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __TRANSACTIONID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.TRANSACTION_ID, new FieldMetaData("transactionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, TransactionStatus.class)));
      put(_Fields.DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(changeTransactionStatus_args.class, metaDataMap);
    }

    public changeTransactionStatus_args() {
    }

    public changeTransactionStatus_args(
      long transactionId,
      TransactionStatus status,
      String description)
    {
      this();
      this.transactionId = transactionId;
      setTransactionIdIsSet(true);
      this.status = status;
      this.description = description;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeTransactionStatus_args(changeTransactionStatus_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.transactionId = other.transactionId;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
      if (other.isSetDescription()) {
        this.description = other.description;
      }
    }

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

    @Deprecated
    public changeTransactionStatus_args clone() {
      return new changeTransactionStatus_args(this);
    }

    public long getTransactionId() {
      return this.transactionId;
    }

    public changeTransactionStatus_args setTransactionId(long transactionId) {
      this.transactionId = transactionId;
      setTransactionIdIsSet(true);
      return this;
    }

    public void unsetTransactionId() {
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
    }

    /** Returns true if field transactionId is set (has been asigned a value) and false otherwise */
    public boolean isSetTransactionId() {
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
    }

    public void setTransactionIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
    }

    /**
     * 
     * @see TransactionStatus
     */
    public TransactionStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see TransactionStatus
     */
    public changeTransactionStatus_args setStatus(TransactionStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public String getDescription() {
      return this.description;
    }

    public changeTransactionStatus_args setDescription(String description) {
      this.description = description;
      return this;
    }

    public void unsetDescription() {
      this.description = null;
    }

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

    public void setDescriptionIsSet(boolean value) {
      if (!value) {
        this.description = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TRANSACTION_ID:
        if (value == null) {
          unsetTransactionId();
        } else {
          setTransactionId((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((TransactionStatus)value);
        }
        break;

      case DESCRIPTION:
        if (value == null) {
          unsetDescription();
        } else {
          setDescription((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TRANSACTION_ID:
        return new Long(getTransactionId());

      case STATUS:
        return getStatus();

      case DESCRIPTION:
        return getDescription();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case TRANSACTION_ID:
        return isSetTransactionId();
      case STATUS:
        return isSetStatus();
      case DESCRIPTION:
        return isSetDescription();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_transactionId = true;
      boolean that_present_transactionId = true;
      if (this_present_transactionId || that_present_transactionId) {
        if (!(this_present_transactionId && that_present_transactionId))
          return false;
        if (this.transactionId != that.transactionId)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      boolean this_present_description = true && this.isSetDescription();
      boolean that_present_description = true && that.isSetDescription();
      if (this_present_description || that_present_description) {
        if (!(this_present_description && that_present_description))
          return false;
        if (!this.description.equals(that.description))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(isSetTransactionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(transactionId, typedOther.transactionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetDescription()).compareTo(isSetDescription());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(description, typedOther.description);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case TRANSACTION_ID:
              if (field.type == TType.I64) {
                this.transactionId = iprot.readI64();
                setTransactionIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case STATUS:
              if (field.type == TType.I32) {
                this.status = TransactionStatus.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case DESCRIPTION:
              if (field.type == TType.STRING) {
                this.description = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
      oprot.writeI64(this.transactionId);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      if (this.description != null) {
        oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
        oprot.writeString(this.description);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("transactionId:");
      sb.append(this.transactionId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("description:");
      if (this.description == null) {
        sb.append("null");
      } else {
        sb.append(this.description);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class changeTransactionStatus_result implements TBase<changeTransactionStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<changeTransactionStatus_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("changeTransactionStatus_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private boolean success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(changeTransactionStatus_result.class, metaDataMap);
    }

    public changeTransactionStatus_result() {
    }

    public changeTransactionStatus_result(
      boolean success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeTransactionStatus_result(changeTransactionStatus_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public changeTransactionStatus_result clone() {
      return new changeTransactionStatus_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public changeTransactionStatus_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public changeTransactionStatus_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class enqueueTransactionInfoEmail_args implements TBase<enqueueTransactionInfoEmail_args._Fields>, java.io.Serializable, Cloneable, Comparable<enqueueTransactionInfoEmail_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("enqueueTransactionInfoEmail_args");

    private static final TField TRANSACTION_ID_FIELD_DESC = new TField("transactionId", TType.I64, (short)1);

    private long transactionId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      TRANSACTION_ID((short)1, "transactionId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __TRANSACTIONID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.TRANSACTION_ID, new FieldMetaData("transactionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(enqueueTransactionInfoEmail_args.class, metaDataMap);
    }

    public enqueueTransactionInfoEmail_args() {
    }

    public enqueueTransactionInfoEmail_args(
      long transactionId)
    {
      this();
      this.transactionId = transactionId;
      setTransactionIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public enqueueTransactionInfoEmail_args(enqueueTransactionInfoEmail_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.transactionId = other.transactionId;
    }

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

    @Deprecated
    public enqueueTransactionInfoEmail_args clone() {
      return new enqueueTransactionInfoEmail_args(this);
    }

    public long getTransactionId() {
      return this.transactionId;
    }

    public enqueueTransactionInfoEmail_args setTransactionId(long transactionId) {
      this.transactionId = transactionId;
      setTransactionIdIsSet(true);
      return this;
    }

    public void unsetTransactionId() {
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
    }

    /** Returns true if field transactionId is set (has been asigned a value) and false otherwise */
    public boolean isSetTransactionId() {
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
    }

    public void setTransactionIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TRANSACTION_ID:
        if (value == null) {
          unsetTransactionId();
        } else {
          setTransactionId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TRANSACTION_ID:
        return new Long(getTransactionId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case TRANSACTION_ID:
        return isSetTransactionId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_transactionId = true;
      boolean that_present_transactionId = true;
      if (this_present_transactionId || that_present_transactionId) {
        if (!(this_present_transactionId && that_present_transactionId))
          return false;
        if (this.transactionId != that.transactionId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(isSetTransactionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(transactionId, typedOther.transactionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case TRANSACTION_ID:
              if (field.type == TType.I64) {
                this.transactionId = iprot.readI64();
                setTransactionIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
      oprot.writeI64(this.transactionId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("transactionId:");
      sb.append(this.transactionId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class enqueueTransactionInfoEmail_result implements TBase<enqueueTransactionInfoEmail_result._Fields>, java.io.Serializable, Cloneable, Comparable<enqueueTransactionInfoEmail_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("enqueueTransactionInfoEmail_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private boolean success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(enqueueTransactionInfoEmail_result.class, metaDataMap);
    }

    public enqueueTransactionInfoEmail_result() {
    }

    public enqueueTransactionInfoEmail_result(
      boolean success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public enqueueTransactionInfoEmail_result(enqueueTransactionInfoEmail_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public enqueueTransactionInfoEmail_result clone() {
      return new enqueueTransactionInfoEmail_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public enqueueTransactionInfoEmail_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public enqueueTransactionInfoEmail_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllOrders_args implements TBase<getAllOrders_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllOrders_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllOrders_args");

    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)1);
    private static final TField FROM_DATE_FIELD_DESC = new TField("from_date", TType.I64, (short)2);
    private static final TField TO_DATE_FIELD_DESC = new TField("to_date", TType.I64, (short)3);
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)4);

    private OrderStatus status;
    private long from_date;
    private long to_date;
    private long warehouse_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      /**
       * 
       * @see OrderStatus
       */
      STATUS((short)1, "status"),
      FROM_DATE((short)2, "from_date"),
      TO_DATE((short)3, "to_date"),
      WAREHOUSE_ID((short)4, "warehouse_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __FROM_DATE_ISSET_ID = 0;
    private static final int __TO_DATE_ISSET_ID = 1;
    private static final int __WAREHOUSE_ID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, OrderStatus.class)));
      put(_Fields.FROM_DATE, new FieldMetaData("from_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TO_DATE, new FieldMetaData("to_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllOrders_args.class, metaDataMap);
    }

    public getAllOrders_args() {
    }

    public getAllOrders_args(
      OrderStatus status,
      long from_date,
      long to_date,
      long warehouse_id)
    {
      this();
      this.status = status;
      this.from_date = from_date;
      setFrom_dateIsSet(true);
      this.to_date = to_date;
      setTo_dateIsSet(true);
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllOrders_args(getAllOrders_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetStatus()) {
        this.status = other.status;
      }
      this.from_date = other.from_date;
      this.to_date = other.to_date;
      this.warehouse_id = other.warehouse_id;
    }

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

    @Deprecated
    public getAllOrders_args clone() {
      return new getAllOrders_args(this);
    }

    /**
     * 
     * @see OrderStatus
     */
    public OrderStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see OrderStatus
     */
    public getAllOrders_args setStatus(OrderStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public long getFrom_date() {
      return this.from_date;
    }

    public getAllOrders_args setFrom_date(long from_date) {
      this.from_date = from_date;
      setFrom_dateIsSet(true);
      return this;
    }

    public void unsetFrom_date() {
      __isset_bit_vector.clear(__FROM_DATE_ISSET_ID);
    }

    /** Returns true if field from_date is set (has been asigned a value) and false otherwise */
    public boolean isSetFrom_date() {
      return __isset_bit_vector.get(__FROM_DATE_ISSET_ID);
    }

    public void setFrom_dateIsSet(boolean value) {
      __isset_bit_vector.set(__FROM_DATE_ISSET_ID, value);
    }

    public long getTo_date() {
      return this.to_date;
    }

    public getAllOrders_args setTo_date(long to_date) {
      this.to_date = to_date;
      setTo_dateIsSet(true);
      return this;
    }

    public void unsetTo_date() {
      __isset_bit_vector.clear(__TO_DATE_ISSET_ID);
    }

    /** Returns true if field to_date is set (has been asigned a value) and false otherwise */
    public boolean isSetTo_date() {
      return __isset_bit_vector.get(__TO_DATE_ISSET_ID);
    }

    public void setTo_dateIsSet(boolean value) {
      __isset_bit_vector.set(__TO_DATE_ISSET_ID, value);
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public getAllOrders_args setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      return this;
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been asigned 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 STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((OrderStatus)value);
        }
        break;

      case FROM_DATE:
        if (value == null) {
          unsetFrom_date();
        } else {
          setFrom_date((Long)value);
        }
        break;

      case TO_DATE:
        if (value == null) {
          unsetTo_date();
        } else {
          setTo_date((Long)value);
        }
        break;

      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case STATUS:
        return getStatus();

      case FROM_DATE:
        return new Long(getFrom_date());

      case TO_DATE:
        return new Long(getTo_date());

      case WAREHOUSE_ID:
        return new Long(getWarehouse_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case STATUS:
        return isSetStatus();
      case FROM_DATE:
        return isSetFrom_date();
      case TO_DATE:
        return isSetTo_date();
      case WAREHOUSE_ID:
        return isSetWarehouse_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      boolean this_present_from_date = true;
      boolean that_present_from_date = true;
      if (this_present_from_date || that_present_from_date) {
        if (!(this_present_from_date && that_present_from_date))
          return false;
        if (this.from_date != that.from_date)
          return false;
      }

      boolean this_present_to_date = true;
      boolean that_present_to_date = true;
      if (this_present_to_date || that_present_to_date) {
        if (!(this_present_to_date && that_present_to_date))
          return false;
        if (this.to_date != that.to_date)
          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(getAllOrders_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetFrom_date()).compareTo(isSetFrom_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(from_date, typedOther.from_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTo_date()).compareTo(isSetTo_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(to_date, typedOther.to_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case STATUS:
              if (field.type == TType.I32) {
                this.status = OrderStatus.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case FROM_DATE:
              if (field.type == TType.I64) {
                this.from_date = iprot.readI64();
                setFrom_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TO_DATE:
              if (field.type == TType.I64) {
                this.to_date = iprot.readI64();
                setTo_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouse_id = iprot.readI64();
                setWarehouse_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(FROM_DATE_FIELD_DESC);
      oprot.writeI64(this.from_date);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_DATE_FIELD_DESC);
      oprot.writeI64(this.to_date);
      oprot.writeFieldEnd();
      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("getAllOrders_args(");
      boolean first = true;

      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("from_date:");
      sb.append(this.from_date);
      first = false;
      if (!first) sb.append(", ");
      sb.append("to_date:");
      sb.append(this.to_date);
      first = false;
      if (!first) sb.append(", ");
      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllOrders_result implements TBase<getAllOrders_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllOrders_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllOrders_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Order> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Order.class))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllOrders_result.class, metaDataMap);
    }

    public getAllOrders_result() {
    }

    public getAllOrders_result(
      List<Order> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllOrders_result(getAllOrders_result other) {
      if (other.isSetSuccess()) {
        List<Order> __this__success = new ArrayList<Order>();
        for (Order other_element : other.success) {
          __this__success.add(new Order(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getAllOrders_result clone() {
      return new getAllOrders_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Order> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Order elem) {
      if (this.success == null) {
        this.success = new ArrayList<Order>();
      }
      this.success.add(elem);
    }

    public List<Order> getSuccess() {
      return this.success;
    }

    public getAllOrders_result setSuccess(List<Order> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getAllOrders_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list16 = iprot.readListBegin();
                  this.success = new ArrayList<Order>(_list16.size);
                  for (int _i17 = 0; _i17 < _list16.size; ++_i17)
                  {
                    Order _elem18;
                    _elem18 = new Order();
                    _elem18.read(iprot);
                    this.success.add(_elem18);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Order _iter19 : this.success)
          {
            _iter19.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrdersByBillingDate_args implements TBase<getOrdersByBillingDate_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrdersByBillingDate_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrdersByBillingDate_args");

    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)1);
    private static final TField START_BILLING_DATE_FIELD_DESC = new TField("start_billing_date", TType.I64, (short)2);
    private static final TField END_BILLING_DATE_FIELD_DESC = new TField("end_billing_date", TType.I64, (short)3);
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)4);

    private OrderStatus status;
    private long start_billing_date;
    private long end_billing_date;
    private long warehouse_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      /**
       * 
       * @see OrderStatus
       */
      STATUS((short)1, "status"),
      START_BILLING_DATE((short)2, "start_billing_date"),
      END_BILLING_DATE((short)3, "end_billing_date"),
      WAREHOUSE_ID((short)4, "warehouse_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __START_BILLING_DATE_ISSET_ID = 0;
    private static final int __END_BILLING_DATE_ISSET_ID = 1;
    private static final int __WAREHOUSE_ID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, OrderStatus.class)));
      put(_Fields.START_BILLING_DATE, new FieldMetaData("start_billing_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.END_BILLING_DATE, new FieldMetaData("end_billing_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrdersByBillingDate_args.class, metaDataMap);
    }

    public getOrdersByBillingDate_args() {
    }

    public getOrdersByBillingDate_args(
      OrderStatus status,
      long start_billing_date,
      long end_billing_date,
      long warehouse_id)
    {
      this();
      this.status = status;
      this.start_billing_date = start_billing_date;
      setStart_billing_dateIsSet(true);
      this.end_billing_date = end_billing_date;
      setEnd_billing_dateIsSet(true);
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrdersByBillingDate_args(getOrdersByBillingDate_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetStatus()) {
        this.status = other.status;
      }
      this.start_billing_date = other.start_billing_date;
      this.end_billing_date = other.end_billing_date;
      this.warehouse_id = other.warehouse_id;
    }

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

    @Deprecated
    public getOrdersByBillingDate_args clone() {
      return new getOrdersByBillingDate_args(this);
    }

    /**
     * 
     * @see OrderStatus
     */
    public OrderStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see OrderStatus
     */
    public getOrdersByBillingDate_args setStatus(OrderStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public long getStart_billing_date() {
      return this.start_billing_date;
    }

    public getOrdersByBillingDate_args setStart_billing_date(long start_billing_date) {
      this.start_billing_date = start_billing_date;
      setStart_billing_dateIsSet(true);
      return this;
    }

    public void unsetStart_billing_date() {
      __isset_bit_vector.clear(__START_BILLING_DATE_ISSET_ID);
    }

    /** Returns true if field start_billing_date is set (has been asigned a value) and false otherwise */
    public boolean isSetStart_billing_date() {
      return __isset_bit_vector.get(__START_BILLING_DATE_ISSET_ID);
    }

    public void setStart_billing_dateIsSet(boolean value) {
      __isset_bit_vector.set(__START_BILLING_DATE_ISSET_ID, value);
    }

    public long getEnd_billing_date() {
      return this.end_billing_date;
    }

    public getOrdersByBillingDate_args setEnd_billing_date(long end_billing_date) {
      this.end_billing_date = end_billing_date;
      setEnd_billing_dateIsSet(true);
      return this;
    }

    public void unsetEnd_billing_date() {
      __isset_bit_vector.clear(__END_BILLING_DATE_ISSET_ID);
    }

    /** Returns true if field end_billing_date is set (has been asigned a value) and false otherwise */
    public boolean isSetEnd_billing_date() {
      return __isset_bit_vector.get(__END_BILLING_DATE_ISSET_ID);
    }

    public void setEnd_billing_dateIsSet(boolean value) {
      __isset_bit_vector.set(__END_BILLING_DATE_ISSET_ID, value);
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public getOrdersByBillingDate_args setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      return this;
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been asigned 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 STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((OrderStatus)value);
        }
        break;

      case START_BILLING_DATE:
        if (value == null) {
          unsetStart_billing_date();
        } else {
          setStart_billing_date((Long)value);
        }
        break;

      case END_BILLING_DATE:
        if (value == null) {
          unsetEnd_billing_date();
        } else {
          setEnd_billing_date((Long)value);
        }
        break;

      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case STATUS:
        return getStatus();

      case START_BILLING_DATE:
        return new Long(getStart_billing_date());

      case END_BILLING_DATE:
        return new Long(getEnd_billing_date());

      case WAREHOUSE_ID:
        return new Long(getWarehouse_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case STATUS:
        return isSetStatus();
      case START_BILLING_DATE:
        return isSetStart_billing_date();
      case END_BILLING_DATE:
        return isSetEnd_billing_date();
      case WAREHOUSE_ID:
        return isSetWarehouse_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      boolean this_present_start_billing_date = true;
      boolean that_present_start_billing_date = true;
      if (this_present_start_billing_date || that_present_start_billing_date) {
        if (!(this_present_start_billing_date && that_present_start_billing_date))
          return false;
        if (this.start_billing_date != that.start_billing_date)
          return false;
      }

      boolean this_present_end_billing_date = true;
      boolean that_present_end_billing_date = true;
      if (this_present_end_billing_date || that_present_end_billing_date) {
        if (!(this_present_end_billing_date && that_present_end_billing_date))
          return false;
        if (this.end_billing_date != that.end_billing_date)
          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(getOrdersByBillingDate_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetStart_billing_date()).compareTo(isSetStart_billing_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(start_billing_date, typedOther.start_billing_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEnd_billing_date()).compareTo(isSetEnd_billing_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(end_billing_date, typedOther.end_billing_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case STATUS:
              if (field.type == TType.I32) {
                this.status = OrderStatus.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case START_BILLING_DATE:
              if (field.type == TType.I64) {
                this.start_billing_date = iprot.readI64();
                setStart_billing_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case END_BILLING_DATE:
              if (field.type == TType.I64) {
                this.end_billing_date = iprot.readI64();
                setEnd_billing_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouse_id = iprot.readI64();
                setWarehouse_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(START_BILLING_DATE_FIELD_DESC);
      oprot.writeI64(this.start_billing_date);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(END_BILLING_DATE_FIELD_DESC);
      oprot.writeI64(this.end_billing_date);
      oprot.writeFieldEnd();
      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("getOrdersByBillingDate_args(");
      boolean first = true;

      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("start_billing_date:");
      sb.append(this.start_billing_date);
      first = false;
      if (!first) sb.append(", ");
      sb.append("end_billing_date:");
      sb.append(this.end_billing_date);
      first = false;
      if (!first) sb.append(", ");
      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrdersByBillingDate_result implements TBase<getOrdersByBillingDate_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOrdersByBillingDate_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrdersByBillingDate_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Order> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Order.class))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrdersByBillingDate_result.class, metaDataMap);
    }

    public getOrdersByBillingDate_result() {
    }

    public getOrdersByBillingDate_result(
      List<Order> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrdersByBillingDate_result(getOrdersByBillingDate_result other) {
      if (other.isSetSuccess()) {
        List<Order> __this__success = new ArrayList<Order>();
        for (Order other_element : other.success) {
          __this__success.add(new Order(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getOrdersByBillingDate_result clone() {
      return new getOrdersByBillingDate_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Order> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Order elem) {
      if (this.success == null) {
        this.success = new ArrayList<Order>();
      }
      this.success.add(elem);
    }

    public List<Order> getSuccess() {
      return this.success;
    }

    public getOrdersByBillingDate_result setSuccess(List<Order> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getOrdersByBillingDate_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list20 = iprot.readListBegin();
                  this.success = new ArrayList<Order>(_list20.size);
                  for (int _i21 = 0; _i21 < _list20.size; ++_i21)
                  {
                    Order _elem22;
                    _elem22 = new Order();
                    _elem22.read(iprot);
                    this.success.add(_elem22);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Order _iter23 : this.success)
          {
            _iter23.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getReturnableOrdersForCustomer_args implements TBase<getReturnableOrdersForCustomer_args._Fields>, java.io.Serializable, Cloneable, Comparable<getReturnableOrdersForCustomer_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getReturnableOrdersForCustomer_args");

    private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customer_id", TType.I64, (short)1);
    private static final TField LIMIT_FIELD_DESC = new TField("limit", TType.I64, (short)2);

    private long customer_id;
    private long limit;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CUSTOMER_ID((short)1, "customer_id"),
      LIMIT((short)2, "limit");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __CUSTOMER_ID_ISSET_ID = 0;
    private static final int __LIMIT_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CUSTOMER_ID, new FieldMetaData("customer_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.LIMIT, new FieldMetaData("limit", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getReturnableOrdersForCustomer_args.class, metaDataMap);
    }

    public getReturnableOrdersForCustomer_args() {
    }

    public getReturnableOrdersForCustomer_args(
      long customer_id,
      long limit)
    {
      this();
      this.customer_id = customer_id;
      setCustomer_idIsSet(true);
      this.limit = limit;
      setLimitIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getReturnableOrdersForCustomer_args(getReturnableOrdersForCustomer_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.customer_id = other.customer_id;
      this.limit = other.limit;
    }

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

    @Deprecated
    public getReturnableOrdersForCustomer_args clone() {
      return new getReturnableOrdersForCustomer_args(this);
    }

    public long getCustomer_id() {
      return this.customer_id;
    }

    public getReturnableOrdersForCustomer_args setCustomer_id(long customer_id) {
      this.customer_id = customer_id;
      setCustomer_idIsSet(true);
      return this;
    }

    public void unsetCustomer_id() {
      __isset_bit_vector.clear(__CUSTOMER_ID_ISSET_ID);
    }

    /** Returns true if field customer_id is set (has been asigned a value) and false otherwise */
    public boolean isSetCustomer_id() {
      return __isset_bit_vector.get(__CUSTOMER_ID_ISSET_ID);
    }

    public void setCustomer_idIsSet(boolean value) {
      __isset_bit_vector.set(__CUSTOMER_ID_ISSET_ID, value);
    }

    public long getLimit() {
      return this.limit;
    }

    public getReturnableOrdersForCustomer_args setLimit(long limit) {
      this.limit = limit;
      setLimitIsSet(true);
      return this;
    }

    public void unsetLimit() {
      __isset_bit_vector.clear(__LIMIT_ISSET_ID);
    }

    /** Returns true if field limit is set (has been asigned a value) and false otherwise */
    public boolean isSetLimit() {
      return __isset_bit_vector.get(__LIMIT_ISSET_ID);
    }

    public void setLimitIsSet(boolean value) {
      __isset_bit_vector.set(__LIMIT_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CUSTOMER_ID:
        if (value == null) {
          unsetCustomer_id();
        } else {
          setCustomer_id((Long)value);
        }
        break;

      case LIMIT:
        if (value == null) {
          unsetLimit();
        } else {
          setLimit((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return new Long(getCustomer_id());

      case LIMIT:
        return new Long(getLimit());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return isSetCustomer_id();
      case LIMIT:
        return isSetLimit();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_customer_id = true;
      boolean that_present_customer_id = true;
      if (this_present_customer_id || that_present_customer_id) {
        if (!(this_present_customer_id && that_present_customer_id))
          return false;
        if (this.customer_id != that.customer_id)
          return false;
      }

      boolean this_present_limit = true;
      boolean that_present_limit = true;
      if (this_present_limit || that_present_limit) {
        if (!(this_present_limit && that_present_limit))
          return false;
        if (this.limit != that.limit)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetCustomer_id()).compareTo(isSetCustomer_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(customer_id, typedOther.customer_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetLimit()).compareTo(isSetLimit());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(limit, typedOther.limit);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CUSTOMER_ID:
              if (field.type == TType.I64) {
                this.customer_id = iprot.readI64();
                setCustomer_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case LIMIT:
              if (field.type == TType.I64) {
                this.limit = iprot.readI64();
                setLimitIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
      oprot.writeI64(this.customer_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(LIMIT_FIELD_DESC);
      oprot.writeI64(this.limit);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("customer_id:");
      sb.append(this.customer_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("limit:");
      sb.append(this.limit);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getReturnableOrdersForCustomer_result implements TBase<getReturnableOrdersForCustomer_result._Fields>, java.io.Serializable, Cloneable, Comparable<getReturnableOrdersForCustomer_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getReturnableOrdersForCustomer_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Long> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new FieldValueMetaData(TType.I64))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getReturnableOrdersForCustomer_result.class, metaDataMap);
    }

    public getReturnableOrdersForCustomer_result() {
    }

    public getReturnableOrdersForCustomer_result(
      List<Long> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getReturnableOrdersForCustomer_result(getReturnableOrdersForCustomer_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.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getReturnableOrdersForCustomer_result clone() {
      return new getReturnableOrdersForCustomer_result(this);
    }

    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 getReturnableOrdersForCustomer_result setSuccess(List<Long> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getReturnableOrdersForCustomer_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list24 = iprot.readListBegin();
                  this.success = new ArrayList<Long>(_list24.size);
                  for (int _i25 = 0; _i25 < _list24.size; ++_i25)
                  {
                    long _elem26;
                    _elem26 = iprot.readI64();
                    this.success.add(_elem26);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.I64, this.success.size()));
          for (long _iter27 : this.success)
          {
            oprot.writeI64(_iter27);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getCancellableOrdersForCustomer_args implements TBase<getCancellableOrdersForCustomer_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCancellableOrdersForCustomer_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getCancellableOrdersForCustomer_args");

    private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customer_id", TType.I64, (short)1);
    private static final TField LIMIT_FIELD_DESC = new TField("limit", TType.I64, (short)2);

    private long customer_id;
    private long limit;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CUSTOMER_ID((short)1, "customer_id"),
      LIMIT((short)2, "limit");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __CUSTOMER_ID_ISSET_ID = 0;
    private static final int __LIMIT_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CUSTOMER_ID, new FieldMetaData("customer_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.LIMIT, new FieldMetaData("limit", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getCancellableOrdersForCustomer_args.class, metaDataMap);
    }

    public getCancellableOrdersForCustomer_args() {
    }

    public getCancellableOrdersForCustomer_args(
      long customer_id,
      long limit)
    {
      this();
      this.customer_id = customer_id;
      setCustomer_idIsSet(true);
      this.limit = limit;
      setLimitIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCancellableOrdersForCustomer_args(getCancellableOrdersForCustomer_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.customer_id = other.customer_id;
      this.limit = other.limit;
    }

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

    @Deprecated
    public getCancellableOrdersForCustomer_args clone() {
      return new getCancellableOrdersForCustomer_args(this);
    }

    public long getCustomer_id() {
      return this.customer_id;
    }

    public getCancellableOrdersForCustomer_args setCustomer_id(long customer_id) {
      this.customer_id = customer_id;
      setCustomer_idIsSet(true);
      return this;
    }

    public void unsetCustomer_id() {
      __isset_bit_vector.clear(__CUSTOMER_ID_ISSET_ID);
    }

    /** Returns true if field customer_id is set (has been asigned a value) and false otherwise */
    public boolean isSetCustomer_id() {
      return __isset_bit_vector.get(__CUSTOMER_ID_ISSET_ID);
    }

    public void setCustomer_idIsSet(boolean value) {
      __isset_bit_vector.set(__CUSTOMER_ID_ISSET_ID, value);
    }

    public long getLimit() {
      return this.limit;
    }

    public getCancellableOrdersForCustomer_args setLimit(long limit) {
      this.limit = limit;
      setLimitIsSet(true);
      return this;
    }

    public void unsetLimit() {
      __isset_bit_vector.clear(__LIMIT_ISSET_ID);
    }

    /** Returns true if field limit is set (has been asigned a value) and false otherwise */
    public boolean isSetLimit() {
      return __isset_bit_vector.get(__LIMIT_ISSET_ID);
    }

    public void setLimitIsSet(boolean value) {
      __isset_bit_vector.set(__LIMIT_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CUSTOMER_ID:
        if (value == null) {
          unsetCustomer_id();
        } else {
          setCustomer_id((Long)value);
        }
        break;

      case LIMIT:
        if (value == null) {
          unsetLimit();
        } else {
          setLimit((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return new Long(getCustomer_id());

      case LIMIT:
        return new Long(getLimit());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return isSetCustomer_id();
      case LIMIT:
        return isSetLimit();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_customer_id = true;
      boolean that_present_customer_id = true;
      if (this_present_customer_id || that_present_customer_id) {
        if (!(this_present_customer_id && that_present_customer_id))
          return false;
        if (this.customer_id != that.customer_id)
          return false;
      }

      boolean this_present_limit = true;
      boolean that_present_limit = true;
      if (this_present_limit || that_present_limit) {
        if (!(this_present_limit && that_present_limit))
          return false;
        if (this.limit != that.limit)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetCustomer_id()).compareTo(isSetCustomer_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(customer_id, typedOther.customer_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetLimit()).compareTo(isSetLimit());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(limit, typedOther.limit);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CUSTOMER_ID:
              if (field.type == TType.I64) {
                this.customer_id = iprot.readI64();
                setCustomer_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case LIMIT:
              if (field.type == TType.I64) {
                this.limit = iprot.readI64();
                setLimitIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
      oprot.writeI64(this.customer_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(LIMIT_FIELD_DESC);
      oprot.writeI64(this.limit);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("customer_id:");
      sb.append(this.customer_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("limit:");
      sb.append(this.limit);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getCancellableOrdersForCustomer_result implements TBase<getCancellableOrdersForCustomer_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCancellableOrdersForCustomer_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getCancellableOrdersForCustomer_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Long> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new FieldValueMetaData(TType.I64))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getCancellableOrdersForCustomer_result.class, metaDataMap);
    }

    public getCancellableOrdersForCustomer_result() {
    }

    public getCancellableOrdersForCustomer_result(
      List<Long> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCancellableOrdersForCustomer_result(getCancellableOrdersForCustomer_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.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getCancellableOrdersForCustomer_result clone() {
      return new getCancellableOrdersForCustomer_result(this);
    }

    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 getCancellableOrdersForCustomer_result setSuccess(List<Long> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getCancellableOrdersForCustomer_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list28 = iprot.readListBegin();
                  this.success = new ArrayList<Long>(_list28.size);
                  for (int _i29 = 0; _i29 < _list28.size; ++_i29)
                  {
                    long _elem30;
                    _elem30 = iprot.readI64();
                    this.success.add(_elem30);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.I64, this.success.size()));
          for (long _iter31 : this.success)
          {
            oprot.writeI64(_iter31);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class changeOrderStatus_args implements TBase<changeOrderStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<changeOrderStatus_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("changeOrderStatus_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)2);
    private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)3);

    private long orderId;
    private OrderStatus status;
    private String description;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId"),
      /**
       * 
       * @see OrderStatus
       */
      STATUS((short)2, "status"),
      DESCRIPTION((short)3, "description");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, OrderStatus.class)));
      put(_Fields.DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(changeOrderStatus_args.class, metaDataMap);
    }

    public changeOrderStatus_args() {
    }

    public changeOrderStatus_args(
      long orderId,
      OrderStatus status,
      String description)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.status = status;
      this.description = description;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeOrderStatus_args(changeOrderStatus_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
      if (other.isSetDescription()) {
        this.description = other.description;
      }
    }

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

    @Deprecated
    public changeOrderStatus_args clone() {
      return new changeOrderStatus_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public changeOrderStatus_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    /**
     * 
     * @see OrderStatus
     */
    public OrderStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see OrderStatus
     */
    public changeOrderStatus_args setStatus(OrderStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public String getDescription() {
      return this.description;
    }

    public changeOrderStatus_args setDescription(String description) {
      this.description = description;
      return this;
    }

    public void unsetDescription() {
      this.description = null;
    }

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

    public void setDescriptionIsSet(boolean value) {
      if (!value) {
        this.description = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((OrderStatus)value);
        }
        break;

      case DESCRIPTION:
        if (value == null) {
          unsetDescription();
        } else {
          setDescription((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      case STATUS:
        return getStatus();

      case DESCRIPTION:
        return getDescription();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      case STATUS:
        return isSetStatus();
      case DESCRIPTION:
        return isSetDescription();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      boolean this_present_description = true && this.isSetDescription();
      boolean that_present_description = true && that.isSetDescription();
      if (this_present_description || that_present_description) {
        if (!(this_present_description && that_present_description))
          return false;
        if (!this.description.equals(that.description))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetDescription()).compareTo(isSetDescription());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(description, typedOther.description);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case STATUS:
              if (field.type == TType.I32) {
                this.status = OrderStatus.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case DESCRIPTION:
              if (field.type == TType.STRING) {
                this.description = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      if (this.description != null) {
        oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
        oprot.writeString(this.description);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("description:");
      if (this.description == null) {
        sb.append("null");
      } else {
        sb.append(this.description);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class changeOrderStatus_result implements TBase<changeOrderStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<changeOrderStatus_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("changeOrderStatus_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private boolean success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(changeOrderStatus_result.class, metaDataMap);
    }

    public changeOrderStatus_result() {
    }

    public changeOrderStatus_result(
      boolean success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeOrderStatus_result(changeOrderStatus_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public changeOrderStatus_result clone() {
      return new changeOrderStatus_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public changeOrderStatus_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public changeOrderStatus_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addBillingDetails_args implements TBase<addBillingDetails_args._Fields>, java.io.Serializable, Cloneable, Comparable<addBillingDetails_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addBillingDetails_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
    private static final TField INVOICE_NUMBER_FIELD_DESC = new TField("invoice_number", TType.STRING, (short)2);
    private static final TField BILLED_BY_FIELD_DESC = new TField("billed_by", TType.STRING, (short)3);

    private long orderId;
    private String invoice_number;
    private String billed_by;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId"),
      INVOICE_NUMBER((short)2, "invoice_number"),
      BILLED_BY((short)3, "billed_by");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.INVOICE_NUMBER, new FieldMetaData("invoice_number", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.BILLED_BY, new FieldMetaData("billed_by", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addBillingDetails_args.class, metaDataMap);
    }

    public addBillingDetails_args() {
    }

    public addBillingDetails_args(
      long orderId,
      String invoice_number,
      String billed_by)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.invoice_number = invoice_number;
      this.billed_by = billed_by;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addBillingDetails_args(addBillingDetails_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
      if (other.isSetInvoice_number()) {
        this.invoice_number = other.invoice_number;
      }
      if (other.isSetBilled_by()) {
        this.billed_by = other.billed_by;
      }
    }

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

    @Deprecated
    public addBillingDetails_args clone() {
      return new addBillingDetails_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public addBillingDetails_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public String getInvoice_number() {
      return this.invoice_number;
    }

    public addBillingDetails_args setInvoice_number(String invoice_number) {
      this.invoice_number = invoice_number;
      return this;
    }

    public void unsetInvoice_number() {
      this.invoice_number = null;
    }

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

    public void setInvoice_numberIsSet(boolean value) {
      if (!value) {
        this.invoice_number = null;
      }
    }

    public String getBilled_by() {
      return this.billed_by;
    }

    public addBillingDetails_args setBilled_by(String billed_by) {
      this.billed_by = billed_by;
      return this;
    }

    public void unsetBilled_by() {
      this.billed_by = null;
    }

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

    public void setBilled_byIsSet(boolean value) {
      if (!value) {
        this.billed_by = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case INVOICE_NUMBER:
        if (value == null) {
          unsetInvoice_number();
        } else {
          setInvoice_number((String)value);
        }
        break;

      case BILLED_BY:
        if (value == null) {
          unsetBilled_by();
        } else {
          setBilled_by((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      case INVOICE_NUMBER:
        return getInvoice_number();

      case BILLED_BY:
        return getBilled_by();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      case INVOICE_NUMBER:
        return isSetInvoice_number();
      case BILLED_BY:
        return isSetBilled_by();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_invoice_number = true && this.isSetInvoice_number();
      boolean that_present_invoice_number = true && that.isSetInvoice_number();
      if (this_present_invoice_number || that_present_invoice_number) {
        if (!(this_present_invoice_number && that_present_invoice_number))
          return false;
        if (!this.invoice_number.equals(that.invoice_number))
          return false;
      }

      boolean this_present_billed_by = true && this.isSetBilled_by();
      boolean that_present_billed_by = true && that.isSetBilled_by();
      if (this_present_billed_by || that_present_billed_by) {
        if (!(this_present_billed_by && that_present_billed_by))
          return false;
        if (!this.billed_by.equals(that.billed_by))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetInvoice_number()).compareTo(isSetInvoice_number());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(invoice_number, typedOther.invoice_number);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetBilled_by()).compareTo(isSetBilled_by());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(billed_by, typedOther.billed_by);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case INVOICE_NUMBER:
              if (field.type == TType.STRING) {
                this.invoice_number = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case BILLED_BY:
              if (field.type == TType.STRING) {
                this.billed_by = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      if (this.invoice_number != null) {
        oprot.writeFieldBegin(INVOICE_NUMBER_FIELD_DESC);
        oprot.writeString(this.invoice_number);
        oprot.writeFieldEnd();
      }
      if (this.billed_by != null) {
        oprot.writeFieldBegin(BILLED_BY_FIELD_DESC);
        oprot.writeString(this.billed_by);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("invoice_number:");
      if (this.invoice_number == null) {
        sb.append("null");
      } else {
        sb.append(this.invoice_number);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("billed_by:");
      if (this.billed_by == null) {
        sb.append("null");
      } else {
        sb.append(this.billed_by);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addBillingDetails_result implements TBase<addBillingDetails_result._Fields>, java.io.Serializable, Cloneable, Comparable<addBillingDetails_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addBillingDetails_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private boolean success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addBillingDetails_result.class, metaDataMap);
    }

    public addBillingDetails_result() {
    }

    public addBillingDetails_result(
      boolean success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addBillingDetails_result(addBillingDetails_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public addBillingDetails_result clone() {
      return new addBillingDetails_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public addBillingDetails_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public addBillingDetails_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addJacketNumber_args implements TBase<addJacketNumber_args._Fields>, java.io.Serializable, Cloneable, Comparable<addJacketNumber_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addJacketNumber_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
    private static final TField JACKET_NUMBER_FIELD_DESC = new TField("jacketNumber", TType.I64, (short)2);

    private long orderId;
    private long jacketNumber;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId"),
      JACKET_NUMBER((short)2, "jacketNumber");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private static final int __JACKETNUMBER_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.JACKET_NUMBER, new FieldMetaData("jacketNumber", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addJacketNumber_args.class, metaDataMap);
    }

    public addJacketNumber_args() {
    }

    public addJacketNumber_args(
      long orderId,
      long jacketNumber)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.jacketNumber = jacketNumber;
      setJacketNumberIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addJacketNumber_args(addJacketNumber_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
      this.jacketNumber = other.jacketNumber;
    }

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

    @Deprecated
    public addJacketNumber_args clone() {
      return new addJacketNumber_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public addJacketNumber_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public long getJacketNumber() {
      return this.jacketNumber;
    }

    public addJacketNumber_args setJacketNumber(long jacketNumber) {
      this.jacketNumber = jacketNumber;
      setJacketNumberIsSet(true);
      return this;
    }

    public void unsetJacketNumber() {
      __isset_bit_vector.clear(__JACKETNUMBER_ISSET_ID);
    }

    /** Returns true if field jacketNumber is set (has been asigned a value) and false otherwise */
    public boolean isSetJacketNumber() {
      return __isset_bit_vector.get(__JACKETNUMBER_ISSET_ID);
    }

    public void setJacketNumberIsSet(boolean value) {
      __isset_bit_vector.set(__JACKETNUMBER_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case JACKET_NUMBER:
        if (value == null) {
          unsetJacketNumber();
        } else {
          setJacketNumber((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      case JACKET_NUMBER:
        return new Long(getJacketNumber());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      case JACKET_NUMBER:
        return isSetJacketNumber();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_jacketNumber = true;
      boolean that_present_jacketNumber = true;
      if (this_present_jacketNumber || that_present_jacketNumber) {
        if (!(this_present_jacketNumber && that_present_jacketNumber))
          return false;
        if (this.jacketNumber != that.jacketNumber)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetJacketNumber()).compareTo(isSetJacketNumber());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(jacketNumber, typedOther.jacketNumber);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case JACKET_NUMBER:
              if (field.type == TType.I64) {
                this.jacketNumber = iprot.readI64();
                setJacketNumberIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(JACKET_NUMBER_FIELD_DESC);
      oprot.writeI64(this.jacketNumber);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("jacketNumber:");
      sb.append(this.jacketNumber);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addJacketNumber_result implements TBase<addJacketNumber_result._Fields>, java.io.Serializable, Cloneable, Comparable<addJacketNumber_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addJacketNumber_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private boolean success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addJacketNumber_result.class, metaDataMap);
    }

    public addJacketNumber_result() {
    }

    public addJacketNumber_result(
      boolean success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addJacketNumber_result(addJacketNumber_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public addJacketNumber_result clone() {
      return new addJacketNumber_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public addJacketNumber_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public addJacketNumber_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class acceptOrder_args implements TBase<acceptOrder_args._Fields>, java.io.Serializable, Cloneable, Comparable<acceptOrder_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("acceptOrder_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);

    private long orderId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(acceptOrder_args.class, metaDataMap);
    }

    public acceptOrder_args() {
    }

    public acceptOrder_args(
      long orderId)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public acceptOrder_args(acceptOrder_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
    }

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

    @Deprecated
    public acceptOrder_args clone() {
      return new acceptOrder_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public acceptOrder_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class acceptOrder_result implements TBase<acceptOrder_result._Fields>, java.io.Serializable, Cloneable, Comparable<acceptOrder_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("acceptOrder_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private boolean success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(acceptOrder_result.class, metaDataMap);
    }

    public acceptOrder_result() {
    }

    public acceptOrder_result(
      boolean success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public acceptOrder_result(acceptOrder_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public acceptOrder_result clone() {
      return new acceptOrder_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public acceptOrder_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public acceptOrder_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class billOrder_args implements TBase<billOrder_args._Fields>, java.io.Serializable, Cloneable, Comparable<billOrder_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("billOrder_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);

    private long orderId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(billOrder_args.class, metaDataMap);
    }

    public billOrder_args() {
    }

    public billOrder_args(
      long orderId)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public billOrder_args(billOrder_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
    }

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

    @Deprecated
    public billOrder_args clone() {
      return new billOrder_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public billOrder_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class billOrder_result implements TBase<billOrder_result._Fields>, java.io.Serializable, Cloneable, Comparable<billOrder_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("billOrder_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private boolean success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(billOrder_result.class, metaDataMap);
    }

    public billOrder_result() {
    }

    public billOrder_result(
      boolean success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public billOrder_result(billOrder_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public billOrder_result clone() {
      return new billOrder_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public billOrder_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public billOrder_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrdersForTransaction_args implements TBase<getOrdersForTransaction_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrdersForTransaction_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrdersForTransaction_args");

    private static final TField TRANSACTION_ID_FIELD_DESC = new TField("transactionId", TType.I64, (short)1);
    private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customerId", TType.I64, (short)2);

    private long transactionId;
    private long customerId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      TRANSACTION_ID((short)1, "transactionId"),
      CUSTOMER_ID((short)2, "customerId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __TRANSACTIONID_ISSET_ID = 0;
    private static final int __CUSTOMERID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.TRANSACTION_ID, new FieldMetaData("transactionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.CUSTOMER_ID, new FieldMetaData("customerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrdersForTransaction_args.class, metaDataMap);
    }

    public getOrdersForTransaction_args() {
    }

    public getOrdersForTransaction_args(
      long transactionId,
      long customerId)
    {
      this();
      this.transactionId = transactionId;
      setTransactionIdIsSet(true);
      this.customerId = customerId;
      setCustomerIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrdersForTransaction_args(getOrdersForTransaction_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.transactionId = other.transactionId;
      this.customerId = other.customerId;
    }

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

    @Deprecated
    public getOrdersForTransaction_args clone() {
      return new getOrdersForTransaction_args(this);
    }

    public long getTransactionId() {
      return this.transactionId;
    }

    public getOrdersForTransaction_args setTransactionId(long transactionId) {
      this.transactionId = transactionId;
      setTransactionIdIsSet(true);
      return this;
    }

    public void unsetTransactionId() {
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
    }

    /** Returns true if field transactionId is set (has been asigned a value) and false otherwise */
    public boolean isSetTransactionId() {
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
    }

    public void setTransactionIdIsSet(boolean value) {
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
    }

    public long getCustomerId() {
      return this.customerId;
    }

    public getOrdersForTransaction_args setCustomerId(long customerId) {
      this.customerId = customerId;
      setCustomerIdIsSet(true);
      return this;
    }

    public void unsetCustomerId() {
      __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
    }

    /** Returns true if field customerId is set (has been asigned a value) and false otherwise */
    public boolean isSetCustomerId() {
      return __isset_bit_vector.get(__CUSTOMERID_ISSET_ID);
    }

    public void setCustomerIdIsSet(boolean value) {
      __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TRANSACTION_ID:
        if (value == null) {
          unsetTransactionId();
        } else {
          setTransactionId((Long)value);
        }
        break;

      case CUSTOMER_ID:
        if (value == null) {
          unsetCustomerId();
        } else {
          setCustomerId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TRANSACTION_ID:
        return new Long(getTransactionId());

      case CUSTOMER_ID:
        return new Long(getCustomerId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case TRANSACTION_ID:
        return isSetTransactionId();
      case CUSTOMER_ID:
        return isSetCustomerId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_transactionId = true;
      boolean that_present_transactionId = true;
      if (this_present_transactionId || that_present_transactionId) {
        if (!(this_present_transactionId && that_present_transactionId))
          return false;
        if (this.transactionId != that.transactionId)
          return false;
      }

      boolean this_present_customerId = true;
      boolean that_present_customerId = true;
      if (this_present_customerId || that_present_customerId) {
        if (!(this_present_customerId && that_present_customerId))
          return false;
        if (this.customerId != that.customerId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(isSetTransactionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(transactionId, typedOther.transactionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(isSetCustomerId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(customerId, typedOther.customerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case TRANSACTION_ID:
              if (field.type == TType.I64) {
                this.transactionId = iprot.readI64();
                setTransactionIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CUSTOMER_ID:
              if (field.type == TType.I64) {
                this.customerId = iprot.readI64();
                setCustomerIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
      oprot.writeI64(this.transactionId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
      oprot.writeI64(this.customerId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("transactionId:");
      sb.append(this.transactionId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("customerId:");
      sb.append(this.customerId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrdersForTransaction_result implements TBase<getOrdersForTransaction_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOrdersForTransaction_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrdersForTransaction_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Order> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Order.class))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrdersForTransaction_result.class, metaDataMap);
    }

    public getOrdersForTransaction_result() {
    }

    public getOrdersForTransaction_result(
      List<Order> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrdersForTransaction_result(getOrdersForTransaction_result other) {
      if (other.isSetSuccess()) {
        List<Order> __this__success = new ArrayList<Order>();
        for (Order other_element : other.success) {
          __this__success.add(new Order(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getOrdersForTransaction_result clone() {
      return new getOrdersForTransaction_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Order> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Order elem) {
      if (this.success == null) {
        this.success = new ArrayList<Order>();
      }
      this.success.add(elem);
    }

    public List<Order> getSuccess() {
      return this.success;
    }

    public getOrdersForTransaction_result setSuccess(List<Order> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getOrdersForTransaction_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list32 = iprot.readListBegin();
                  this.success = new ArrayList<Order>(_list32.size);
                  for (int _i33 = 0; _i33 < _list32.size; ++_i33)
                  {
                    Order _elem34;
                    _elem34 = new Order();
                    _elem34.read(iprot);
                    this.success.add(_elem34);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Order _iter35 : this.success)
          {
            _iter35.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrdersForCustomer_args implements TBase<getOrdersForCustomer_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrdersForCustomer_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrdersForCustomer_args");

    private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customerId", TType.I64, (short)1);
    private static final TField FROM_DATE_FIELD_DESC = new TField("from_date", TType.I64, (short)2);
    private static final TField TO_DATE_FIELD_DESC = new TField("to_date", TType.I64, (short)3);
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)4);

    private long customerId;
    private long from_date;
    private long to_date;
    private OrderStatus status;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CUSTOMER_ID((short)1, "customerId"),
      FROM_DATE((short)2, "from_date"),
      TO_DATE((short)3, "to_date"),
      /**
       * 
       * @see OrderStatus
       */
      STATUS((short)4, "status");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __CUSTOMERID_ISSET_ID = 0;
    private static final int __FROM_DATE_ISSET_ID = 1;
    private static final int __TO_DATE_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CUSTOMER_ID, new FieldMetaData("customerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.FROM_DATE, new FieldMetaData("from_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TO_DATE, new FieldMetaData("to_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, OrderStatus.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrdersForCustomer_args.class, metaDataMap);
    }

    public getOrdersForCustomer_args() {
    }

    public getOrdersForCustomer_args(
      long customerId,
      long from_date,
      long to_date,
      OrderStatus status)
    {
      this();
      this.customerId = customerId;
      setCustomerIdIsSet(true);
      this.from_date = from_date;
      setFrom_dateIsSet(true);
      this.to_date = to_date;
      setTo_dateIsSet(true);
      this.status = status;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrdersForCustomer_args(getOrdersForCustomer_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.customerId = other.customerId;
      this.from_date = other.from_date;
      this.to_date = other.to_date;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
    }

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

    @Deprecated
    public getOrdersForCustomer_args clone() {
      return new getOrdersForCustomer_args(this);
    }

    public long getCustomerId() {
      return this.customerId;
    }

    public getOrdersForCustomer_args setCustomerId(long customerId) {
      this.customerId = customerId;
      setCustomerIdIsSet(true);
      return this;
    }

    public void unsetCustomerId() {
      __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
    }

    /** Returns true if field customerId is set (has been asigned a value) and false otherwise */
    public boolean isSetCustomerId() {
      return __isset_bit_vector.get(__CUSTOMERID_ISSET_ID);
    }

    public void setCustomerIdIsSet(boolean value) {
      __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
    }

    public long getFrom_date() {
      return this.from_date;
    }

    public getOrdersForCustomer_args setFrom_date(long from_date) {
      this.from_date = from_date;
      setFrom_dateIsSet(true);
      return this;
    }

    public void unsetFrom_date() {
      __isset_bit_vector.clear(__FROM_DATE_ISSET_ID);
    }

    /** Returns true if field from_date is set (has been asigned a value) and false otherwise */
    public boolean isSetFrom_date() {
      return __isset_bit_vector.get(__FROM_DATE_ISSET_ID);
    }

    public void setFrom_dateIsSet(boolean value) {
      __isset_bit_vector.set(__FROM_DATE_ISSET_ID, value);
    }

    public long getTo_date() {
      return this.to_date;
    }

    public getOrdersForCustomer_args setTo_date(long to_date) {
      this.to_date = to_date;
      setTo_dateIsSet(true);
      return this;
    }

    public void unsetTo_date() {
      __isset_bit_vector.clear(__TO_DATE_ISSET_ID);
    }

    /** Returns true if field to_date is set (has been asigned a value) and false otherwise */
    public boolean isSetTo_date() {
      return __isset_bit_vector.get(__TO_DATE_ISSET_ID);
    }

    public void setTo_dateIsSet(boolean value) {
      __isset_bit_vector.set(__TO_DATE_ISSET_ID, value);
    }

    /**
     * 
     * @see OrderStatus
     */
    public OrderStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see OrderStatus
     */
    public getOrdersForCustomer_args setStatus(OrderStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CUSTOMER_ID:
        if (value == null) {
          unsetCustomerId();
        } else {
          setCustomerId((Long)value);
        }
        break;

      case FROM_DATE:
        if (value == null) {
          unsetFrom_date();
        } else {
          setFrom_date((Long)value);
        }
        break;

      case TO_DATE:
        if (value == null) {
          unsetTo_date();
        } else {
          setTo_date((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((OrderStatus)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return new Long(getCustomerId());

      case FROM_DATE:
        return new Long(getFrom_date());

      case TO_DATE:
        return new Long(getTo_date());

      case STATUS:
        return getStatus();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return isSetCustomerId();
      case FROM_DATE:
        return isSetFrom_date();
      case TO_DATE:
        return isSetTo_date();
      case STATUS:
        return isSetStatus();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_customerId = true;
      boolean that_present_customerId = true;
      if (this_present_customerId || that_present_customerId) {
        if (!(this_present_customerId && that_present_customerId))
          return false;
        if (this.customerId != that.customerId)
          return false;
      }

      boolean this_present_from_date = true;
      boolean that_present_from_date = true;
      if (this_present_from_date || that_present_from_date) {
        if (!(this_present_from_date && that_present_from_date))
          return false;
        if (this.from_date != that.from_date)
          return false;
      }

      boolean this_present_to_date = true;
      boolean that_present_to_date = true;
      if (this_present_to_date || that_present_to_date) {
        if (!(this_present_to_date && that_present_to_date))
          return false;
        if (this.to_date != that.to_date)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(isSetCustomerId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(customerId, typedOther.customerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetFrom_date()).compareTo(isSetFrom_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(from_date, typedOther.from_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTo_date()).compareTo(isSetTo_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(to_date, typedOther.to_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CUSTOMER_ID:
              if (field.type == TType.I64) {
                this.customerId = iprot.readI64();
                setCustomerIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case FROM_DATE:
              if (field.type == TType.I64) {
                this.from_date = iprot.readI64();
                setFrom_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TO_DATE:
              if (field.type == TType.I64) {
                this.to_date = iprot.readI64();
                setTo_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case STATUS:
              if (field.type == TType.I32) {
                this.status = OrderStatus.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
      oprot.writeI64(this.customerId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FROM_DATE_FIELD_DESC);
      oprot.writeI64(this.from_date);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_DATE_FIELD_DESC);
      oprot.writeI64(this.to_date);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("customerId:");
      sb.append(this.customerId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("from_date:");
      sb.append(this.from_date);
      first = false;
      if (!first) sb.append(", ");
      sb.append("to_date:");
      sb.append(this.to_date);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrdersForCustomer_result implements TBase<getOrdersForCustomer_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOrdersForCustomer_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrdersForCustomer_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Order> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Order.class))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrdersForCustomer_result.class, metaDataMap);
    }

    public getOrdersForCustomer_result() {
    }

    public getOrdersForCustomer_result(
      List<Order> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrdersForCustomer_result(getOrdersForCustomer_result other) {
      if (other.isSetSuccess()) {
        List<Order> __this__success = new ArrayList<Order>();
        for (Order other_element : other.success) {
          __this__success.add(new Order(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getOrdersForCustomer_result clone() {
      return new getOrdersForCustomer_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Order> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Order elem) {
      if (this.success == null) {
        this.success = new ArrayList<Order>();
      }
      this.success.add(elem);
    }

    public List<Order> getSuccess() {
      return this.success;
    }

    public getOrdersForCustomer_result setSuccess(List<Order> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getOrdersForCustomer_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list36 = iprot.readListBegin();
                  this.success = new ArrayList<Order>(_list36.size);
                  for (int _i37 = 0; _i37 < _list36.size; ++_i37)
                  {
                    Order _elem38;
                    _elem38 = new Order();
                    _elem38.read(iprot);
                    this.success.add(_elem38);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Order _iter39 : this.success)
          {
            _iter39.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class createOrder_args implements TBase<createOrder_args._Fields>, java.io.Serializable, Cloneable, Comparable<createOrder_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("createOrder_args");

    private static final TField ORDER_FIELD_DESC = new TField("order", TType.STRUCT, (short)1);

    private Order order;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER((short)1, "order");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER, new FieldMetaData("order", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Order.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(createOrder_args.class, metaDataMap);
    }

    public createOrder_args() {
    }

    public createOrder_args(
      Order order)
    {
      this();
      this.order = order;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createOrder_args(createOrder_args other) {
      if (other.isSetOrder()) {
        this.order = new Order(other.order);
      }
    }

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

    @Deprecated
    public createOrder_args clone() {
      return new createOrder_args(this);
    }

    public Order getOrder() {
      return this.order;
    }

    public createOrder_args setOrder(Order order) {
      this.order = order;
      return this;
    }

    public void unsetOrder() {
      this.order = null;
    }

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

    public void setOrderIsSet(boolean value) {
      if (!value) {
        this.order = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER:
        if (value == null) {
          unsetOrder();
        } else {
          setOrder((Order)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER:
        return getOrder();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER:
        return isSetOrder();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_order = true && this.isSetOrder();
      boolean that_present_order = true && that.isSetOrder();
      if (this_present_order || that_present_order) {
        if (!(this_present_order && that_present_order))
          return false;
        if (!this.order.equals(that.order))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrder()).compareTo(isSetOrder());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(order, typedOther.order);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER:
              if (field.type == TType.STRUCT) {
                this.order = new Order();
                this.order.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

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

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

      sb.append("order:");
      if (this.order == null) {
        sb.append("null");
      } else {
        sb.append(this.order);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class createOrder_result implements TBase<createOrder_result._Fields>, java.io.Serializable, Cloneable, Comparable<createOrder_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("createOrder_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private long success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(createOrder_result.class, metaDataMap);
    }

    public createOrder_result() {
    }

    public createOrder_result(
      long success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createOrder_result(createOrder_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public createOrder_result clone() {
      return new createOrder_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public createOrder_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public createOrder_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrder_args implements TBase<getOrder_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrder_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrder_args");

    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);

    private long id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ID((short)1, "id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrder_args.class, metaDataMap);
    }

    public getOrder_args() {
    }

    public getOrder_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrder_args(getOrder_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

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

    @Deprecated
    public getOrder_args clone() {
      return new getOrder_args(this);
    }

    public long getId() {
      return this.id;
    }

    public getOrder_args setId(long id) {
      this.id = id;
      setIdIsSet(true);
      return this;
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been asigned 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 void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return new Long(getId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getOrder_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(getOrder_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ID:
              if (field.type == TType.I64) {
                this.id = iprot.readI64();
                setIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws 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("getOrder_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrder_result implements TBase<getOrder_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOrder_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrder_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private Order success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Order.class)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrder_result.class, metaDataMap);
    }

    public getOrder_result() {
    }

    public getOrder_result(
      Order success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrder_result(getOrder_result other) {
      if (other.isSetSuccess()) {
        this.success = new Order(other.success);
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getOrder_result clone() {
      return new getOrder_result(this);
    }

    public Order getSuccess() {
      return this.success;
    }

    public getOrder_result setSuccess(Order success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getOrder_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new Order();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getLineItemsForOrder_args implements TBase<getLineItemsForOrder_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLineItemsForOrder_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getLineItemsForOrder_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);

    private long orderId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getLineItemsForOrder_args.class, metaDataMap);
    }

    public getLineItemsForOrder_args() {
    }

    public getLineItemsForOrder_args(
      long orderId)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLineItemsForOrder_args(getLineItemsForOrder_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
    }

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

    @Deprecated
    public getLineItemsForOrder_args clone() {
      return new getLineItemsForOrder_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public getLineItemsForOrder_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getLineItemsForOrder_result implements TBase<getLineItemsForOrder_result._Fields>, java.io.Serializable, Cloneable, Comparable<getLineItemsForOrder_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getLineItemsForOrder_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<LineItem> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, LineItem.class))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getLineItemsForOrder_result.class, metaDataMap);
    }

    public getLineItemsForOrder_result() {
    }

    public getLineItemsForOrder_result(
      List<LineItem> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLineItemsForOrder_result(getLineItemsForOrder_result other) {
      if (other.isSetSuccess()) {
        List<LineItem> __this__success = new ArrayList<LineItem>();
        for (LineItem other_element : other.success) {
          __this__success.add(new LineItem(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getLineItemsForOrder_result clone() {
      return new getLineItemsForOrder_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<LineItem> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(LineItem elem) {
      if (this.success == null) {
        this.success = new ArrayList<LineItem>();
      }
      this.success.add(elem);
    }

    public List<LineItem> getSuccess() {
      return this.success;
    }

    public getLineItemsForOrder_result setSuccess(List<LineItem> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getLineItemsForOrder_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list40 = iprot.readListBegin();
                  this.success = new ArrayList<LineItem>(_list40.size);
                  for (int _i41 = 0; _i41 < _list40.size; ++_i41)
                  {
                    LineItem _elem42;
                    _elem42 = new LineItem();
                    _elem42.read(iprot);
                    this.success.add(_elem42);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (LineItem _iter43 : this.success)
          {
            _iter43.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrderForCustomer_args implements TBase<getOrderForCustomer_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrderForCustomer_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrderForCustomer_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
    private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customerId", TType.I64, (short)2);

    private long orderId;
    private long customerId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId"),
      CUSTOMER_ID((short)2, "customerId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private static final int __CUSTOMERID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.CUSTOMER_ID, new FieldMetaData("customerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrderForCustomer_args.class, metaDataMap);
    }

    public getOrderForCustomer_args() {
    }

    public getOrderForCustomer_args(
      long orderId,
      long customerId)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.customerId = customerId;
      setCustomerIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrderForCustomer_args(getOrderForCustomer_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
      this.customerId = other.customerId;
    }

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

    @Deprecated
    public getOrderForCustomer_args clone() {
      return new getOrderForCustomer_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public getOrderForCustomer_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public long getCustomerId() {
      return this.customerId;
    }

    public getOrderForCustomer_args setCustomerId(long customerId) {
      this.customerId = customerId;
      setCustomerIdIsSet(true);
      return this;
    }

    public void unsetCustomerId() {
      __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
    }

    /** Returns true if field customerId is set (has been asigned a value) and false otherwise */
    public boolean isSetCustomerId() {
      return __isset_bit_vector.get(__CUSTOMERID_ISSET_ID);
    }

    public void setCustomerIdIsSet(boolean value) {
      __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case CUSTOMER_ID:
        if (value == null) {
          unsetCustomerId();
        } else {
          setCustomerId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      case CUSTOMER_ID:
        return new Long(getCustomerId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      case CUSTOMER_ID:
        return isSetCustomerId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_customerId = true;
      boolean that_present_customerId = true;
      if (this_present_customerId || that_present_customerId) {
        if (!(this_present_customerId && that_present_customerId))
          return false;
        if (this.customerId != that.customerId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(isSetCustomerId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(customerId, typedOther.customerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CUSTOMER_ID:
              if (field.type == TType.I64) {
                this.customerId = iprot.readI64();
                setCustomerIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
      oprot.writeI64(this.customerId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("customerId:");
      sb.append(this.customerId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getOrderForCustomer_result implements TBase<getOrderForCustomer_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOrderForCustomer_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getOrderForCustomer_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private Order success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Order.class)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getOrderForCustomer_result.class, metaDataMap);
    }

    public getOrderForCustomer_result() {
    }

    public getOrderForCustomer_result(
      Order success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getOrderForCustomer_result(getOrderForCustomer_result other) {
      if (other.isSetSuccess()) {
        this.success = new Order(other.success);
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public getOrderForCustomer_result clone() {
      return new getOrderForCustomer_result(this);
    }

    public Order getSuccess() {
      return this.success;
    }

    public getOrderForCustomer_result setSuccess(Order success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public getOrderForCustomer_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new Order();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class batchOrders_args implements TBase<batchOrders_args._Fields>, java.io.Serializable, Cloneable, Comparable<batchOrders_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("batchOrders_args");

    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouseId", TType.I64, (short)1);

    private long warehouseId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      WAREHOUSE_ID((short)1, "warehouseId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __WAREHOUSEID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouseId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(batchOrders_args.class, metaDataMap);
    }

    public batchOrders_args() {
    }

    public batchOrders_args(
      long warehouseId)
    {
      this();
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public batchOrders_args(batchOrders_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouseId = other.warehouseId;
    }

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

    @Deprecated
    public batchOrders_args clone() {
      return new batchOrders_args(this);
    }

    public long getWarehouseId() {
      return this.warehouseId;
    }

    public batchOrders_args setWarehouseId(long warehouseId) {
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
      return this;
    }

    public void unsetWarehouseId() {
      __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field warehouseId is set (has been asigned a value) and false otherwise */
    public boolean isSetWarehouseId() {
      return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
    }

    public void setWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouseId();
        } else {
          setWarehouseId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return new Long(getWarehouseId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return isSetWarehouseId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_warehouseId = true;
      boolean that_present_warehouseId = true;
      if (this_present_warehouseId || that_present_warehouseId) {
        if (!(this_present_warehouseId && that_present_warehouseId))
          return false;
        if (this.warehouseId != that.warehouseId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(isSetWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouseId, typedOther.warehouseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouseId = iprot.readI64();
                setWarehouseIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("warehouseId:");
      sb.append(this.warehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class batchOrders_result implements TBase<batchOrders_result._Fields>, java.io.Serializable, Cloneable, Comparable<batchOrders_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("batchOrders_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Order> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Order.class))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(batchOrders_result.class, metaDataMap);
    }

    public batchOrders_result() {
    }

    public batchOrders_result(
      List<Order> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public batchOrders_result(batchOrders_result other) {
      if (other.isSetSuccess()) {
        List<Order> __this__success = new ArrayList<Order>();
        for (Order other_element : other.success) {
          __this__success.add(new Order(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public batchOrders_result clone() {
      return new batchOrders_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Order> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Order elem) {
      if (this.success == null) {
        this.success = new ArrayList<Order>();
      }
      this.success.add(elem);
    }

    public List<Order> getSuccess() {
      return this.success;
    }

    public batchOrders_result setSuccess(List<Order> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public batchOrders_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list44 = iprot.readListBegin();
                  this.success = new ArrayList<Order>(_list44.size);
                  for (int _i45 = 0; _i45 < _list44.size; ++_i45)
                  {
                    Order _elem46;
                    _elem46 = new Order();
                    _elem46.read(iprot);
                    this.success.add(_elem46);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Order _iter47 : this.success)
          {
            _iter47.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class markOrderAsOutOfStock_args implements TBase<markOrderAsOutOfStock_args._Fields>, java.io.Serializable, Cloneable, Comparable<markOrderAsOutOfStock_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("markOrderAsOutOfStock_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);

    private long orderId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrderAsOutOfStock_args.class, metaDataMap);
    }

    public markOrderAsOutOfStock_args() {
    }

    public markOrderAsOutOfStock_args(
      long orderId)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markOrderAsOutOfStock_args(markOrderAsOutOfStock_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
    }

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

    @Deprecated
    public markOrderAsOutOfStock_args clone() {
      return new markOrderAsOutOfStock_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public markOrderAsOutOfStock_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class markOrderAsOutOfStock_result implements TBase<markOrderAsOutOfStock_result._Fields>, java.io.Serializable, Cloneable, Comparable<markOrderAsOutOfStock_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("markOrderAsOutOfStock_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private boolean success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrderAsOutOfStock_result.class, metaDataMap);
    }

    public markOrderAsOutOfStock_result() {
    }

    public markOrderAsOutOfStock_result(
      boolean success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markOrderAsOutOfStock_result(markOrderAsOutOfStock_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public markOrderAsOutOfStock_result clone() {
      return new markOrderAsOutOfStock_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public markOrderAsOutOfStock_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public markOrderAsOutOfStock_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class markOrdersAsManifested_args implements TBase<markOrdersAsManifested_args._Fields>, java.io.Serializable, Cloneable, Comparable<markOrdersAsManifested_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("markOrdersAsManifested_args");

    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouseId", TType.I64, (short)1);
    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)2);

    private long warehouseId;
    private long providerId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      WAREHOUSE_ID((short)1, "warehouseId"),
      PROVIDER_ID((short)2, "providerId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __WAREHOUSEID_ISSET_ID = 0;
    private static final int __PROVIDERID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouseId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrdersAsManifested_args.class, metaDataMap);
    }

    public markOrdersAsManifested_args() {
    }

    public markOrdersAsManifested_args(
      long warehouseId,
      long providerId)
    {
      this();
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
      this.providerId = providerId;
      setProviderIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markOrdersAsManifested_args(markOrdersAsManifested_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouseId = other.warehouseId;
      this.providerId = other.providerId;
    }

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

    @Deprecated
    public markOrdersAsManifested_args clone() {
      return new markOrdersAsManifested_args(this);
    }

    public long getWarehouseId() {
      return this.warehouseId;
    }

    public markOrdersAsManifested_args setWarehouseId(long warehouseId) {
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
      return this;
    }

    public void unsetWarehouseId() {
      __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field warehouseId is set (has been asigned a value) and false otherwise */
    public boolean isSetWarehouseId() {
      return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
    }

    public void setWarehouseIdIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
    }

    public long getProviderId() {
      return this.providerId;
    }

    public markOrdersAsManifested_args setProviderId(long providerId) {
      this.providerId = providerId;
      setProviderIdIsSet(true);
      return this;
    }

    public void unsetProviderId() {
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
    }

    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
    public boolean isSetProviderId() {
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
    }

    public void setProviderIdIsSet(boolean value) {
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouseId();
        } else {
          setWarehouseId((Long)value);
        }
        break;

      case PROVIDER_ID:
        if (value == null) {
          unsetProviderId();
        } else {
          setProviderId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return new Long(getWarehouseId());

      case PROVIDER_ID:
        return new Long(getProviderId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return isSetWarehouseId();
      case PROVIDER_ID:
        return isSetProviderId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_warehouseId = true;
      boolean that_present_warehouseId = true;
      if (this_present_warehouseId || that_present_warehouseId) {
        if (!(this_present_warehouseId && that_present_warehouseId))
          return false;
        if (this.warehouseId != that.warehouseId)
          return false;
      }

      boolean this_present_providerId = true;
      boolean that_present_providerId = true;
      if (this_present_providerId || that_present_providerId) {
        if (!(this_present_providerId && that_present_providerId))
          return false;
        if (this.providerId != that.providerId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(isSetWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouseId, typedOther.warehouseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetProviderId()).compareTo(isSetProviderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(providerId, typedOther.providerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouseId = iprot.readI64();
                setWarehouseIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case PROVIDER_ID:
              if (field.type == TType.I64) {
                this.providerId = iprot.readI64();
                setProviderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouseId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
      oprot.writeI64(this.providerId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("warehouseId:");
      sb.append(this.warehouseId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("providerId:");
      sb.append(this.providerId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class markOrdersAsManifested_result implements TBase<markOrdersAsManifested_result._Fields>, java.io.Serializable, Cloneable, Comparable<markOrdersAsManifested_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("markOrdersAsManifested_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private boolean success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrdersAsManifested_result.class, metaDataMap);
    }

    public markOrdersAsManifested_result() {
    }

    public markOrdersAsManifested_result(
      boolean success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markOrdersAsManifested_result(markOrdersAsManifested_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public markOrdersAsManifested_result clone() {
      return new markOrdersAsManifested_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public markOrdersAsManifested_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 TransactionServiceException getEx() {
      return this.ex;
    }

    public markOrdersAsManifested_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

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

    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
    private static final TField PICKUP_DETAILS_FIELD_DESC = new TField("pickupDetails", TType.MAP, (short)2);

    private long providerId;
    private Map<String,String> pickupDetails;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      PROVIDER_ID((short)1, "providerId"),
      PICKUP_DETAILS((short)2, "pickupDetails");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __PROVIDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.PICKUP_DETAILS, new FieldMetaData("pickupDetails", TFieldRequirementType.DEFAULT, 
          new MapMetaData(TType.MAP, 
              new FieldValueMetaData(TType.STRING), 
              new FieldValueMetaData(TType.STRING))));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrdersAsPickedUp_args.class, metaDataMap);
    }

    public markOrdersAsPickedUp_args() {
    }

    public markOrdersAsPickedUp_args(
      long providerId,
      Map<String,String> pickupDetails)
    {
      this();
      this.providerId = providerId;
      setProviderIdIsSet(true);
      this.pickupDetails = pickupDetails;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markOrdersAsPickedUp_args(markOrdersAsPickedUp_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.providerId = other.providerId;
      if (other.isSetPickupDetails()) {
        Map<String,String> __this__pickupDetails = new HashMap<String,String>();
        for (Map.Entry<String, String> other_element : other.pickupDetails.entrySet()) {

          String other_element_key = other_element.getKey();
          String other_element_value = other_element.getValue();

          String __this__pickupDetails_copy_key = other_element_key;

          String __this__pickupDetails_copy_value = other_element_value;

          __this__pickupDetails.put(__this__pickupDetails_copy_key, __this__pickupDetails_copy_value);
        }
        this.pickupDetails = __this__pickupDetails;
      }
    }

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

    @Deprecated
    public markOrdersAsPickedUp_args clone() {
      return new markOrdersAsPickedUp_args(this);
    }

    public long getProviderId() {
      return this.providerId;
    }

    public markOrdersAsPickedUp_args setProviderId(long providerId) {
      this.providerId = providerId;
      setProviderIdIsSet(true);
      return this;
    }

    public void unsetProviderId() {
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
    }

    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
    public boolean isSetProviderId() {
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
    }

    public void setProviderIdIsSet(boolean value) {
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
    }

    public int getPickupDetailsSize() {
      return (this.pickupDetails == null) ? 0 : this.pickupDetails.size();
    }

    public void putToPickupDetails(String key, String val) {
      if (this.pickupDetails == null) {
        this.pickupDetails = new HashMap<String,String>();
      }
      this.pickupDetails.put(key, val);
    }

    public Map<String,String> getPickupDetails() {
      return this.pickupDetails;
    }

    public markOrdersAsPickedUp_args setPickupDetails(Map<String,String> pickupDetails) {
      this.pickupDetails = pickupDetails;
      return this;
    }

    public void unsetPickupDetails() {
      this.pickupDetails = null;
    }

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

    public void setPickupDetailsIsSet(boolean value) {
      if (!value) {
        this.pickupDetails = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PROVIDER_ID:
        if (value == null) {
          unsetProviderId();
        } else {
          setProviderId((Long)value);
        }
        break;

      case PICKUP_DETAILS:
        if (value == null) {
          unsetPickupDetails();
        } else {
          setPickupDetails((Map<String,String>)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return new Long(getProviderId());

      case PICKUP_DETAILS:
        return getPickupDetails();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return isSetProviderId();
      case PICKUP_DETAILS:
        return isSetPickupDetails();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_providerId = true;
      boolean that_present_providerId = true;
      if (this_present_providerId || that_present_providerId) {
        if (!(this_present_providerId && that_present_providerId))
          return false;
        if (this.providerId != that.providerId)
          return false;
      }

      boolean this_present_pickupDetails = true && this.isSetPickupDetails();
      boolean that_present_pickupDetails = true && that.isSetPickupDetails();
      if (this_present_pickupDetails || that_present_pickupDetails) {
        if (!(this_present_pickupDetails && that_present_pickupDetails))
          return false;
        if (!this.pickupDetails.equals(that.pickupDetails))
          return false;
      }

      return true;
    }

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

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case PROVIDER_ID:
              if (field.type == TType.I64) {
                this.providerId = iprot.readI64();
                setProviderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case PICKUP_DETAILS:
              if (field.type == TType.MAP) {
                {
                  TMap _map48 = iprot.readMapBegin();
                  this.pickupDetails = new HashMap<String,String>(2*_map48.size);
                  for (int _i49 = 0; _i49 < _map48.size; ++_i49)
                  {
                    String _key50;
                    String _val51;
                    _key50 = iprot.readString();
                    _val51 = iprot.readString();
                    this.pickupDetails.put(_key50, _val51);
                  }
                  iprot.readMapEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
      oprot.writeI64(this.providerId);
      oprot.writeFieldEnd();
      if (this.pickupDetails != null) {
        oprot.writeFieldBegin(PICKUP_DETAILS_FIELD_DESC);
        {
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.pickupDetails.size()));
          for (Map.Entry<String, String> _iter52 : this.pickupDetails.entrySet())
          {
            oprot.writeString(_iter52.getKey());
            oprot.writeString(_iter52.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("providerId:");
      sb.append(this.providerId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("pickupDetails:");
      if (this.pickupDetails == null) {
        sb.append("null");
      } else {
        sb.append(this.pickupDetails);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class markOrdersAsPickedUp_result implements TBase<markOrdersAsPickedUp_result._Fields>, java.io.Serializable, Cloneable, Comparable<markOrdersAsPickedUp_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("markOrdersAsPickedUp_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private List<Order> success;
    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Order.class))));
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrdersAsPickedUp_result.class, metaDataMap);
    }

    public markOrdersAsPickedUp_result() {
    }

    public markOrdersAsPickedUp_result(
      List<Order> success,
      TransactionServiceException ex)
    {
      this();
      this.success = success;
      this.ex = ex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markOrdersAsPickedUp_result(markOrdersAsPickedUp_result other) {
      if (other.isSetSuccess()) {
        List<Order> __this__success = new ArrayList<Order>();
        for (Order other_element : other.success) {
          __this__success.add(new Order(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetEx()) {
        this.ex = new TransactionServiceException(other.ex);
      }
    }

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

    @Deprecated
    public markOrdersAsPickedUp_result clone() {
      return new markOrdersAsPickedUp_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Order> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Order elem) {
      if (this.success == null) {
        this.success = new ArrayList<Order>();
      }
      this.success.add(elem);
    }

    public List<Order> getSuccess() {
      return this.success;
    }

    public markOrdersAsPickedUp_result setSuccess(List<Order> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public markOrdersAsPickedUp_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

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

      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list53 = iprot.readListBegin();
                  this.success = new ArrayList<Order>(_list53.size);
                  for (int _i54 = 0; _i54 < _list53.size; ++_i54)
                  {
                    Order _elem55;
                    _elem55 = new Order();
                    _elem55.read(iprot);
                    this.success.add(_elem55);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Order _iter56 : this.success)
          {
            _iter56.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

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

    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
    private static final TField DELIVERED_ORDERS_FIELD_DESC = new TField("deliveredOrders", TType.MAP, (short)2);

    private long providerId;
    private Map<String,String> deliveredOrders;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      PROVIDER_ID((short)1, "providerId"),
      DELIVERED_ORDERS((short)2, "deliveredOrders");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __PROVIDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.DELIVERED_ORDERS, new FieldMetaData("deliveredOrders", TFieldRequirementType.DEFAULT, 
          new MapMetaData(TType.MAP, 
              new FieldValueMetaData(TType.STRING), 
              new FieldValueMetaData(TType.STRING))));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrdersAsDelivered_args.class, metaDataMap);
    }

    public markOrdersAsDelivered_args() {
    }

    public markOrdersAsDelivered_args(
      long providerId,
      Map<String,String> deliveredOrders)
    {
      this();
      this.providerId = providerId;
      setProviderIdIsSet(true);
      this.deliveredOrders = deliveredOrders;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markOrdersAsDelivered_args(markOrdersAsDelivered_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.providerId = other.providerId;
      if (other.isSetDeliveredOrders()) {
        Map<String,String> __this__deliveredOrders = new HashMap<String,String>();
        for (Map.Entry<String, String> other_element : other.deliveredOrders.entrySet()) {

          String other_element_key = other_element.getKey();
          String other_element_value = other_element.getValue();

          String __this__deliveredOrders_copy_key = other_element_key;

          String __this__deliveredOrders_copy_value = other_element_value;

          __this__deliveredOrders.put(__this__deliveredOrders_copy_key, __this__deliveredOrders_copy_value);
        }
        this.deliveredOrders = __this__deliveredOrders;
      }
    }

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

    @Deprecated
    public markOrdersAsDelivered_args clone() {
      return new markOrdersAsDelivered_args(this);
    }

    public long getProviderId() {
      return this.providerId;
    }

    public markOrdersAsDelivered_args setProviderId(long providerId) {
      this.providerId = providerId;
      setProviderIdIsSet(true);
      return this;
    }

    public void unsetProviderId() {
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
    }

    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
    public boolean isSetProviderId() {
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
    }

    public void setProviderIdIsSet(boolean value) {
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
    }

    public int getDeliveredOrdersSize() {
      return (this.deliveredOrders == null) ? 0 : this.deliveredOrders.size();
    }

    public void putToDeliveredOrders(String key, String val) {
      if (this.deliveredOrders == null) {
        this.deliveredOrders = new HashMap<String,String>();
      }
      this.deliveredOrders.put(key, val);
    }

    public Map<String,String> getDeliveredOrders() {
      return this.deliveredOrders;
    }

    public markOrdersAsDelivered_args setDeliveredOrders(Map<String,String> deliveredOrders) {
      this.deliveredOrders = deliveredOrders;
      return this;
    }

    public void unsetDeliveredOrders() {
      this.deliveredOrders = null;
    }

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

    public void setDeliveredOrdersIsSet(boolean value) {
      if (!value) {
        this.deliveredOrders = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PROVIDER_ID:
        if (value == null) {
          unsetProviderId();
        } else {
          setProviderId((Long)value);
        }
        break;

      case DELIVERED_ORDERS:
        if (value == null) {
          unsetDeliveredOrders();
        } else {
          setDeliveredOrders((Map<String,String>)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return new Long(getProviderId());

      case DELIVERED_ORDERS:
        return getDeliveredOrders();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return isSetProviderId();
      case DELIVERED_ORDERS:
        return isSetDeliveredOrders();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_providerId = true;
      boolean that_present_providerId = true;
      if (this_present_providerId || that_present_providerId) {
        if (!(this_present_providerId && that_present_providerId))
          return false;
        if (this.providerId != that.providerId)
          return false;
      }

      boolean this_present_deliveredOrders = true && this.isSetDeliveredOrders();
      boolean that_present_deliveredOrders = true && that.isSetDeliveredOrders();
      if (this_present_deliveredOrders || that_present_deliveredOrders) {
        if (!(this_present_deliveredOrders && that_present_deliveredOrders))
          return false;
        if (!this.deliveredOrders.equals(that.deliveredOrders))
          return false;
      }

      return true;
    }

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

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case PROVIDER_ID:
              if (field.type == TType.I64) {
                this.providerId = iprot.readI64();
                setProviderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case DELIVERED_ORDERS:
              if (field.type == TType.MAP) {
                {
                  TMap _map57 = iprot.readMapBegin();
                  this.deliveredOrders = new HashMap<String,String>(2*_map57.size);
                  for (int _i58 = 0; _i58 < _map57.size; ++_i58)
                  {
                    String _key59;
                    String _val60;
                    _key59 = iprot.readString();
                    _val60 = iprot.readString();
                    this.deliveredOrders.put(_key59, _val60);
                  }
                  iprot.readMapEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
      oprot.writeI64(this.providerId);
      oprot.writeFieldEnd();
      if (this.deliveredOrders != null) {
        oprot.writeFieldBegin(DELIVERED_ORDERS_FIELD_DESC);
        {
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.deliveredOrders.size()));
          for (Map.Entry<String, String> _iter61 : this.deliveredOrders.entrySet())
          {
            oprot.writeString(_iter61.getKey());
            oprot.writeString(_iter61.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("providerId:");
      sb.append(this.providerId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("deliveredOrders:");
      if (this.deliveredOrders == null) {
        sb.append("null");
      } else {
        sb.append(this.deliveredOrders);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class markOrdersAsDelivered_result implements TBase<markOrdersAsDelivered_result._Fields>, java.io.Serializable, Cloneable, Comparable<markOrdersAsDelivered_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("markOrdersAsDelivered_result");

    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrdersAsDelivered_result.class, metaDataMap);
    }

    public markOrdersAsDelivered_result() {
    }

    public markOrdersAsDelivered_result(
      TransactionServiceException ex)
    {
      this();
      this.ex = ex;
    }

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

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

    @Deprecated
    public markOrdersAsDelivered_result clone() {
      return new markOrdersAsDelivered_result(this);
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public markOrdersAsDelivered_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

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

    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
    private static final TField RETURNED_ORDERS_FIELD_DESC = new TField("returnedOrders", TType.MAP, (short)2);

    private long providerId;
    private Map<String,String> returnedOrders;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      PROVIDER_ID((short)1, "providerId"),
      RETURNED_ORDERS((short)2, "returnedOrders");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __PROVIDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.RETURNED_ORDERS, new FieldMetaData("returnedOrders", TFieldRequirementType.DEFAULT, 
          new MapMetaData(TType.MAP, 
              new FieldValueMetaData(TType.STRING), 
              new FieldValueMetaData(TType.STRING))));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrdersAsFailed_args.class, metaDataMap);
    }

    public markOrdersAsFailed_args() {
    }

    public markOrdersAsFailed_args(
      long providerId,
      Map<String,String> returnedOrders)
    {
      this();
      this.providerId = providerId;
      setProviderIdIsSet(true);
      this.returnedOrders = returnedOrders;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markOrdersAsFailed_args(markOrdersAsFailed_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.providerId = other.providerId;
      if (other.isSetReturnedOrders()) {
        Map<String,String> __this__returnedOrders = new HashMap<String,String>();
        for (Map.Entry<String, String> other_element : other.returnedOrders.entrySet()) {

          String other_element_key = other_element.getKey();
          String other_element_value = other_element.getValue();

          String __this__returnedOrders_copy_key = other_element_key;

          String __this__returnedOrders_copy_value = other_element_value;

          __this__returnedOrders.put(__this__returnedOrders_copy_key, __this__returnedOrders_copy_value);
        }
        this.returnedOrders = __this__returnedOrders;
      }
    }

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

    @Deprecated
    public markOrdersAsFailed_args clone() {
      return new markOrdersAsFailed_args(this);
    }

    public long getProviderId() {
      return this.providerId;
    }

    public markOrdersAsFailed_args setProviderId(long providerId) {
      this.providerId = providerId;
      setProviderIdIsSet(true);
      return this;
    }

    public void unsetProviderId() {
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
    }

    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
    public boolean isSetProviderId() {
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
    }

    public void setProviderIdIsSet(boolean value) {
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
    }

    public int getReturnedOrdersSize() {
      return (this.returnedOrders == null) ? 0 : this.returnedOrders.size();
    }

    public void putToReturnedOrders(String key, String val) {
      if (this.returnedOrders == null) {
        this.returnedOrders = new HashMap<String,String>();
      }
      this.returnedOrders.put(key, val);
    }

    public Map<String,String> getReturnedOrders() {
      return this.returnedOrders;
    }

    public markOrdersAsFailed_args setReturnedOrders(Map<String,String> returnedOrders) {
      this.returnedOrders = returnedOrders;
      return this;
    }

    public void unsetReturnedOrders() {
      this.returnedOrders = null;
    }

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

    public void setReturnedOrdersIsSet(boolean value) {
      if (!value) {
        this.returnedOrders = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PROVIDER_ID:
        if (value == null) {
          unsetProviderId();
        } else {
          setProviderId((Long)value);
        }
        break;

      case RETURNED_ORDERS:
        if (value == null) {
          unsetReturnedOrders();
        } else {
          setReturnedOrders((Map<String,String>)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return new Long(getProviderId());

      case RETURNED_ORDERS:
        return getReturnedOrders();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return isSetProviderId();
      case RETURNED_ORDERS:
        return isSetReturnedOrders();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_providerId = true;
      boolean that_present_providerId = true;
      if (this_present_providerId || that_present_providerId) {
        if (!(this_present_providerId && that_present_providerId))
          return false;
        if (this.providerId != that.providerId)
          return false;
      }

      boolean this_present_returnedOrders = true && this.isSetReturnedOrders();
      boolean that_present_returnedOrders = true && that.isSetReturnedOrders();
      if (this_present_returnedOrders || that_present_returnedOrders) {
        if (!(this_present_returnedOrders && that_present_returnedOrders))
          return false;
        if (!this.returnedOrders.equals(that.returnedOrders))
          return false;
      }

      return true;
    }

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

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case PROVIDER_ID:
              if (field.type == TType.I64) {
                this.providerId = iprot.readI64();
                setProviderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case RETURNED_ORDERS:
              if (field.type == TType.MAP) {
                {
                  TMap _map62 = iprot.readMapBegin();
                  this.returnedOrders = new HashMap<String,String>(2*_map62.size);
                  for (int _i63 = 0; _i63 < _map62.size; ++_i63)
                  {
                    String _key64;
                    String _val65;
                    _key64 = iprot.readString();
                    _val65 = iprot.readString();
                    this.returnedOrders.put(_key64, _val65);
                  }
                  iprot.readMapEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
      oprot.writeI64(this.providerId);
      oprot.writeFieldEnd();
      if (this.returnedOrders != null) {
        oprot.writeFieldBegin(RETURNED_ORDERS_FIELD_DESC);
        {
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.returnedOrders.size()));
          for (Map.Entry<String, String> _iter66 : this.returnedOrders.entrySet())
          {
            oprot.writeString(_iter66.getKey());
            oprot.writeString(_iter66.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("providerId:");
      sb.append(this.providerId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("returnedOrders:");
      if (this.returnedOrders == null) {
        sb.append("null");
      } else {
        sb.append(this.returnedOrders);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class markOrdersAsFailed_result implements TBase<markOrdersAsFailed_result._Fields>, java.io.Serializable, Cloneable, Comparable<markOrdersAsFailed_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("markOrdersAsFailed_result");

    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(markOrdersAsFailed_result.class, metaDataMap);
    }

    public markOrdersAsFailed_result() {
    }

    public markOrdersAsFailed_result(
      TransactionServiceException ex)
    {
      this();
      this.ex = ex;
    }

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

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

    @Deprecated
    public markOrdersAsFailed_result clone() {
      return new markOrdersAsFailed_result(this);
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public markOrdersAsFailed_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

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

    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
    private static final TField UNDELIVERED_ORDERS_FIELD_DESC = new TField("undeliveredOrders", TType.MAP, (short)2);

    private long providerId;
    private Map<String,String> undeliveredOrders;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      PROVIDER_ID((short)1, "providerId"),
      UNDELIVERED_ORDERS((short)2, "undeliveredOrders");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __PROVIDERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.UNDELIVERED_ORDERS, new FieldMetaData("undeliveredOrders", TFieldRequirementType.DEFAULT, 
          new MapMetaData(TType.MAP, 
              new FieldValueMetaData(TType.STRING), 
              new FieldValueMetaData(TType.STRING))));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updateNonDeliveryReason_args.class, metaDataMap);
    }

    public updateNonDeliveryReason_args() {
    }

    public updateNonDeliveryReason_args(
      long providerId,
      Map<String,String> undeliveredOrders)
    {
      this();
      this.providerId = providerId;
      setProviderIdIsSet(true);
      this.undeliveredOrders = undeliveredOrders;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateNonDeliveryReason_args(updateNonDeliveryReason_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.providerId = other.providerId;
      if (other.isSetUndeliveredOrders()) {
        Map<String,String> __this__undeliveredOrders = new HashMap<String,String>();
        for (Map.Entry<String, String> other_element : other.undeliveredOrders.entrySet()) {

          String other_element_key = other_element.getKey();
          String other_element_value = other_element.getValue();

          String __this__undeliveredOrders_copy_key = other_element_key;

          String __this__undeliveredOrders_copy_value = other_element_value;

          __this__undeliveredOrders.put(__this__undeliveredOrders_copy_key, __this__undeliveredOrders_copy_value);
        }
        this.undeliveredOrders = __this__undeliveredOrders;
      }
    }

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

    @Deprecated
    public updateNonDeliveryReason_args clone() {
      return new updateNonDeliveryReason_args(this);
    }

    public long getProviderId() {
      return this.providerId;
    }

    public updateNonDeliveryReason_args setProviderId(long providerId) {
      this.providerId = providerId;
      setProviderIdIsSet(true);
      return this;
    }

    public void unsetProviderId() {
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
    }

    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
    public boolean isSetProviderId() {
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
    }

    public void setProviderIdIsSet(boolean value) {
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
    }

    public int getUndeliveredOrdersSize() {
      return (this.undeliveredOrders == null) ? 0 : this.undeliveredOrders.size();
    }

    public void putToUndeliveredOrders(String key, String val) {
      if (this.undeliveredOrders == null) {
        this.undeliveredOrders = new HashMap<String,String>();
      }
      this.undeliveredOrders.put(key, val);
    }

    public Map<String,String> getUndeliveredOrders() {
      return this.undeliveredOrders;
    }

    public updateNonDeliveryReason_args setUndeliveredOrders(Map<String,String> undeliveredOrders) {
      this.undeliveredOrders = undeliveredOrders;
      return this;
    }

    public void unsetUndeliveredOrders() {
      this.undeliveredOrders = null;
    }

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

    public void setUndeliveredOrdersIsSet(boolean value) {
      if (!value) {
        this.undeliveredOrders = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PROVIDER_ID:
        if (value == null) {
          unsetProviderId();
        } else {
          setProviderId((Long)value);
        }
        break;

      case UNDELIVERED_ORDERS:
        if (value == null) {
          unsetUndeliveredOrders();
        } else {
          setUndeliveredOrders((Map<String,String>)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return new Long(getProviderId());

      case UNDELIVERED_ORDERS:
        return getUndeliveredOrders();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return isSetProviderId();
      case UNDELIVERED_ORDERS:
        return isSetUndeliveredOrders();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_providerId = true;
      boolean that_present_providerId = true;
      if (this_present_providerId || that_present_providerId) {
        if (!(this_present_providerId && that_present_providerId))
          return false;
        if (this.providerId != that.providerId)
          return false;
      }

      boolean this_present_undeliveredOrders = true && this.isSetUndeliveredOrders();
      boolean that_present_undeliveredOrders = true && that.isSetUndeliveredOrders();
      if (this_present_undeliveredOrders || that_present_undeliveredOrders) {
        if (!(this_present_undeliveredOrders && that_present_undeliveredOrders))
          return false;
        if (!this.undeliveredOrders.equals(that.undeliveredOrders))
          return false;
      }

      return true;
    }

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

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case PROVIDER_ID:
              if (field.type == TType.I64) {
                this.providerId = iprot.readI64();
                setProviderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UNDELIVERED_ORDERS:
              if (field.type == TType.MAP) {
                {
                  TMap _map67 = iprot.readMapBegin();
                  this.undeliveredOrders = new HashMap<String,String>(2*_map67.size);
                  for (int _i68 = 0; _i68 < _map67.size; ++_i68)
                  {
                    String _key69;
                    String _val70;
                    _key69 = iprot.readString();
                    _val70 = iprot.readString();
                    this.undeliveredOrders.put(_key69, _val70);
                  }
                  iprot.readMapEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
      oprot.writeI64(this.providerId);
      oprot.writeFieldEnd();
      if (this.undeliveredOrders != null) {
        oprot.writeFieldBegin(UNDELIVERED_ORDERS_FIELD_DESC);
        {
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.undeliveredOrders.size()));
          for (Map.Entry<String, String> _iter71 : this.undeliveredOrders.entrySet())
          {
            oprot.writeString(_iter71.getKey());
            oprot.writeString(_iter71.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("providerId:");
      sb.append(this.providerId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("undeliveredOrders:");
      if (this.undeliveredOrders == null) {
        sb.append("null");
      } else {
        sb.append(this.undeliveredOrders);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class updateNonDeliveryReason_result implements TBase<updateNonDeliveryReason_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateNonDeliveryReason_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateNonDeliveryReason_result");

    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);

    private TransactionServiceException ex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      EX((short)1, "ex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updateNonDeliveryReason_result.class, metaDataMap);
    }

    public updateNonDeliveryReason_result() {
    }

    public updateNonDeliveryReason_result(
      TransactionServiceException ex)
    {
      this();
      this.ex = ex;
    }

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

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

    @Deprecated
    public updateNonDeliveryReason_result clone() {
      return new updateNonDeliveryReason_result(this);
    }

    public TransactionServiceException getEx() {
      return this.ex;
    }

    public updateNonDeliveryReason_result setEx(TransactionServiceException ex) {
      this.ex = ex;
      return this;
    }

    public void unsetEx() {
      this.ex = null;
    }

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

    public void setExIsSet(boolean value) {
      if (!value) {
        this.ex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EX:
        if (value == null) {
          unsetEx();
        } else {
          setEx((TransactionServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EX:
        return getEx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case EX:
        return isSetEx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_ex = true && this.isSetEx();
      boolean that_present_ex = true && that.isSetEx();
      if (this_present_ex || that_present_ex) {
        if (!(this_present_ex && that_present_ex))
          return false;
        if (!this.ex.equals(that.ex))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case EX:
              if (field.type == TType.STRUCT) {
                this.ex = new TransactionServiceException();
                this.ex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetEx()) {
        oprot.writeFieldBegin(EX_FIELD_DESC);
        this.ex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("ex:");
      if (this.ex == null) {
        sb.append("null");
      } else {
        sb.append(this.ex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getUndeliveredOrders_args implements TBase<getUndeliveredOrders_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUndeliveredOrders_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getUndeliveredOrders_args");

    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouseId", TType.I64, (short)2);

    private long providerId;
    private long warehouseId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      PROVIDER_ID((short)1, "providerId"),
      WAREHOUSE_ID((short)2, "warehouseId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __PROVIDERID_ISSET_ID = 0;
    private static final int __WAREHOUSEID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouseId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getUndeliveredOrders_args.class, metaDataMap);
    }

    public getUndeliveredOrders_args() {
    }

    public getUndeliveredOrders_args(
      long providerId,
      long warehouseId)
    {
      this();
      this.providerId = providerId;
      setProviderIdIsSet(true);
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getUndeliveredOrders_args(getUndeliveredOrders_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.providerId = other.providerId;
      this.warehouseId = other.warehouseId;
    }

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

    @Deprecated
    public getUndeliveredOrders_args clone() {
      return new getUndeliveredOrders_args(this);
    }

    public long getProviderId() {
      return this.providerId;
    }

    public getUndeliveredOrders_args setProviderId(long providerId) {
      this.providerId = providerId;
      setProviderIdIsSet(true);
      return this;
    }

    public void unsetProviderId() {
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
    }

    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
    public boolean isSetProviderId() {
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
    }

    public void setProviderIdIsSet(boolean value) {
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
    }

    public long getWarehouseId() {
      return this.warehouseId;
    }

    public getUndeliveredOrders_args setWarehouseId(long warehouseId) {
      this.warehouseId = warehouseId;
      setWarehouseIdIsSet(true);
      return this;
    }

    public void unsetWarehouseId() {
      __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
    }

    /** Returns true if field warehouseId is set (has been asigned 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 PROVIDER_ID:
        if (value == null) {
          unsetProviderId();
        } else {
          setProviderId((Long)value);
        }
        break;

      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouseId();
        } else {
          setWarehouseId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return new Long(getProviderId());

      case WAREHOUSE_ID:
        return new Long(getWarehouseId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case PROVIDER_ID:
        return isSetProviderId();
      case WAREHOUSE_ID:
        return isSetWarehouseId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_providerId = true;
      boolean that_present_providerId = true;
      if (this_present_providerId || that_present_providerId) {
        if (!(this_present_providerId && that_present_providerId))
          return false;
        if (this.providerId != that.providerId)
          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(getUndeliveredOrders_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetProviderId()).compareTo(isSetProviderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(providerId, typedOther.providerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(isSetWarehouseId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouseId, typedOther.warehouseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case PROVIDER_ID:
              if (field.type == TType.I64) {
                this.providerId = iprot.readI64();
                setProviderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouseId = iprot.readI64();
                setWarehouseIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
      oprot.writeI64(this.providerId);
      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("getUndeliveredOrders_args(");
      boolean first = true;

      sb.append("providerId:");
      sb.append(this.providerId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("warehouseId:");
      sb.append(this.warehouseId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getUndeliveredOrders_result implements TBase<getUndeliveredOrders_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUndeliveredOrders_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getUndeliveredOrders_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);

    private List<Order> success;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Order.class))));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getUndeliveredOrders_result.class, metaDataMap);
    }

    public getUndeliveredOrders_result() {
    }

    public getUndeliveredOrders_result(
      List<Order> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getUndeliveredOrders_result(getUndeliveredOrders_result other) {
      if (other.isSetSuccess()) {
        List<Order> __this__success = new ArrayList<Order>();
        for (Order other_element : other.success) {
          __this__success.add(new Order(other_element));
        }
        this.success = __this__success;
      }
    }

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

    @Deprecated
    public getUndeliveredOrders_result clone() {
      return new getUndeliveredOrders_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Order> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Order elem) {
      if (this.success == null) {
        this.success = new ArrayList<Order>();
      }
      this.success.add(elem);
    }

    public List<Order> getSuccess() {
      return this.success;
    }

    public getUndeliveredOrders_result setSuccess(List<Order> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned 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<Order>)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getUndeliveredOrders_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(getUndeliveredOrders_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list72 = iprot.readListBegin();
                  this.success = new ArrayList<Order>(_list72.size);
                  for (int _i73 = 0; _i73 < _list72.size; ++_i73)
                  {
                    Order _elem74;
                    _elem74 = new Order();
                    _elem74.read(iprot);
                    this.success.add(_elem74);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Order _iter75 : this.success)
          {
            _iter75.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getUndeliveredOrders_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 TException {
      // check for required fields
    }

  }

  public static class getAlerts_args implements TBase<getAlerts_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAlerts_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAlerts_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
    private static final TField VALID_FIELD_DESC = new TField("valid", TType.BOOL, (short)2);

    private long orderId;
    private boolean valid;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId"),
      VALID((short)2, "valid");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private static final int __VALID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.VALID, new FieldMetaData("valid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAlerts_args.class, metaDataMap);
    }

    public getAlerts_args() {
    }

    public getAlerts_args(
      long orderId,
      boolean valid)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.valid = valid;
      setValidIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAlerts_args(getAlerts_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
      this.valid = other.valid;
    }

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

    @Deprecated
    public getAlerts_args clone() {
      return new getAlerts_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public getAlerts_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public boolean isValid() {
      return this.valid;
    }

    public getAlerts_args setValid(boolean valid) {
      this.valid = valid;
      setValidIsSet(true);
      return this;
    }

    public void unsetValid() {
      __isset_bit_vector.clear(__VALID_ISSET_ID);
    }

    /** Returns true if field valid is set (has been asigned a value) and false otherwise */
    public boolean isSetValid() {
      return __isset_bit_vector.get(__VALID_ISSET_ID);
    }

    public void setValidIsSet(boolean value) {
      __isset_bit_vector.set(__VALID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case VALID:
        if (value == null) {
          unsetValid();
        } else {
          setValid((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      case VALID:
        return new Boolean(isValid());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      case VALID:
        return isSetValid();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_valid = true;
      boolean that_present_valid = true;
      if (this_present_valid || that_present_valid) {
        if (!(this_present_valid && that_present_valid))
          return false;
        if (this.valid != that.valid)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetValid()).compareTo(isSetValid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(valid, typedOther.valid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case VALID:
              if (field.type == TType.BOOL) {
                this.valid = iprot.readBool();
                setValidIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(VALID_FIELD_DESC);
      oprot.writeBool(this.valid);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("valid:");
      sb.append(this.valid);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAlerts_result implements TBase<getAlerts_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAlerts_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAlerts_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);

    private List<Alert> success;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Alert.class))));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAlerts_result.class, metaDataMap);
    }

    public getAlerts_result() {
    }

    public getAlerts_result(
      List<Alert> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAlerts_result(getAlerts_result other) {
      if (other.isSetSuccess()) {
        List<Alert> __this__success = new ArrayList<Alert>();
        for (Alert other_element : other.success) {
          __this__success.add(new Alert(other_element));
        }
        this.success = __this__success;
      }
    }

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

    @Deprecated
    public getAlerts_result clone() {
      return new getAlerts_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Alert> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Alert elem) {
      if (this.success == null) {
        this.success = new ArrayList<Alert>();
      }
      this.success.add(elem);
    }

    public List<Alert> getSuccess() {
      return this.success;
    }

    public getAlerts_result setSuccess(List<Alert> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned 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<Alert>)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getAlerts_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(getAlerts_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list76 = iprot.readListBegin();
                  this.success = new ArrayList<Alert>(_list76.size);
                  for (int _i77 = 0; _i77 < _list76.size; ++_i77)
                  {
                    Alert _elem78;
                    _elem78 = new Alert();
                    _elem78.read(iprot);
                    this.success.add(_elem78);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Alert _iter79 : this.success)
          {
            _iter79.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAlerts_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 TException {
      // check for required fields
    }

  }

  public static class setAlert_args implements TBase<setAlert_args._Fields>, java.io.Serializable, Cloneable, Comparable<setAlert_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("setAlert_args");

    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
    private static final TField UNSET_FIELD_DESC = new TField("unset", TType.BOOL, (short)2);
    private static final TField TYPE_FIELD_DESC = new TField("type", TType.I64, (short)3);
    private static final TField COMMENT_FIELD_DESC = new TField("comment", TType.STRING, (short)4);

    private long orderId;
    private boolean unset;
    private long type;
    private String comment;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ORDER_ID((short)1, "orderId"),
      UNSET((short)2, "unset"),
      TYPE((short)3, "type"),
      COMMENT((short)4, "comment");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private static final int __UNSET_ISSET_ID = 1;
    private static final int __TYPE_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.UNSET, new FieldMetaData("unset", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.COMMENT, new FieldMetaData("comment", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(setAlert_args.class, metaDataMap);
    }

    public setAlert_args() {
    }

    public setAlert_args(
      long orderId,
      boolean unset,
      long type,
      String comment)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.unset = unset;
      setUnsetIsSet(true);
      this.type = type;
      setTypeIsSet(true);
      this.comment = comment;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setAlert_args(setAlert_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
      this.unset = other.unset;
      this.type = other.type;
      if (other.isSetComment()) {
        this.comment = other.comment;
      }
    }

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

    @Deprecated
    public setAlert_args clone() {
      return new setAlert_args(this);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public setAlert_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public boolean isUnset() {
      return this.unset;
    }

    public setAlert_args setUnset(boolean unset) {
      this.unset = unset;
      setUnsetIsSet(true);
      return this;
    }

    public void unsetUnset() {
      __isset_bit_vector.clear(__UNSET_ISSET_ID);
    }

    /** Returns true if field unset is set (has been asigned a value) and false otherwise */
    public boolean isSetUnset() {
      return __isset_bit_vector.get(__UNSET_ISSET_ID);
    }

    public void setUnsetIsSet(boolean value) {
      __isset_bit_vector.set(__UNSET_ISSET_ID, value);
    }

    public long getType() {
      return this.type;
    }

    public setAlert_args setType(long type) {
      this.type = type;
      setTypeIsSet(true);
      return this;
    }

    public void unsetType() {
      __isset_bit_vector.clear(__TYPE_ISSET_ID);
    }

    /** Returns true if field type is set (has been asigned a value) and false otherwise */
    public boolean isSetType() {
      return __isset_bit_vector.get(__TYPE_ISSET_ID);
    }

    public void setTypeIsSet(boolean value) {
      __isset_bit_vector.set(__TYPE_ISSET_ID, value);
    }

    public String getComment() {
      return this.comment;
    }

    public setAlert_args setComment(String comment) {
      this.comment = comment;
      return this;
    }

    public void unsetComment() {
      this.comment = null;
    }

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

    public void setCommentIsSet(boolean value) {
      if (!value) {
        this.comment = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case UNSET:
        if (value == null) {
          unsetUnset();
        } else {
          setUnset((Boolean)value);
        }
        break;

      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((Long)value);
        }
        break;

      case COMMENT:
        if (value == null) {
          unsetComment();
        } else {
          setComment((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return new Long(getOrderId());

      case UNSET:
        return new Boolean(isUnset());

      case TYPE:
        return new Long(getType());

      case COMMENT:
        return getComment();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      case UNSET:
        return isSetUnset();
      case TYPE:
        return isSetType();
      case COMMENT:
        return isSetComment();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_unset = true;
      boolean that_present_unset = true;
      if (this_present_unset || that_present_unset) {
        if (!(this_present_unset && that_present_unset))
          return false;
        if (this.unset != that.unset)
          return false;
      }

      boolean this_present_type = true;
      boolean that_present_type = true;
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (this.type != that.type)
          return false;
      }

      boolean this_present_comment = true && this.isSetComment();
      boolean that_present_comment = true && that.isSetComment();
      if (this_present_comment || that_present_comment) {
        if (!(this_present_comment && that_present_comment))
          return false;
        if (!this.comment.equals(that.comment))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUnset()).compareTo(isSetUnset());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(unset, typedOther.unset);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetType()).compareTo(isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(type, typedOther.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetComment()).compareTo(isSetComment());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(comment, typedOther.comment);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UNSET:
              if (field.type == TType.BOOL) {
                this.unset = iprot.readBool();
                setUnsetIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TYPE:
              if (field.type == TType.I64) {
                this.type = iprot.readI64();
                setTypeIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case COMMENT:
              if (field.type == TType.STRING) {
                this.comment = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(UNSET_FIELD_DESC);
      oprot.writeBool(this.unset);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
      oprot.writeI64(this.type);
      oprot.writeFieldEnd();
      if (this.comment != null) {
        oprot.writeFieldBegin(COMMENT_FIELD_DESC);
        oprot.writeString(this.comment);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("unset:");
      sb.append(this.unset);
      first = false;
      if (!first) sb.append(", ");
      sb.append("type:");
      sb.append(this.type);
      first = false;
      if (!first) sb.append(", ");
      sb.append("comment:");
      if (this.comment == null) {
        sb.append("null");
      } else {
        sb.append(this.comment);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class setAlert_result implements TBase<setAlert_result._Fields>, java.io.Serializable, Cloneable, Comparable<setAlert_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("setAlert_result");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(setAlert_result.class, metaDataMap);
    }

    public setAlert_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setAlert_result(setAlert_result other) {
    }

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

    @Deprecated
    public setAlert_result clone() {
      return new setAlert_result(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      return true;
    }

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

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

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

      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getValidOrderCount_args implements TBase<getValidOrderCount_args._Fields>, java.io.Serializable, Cloneable, Comparable<getValidOrderCount_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getValidOrderCount_args");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getValidOrderCount_args.class, metaDataMap);
    }

    public getValidOrderCount_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getValidOrderCount_args(getValidOrderCount_args other) {
    }

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

    @Deprecated
    public getValidOrderCount_args clone() {
      return new getValidOrderCount_args(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      return true;
    }

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

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

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

      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getValidOrderCount_result implements TBase<getValidOrderCount_result._Fields>, java.io.Serializable, Cloneable, Comparable<getValidOrderCount_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getValidOrderCount_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);

    private long success;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getValidOrderCount_result.class, metaDataMap);
    }

    public getValidOrderCount_result() {
    }

    public getValidOrderCount_result(
      long success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getValidOrderCount_result(getValidOrderCount_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
    }

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

    @Deprecated
    public getValidOrderCount_result clone() {
      return new getValidOrderCount_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public getValidOrderCount_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getValidOrderCount_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(getValidOrderCount_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws 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("getValidOrderCount_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getNoOfCustomersWithSuccessfulTransaction_args implements TBase<getNoOfCustomersWithSuccessfulTransaction_args._Fields>, java.io.Serializable, Cloneable, Comparable<getNoOfCustomersWithSuccessfulTransaction_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getNoOfCustomersWithSuccessfulTransaction_args");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getNoOfCustomersWithSuccessfulTransaction_args.class, metaDataMap);
    }

    public getNoOfCustomersWithSuccessfulTransaction_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getNoOfCustomersWithSuccessfulTransaction_args(getNoOfCustomersWithSuccessfulTransaction_args other) {
    }

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

    @Deprecated
    public getNoOfCustomersWithSuccessfulTransaction_args clone() {
      return new getNoOfCustomersWithSuccessfulTransaction_args(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      return true;
    }

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

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

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

      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getNoOfCustomersWithSuccessfulTransaction_result implements TBase<getNoOfCustomersWithSuccessfulTransaction_result._Fields>, java.io.Serializable, Cloneable, Comparable<getNoOfCustomersWithSuccessfulTransaction_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getNoOfCustomersWithSuccessfulTransaction_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);

    private long success;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getNoOfCustomersWithSuccessfulTransaction_result.class, metaDataMap);
    }

    public getNoOfCustomersWithSuccessfulTransaction_result() {
    }

    public getNoOfCustomersWithSuccessfulTransaction_result(
      long success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getNoOfCustomersWithSuccessfulTransaction_result(getNoOfCustomersWithSuccessfulTransaction_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
    }

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

    @Deprecated
    public getNoOfCustomersWithSuccessfulTransaction_result clone() {
      return new getNoOfCustomersWithSuccessfulTransaction_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public getNoOfCustomersWithSuccessfulTransaction_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned 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 void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getNoOfCustomersWithSuccessfulTransaction_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(getNoOfCustomersWithSuccessfulTransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws 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("getNoOfCustomersWithSuccessfulTransaction_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getValidOrdersAmountRange_args implements TBase<getValidOrdersAmountRange_args._Fields>, java.io.Serializable, Cloneable, Comparable<getValidOrdersAmountRange_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getValidOrdersAmountRange_args");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getValidOrdersAmountRange_args.class, metaDataMap);
    }

    public getValidOrdersAmountRange_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getValidOrdersAmountRange_args(getValidOrdersAmountRange_args other) {
    }

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

    @Deprecated
    public getValidOrdersAmountRange_args clone() {
      return new getValidOrdersAmountRange_args(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      return true;
    }

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

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

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

      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getValidOrdersAmountRange_result implements TBase<getValidOrdersAmountRange_result._Fields>, java.io.Serializable, Cloneable, Comparable<getValidOrdersAmountRange_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getValidOrdersAmountRange_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);

    private List<Double> success;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new FieldValueMetaData(TType.DOUBLE))));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getValidOrdersAmountRange_result.class, metaDataMap);
    }

    public getValidOrdersAmountRange_result() {
    }

    public getValidOrdersAmountRange_result(
      List<Double> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getValidOrdersAmountRange_result(getValidOrdersAmountRange_result other) {
      if (other.isSetSuccess()) {
        List<Double> __this__success = new ArrayList<Double>();
        for (Double other_element : other.success) {
          __this__success.add(other_element);
        }
        this.success = __this__success;
      }
    }

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

    @Deprecated
    public getValidOrdersAmountRange_result clone() {
      return new getValidOrdersAmountRange_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Double> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(double elem) {
      if (this.success == null) {
        this.success = new ArrayList<Double>();
      }
      this.success.add(elem);
    }

    public List<Double> getSuccess() {
      return this.success;
    }

    public getValidOrdersAmountRange_result setSuccess(List<Double> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned 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<Double>)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getValidOrdersAmountRange_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(getValidOrdersAmountRange_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list80 = iprot.readListBegin();
                  this.success = new ArrayList<Double>(_list80.size);
                  for (int _i81 = 0; _i81 < _list80.size; ++_i81)
                  {
                    double _elem82;
                    _elem82 = iprot.readDouble();
                    this.success.add(_elem82);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.DOUBLE, this.success.size()));
          for (double _iter83 : this.success)
          {
            oprot.writeDouble(_iter83);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getValidOrdersAmountRange_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 TException {
      // check for required fields
    }

  }

  public static class getValidOrders_args implements TBase<getValidOrders_args._Fields>, java.io.Serializable, Cloneable, Comparable<getValidOrders_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getValidOrders_args");

    private static final TField LIMIT_FIELD_DESC = new TField("limit", TType.I64, (short)1);

    private long limit;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      LIMIT((short)1, "limit");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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 __LIMIT_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.LIMIT, new FieldMetaData("limit", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getValidOrders_args.class, metaDataMap);
    }

    public getValidOrders_args() {
    }

    public getValidOrders_args(
      long limit)
    {
      this();
      this.limit = limit;
      setLimitIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getValidOrders_args(getValidOrders_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.limit = other.limit;
    }

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

    @Deprecated
    public getValidOrders_args clone() {
      return new getValidOrders_args(this);
    }

    public long getLimit() {
      return this.limit;
    }

    public getValidOrders_args setLimit(long limit) {
      this.limit = limit;
      setLimitIsSet(true);
      return this;
    }

    public void unsetLimit() {
      __isset_bit_vector.clear(__LIMIT_ISSET_ID);
    }

    /** Returns true if field limit is set (has been asigned a value) and false otherwise */
    public boolean isSetLimit() {
      return __isset_bit_vector.get(__LIMIT_ISSET_ID);
    }

    public void setLimitIsSet(boolean value) {
      __isset_bit_vector.set(__LIMIT_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case LIMIT:
        if (value == null) {
          unsetLimit();
        } else {
          setLimit((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case LIMIT:
        return new Long(getLimit());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case LIMIT:
        return isSetLimit();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

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

      boolean this_present_limit = true;
      boolean that_present_limit = true;
      if (this_present_limit || that_present_limit) {
        if (!(this_present_limit && that_present_limit))
          return false;
        if (this.limit != that.limit)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetLimit()).compareTo(isSetLimit());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(limit, typedOther.limit);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case LIMIT:
              if (field.type == TType.I64) {
                this.limit = iprot.readI64();
                setLimitIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(LIMIT_FIELD_DESC);
      oprot.writeI64(this.limit);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("limit:");
      sb.append(this.limit);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getValidOrders_result implements TBase<getValidOrders_result._Fields>, java.io.Serializable, Cloneable, Comparable<getValidOrders_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getValidOrders_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);

    private List<Order> success;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Order.class))));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getValidOrders_result.class, metaDataMap);
    }

    public getValidOrders_result() {
    }

    public getValidOrders_result(
      List<Order> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getValidOrders_result(getValidOrders_result other) {
      if (other.isSetSuccess()) {
        List<Order> __this__success = new ArrayList<Order>();
        for (Order other_element : other.success) {
          __this__success.add(new Order(other_element));
        }
        this.success = __this__success;
      }
    }

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

    @Deprecated
    public getValidOrders_result clone() {
      return new getValidOrders_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Order> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Order elem) {
      if (this.success == null) {
        this.success = new ArrayList<Order>();
      }
      this.success.add(elem);
    }

    public List<Order> getSuccess() {
      return this.success;
    }

    public getValidOrders_result setSuccess(List<Order> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned 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<Order>)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

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

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

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

    public boolean equals(getValidOrders_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(getValidOrders_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list84 = iprot.readListBegin();
                  this.success = new ArrayList<Order>(_list84.size);
                  for (int _i85 = 0; _i85 < _list84.size; ++_i85)
                  {
                    Order _elem86;
                    _elem86 = new Order();
                    _elem86.read(iprot);
                    this.success.add(_elem86);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Order _iter87 : this.success)
          {
            _iter87.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getValidOrders_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 TException {
      // check for required fields
    }

  }

}