Subversion Repositories SmartDukaan

Rev

Rev 3376 | Rev 3424 | 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
#

from thrift.Thrift import *
import shop2020.thriftpy.generic.GenericService
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None


class Iface(shop2020.thriftpy.generic.GenericService.Iface):
  def createPurchaseOrder(self, purchaseOrder):
    """
    Creates a purchase order based on the data in the given purchase order object.
    This method populates a nummber of missing fields
    
    Parameters:
     - purchaseOrder
    """
    pass

  def getPurchaseOrder(self, id):
    """
    Returns the purchase order with the given id. Throws an exception if there is no such purchase order.
    
    Parameters:
     - id
    """
    pass

  def getAllPurchaseOrders(self, status):
    """
    Returns a list of all the purchase orders in the given state
    
    Parameters:
     - status
    """
    pass

  def getSupplier(self, id):
    """
    Returns the supplier with the given order id. Throws an exception if there is no such supplier.
    
    Parameters:
     - id
    """
    pass

  def startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges):
    """
    Creates a purchase for the given purchase order.
    Throws an exception if no more purchases are allowed against the given purchase order.
    
    Parameters:
     - purchaseOrderId
     - invoiceNumber
     - freightCharges
    """
    pass

  def closePurchase(self, purchaseId):
    """
    Marks a purchase as complete and updates the receivedOn time.
    Throws an exception if no such purchase exists.
    
    Parameters:
     - purchaseId
    """
    pass

  def getAllPurchases(self, purchaseOrderId, open):
    """
    Returns all open or closed purchases for the given purchase order. Throws an exception if no such purchase order exists
    
    Parameters:
     - purchaseOrderId
     - open
    """
    pass

  def scanIn(self, purchaseId, itemNumber, imeiNumber, type):
    """
    Creates a Scan object using the given details.
    Raises an exception if no more of the given item can be scanned in against the purchase order of the given purchase.
    
    Parameters:
     - purchaseId
     - itemNumber
     - imeiNumber
     - type
    """
    pass

  def scanOut(self, itemNumber, imeiNumber, type):
    """
    Marks the Scan object with the given details as scanned out. In case, the imeiNumber is not given,
    marks the oldest ItemInventory object as being scanned out.
    Raises an exception if:
    1. There is no stock present corresponding to the given item details.
    2. An older stock is present corresponding to the itemNumber which has not been scanned out.
    
    Parameters:
     - itemNumber
     - imeiNumber
     - type
    """
    pass


class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
  def __init__(self, iprot, oprot=None):
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)

  def createPurchaseOrder(self, purchaseOrder):
    """
    Creates a purchase order based on the data in the given purchase order object.
    This method populates a nummber of missing fields
    
    Parameters:
     - purchaseOrder
    """
    self.send_createPurchaseOrder(purchaseOrder)
    return self.recv_createPurchaseOrder()

  def send_createPurchaseOrder(self, purchaseOrder):
    self._oprot.writeMessageBegin('createPurchaseOrder', TMessageType.CALL, self._seqid)
    args = createPurchaseOrder_args()
    args.purchaseOrder = purchaseOrder
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_createPurchaseOrder(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = createPurchaseOrder_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.wex != None:
      raise result.wex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createPurchaseOrder failed: unknown result");

  def getPurchaseOrder(self, id):
    """
    Returns the purchase order with the given id. Throws an exception if there is no such purchase order.
    
    Parameters:
     - id
    """
    self.send_getPurchaseOrder(id)
    return self.recv_getPurchaseOrder()

  def send_getPurchaseOrder(self, id):
    self._oprot.writeMessageBegin('getPurchaseOrder', TMessageType.CALL, self._seqid)
    args = getPurchaseOrder_args()
    args.id = id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getPurchaseOrder(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getPurchaseOrder_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.wex != None:
      raise result.wex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPurchaseOrder failed: unknown result");

  def getAllPurchaseOrders(self, status):
    """
    Returns a list of all the purchase orders in the given state
    
    Parameters:
     - status
    """
    self.send_getAllPurchaseOrders(status)
    return self.recv_getAllPurchaseOrders()

  def send_getAllPurchaseOrders(self, status):
    self._oprot.writeMessageBegin('getAllPurchaseOrders', TMessageType.CALL, self._seqid)
    args = getAllPurchaseOrders_args()
    args.status = status
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getAllPurchaseOrders(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getAllPurchaseOrders_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.wex != None:
      raise result.wex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPurchaseOrders failed: unknown result");

  def getSupplier(self, id):
    """
    Returns the supplier with the given order id. Throws an exception if there is no such supplier.
    
    Parameters:
     - id
    """
    self.send_getSupplier(id)
    return self.recv_getSupplier()

  def send_getSupplier(self, id):
    self._oprot.writeMessageBegin('getSupplier', TMessageType.CALL, self._seqid)
    args = getSupplier_args()
    args.id = id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getSupplier(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getSupplier_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.wex != None:
      raise result.wex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getSupplier failed: unknown result");

  def startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges):
    """
    Creates a purchase for the given purchase order.
    Throws an exception if no more purchases are allowed against the given purchase order.
    
    Parameters:
     - purchaseOrderId
     - invoiceNumber
     - freightCharges
    """
    self.send_startPurchase(purchaseOrderId, invoiceNumber, freightCharges)
    return self.recv_startPurchase()

  def send_startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges):
    self._oprot.writeMessageBegin('startPurchase', TMessageType.CALL, self._seqid)
    args = startPurchase_args()
    args.purchaseOrderId = purchaseOrderId
    args.invoiceNumber = invoiceNumber
    args.freightCharges = freightCharges
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_startPurchase(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = startPurchase_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.wex != None:
      raise result.wex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "startPurchase failed: unknown result");

  def closePurchase(self, purchaseId):
    """
    Marks a purchase as complete and updates the receivedOn time.
    Throws an exception if no such purchase exists.
    
    Parameters:
     - purchaseId
    """
    self.send_closePurchase(purchaseId)
    return self.recv_closePurchase()

  def send_closePurchase(self, purchaseId):
    self._oprot.writeMessageBegin('closePurchase', TMessageType.CALL, self._seqid)
    args = closePurchase_args()
    args.purchaseId = purchaseId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_closePurchase(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = closePurchase_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.wex != None:
      raise result.wex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "closePurchase failed: unknown result");

  def getAllPurchases(self, purchaseOrderId, open):
    """
    Returns all open or closed purchases for the given purchase order. Throws an exception if no such purchase order exists
    
    Parameters:
     - purchaseOrderId
     - open
    """
    self.send_getAllPurchases(purchaseOrderId, open)
    return self.recv_getAllPurchases()

  def send_getAllPurchases(self, purchaseOrderId, open):
    self._oprot.writeMessageBegin('getAllPurchases', TMessageType.CALL, self._seqid)
    args = getAllPurchases_args()
    args.purchaseOrderId = purchaseOrderId
    args.open = open
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getAllPurchases(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getAllPurchases_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.wex != None:
      raise result.wex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");

  def scanIn(self, purchaseId, itemNumber, imeiNumber, type):
    """
    Creates a Scan object using the given details.
    Raises an exception if no more of the given item can be scanned in against the purchase order of the given purchase.
    
    Parameters:
     - purchaseId
     - itemNumber
     - imeiNumber
     - type
    """
    self.send_scanIn(purchaseId, itemNumber, imeiNumber, type)
    self.recv_scanIn()

  def send_scanIn(self, purchaseId, itemNumber, imeiNumber, type):
    self._oprot.writeMessageBegin('scanIn', TMessageType.CALL, self._seqid)
    args = scanIn_args()
    args.purchaseId = purchaseId
    args.itemNumber = itemNumber
    args.imeiNumber = imeiNumber
    args.type = type
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_scanIn(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = scanIn_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.wex != None:
      raise result.wex
    return

  def scanOut(self, itemNumber, imeiNumber, type):
    """
    Marks the Scan object with the given details as scanned out. In case, the imeiNumber is not given,
    marks the oldest ItemInventory object as being scanned out.
    Raises an exception if:
    1. There is no stock present corresponding to the given item details.
    2. An older stock is present corresponding to the itemNumber which has not been scanned out.
    
    Parameters:
     - itemNumber
     - imeiNumber
     - type
    """
    self.send_scanOut(itemNumber, imeiNumber, type)
    self.recv_scanOut()

  def send_scanOut(self, itemNumber, imeiNumber, type):
    self._oprot.writeMessageBegin('scanOut', TMessageType.CALL, self._seqid)
    args = scanOut_args()
    args.itemNumber = itemNumber
    args.imeiNumber = imeiNumber
    args.type = type
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_scanOut(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = scanOut_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.wex != None:
      raise result.wex
    return


class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
  def __init__(self, handler):
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
    self._processMap["createPurchaseOrder"] = Processor.process_createPurchaseOrder
    self._processMap["getPurchaseOrder"] = Processor.process_getPurchaseOrder
    self._processMap["getAllPurchaseOrders"] = Processor.process_getAllPurchaseOrders
    self._processMap["getSupplier"] = Processor.process_getSupplier
    self._processMap["startPurchase"] = Processor.process_startPurchase
    self._processMap["closePurchase"] = Processor.process_closePurchase
    self._processMap["getAllPurchases"] = Processor.process_getAllPurchases
    self._processMap["scanIn"] = Processor.process_scanIn
    self._processMap["scanOut"] = Processor.process_scanOut

  def process(self, iprot, oprot):
    (name, type, seqid) = iprot.readMessageBegin()
    if name not in self._processMap:
      iprot.skip(TType.STRUCT)
      iprot.readMessageEnd()
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
      x.write(oprot)
      oprot.writeMessageEnd()
      oprot.trans.flush()
      return
    else:
      self._processMap[name](self, seqid, iprot, oprot)
    return True

  def process_createPurchaseOrder(self, seqid, iprot, oprot):
    args = createPurchaseOrder_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = createPurchaseOrder_result()
    try:
      result.success = self._handler.createPurchaseOrder(args.purchaseOrder)
    except WarehouseServiceException, wex:
      result.wex = wex
    oprot.writeMessageBegin("createPurchaseOrder", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getPurchaseOrder(self, seqid, iprot, oprot):
    args = getPurchaseOrder_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getPurchaseOrder_result()
    try:
      result.success = self._handler.getPurchaseOrder(args.id)
    except WarehouseServiceException, wex:
      result.wex = wex
    oprot.writeMessageBegin("getPurchaseOrder", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getAllPurchaseOrders(self, seqid, iprot, oprot):
    args = getAllPurchaseOrders_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getAllPurchaseOrders_result()
    try:
      result.success = self._handler.getAllPurchaseOrders(args.status)
    except WarehouseServiceException, wex:
      result.wex = wex
    oprot.writeMessageBegin("getAllPurchaseOrders", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getSupplier(self, seqid, iprot, oprot):
    args = getSupplier_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getSupplier_result()
    try:
      result.success = self._handler.getSupplier(args.id)
    except WarehouseServiceException, wex:
      result.wex = wex
    oprot.writeMessageBegin("getSupplier", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_startPurchase(self, seqid, iprot, oprot):
    args = startPurchase_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = startPurchase_result()
    try:
      result.success = self._handler.startPurchase(args.purchaseOrderId, args.invoiceNumber, args.freightCharges)
    except WarehouseServiceException, wex:
      result.wex = wex
    oprot.writeMessageBegin("startPurchase", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_closePurchase(self, seqid, iprot, oprot):
    args = closePurchase_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = closePurchase_result()
    try:
      result.success = self._handler.closePurchase(args.purchaseId)
    except WarehouseServiceException, wex:
      result.wex = wex
    oprot.writeMessageBegin("closePurchase", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getAllPurchases(self, seqid, iprot, oprot):
    args = getAllPurchases_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getAllPurchases_result()
    try:
      result.success = self._handler.getAllPurchases(args.purchaseOrderId, args.open)
    except WarehouseServiceException, wex:
      result.wex = wex
    oprot.writeMessageBegin("getAllPurchases", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_scanIn(self, seqid, iprot, oprot):
    args = scanIn_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = scanIn_result()
    try:
      self._handler.scanIn(args.purchaseId, args.itemNumber, args.imeiNumber, args.type)
    except WarehouseServiceException, wex:
      result.wex = wex
    oprot.writeMessageBegin("scanIn", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_scanOut(self, seqid, iprot, oprot):
    args = scanOut_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = scanOut_result()
    try:
      self._handler.scanOut(args.itemNumber, args.imeiNumber, args.type)
    except WarehouseServiceException, wex:
      result.wex = wex
    oprot.writeMessageBegin("scanOut", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES

class createPurchaseOrder_args:
  """
  Attributes:
   - purchaseOrder
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'purchaseOrder', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 1
  )

  def __init__(self, purchaseOrder=None,):
    self.purchaseOrder = purchaseOrder

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.purchaseOrder = PurchaseOrder()
          self.purchaseOrder.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createPurchaseOrder_args')
    if self.purchaseOrder != None:
      oprot.writeFieldBegin('purchaseOrder', TType.STRUCT, 1)
      self.purchaseOrder.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class createPurchaseOrder_result:
  """
  Attributes:
   - success
   - wex
  """

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, wex=None,):
    self.success = success
    self.wex = wex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.I64:
          self.success = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.wex = WarehouseServiceException()
          self.wex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createPurchaseOrder_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.I64, 0)
      oprot.writeI64(self.success)
      oprot.writeFieldEnd()
    if self.wex != None:
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
      self.wex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPurchaseOrder_args:
  """
  Attributes:
   - id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
  )

  def __init__(self, id=None,):
    self.id = id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPurchaseOrder_args')
    if self.id != None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPurchaseOrder_result:
  """
  Attributes:
   - success
   - wex
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, wex=None,):
    self.success = success
    self.wex = wex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = PurchaseOrder()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.wex = WarehouseServiceException()
          self.wex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPurchaseOrder_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.wex != None:
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
      self.wex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getAllPurchaseOrders_args:
  """
  Attributes:
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'status', None, None, ), # 1
  )

  def __init__(self, status=None,):
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getAllPurchaseOrders_args')
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 1)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getAllPurchaseOrders_result:
  """
  Attributes:
   - success
   - wex
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(PurchaseOrder, PurchaseOrder.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, wex=None,):
    self.success = success
    self.wex = wex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype10, _size7) = iprot.readListBegin()
          for _i11 in xrange(_size7):
            _elem12 = PurchaseOrder()
            _elem12.read(iprot)
            self.success.append(_elem12)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.wex = WarehouseServiceException()
          self.wex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getAllPurchaseOrders_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter13 in self.success:
        iter13.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.wex != None:
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
      self.wex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getSupplier_args:
  """
  Attributes:
   - id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
  )

  def __init__(self, id=None,):
    self.id = id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getSupplier_args')
    if self.id != None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getSupplier_result:
  """
  Attributes:
   - success
   - wex
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Supplier, Supplier.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, wex=None,):
    self.success = success
    self.wex = wex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = Supplier()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.wex = WarehouseServiceException()
          self.wex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getSupplier_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.wex != None:
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
      self.wex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class startPurchase_args:
  """
  Attributes:
   - purchaseOrderId
   - invoiceNumber
   - freightCharges
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'purchaseOrderId', None, None, ), # 1
    (2, TType.STRING, 'invoiceNumber', None, None, ), # 2
    (3, TType.DOUBLE, 'freightCharges', None, None, ), # 3
  )

  def __init__(self, purchaseOrderId=None, invoiceNumber=None, freightCharges=None,):
    self.purchaseOrderId = purchaseOrderId
    self.invoiceNumber = invoiceNumber
    self.freightCharges = freightCharges

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.purchaseOrderId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.invoiceNumber = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.freightCharges = iprot.readDouble();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('startPurchase_args')
    if self.purchaseOrderId != None:
      oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)
      oprot.writeI64(self.purchaseOrderId)
      oprot.writeFieldEnd()
    if self.invoiceNumber != None:
      oprot.writeFieldBegin('invoiceNumber', TType.STRING, 2)
      oprot.writeString(self.invoiceNumber)
      oprot.writeFieldEnd()
    if self.freightCharges != None:
      oprot.writeFieldBegin('freightCharges', TType.DOUBLE, 3)
      oprot.writeDouble(self.freightCharges)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class startPurchase_result:
  """
  Attributes:
   - success
   - wex
  """

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, wex=None,):
    self.success = success
    self.wex = wex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.I64:
          self.success = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.wex = WarehouseServiceException()
          self.wex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('startPurchase_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.I64, 0)
      oprot.writeI64(self.success)
      oprot.writeFieldEnd()
    if self.wex != None:
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
      self.wex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class closePurchase_args:
  """
  Attributes:
   - purchaseId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'purchaseId', None, None, ), # 1
  )

  def __init__(self, purchaseId=None,):
    self.purchaseId = purchaseId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.purchaseId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('closePurchase_args')
    if self.purchaseId != None:
      oprot.writeFieldBegin('purchaseId', TType.I64, 1)
      oprot.writeI64(self.purchaseId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class closePurchase_result:
  """
  Attributes:
   - success
   - wex
  """

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, wex=None,):
    self.success = success
    self.wex = wex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.I64:
          self.success = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.wex = WarehouseServiceException()
          self.wex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('closePurchase_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.I64, 0)
      oprot.writeI64(self.success)
      oprot.writeFieldEnd()
    if self.wex != None:
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
      self.wex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getAllPurchases_args:
  """
  Attributes:
   - purchaseOrderId
   - open
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'purchaseOrderId', None, None, ), # 1
    (2, TType.BOOL, 'open', None, None, ), # 2
  )

  def __init__(self, purchaseOrderId=None, open=None,):
    self.purchaseOrderId = purchaseOrderId
    self.open = open

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.purchaseOrderId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.BOOL:
          self.open = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getAllPurchases_args')
    if self.purchaseOrderId != None:
      oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)
      oprot.writeI64(self.purchaseOrderId)
      oprot.writeFieldEnd()
    if self.open != None:
      oprot.writeFieldBegin('open', TType.BOOL, 2)
      oprot.writeBool(self.open)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getAllPurchases_result:
  """
  Attributes:
   - success
   - wex
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(Purchase, Purchase.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, wex=None,):
    self.success = success
    self.wex = wex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype17, _size14) = iprot.readListBegin()
          for _i18 in xrange(_size14):
            _elem19 = Purchase()
            _elem19.read(iprot)
            self.success.append(_elem19)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.wex = WarehouseServiceException()
          self.wex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getAllPurchases_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter20 in self.success:
        iter20.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.wex != None:
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
      self.wex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class scanIn_args:
  """
  Attributes:
   - purchaseId
   - itemNumber
   - imeiNumber
   - type
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'purchaseId', None, None, ), # 1
    (2, TType.STRING, 'itemNumber', None, None, ), # 2
    (3, TType.STRING, 'imeiNumber', None, None, ), # 3
    (4, TType.I32, 'type', None, None, ), # 4
  )

  def __init__(self, purchaseId=None, itemNumber=None, imeiNumber=None, type=None,):
    self.purchaseId = purchaseId
    self.itemNumber = itemNumber
    self.imeiNumber = imeiNumber
    self.type = type

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.purchaseId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.itemNumber = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.imeiNumber = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('scanIn_args')
    if self.purchaseId != None:
      oprot.writeFieldBegin('purchaseId', TType.I64, 1)
      oprot.writeI64(self.purchaseId)
      oprot.writeFieldEnd()
    if self.itemNumber != None:
      oprot.writeFieldBegin('itemNumber', TType.STRING, 2)
      oprot.writeString(self.itemNumber)
      oprot.writeFieldEnd()
    if self.imeiNumber != None:
      oprot.writeFieldBegin('imeiNumber', TType.STRING, 3)
      oprot.writeString(self.imeiNumber)
      oprot.writeFieldEnd()
    if self.type != None:
      oprot.writeFieldBegin('type', TType.I32, 4)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class scanIn_result:
  """
  Attributes:
   - wex
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
  )

  def __init__(self, wex=None,):
    self.wex = wex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.wex = WarehouseServiceException()
          self.wex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('scanIn_result')
    if self.wex != None:
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
      self.wex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class scanOut_args:
  """
  Attributes:
   - itemNumber
   - imeiNumber
   - type
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'itemNumber', None, None, ), # 1
    (2, TType.I64, 'imeiNumber', None, None, ), # 2
    (3, TType.I32, 'type', None, None, ), # 3
  )

  def __init__(self, itemNumber=None, imeiNumber=None, type=None,):
    self.itemNumber = itemNumber
    self.imeiNumber = imeiNumber
    self.type = type

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.itemNumber = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.imeiNumber = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('scanOut_args')
    if self.itemNumber != None:
      oprot.writeFieldBegin('itemNumber', TType.I64, 1)
      oprot.writeI64(self.itemNumber)
      oprot.writeFieldEnd()
    if self.imeiNumber != None:
      oprot.writeFieldBegin('imeiNumber', TType.I64, 2)
      oprot.writeI64(self.imeiNumber)
      oprot.writeFieldEnd()
    if self.type != None:
      oprot.writeFieldBegin('type', TType.I32, 3)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class scanOut_result:
  """
  Attributes:
   - wex
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
  )

  def __init__(self, wex=None,):
    self.wex = wex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.wex = WarehouseServiceException()
          self.wex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('scanOut_result')
    if self.wex != None:
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
      self.wex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)