Rev 5530 | Rev 6386 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
## Autogenerated by Thrift Compiler (0.7.0)## DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING#from thrift.Thrift import *import shop2020.thriftpy.generic.GenericServicefrom ttypes import *from thrift.Thrift import TProcessorfrom thrift.transport import TTransportfrom thrift.protocol import TBinaryProtocol, TProtocoltry:from thrift.protocol import fastbinaryexcept:fastbinary = Noneclass 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 fieldsParameters:- purchaseOrder"""passdef getPurchaseOrder(self, id):"""Returns the purchase order with the given id. Throws an exception if there is no such purchase order.Parameters:- id"""passdef getAllPurchaseOrders(self, status):"""Returns a list of all the purchase orders in the given stateParameters:- status"""passdef getSupplier(self, id):"""Returns the supplier with the given order id. Throws an exception if there is no such supplier.Parameters:- id"""passdef 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"""passdef closePurchase(self, purchaseId):"""Marks a purchase as complete and updates the receivedOn time.Throws an exception if no such purchase exists.Parameters:- purchaseId"""passdef getAllPurchases(self, purchaseOrderId, open):"""Returns all open or closed purchases for the given purchase order. Throws an exception if no such purchase order existsParameters:- purchaseOrderId- open"""passdef getPurchaseOrderForPurchase(self, purchaseId):"""Returns the purchase order object for a given purchaseParameters:- purchaseId"""passdef getPendingPurchaseOrders(self, warehouseId):"""Creates purchase order objects from pending ordersParameters:- warehouseId"""passdef getSuppliers(self, ):"""Returns all the valid suppliers"""passdef fulfillPO(self, purchaseOrderId, itemId, quantity):"""Fulfills a given purchase order with an item.Parameters:- purchaseOrderId- itemId- quantity"""passdef updatePurchaseOrder(self, purchaseOrder):"""Amends a PO as per the new lineitems passedParameters:- purchaseOrder"""passdef unFulfillPO(self, purchaseId, itemId, quantity):"""Fulfills a given purchase id with an item and its quantity.Parameters:- purchaseId- itemId- quantity"""passdef getInvoices(self, date):"""Fetches all invoices after a given dateParameters:- date"""passdef createInvoice(self, invoice):"""Creates an invoice objectParameters:- invoice"""passdef addSupplier(self, supplier):"""Creates a supplierParameters:- supplier"""passdef updateSupplier(self, supplier):"""Updates a supplierParameters:- supplier"""passclass 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 fieldsParameters:- 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 = purchaseOrderargs.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 xresult = createPurchaseOrder_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise 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 = idargs.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 xresult = getPurchaseOrder_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise TApplicationException(TApplicationException.MISSING_RESULT, "getPurchaseOrder failed: unknown result");def getAllPurchaseOrders(self, status):"""Returns a list of all the purchase orders in the given stateParameters:- 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 = statusargs.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 xresult = getAllPurchaseOrders_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise 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 = idargs.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 xresult = getSupplier_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise 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 = purchaseOrderIdargs.invoiceNumber = invoiceNumberargs.freightCharges = freightChargesargs.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 xresult = startPurchase_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise 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 = purchaseIdargs.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 xresult = closePurchase_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise 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 existsParameters:- 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 = purchaseOrderIdargs.open = openargs.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 xresult = getAllPurchases_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");def getPurchaseOrderForPurchase(self, purchaseId):"""Returns the purchase order object for a given purchaseParameters:- purchaseId"""self.send_getPurchaseOrderForPurchase(purchaseId)return self.recv_getPurchaseOrderForPurchase()def send_getPurchaseOrderForPurchase(self, purchaseId):self._oprot.writeMessageBegin('getPurchaseOrderForPurchase', TMessageType.CALL, self._seqid)args = getPurchaseOrderForPurchase_args()args.purchaseId = purchaseIdargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getPurchaseOrderForPurchase(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getPurchaseOrderForPurchase_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successraise TApplicationException(TApplicationException.MISSING_RESULT, "getPurchaseOrderForPurchase failed: unknown result");def getPendingPurchaseOrders(self, warehouseId):"""Creates purchase order objects from pending ordersParameters:- warehouseId"""self.send_getPendingPurchaseOrders(warehouseId)return self.recv_getPendingPurchaseOrders()def send_getPendingPurchaseOrders(self, warehouseId):self._oprot.writeMessageBegin('getPendingPurchaseOrders', TMessageType.CALL, self._seqid)args = getPendingPurchaseOrders_args()args.warehouseId = warehouseIdargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getPendingPurchaseOrders(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getPendingPurchaseOrders_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise TApplicationException(TApplicationException.MISSING_RESULT, "getPendingPurchaseOrders failed: unknown result");def getSuppliers(self, ):"""Returns all the valid suppliers"""self.send_getSuppliers()return self.recv_getSuppliers()def send_getSuppliers(self, ):self._oprot.writeMessageBegin('getSuppliers', TMessageType.CALL, self._seqid)args = getSuppliers_args()args.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getSuppliers(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getSuppliers_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise TApplicationException(TApplicationException.MISSING_RESULT, "getSuppliers failed: unknown result");def fulfillPO(self, purchaseOrderId, itemId, quantity):"""Fulfills a given purchase order with an item.Parameters:- purchaseOrderId- itemId- quantity"""self.send_fulfillPO(purchaseOrderId, itemId, quantity)self.recv_fulfillPO()def send_fulfillPO(self, purchaseOrderId, itemId, quantity):self._oprot.writeMessageBegin('fulfillPO', TMessageType.CALL, self._seqid)args = fulfillPO_args()args.purchaseOrderId = purchaseOrderIdargs.itemId = itemIdargs.quantity = quantityargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_fulfillPO(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = fulfillPO_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.e is not None:raise result.ereturndef updatePurchaseOrder(self, purchaseOrder):"""Amends a PO as per the new lineitems passedParameters:- purchaseOrder"""self.send_updatePurchaseOrder(purchaseOrder)self.recv_updatePurchaseOrder()def send_updatePurchaseOrder(self, purchaseOrder):self._oprot.writeMessageBegin('updatePurchaseOrder', TMessageType.CALL, self._seqid)args = updatePurchaseOrder_args()args.purchaseOrder = purchaseOrderargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_updatePurchaseOrder(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = updatePurchaseOrder_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.e is not None:raise result.ereturndef unFulfillPO(self, purchaseId, itemId, quantity):"""Fulfills a given purchase id with an item and its quantity.Parameters:- purchaseId- itemId- quantity"""self.send_unFulfillPO(purchaseId, itemId, quantity)self.recv_unFulfillPO()def send_unFulfillPO(self, purchaseId, itemId, quantity):self._oprot.writeMessageBegin('unFulfillPO', TMessageType.CALL, self._seqid)args = unFulfillPO_args()args.purchaseId = purchaseIdargs.itemId = itemIdargs.quantity = quantityargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_unFulfillPO(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = unFulfillPO_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.e is not None:raise result.ereturndef getInvoices(self, date):"""Fetches all invoices after a given dateParameters:- date"""self.send_getInvoices(date)return self.recv_getInvoices()def send_getInvoices(self, date):self._oprot.writeMessageBegin('getInvoices', TMessageType.CALL, self._seqid)args = getInvoices_args()args.date = dateargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getInvoices(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getInvoices_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successraise TApplicationException(TApplicationException.MISSING_RESULT, "getInvoices failed: unknown result");def createInvoice(self, invoice):"""Creates an invoice objectParameters:- invoice"""self.send_createInvoice(invoice)self.recv_createInvoice()def send_createInvoice(self, invoice):self._oprot.writeMessageBegin('createInvoice', TMessageType.CALL, self._seqid)args = createInvoice_args()args.invoice = invoiceargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_createInvoice(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = createInvoice_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.e is not None:raise result.ereturndef addSupplier(self, supplier):"""Creates a supplierParameters:- supplier"""self.send_addSupplier(supplier)return self.recv_addSupplier()def send_addSupplier(self, supplier):self._oprot.writeMessageBegin('addSupplier', TMessageType.CALL, self._seqid)args = addSupplier_args()args.supplier = supplierargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_addSupplier(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = addSupplier_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successraise TApplicationException(TApplicationException.MISSING_RESULT, "addSupplier failed: unknown result");def updateSupplier(self, supplier):"""Updates a supplierParameters:- supplier"""self.send_updateSupplier(supplier)self.recv_updateSupplier()def send_updateSupplier(self, supplier):self._oprot.writeMessageBegin('updateSupplier', TMessageType.CALL, self._seqid)args = updateSupplier_args()args.supplier = supplierargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_updateSupplier(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = updateSupplier_result()result.read(self._iprot)self._iprot.readMessageEnd()returnclass 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_createPurchaseOrderself._processMap["getPurchaseOrder"] = Processor.process_getPurchaseOrderself._processMap["getAllPurchaseOrders"] = Processor.process_getAllPurchaseOrdersself._processMap["getSupplier"] = Processor.process_getSupplierself._processMap["startPurchase"] = Processor.process_startPurchaseself._processMap["closePurchase"] = Processor.process_closePurchaseself._processMap["getAllPurchases"] = Processor.process_getAllPurchasesself._processMap["getPurchaseOrderForPurchase"] = Processor.process_getPurchaseOrderForPurchaseself._processMap["getPendingPurchaseOrders"] = Processor.process_getPendingPurchaseOrdersself._processMap["getSuppliers"] = Processor.process_getSuppliersself._processMap["fulfillPO"] = Processor.process_fulfillPOself._processMap["updatePurchaseOrder"] = Processor.process_updatePurchaseOrderself._processMap["unFulfillPO"] = Processor.process_unFulfillPOself._processMap["getInvoices"] = Processor.process_getInvoicesself._processMap["createInvoice"] = Processor.process_createInvoiceself._processMap["addSupplier"] = Processor.process_addSupplierself._processMap["updateSupplier"] = Processor.process_updateSupplierdef 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()returnelse:self._processMap[name](self, seqid, iprot, oprot)return Truedef 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 PurchaseServiceException, e:result.e = eoprot.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 PurchaseServiceException, e:result.e = eoprot.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 PurchaseServiceException, e:result.e = eoprot.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 PurchaseServiceException, e:result.e = eoprot.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 PurchaseServiceException, e:result.e = eoprot.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 PurchaseServiceException, e:result.e = eoprot.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 PurchaseServiceException, e:result.e = eoprot.writeMessageBegin("getAllPurchases", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getPurchaseOrderForPurchase(self, seqid, iprot, oprot):args = getPurchaseOrderForPurchase_args()args.read(iprot)iprot.readMessageEnd()result = getPurchaseOrderForPurchase_result()result.success = self._handler.getPurchaseOrderForPurchase(args.purchaseId)oprot.writeMessageBegin("getPurchaseOrderForPurchase", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getPendingPurchaseOrders(self, seqid, iprot, oprot):args = getPendingPurchaseOrders_args()args.read(iprot)iprot.readMessageEnd()result = getPendingPurchaseOrders_result()try:result.success = self._handler.getPendingPurchaseOrders(args.warehouseId)except PurchaseServiceException, e:result.e = eoprot.writeMessageBegin("getPendingPurchaseOrders", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getSuppliers(self, seqid, iprot, oprot):args = getSuppliers_args()args.read(iprot)iprot.readMessageEnd()result = getSuppliers_result()try:result.success = self._handler.getSuppliers()except PurchaseServiceException, e:result.e = eoprot.writeMessageBegin("getSuppliers", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_fulfillPO(self, seqid, iprot, oprot):args = fulfillPO_args()args.read(iprot)iprot.readMessageEnd()result = fulfillPO_result()try:self._handler.fulfillPO(args.purchaseOrderId, args.itemId, args.quantity)except PurchaseServiceException, e:result.e = eoprot.writeMessageBegin("fulfillPO", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_updatePurchaseOrder(self, seqid, iprot, oprot):args = updatePurchaseOrder_args()args.read(iprot)iprot.readMessageEnd()result = updatePurchaseOrder_result()try:self._handler.updatePurchaseOrder(args.purchaseOrder)except PurchaseServiceException, e:result.e = eoprot.writeMessageBegin("updatePurchaseOrder", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_unFulfillPO(self, seqid, iprot, oprot):args = unFulfillPO_args()args.read(iprot)iprot.readMessageEnd()result = unFulfillPO_result()try:self._handler.unFulfillPO(args.purchaseId, args.itemId, args.quantity)except PurchaseServiceException, e:result.e = eoprot.writeMessageBegin("unFulfillPO", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getInvoices(self, seqid, iprot, oprot):args = getInvoices_args()args.read(iprot)iprot.readMessageEnd()result = getInvoices_result()result.success = self._handler.getInvoices(args.date)oprot.writeMessageBegin("getInvoices", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_createInvoice(self, seqid, iprot, oprot):args = createInvoice_args()args.read(iprot)iprot.readMessageEnd()result = createInvoice_result()try:self._handler.createInvoice(args.invoice)except PurchaseServiceException, e:result.e = eoprot.writeMessageBegin("createInvoice", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_addSupplier(self, seqid, iprot, oprot):args = addSupplier_args()args.read(iprot)iprot.readMessageEnd()result = addSupplier_result()result.success = self._handler.addSupplier(args.supplier)oprot.writeMessageBegin("addSupplier", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_updateSupplier(self, seqid, iprot, oprot):args = updateSupplier_args()args.read(iprot)iprot.readMessageEnd()result = updateSupplier_result()self._handler.updateSupplier(args.supplier)oprot.writeMessageBegin("updateSupplier", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()# HELPER FUNCTIONS AND STRUCTURESclass 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 = purchaseOrderdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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)))returnoprot.writeStructBegin('createPurchaseOrder_args')if self.purchaseOrder is not None:oprot.writeFieldBegin('purchaseOrder', TType.STRUCT, 1)self.purchaseOrder.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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- e"""thrift_spec = ((0, TType.I64, 'success', None, None, ), # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.I64:self.success = iprot.readI64();else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('createPurchaseOrder_result')if self.success is not None:oprot.writeFieldBegin('success', TType.I64, 0)oprot.writeI64(self.success)oprot.writeFieldEnd()if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 = iddef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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)))returnoprot.writeStructBegin('getPurchaseOrder_args')if self.id is not None:oprot.writeFieldBegin('id', TType.I64, 1)oprot.writeI64(self.id)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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- e"""thrift_spec = ((0, TType.STRUCT, 'success', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('getPurchaseOrder_result')if self.success is not None:oprot.writeFieldBegin('success', TType.STRUCT, 0)self.success.write(oprot)oprot.writeFieldEnd()if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 = statusdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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)))returnoprot.writeStructBegin('getAllPurchaseOrders_args')if self.status is not None:oprot.writeFieldBegin('status', TType.I32, 1)oprot.writeI32(self.status)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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- e"""thrift_spec = ((0, TType.LIST, 'success', (TType.STRUCT,(PurchaseOrder, PurchaseOrder.thrift_spec)), None, ), # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('getAllPurchaseOrders_result')if self.success is not 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.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 = iddef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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)))returnoprot.writeStructBegin('getSupplier_args')if self.id is not None:oprot.writeFieldBegin('id', TType.I64, 1)oprot.writeI64(self.id)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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- e"""thrift_spec = ((0, TType.STRUCT, 'success', (Supplier, Supplier.thrift_spec), None, ), # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('getSupplier_result')if self.success is not None:oprot.writeFieldBegin('success', TType.STRUCT, 0)self.success.write(oprot)oprot.writeFieldEnd()if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 = purchaseOrderIdself.invoiceNumber = invoiceNumberself.freightCharges = freightChargesdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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)))returnoprot.writeStructBegin('startPurchase_args')if self.purchaseOrderId is not None:oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)oprot.writeI64(self.purchaseOrderId)oprot.writeFieldEnd()if self.invoiceNumber is not None:oprot.writeFieldBegin('invoiceNumber', TType.STRING, 2)oprot.writeString(self.invoiceNumber)oprot.writeFieldEnd()if self.freightCharges is not None:oprot.writeFieldBegin('freightCharges', TType.DOUBLE, 3)oprot.writeDouble(self.freightCharges)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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- e"""thrift_spec = ((0, TType.I64, 'success', None, None, ), # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.I64:self.success = iprot.readI64();else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('startPurchase_result')if self.success is not None:oprot.writeFieldBegin('success', TType.I64, 0)oprot.writeI64(self.success)oprot.writeFieldEnd()if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 = purchaseIddef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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)))returnoprot.writeStructBegin('closePurchase_args')if self.purchaseId is not None:oprot.writeFieldBegin('purchaseId', TType.I64, 1)oprot.writeI64(self.purchaseId)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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- e"""thrift_spec = ((0, TType.I64, 'success', None, None, ), # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.I64:self.success = iprot.readI64();else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('closePurchase_result')if self.success is not None:oprot.writeFieldBegin('success', TType.I64, 0)oprot.writeI64(self.success)oprot.writeFieldEnd()if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 = purchaseOrderIdself.open = opendef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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)))returnoprot.writeStructBegin('getAllPurchases_args')if self.purchaseOrderId is not None:oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)oprot.writeI64(self.purchaseOrderId)oprot.writeFieldEnd()if self.open is not None:oprot.writeFieldBegin('open', TType.BOOL, 2)oprot.writeBool(self.open)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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- e"""thrift_spec = ((0, TType.LIST, 'success', (TType.STRUCT,(Purchase, Purchase.thrift_spec)), None, ), # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('getAllPurchases_result')if self.success is not 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.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 getPurchaseOrderForPurchase_args:"""Attributes:- purchaseId"""thrift_spec = (None, # 0(1, TType.I64, 'purchaseId', None, None, ), # 1)def __init__(self, purchaseId=None,):self.purchaseId = purchaseIddef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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)))returnoprot.writeStructBegin('getPurchaseOrderForPurchase_args')if self.purchaseId is not None:oprot.writeFieldBegin('purchaseId', TType.I64, 1)oprot.writeI64(self.purchaseId)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 getPurchaseOrderForPurchase_result:"""Attributes:- success"""thrift_spec = ((0, TType.STRUCT, 'success', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 0)def __init__(self, success=None,):self.success = successdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.STRUCT:self.success = PurchaseOrder()self.success.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)))returnoprot.writeStructBegin('getPurchaseOrderForPurchase_result')if self.success is not None:oprot.writeFieldBegin('success', TType.STRUCT, 0)self.success.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 getPendingPurchaseOrders_args:"""Attributes:- warehouseId"""thrift_spec = (None, # 0(1, TType.I64, 'warehouseId', None, None, ), # 1)def __init__(self, warehouseId=None,):self.warehouseId = warehouseIddef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I64:self.warehouseId = 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)))returnoprot.writeStructBegin('getPendingPurchaseOrders_args')if self.warehouseId is not None:oprot.writeFieldBegin('warehouseId', TType.I64, 1)oprot.writeI64(self.warehouseId)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 getPendingPurchaseOrders_result:"""Attributes:- success- e"""thrift_spec = ((0, TType.LIST, 'success', (TType.STRUCT,(PurchaseOrder, PurchaseOrder.thrift_spec)), None, ), # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.LIST:self.success = [](_etype24, _size21) = iprot.readListBegin()for _i25 in xrange(_size21):_elem26 = PurchaseOrder()_elem26.read(iprot)self.success.append(_elem26)iprot.readListEnd()else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('getPendingPurchaseOrders_result')if self.success is not None:oprot.writeFieldBegin('success', TType.LIST, 0)oprot.writeListBegin(TType.STRUCT, len(self.success))for iter27 in self.success:iter27.write(oprot)oprot.writeListEnd()oprot.writeFieldEnd()if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 getSuppliers_args:thrift_spec = ()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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakelse: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)))returnoprot.writeStructBegin('getSuppliers_args')oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 getSuppliers_result:"""Attributes:- success- e"""thrift_spec = ((0, TType.LIST, 'success', (TType.STRUCT,(Supplier, Supplier.thrift_spec)), None, ), # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.LIST:self.success = [](_etype31, _size28) = iprot.readListBegin()for _i32 in xrange(_size28):_elem33 = Supplier()_elem33.read(iprot)self.success.append(_elem33)iprot.readListEnd()else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('getSuppliers_result')if self.success is not None:oprot.writeFieldBegin('success', TType.LIST, 0)oprot.writeListBegin(TType.STRUCT, len(self.success))for iter34 in self.success:iter34.write(oprot)oprot.writeListEnd()oprot.writeFieldEnd()if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 fulfillPO_args:"""Attributes:- purchaseOrderId- itemId- quantity"""thrift_spec = (None, # 0(1, TType.I64, 'purchaseOrderId', None, None, ), # 1(2, TType.I64, 'itemId', None, None, ), # 2(3, TType.I64, 'quantity', None, None, ), # 3)def __init__(self, purchaseOrderId=None, itemId=None, quantity=None,):self.purchaseOrderId = purchaseOrderIdself.itemId = itemIdself.quantity = quantitydef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I64:self.purchaseOrderId = iprot.readI64();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.I64:self.itemId = iprot.readI64();else:iprot.skip(ftype)elif fid == 3:if ftype == TType.I64:self.quantity = 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)))returnoprot.writeStructBegin('fulfillPO_args')if self.purchaseOrderId is not None:oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)oprot.writeI64(self.purchaseOrderId)oprot.writeFieldEnd()if self.itemId is not None:oprot.writeFieldBegin('itemId', TType.I64, 2)oprot.writeI64(self.itemId)oprot.writeFieldEnd()if self.quantity is not None:oprot.writeFieldBegin('quantity', TType.I64, 3)oprot.writeI64(self.quantity)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 fulfillPO_result:"""Attributes:- e"""thrift_spec = (None, # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, e=None,):self.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRUCT:self.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('fulfillPO_result')if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 updatePurchaseOrder_args:"""Attributes:- purchaseOrder"""thrift_spec = (None, # 0(1, TType.STRUCT, 'purchaseOrder', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 1)def __init__(self, purchaseOrder=None,):self.purchaseOrder = purchaseOrderdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif 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)))returnoprot.writeStructBegin('updatePurchaseOrder_args')if self.purchaseOrder is not None:oprot.writeFieldBegin('purchaseOrder', TType.STRUCT, 1)self.purchaseOrder.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 updatePurchaseOrder_result:"""Attributes:- e"""thrift_spec = (None, # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, e=None,):self.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRUCT:self.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('updatePurchaseOrder_result')if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 unFulfillPO_args:"""Attributes:- purchaseId- itemId- quantity"""thrift_spec = (None, # 0(1, TType.I64, 'purchaseId', None, None, ), # 1(2, TType.I64, 'itemId', None, None, ), # 2(3, TType.I64, 'quantity', None, None, ), # 3)def __init__(self, purchaseId=None, itemId=None, quantity=None,):self.purchaseId = purchaseIdself.itemId = itemIdself.quantity = quantitydef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I64:self.purchaseId = iprot.readI64();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.I64:self.itemId = iprot.readI64();else:iprot.skip(ftype)elif fid == 3:if ftype == TType.I64:self.quantity = 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)))returnoprot.writeStructBegin('unFulfillPO_args')if self.purchaseId is not None:oprot.writeFieldBegin('purchaseId', TType.I64, 1)oprot.writeI64(self.purchaseId)oprot.writeFieldEnd()if self.itemId is not None:oprot.writeFieldBegin('itemId', TType.I64, 2)oprot.writeI64(self.itemId)oprot.writeFieldEnd()if self.quantity is not None:oprot.writeFieldBegin('quantity', TType.I64, 3)oprot.writeI64(self.quantity)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 unFulfillPO_result:"""Attributes:- e"""thrift_spec = (None, # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, e=None,):self.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRUCT:self.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('unFulfillPO_result')if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 getInvoices_args:"""Attributes:- date"""thrift_spec = (None, # 0(1, TType.I64, 'date', None, None, ), # 1)def __init__(self, date=None,):self.date = datedef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I64:self.date = 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)))returnoprot.writeStructBegin('getInvoices_args')if self.date is not None:oprot.writeFieldBegin('date', TType.I64, 1)oprot.writeI64(self.date)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 getInvoices_result:"""Attributes:- success"""thrift_spec = ((0, TType.LIST, 'success', (TType.STRUCT,(Invoice, Invoice.thrift_spec)), None, ), # 0)def __init__(self, success=None,):self.success = successdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.LIST:self.success = [](_etype38, _size35) = iprot.readListBegin()for _i39 in xrange(_size35):_elem40 = Invoice()_elem40.read(iprot)self.success.append(_elem40)iprot.readListEnd()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)))returnoprot.writeStructBegin('getInvoices_result')if self.success is not None:oprot.writeFieldBegin('success', TType.LIST, 0)oprot.writeListBegin(TType.STRUCT, len(self.success))for iter41 in self.success:iter41.write(oprot)oprot.writeListEnd()oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 createInvoice_args:"""Attributes:- invoice"""thrift_spec = (None, # 0(1, TType.STRUCT, 'invoice', (Invoice, Invoice.thrift_spec), None, ), # 1)def __init__(self, invoice=None,):self.invoice = invoicedef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRUCT:self.invoice = Invoice()self.invoice.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)))returnoprot.writeStructBegin('createInvoice_args')if self.invoice is not None:oprot.writeFieldBegin('invoice', TType.STRUCT, 1)self.invoice.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 createInvoice_result:"""Attributes:- e"""thrift_spec = (None, # 0(1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1)def __init__(self, e=None,):self.e = edef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRUCT:self.e = PurchaseServiceException()self.e.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)))returnoprot.writeStructBegin('createInvoice_result')if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 addSupplier_args:"""Attributes:- supplier"""thrift_spec = (None, # 0(1, TType.STRUCT, 'supplier', (Supplier, Supplier.thrift_spec), None, ), # 1)def __init__(self, supplier=None,):self.supplier = supplierdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRUCT:self.supplier = Supplier()self.supplier.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)))returnoprot.writeStructBegin('addSupplier_args')if self.supplier is not None:oprot.writeFieldBegin('supplier', TType.STRUCT, 1)self.supplier.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 addSupplier_result:"""Attributes:- success"""thrift_spec = ((0, TType.STRUCT, 'success', (Supplier, Supplier.thrift_spec), None, ), # 0)def __init__(self, success=None,):self.success = successdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.STRUCT:self.success = Supplier()self.success.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)))returnoprot.writeStructBegin('addSupplier_result')if self.success is not None:oprot.writeFieldBegin('success', TType.STRUCT, 0)self.success.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 updateSupplier_args:"""Attributes:- supplier"""thrift_spec = (None, # 0(1, TType.STRUCT, 'supplier', (Supplier, Supplier.thrift_spec), None, ), # 1)def __init__(self, supplier=None,):self.supplier = supplierdef 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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRUCT:self.supplier = Supplier()self.supplier.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)))returnoprot.writeStructBegin('updateSupplier_args')if self.supplier is not None:oprot.writeFieldBegin('supplier', TType.STRUCT, 1)self.supplier.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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 updateSupplier_result:thrift_spec = ()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))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakelse: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)))returnoprot.writeStructBegin('updateSupplier_result')oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __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)