Subversion Repositories SmartDukaan

Rev

Rev 4754 | Rev 5443 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4502 mandeep.dh 1
#
2
# Autogenerated by Thrift Compiler (0.7.0)
3
#
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
#
6
 
7
from thrift.Thrift import *
8
import shop2020.thriftpy.generic.GenericService
9
from ttypes import *
10
from thrift.Thrift import TProcessor
11
from thrift.transport import TTransport
12
from thrift.protocol import TBinaryProtocol, TProtocol
13
try:
14
  from thrift.protocol import fastbinary
15
except:
16
  fastbinary = None
17
 
18
 
19
class Iface(shop2020.thriftpy.generic.GenericService.Iface):
20
  def createPurchaseOrder(self, purchaseOrder):
21
    """
22
    Creates a purchase order based on the data in the given purchase order object.
23
    This method populates a nummber of missing fields
24
 
25
    Parameters:
26
     - purchaseOrder
27
    """
28
    pass
29
 
30
  def getPurchaseOrder(self, id):
31
    """
32
    Returns the purchase order with the given id. Throws an exception if there is no such purchase order.
33
 
34
    Parameters:
35
     - id
36
    """
37
    pass
38
 
39
  def getAllPurchaseOrders(self, status):
40
    """
41
    Returns a list of all the purchase orders in the given state
42
 
43
    Parameters:
44
     - status
45
    """
46
    pass
47
 
48
  def getSupplier(self, id):
49
    """
50
    Returns the supplier with the given order id. Throws an exception if there is no such supplier.
51
 
52
    Parameters:
53
     - id
54
    """
55
    pass
56
 
57
  def startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges):
58
    """
59
    Creates a purchase for the given purchase order.
60
    Throws an exception if no more purchases are allowed against the given purchase order.
61
 
62
    Parameters:
63
     - purchaseOrderId
64
     - invoiceNumber
65
     - freightCharges
66
    """
67
    pass
68
 
69
  def closePurchase(self, purchaseId):
70
    """
71
    Marks a purchase as complete and updates the receivedOn time.
72
    Throws an exception if no such purchase exists.
73
 
74
    Parameters:
75
     - purchaseId
76
    """
77
    pass
78
 
79
  def getAllPurchases(self, purchaseOrderId, open):
80
    """
81
    Returns all open or closed purchases for the given purchase order. Throws an exception if no such purchase order exists
82
 
83
    Parameters:
84
     - purchaseOrderId
85
     - open
86
    """
87
    pass
88
 
4555 mandeep.dh 89
  def getPurchaseOrderForPurchase(self, purchaseId):
4502 mandeep.dh 90
    """
4555 mandeep.dh 91
    Returns the purchase order object for a given purchase
4502 mandeep.dh 92
 
93
    Parameters:
94
     - purchaseId
95
    """
96
    pass
97
 
4754 mandeep.dh 98
  def getPendingPurchaseOrders(self, warehouseId):
99
    """
100
    Creates purchase order objects from pending orders
4502 mandeep.dh 101
 
4754 mandeep.dh 102
    Parameters:
103
     - warehouseId
104
    """
105
    pass
106
 
107
  def getSuppliers(self, ):
108
    """
109
    Returns all the valid suppliers
110
    """
111
    pass
112
 
113
  def fulfillPO(self, purchaseOrderId, itemId, quantity):
114
    """
115
    Fulfills a given purchase order with an item.
116
 
117
    Parameters:
118
     - purchaseOrderId
119
     - itemId
120
     - quantity
121
    """
122
    pass
123
 
124
  def updatePurchaseOrder(self, purchaseOrder):
125
    """
126
    Amends a PO as per the new lineitems passed
127
 
128
    Parameters:
129
     - purchaseOrder
130
    """
131
    pass
132
 
5185 mandeep.dh 133
  def unFulfillPO(self, purchaseId, itemId, quantity):
134
    """
135
    Fulfills a given purchase id with an item and its quantity.
4754 mandeep.dh 136
 
5185 mandeep.dh 137
    Parameters:
138
     - purchaseId
139
     - itemId
140
     - quantity
141
    """
142
    pass
143
 
144
 
4502 mandeep.dh 145
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
146
  def __init__(self, iprot, oprot=None):
147
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
148
 
149
  def createPurchaseOrder(self, purchaseOrder):
150
    """
151
    Creates a purchase order based on the data in the given purchase order object.
152
    This method populates a nummber of missing fields
153
 
154
    Parameters:
155
     - purchaseOrder
156
    """
157
    self.send_createPurchaseOrder(purchaseOrder)
158
    return self.recv_createPurchaseOrder()
159
 
160
  def send_createPurchaseOrder(self, purchaseOrder):
161
    self._oprot.writeMessageBegin('createPurchaseOrder', TMessageType.CALL, self._seqid)
162
    args = createPurchaseOrder_args()
163
    args.purchaseOrder = purchaseOrder
164
    args.write(self._oprot)
165
    self._oprot.writeMessageEnd()
166
    self._oprot.trans.flush()
167
 
168
  def recv_createPurchaseOrder(self, ):
169
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
170
    if mtype == TMessageType.EXCEPTION:
171
      x = TApplicationException()
172
      x.read(self._iprot)
173
      self._iprot.readMessageEnd()
174
      raise x
175
    result = createPurchaseOrder_result()
176
    result.read(self._iprot)
177
    self._iprot.readMessageEnd()
178
    if result.success is not None:
179
      return result.success
180
    if result.e is not None:
181
      raise result.e
182
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createPurchaseOrder failed: unknown result");
183
 
184
  def getPurchaseOrder(self, id):
185
    """
186
    Returns the purchase order with the given id. Throws an exception if there is no such purchase order.
187
 
188
    Parameters:
189
     - id
190
    """
191
    self.send_getPurchaseOrder(id)
192
    return self.recv_getPurchaseOrder()
193
 
194
  def send_getPurchaseOrder(self, id):
195
    self._oprot.writeMessageBegin('getPurchaseOrder', TMessageType.CALL, self._seqid)
196
    args = getPurchaseOrder_args()
197
    args.id = id
198
    args.write(self._oprot)
199
    self._oprot.writeMessageEnd()
200
    self._oprot.trans.flush()
201
 
202
  def recv_getPurchaseOrder(self, ):
203
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
204
    if mtype == TMessageType.EXCEPTION:
205
      x = TApplicationException()
206
      x.read(self._iprot)
207
      self._iprot.readMessageEnd()
208
      raise x
209
    result = getPurchaseOrder_result()
210
    result.read(self._iprot)
211
    self._iprot.readMessageEnd()
212
    if result.success is not None:
213
      return result.success
214
    if result.e is not None:
215
      raise result.e
216
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPurchaseOrder failed: unknown result");
217
 
218
  def getAllPurchaseOrders(self, status):
219
    """
220
    Returns a list of all the purchase orders in the given state
221
 
222
    Parameters:
223
     - status
224
    """
225
    self.send_getAllPurchaseOrders(status)
226
    return self.recv_getAllPurchaseOrders()
227
 
228
  def send_getAllPurchaseOrders(self, status):
229
    self._oprot.writeMessageBegin('getAllPurchaseOrders', TMessageType.CALL, self._seqid)
230
    args = getAllPurchaseOrders_args()
231
    args.status = status
232
    args.write(self._oprot)
233
    self._oprot.writeMessageEnd()
234
    self._oprot.trans.flush()
235
 
236
  def recv_getAllPurchaseOrders(self, ):
237
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
238
    if mtype == TMessageType.EXCEPTION:
239
      x = TApplicationException()
240
      x.read(self._iprot)
241
      self._iprot.readMessageEnd()
242
      raise x
243
    result = getAllPurchaseOrders_result()
244
    result.read(self._iprot)
245
    self._iprot.readMessageEnd()
246
    if result.success is not None:
247
      return result.success
248
    if result.e is not None:
249
      raise result.e
250
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPurchaseOrders failed: unknown result");
251
 
252
  def getSupplier(self, id):
253
    """
254
    Returns the supplier with the given order id. Throws an exception if there is no such supplier.
255
 
256
    Parameters:
257
     - id
258
    """
259
    self.send_getSupplier(id)
260
    return self.recv_getSupplier()
261
 
262
  def send_getSupplier(self, id):
263
    self._oprot.writeMessageBegin('getSupplier', TMessageType.CALL, self._seqid)
264
    args = getSupplier_args()
265
    args.id = id
266
    args.write(self._oprot)
267
    self._oprot.writeMessageEnd()
268
    self._oprot.trans.flush()
269
 
270
  def recv_getSupplier(self, ):
271
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
272
    if mtype == TMessageType.EXCEPTION:
273
      x = TApplicationException()
274
      x.read(self._iprot)
275
      self._iprot.readMessageEnd()
276
      raise x
277
    result = getSupplier_result()
278
    result.read(self._iprot)
279
    self._iprot.readMessageEnd()
280
    if result.success is not None:
281
      return result.success
282
    if result.e is not None:
283
      raise result.e
284
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getSupplier failed: unknown result");
285
 
286
  def startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges):
287
    """
288
    Creates a purchase for the given purchase order.
289
    Throws an exception if no more purchases are allowed against the given purchase order.
290
 
291
    Parameters:
292
     - purchaseOrderId
293
     - invoiceNumber
294
     - freightCharges
295
    """
296
    self.send_startPurchase(purchaseOrderId, invoiceNumber, freightCharges)
297
    return self.recv_startPurchase()
298
 
299
  def send_startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges):
300
    self._oprot.writeMessageBegin('startPurchase', TMessageType.CALL, self._seqid)
301
    args = startPurchase_args()
302
    args.purchaseOrderId = purchaseOrderId
303
    args.invoiceNumber = invoiceNumber
304
    args.freightCharges = freightCharges
305
    args.write(self._oprot)
306
    self._oprot.writeMessageEnd()
307
    self._oprot.trans.flush()
308
 
309
  def recv_startPurchase(self, ):
310
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
311
    if mtype == TMessageType.EXCEPTION:
312
      x = TApplicationException()
313
      x.read(self._iprot)
314
      self._iprot.readMessageEnd()
315
      raise x
316
    result = startPurchase_result()
317
    result.read(self._iprot)
318
    self._iprot.readMessageEnd()
319
    if result.success is not None:
320
      return result.success
321
    if result.e is not None:
322
      raise result.e
323
    raise TApplicationException(TApplicationException.MISSING_RESULT, "startPurchase failed: unknown result");
324
 
325
  def closePurchase(self, purchaseId):
326
    """
327
    Marks a purchase as complete and updates the receivedOn time.
328
    Throws an exception if no such purchase exists.
329
 
330
    Parameters:
331
     - purchaseId
332
    """
333
    self.send_closePurchase(purchaseId)
334
    return self.recv_closePurchase()
335
 
336
  def send_closePurchase(self, purchaseId):
337
    self._oprot.writeMessageBegin('closePurchase', TMessageType.CALL, self._seqid)
338
    args = closePurchase_args()
339
    args.purchaseId = purchaseId
340
    args.write(self._oprot)
341
    self._oprot.writeMessageEnd()
342
    self._oprot.trans.flush()
343
 
344
  def recv_closePurchase(self, ):
345
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
346
    if mtype == TMessageType.EXCEPTION:
347
      x = TApplicationException()
348
      x.read(self._iprot)
349
      self._iprot.readMessageEnd()
350
      raise x
351
    result = closePurchase_result()
352
    result.read(self._iprot)
353
    self._iprot.readMessageEnd()
354
    if result.success is not None:
355
      return result.success
356
    if result.e is not None:
357
      raise result.e
358
    raise TApplicationException(TApplicationException.MISSING_RESULT, "closePurchase failed: unknown result");
359
 
360
  def getAllPurchases(self, purchaseOrderId, open):
361
    """
362
    Returns all open or closed purchases for the given purchase order. Throws an exception if no such purchase order exists
363
 
364
    Parameters:
365
     - purchaseOrderId
366
     - open
367
    """
368
    self.send_getAllPurchases(purchaseOrderId, open)
369
    return self.recv_getAllPurchases()
370
 
371
  def send_getAllPurchases(self, purchaseOrderId, open):
372
    self._oprot.writeMessageBegin('getAllPurchases', TMessageType.CALL, self._seqid)
373
    args = getAllPurchases_args()
374
    args.purchaseOrderId = purchaseOrderId
375
    args.open = open
376
    args.write(self._oprot)
377
    self._oprot.writeMessageEnd()
378
    self._oprot.trans.flush()
379
 
380
  def recv_getAllPurchases(self, ):
381
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
382
    if mtype == TMessageType.EXCEPTION:
383
      x = TApplicationException()
384
      x.read(self._iprot)
385
      self._iprot.readMessageEnd()
386
      raise x
387
    result = getAllPurchases_result()
388
    result.read(self._iprot)
389
    self._iprot.readMessageEnd()
390
    if result.success is not None:
391
      return result.success
392
    if result.e is not None:
393
      raise result.e
394
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");
395
 
4555 mandeep.dh 396
  def getPurchaseOrderForPurchase(self, purchaseId):
4502 mandeep.dh 397
    """
4555 mandeep.dh 398
    Returns the purchase order object for a given purchase
4502 mandeep.dh 399
 
400
    Parameters:
401
     - purchaseId
402
    """
4555 mandeep.dh 403
    self.send_getPurchaseOrderForPurchase(purchaseId)
404
    return self.recv_getPurchaseOrderForPurchase()
4502 mandeep.dh 405
 
4555 mandeep.dh 406
  def send_getPurchaseOrderForPurchase(self, purchaseId):
407
    self._oprot.writeMessageBegin('getPurchaseOrderForPurchase', TMessageType.CALL, self._seqid)
408
    args = getPurchaseOrderForPurchase_args()
4502 mandeep.dh 409
    args.purchaseId = purchaseId
410
    args.write(self._oprot)
411
    self._oprot.writeMessageEnd()
412
    self._oprot.trans.flush()
413
 
4555 mandeep.dh 414
  def recv_getPurchaseOrderForPurchase(self, ):
4502 mandeep.dh 415
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
416
    if mtype == TMessageType.EXCEPTION:
417
      x = TApplicationException()
418
      x.read(self._iprot)
419
      self._iprot.readMessageEnd()
420
      raise x
4555 mandeep.dh 421
    result = getPurchaseOrderForPurchase_result()
4502 mandeep.dh 422
    result.read(self._iprot)
423
    self._iprot.readMessageEnd()
424
    if result.success is not None:
425
      return result.success
4555 mandeep.dh 426
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPurchaseOrderForPurchase failed: unknown result");
4502 mandeep.dh 427
 
4754 mandeep.dh 428
  def getPendingPurchaseOrders(self, warehouseId):
429
    """
430
    Creates purchase order objects from pending orders
4502 mandeep.dh 431
 
4754 mandeep.dh 432
    Parameters:
433
     - warehouseId
434
    """
435
    self.send_getPendingPurchaseOrders(warehouseId)
436
    return self.recv_getPendingPurchaseOrders()
437
 
438
  def send_getPendingPurchaseOrders(self, warehouseId):
439
    self._oprot.writeMessageBegin('getPendingPurchaseOrders', TMessageType.CALL, self._seqid)
440
    args = getPendingPurchaseOrders_args()
441
    args.warehouseId = warehouseId
442
    args.write(self._oprot)
443
    self._oprot.writeMessageEnd()
444
    self._oprot.trans.flush()
445
 
446
  def recv_getPendingPurchaseOrders(self, ):
447
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
448
    if mtype == TMessageType.EXCEPTION:
449
      x = TApplicationException()
450
      x.read(self._iprot)
451
      self._iprot.readMessageEnd()
452
      raise x
453
    result = getPendingPurchaseOrders_result()
454
    result.read(self._iprot)
455
    self._iprot.readMessageEnd()
456
    if result.success is not None:
457
      return result.success
458
    if result.e is not None:
459
      raise result.e
460
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPendingPurchaseOrders failed: unknown result");
461
 
462
  def getSuppliers(self, ):
463
    """
464
    Returns all the valid suppliers
465
    """
466
    self.send_getSuppliers()
467
    return self.recv_getSuppliers()
468
 
469
  def send_getSuppliers(self, ):
470
    self._oprot.writeMessageBegin('getSuppliers', TMessageType.CALL, self._seqid)
471
    args = getSuppliers_args()
472
    args.write(self._oprot)
473
    self._oprot.writeMessageEnd()
474
    self._oprot.trans.flush()
475
 
476
  def recv_getSuppliers(self, ):
477
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
478
    if mtype == TMessageType.EXCEPTION:
479
      x = TApplicationException()
480
      x.read(self._iprot)
481
      self._iprot.readMessageEnd()
482
      raise x
483
    result = getSuppliers_result()
484
    result.read(self._iprot)
485
    self._iprot.readMessageEnd()
486
    if result.success is not None:
487
      return result.success
488
    if result.e is not None:
489
      raise result.e
490
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getSuppliers failed: unknown result");
491
 
492
  def fulfillPO(self, purchaseOrderId, itemId, quantity):
493
    """
494
    Fulfills a given purchase order with an item.
495
 
496
    Parameters:
497
     - purchaseOrderId
498
     - itemId
499
     - quantity
500
    """
501
    self.send_fulfillPO(purchaseOrderId, itemId, quantity)
502
    self.recv_fulfillPO()
503
 
504
  def send_fulfillPO(self, purchaseOrderId, itemId, quantity):
505
    self._oprot.writeMessageBegin('fulfillPO', TMessageType.CALL, self._seqid)
506
    args = fulfillPO_args()
507
    args.purchaseOrderId = purchaseOrderId
508
    args.itemId = itemId
509
    args.quantity = quantity
510
    args.write(self._oprot)
511
    self._oprot.writeMessageEnd()
512
    self._oprot.trans.flush()
513
 
514
  def recv_fulfillPO(self, ):
515
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
516
    if mtype == TMessageType.EXCEPTION:
517
      x = TApplicationException()
518
      x.read(self._iprot)
519
      self._iprot.readMessageEnd()
520
      raise x
521
    result = fulfillPO_result()
522
    result.read(self._iprot)
523
    self._iprot.readMessageEnd()
524
    if result.e is not None:
525
      raise result.e
526
    return
527
 
528
  def updatePurchaseOrder(self, purchaseOrder):
529
    """
530
    Amends a PO as per the new lineitems passed
531
 
532
    Parameters:
533
     - purchaseOrder
534
    """
535
    self.send_updatePurchaseOrder(purchaseOrder)
536
    self.recv_updatePurchaseOrder()
537
 
538
  def send_updatePurchaseOrder(self, purchaseOrder):
539
    self._oprot.writeMessageBegin('updatePurchaseOrder', TMessageType.CALL, self._seqid)
540
    args = updatePurchaseOrder_args()
541
    args.purchaseOrder = purchaseOrder
542
    args.write(self._oprot)
543
    self._oprot.writeMessageEnd()
544
    self._oprot.trans.flush()
545
 
546
  def recv_updatePurchaseOrder(self, ):
547
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
548
    if mtype == TMessageType.EXCEPTION:
549
      x = TApplicationException()
550
      x.read(self._iprot)
551
      self._iprot.readMessageEnd()
552
      raise x
553
    result = updatePurchaseOrder_result()
554
    result.read(self._iprot)
555
    self._iprot.readMessageEnd()
556
    if result.e is not None:
557
      raise result.e
558
    return
559
 
5185 mandeep.dh 560
  def unFulfillPO(self, purchaseId, itemId, quantity):
561
    """
562
    Fulfills a given purchase id with an item and its quantity.
4754 mandeep.dh 563
 
5185 mandeep.dh 564
    Parameters:
565
     - purchaseId
566
     - itemId
567
     - quantity
568
    """
569
    self.send_unFulfillPO(purchaseId, itemId, quantity)
570
    self.recv_unFulfillPO()
571
 
572
  def send_unFulfillPO(self, purchaseId, itemId, quantity):
573
    self._oprot.writeMessageBegin('unFulfillPO', TMessageType.CALL, self._seqid)
574
    args = unFulfillPO_args()
575
    args.purchaseId = purchaseId
576
    args.itemId = itemId
577
    args.quantity = quantity
578
    args.write(self._oprot)
579
    self._oprot.writeMessageEnd()
580
    self._oprot.trans.flush()
581
 
582
  def recv_unFulfillPO(self, ):
583
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
584
    if mtype == TMessageType.EXCEPTION:
585
      x = TApplicationException()
586
      x.read(self._iprot)
587
      self._iprot.readMessageEnd()
588
      raise x
589
    result = unFulfillPO_result()
590
    result.read(self._iprot)
591
    self._iprot.readMessageEnd()
592
    if result.e is not None:
593
      raise result.e
594
    return
595
 
596
 
4502 mandeep.dh 597
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
598
  def __init__(self, handler):
599
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
600
    self._processMap["createPurchaseOrder"] = Processor.process_createPurchaseOrder
601
    self._processMap["getPurchaseOrder"] = Processor.process_getPurchaseOrder
602
    self._processMap["getAllPurchaseOrders"] = Processor.process_getAllPurchaseOrders
603
    self._processMap["getSupplier"] = Processor.process_getSupplier
604
    self._processMap["startPurchase"] = Processor.process_startPurchase
605
    self._processMap["closePurchase"] = Processor.process_closePurchase
606
    self._processMap["getAllPurchases"] = Processor.process_getAllPurchases
4555 mandeep.dh 607
    self._processMap["getPurchaseOrderForPurchase"] = Processor.process_getPurchaseOrderForPurchase
4754 mandeep.dh 608
    self._processMap["getPendingPurchaseOrders"] = Processor.process_getPendingPurchaseOrders
609
    self._processMap["getSuppliers"] = Processor.process_getSuppliers
610
    self._processMap["fulfillPO"] = Processor.process_fulfillPO
611
    self._processMap["updatePurchaseOrder"] = Processor.process_updatePurchaseOrder
5185 mandeep.dh 612
    self._processMap["unFulfillPO"] = Processor.process_unFulfillPO
4502 mandeep.dh 613
 
614
  def process(self, iprot, oprot):
615
    (name, type, seqid) = iprot.readMessageBegin()
616
    if name not in self._processMap:
617
      iprot.skip(TType.STRUCT)
618
      iprot.readMessageEnd()
619
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
620
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
621
      x.write(oprot)
622
      oprot.writeMessageEnd()
623
      oprot.trans.flush()
624
      return
625
    else:
626
      self._processMap[name](self, seqid, iprot, oprot)
627
    return True
628
 
629
  def process_createPurchaseOrder(self, seqid, iprot, oprot):
630
    args = createPurchaseOrder_args()
631
    args.read(iprot)
632
    iprot.readMessageEnd()
633
    result = createPurchaseOrder_result()
634
    try:
635
      result.success = self._handler.createPurchaseOrder(args.purchaseOrder)
636
    except PurchaseServiceException, e:
637
      result.e = e
638
    oprot.writeMessageBegin("createPurchaseOrder", TMessageType.REPLY, seqid)
639
    result.write(oprot)
640
    oprot.writeMessageEnd()
641
    oprot.trans.flush()
642
 
643
  def process_getPurchaseOrder(self, seqid, iprot, oprot):
644
    args = getPurchaseOrder_args()
645
    args.read(iprot)
646
    iprot.readMessageEnd()
647
    result = getPurchaseOrder_result()
648
    try:
649
      result.success = self._handler.getPurchaseOrder(args.id)
650
    except PurchaseServiceException, e:
651
      result.e = e
652
    oprot.writeMessageBegin("getPurchaseOrder", TMessageType.REPLY, seqid)
653
    result.write(oprot)
654
    oprot.writeMessageEnd()
655
    oprot.trans.flush()
656
 
657
  def process_getAllPurchaseOrders(self, seqid, iprot, oprot):
658
    args = getAllPurchaseOrders_args()
659
    args.read(iprot)
660
    iprot.readMessageEnd()
661
    result = getAllPurchaseOrders_result()
662
    try:
663
      result.success = self._handler.getAllPurchaseOrders(args.status)
664
    except PurchaseServiceException, e:
665
      result.e = e
666
    oprot.writeMessageBegin("getAllPurchaseOrders", TMessageType.REPLY, seqid)
667
    result.write(oprot)
668
    oprot.writeMessageEnd()
669
    oprot.trans.flush()
670
 
671
  def process_getSupplier(self, seqid, iprot, oprot):
672
    args = getSupplier_args()
673
    args.read(iprot)
674
    iprot.readMessageEnd()
675
    result = getSupplier_result()
676
    try:
677
      result.success = self._handler.getSupplier(args.id)
678
    except PurchaseServiceException, e:
679
      result.e = e
680
    oprot.writeMessageBegin("getSupplier", TMessageType.REPLY, seqid)
681
    result.write(oprot)
682
    oprot.writeMessageEnd()
683
    oprot.trans.flush()
684
 
685
  def process_startPurchase(self, seqid, iprot, oprot):
686
    args = startPurchase_args()
687
    args.read(iprot)
688
    iprot.readMessageEnd()
689
    result = startPurchase_result()
690
    try:
691
      result.success = self._handler.startPurchase(args.purchaseOrderId, args.invoiceNumber, args.freightCharges)
692
    except PurchaseServiceException, e:
693
      result.e = e
694
    oprot.writeMessageBegin("startPurchase", TMessageType.REPLY, seqid)
695
    result.write(oprot)
696
    oprot.writeMessageEnd()
697
    oprot.trans.flush()
698
 
699
  def process_closePurchase(self, seqid, iprot, oprot):
700
    args = closePurchase_args()
701
    args.read(iprot)
702
    iprot.readMessageEnd()
703
    result = closePurchase_result()
704
    try:
705
      result.success = self._handler.closePurchase(args.purchaseId)
706
    except PurchaseServiceException, e:
707
      result.e = e
708
    oprot.writeMessageBegin("closePurchase", TMessageType.REPLY, seqid)
709
    result.write(oprot)
710
    oprot.writeMessageEnd()
711
    oprot.trans.flush()
712
 
713
  def process_getAllPurchases(self, seqid, iprot, oprot):
714
    args = getAllPurchases_args()
715
    args.read(iprot)
716
    iprot.readMessageEnd()
717
    result = getAllPurchases_result()
718
    try:
719
      result.success = self._handler.getAllPurchases(args.purchaseOrderId, args.open)
720
    except PurchaseServiceException, e:
721
      result.e = e
722
    oprot.writeMessageBegin("getAllPurchases", TMessageType.REPLY, seqid)
723
    result.write(oprot)
724
    oprot.writeMessageEnd()
725
    oprot.trans.flush()
726
 
4555 mandeep.dh 727
  def process_getPurchaseOrderForPurchase(self, seqid, iprot, oprot):
728
    args = getPurchaseOrderForPurchase_args()
4502 mandeep.dh 729
    args.read(iprot)
730
    iprot.readMessageEnd()
4555 mandeep.dh 731
    result = getPurchaseOrderForPurchase_result()
732
    result.success = self._handler.getPurchaseOrderForPurchase(args.purchaseId)
733
    oprot.writeMessageBegin("getPurchaseOrderForPurchase", TMessageType.REPLY, seqid)
4502 mandeep.dh 734
    result.write(oprot)
735
    oprot.writeMessageEnd()
736
    oprot.trans.flush()
737
 
4754 mandeep.dh 738
  def process_getPendingPurchaseOrders(self, seqid, iprot, oprot):
739
    args = getPendingPurchaseOrders_args()
740
    args.read(iprot)
741
    iprot.readMessageEnd()
742
    result = getPendingPurchaseOrders_result()
743
    try:
744
      result.success = self._handler.getPendingPurchaseOrders(args.warehouseId)
745
    except PurchaseServiceException, e:
746
      result.e = e
747
    oprot.writeMessageBegin("getPendingPurchaseOrders", TMessageType.REPLY, seqid)
748
    result.write(oprot)
749
    oprot.writeMessageEnd()
750
    oprot.trans.flush()
4502 mandeep.dh 751
 
4754 mandeep.dh 752
  def process_getSuppliers(self, seqid, iprot, oprot):
753
    args = getSuppliers_args()
754
    args.read(iprot)
755
    iprot.readMessageEnd()
756
    result = getSuppliers_result()
757
    try:
758
      result.success = self._handler.getSuppliers()
759
    except PurchaseServiceException, e:
760
      result.e = e
761
    oprot.writeMessageBegin("getSuppliers", TMessageType.REPLY, seqid)
762
    result.write(oprot)
763
    oprot.writeMessageEnd()
764
    oprot.trans.flush()
765
 
766
  def process_fulfillPO(self, seqid, iprot, oprot):
767
    args = fulfillPO_args()
768
    args.read(iprot)
769
    iprot.readMessageEnd()
770
    result = fulfillPO_result()
771
    try:
772
      self._handler.fulfillPO(args.purchaseOrderId, args.itemId, args.quantity)
773
    except PurchaseServiceException, e:
774
      result.e = e
775
    oprot.writeMessageBegin("fulfillPO", TMessageType.REPLY, seqid)
776
    result.write(oprot)
777
    oprot.writeMessageEnd()
778
    oprot.trans.flush()
779
 
780
  def process_updatePurchaseOrder(self, seqid, iprot, oprot):
781
    args = updatePurchaseOrder_args()
782
    args.read(iprot)
783
    iprot.readMessageEnd()
784
    result = updatePurchaseOrder_result()
785
    try:
786
      self._handler.updatePurchaseOrder(args.purchaseOrder)
787
    except PurchaseServiceException, e:
788
      result.e = e
789
    oprot.writeMessageBegin("updatePurchaseOrder", TMessageType.REPLY, seqid)
790
    result.write(oprot)
791
    oprot.writeMessageEnd()
792
    oprot.trans.flush()
793
 
5185 mandeep.dh 794
  def process_unFulfillPO(self, seqid, iprot, oprot):
795
    args = unFulfillPO_args()
796
    args.read(iprot)
797
    iprot.readMessageEnd()
798
    result = unFulfillPO_result()
799
    try:
800
      self._handler.unFulfillPO(args.purchaseId, args.itemId, args.quantity)
801
    except PurchaseServiceException, e:
802
      result.e = e
803
    oprot.writeMessageBegin("unFulfillPO", TMessageType.REPLY, seqid)
804
    result.write(oprot)
805
    oprot.writeMessageEnd()
806
    oprot.trans.flush()
4754 mandeep.dh 807
 
5185 mandeep.dh 808
 
4502 mandeep.dh 809
# HELPER FUNCTIONS AND STRUCTURES
810
 
811
class createPurchaseOrder_args:
812
  """
813
  Attributes:
814
   - purchaseOrder
815
  """
816
 
817
  thrift_spec = (
818
    None, # 0
819
    (1, TType.STRUCT, 'purchaseOrder', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 1
820
  )
821
 
822
  def __init__(self, purchaseOrder=None,):
823
    self.purchaseOrder = purchaseOrder
824
 
825
  def read(self, iprot):
826
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
827
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
828
      return
829
    iprot.readStructBegin()
830
    while True:
831
      (fname, ftype, fid) = iprot.readFieldBegin()
832
      if ftype == TType.STOP:
833
        break
834
      if fid == 1:
835
        if ftype == TType.STRUCT:
836
          self.purchaseOrder = PurchaseOrder()
837
          self.purchaseOrder.read(iprot)
838
        else:
839
          iprot.skip(ftype)
840
      else:
841
        iprot.skip(ftype)
842
      iprot.readFieldEnd()
843
    iprot.readStructEnd()
844
 
845
  def write(self, oprot):
846
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
847
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
848
      return
849
    oprot.writeStructBegin('createPurchaseOrder_args')
850
    if self.purchaseOrder is not None:
851
      oprot.writeFieldBegin('purchaseOrder', TType.STRUCT, 1)
852
      self.purchaseOrder.write(oprot)
853
      oprot.writeFieldEnd()
854
    oprot.writeFieldStop()
855
    oprot.writeStructEnd()
856
 
857
  def validate(self):
858
    return
859
 
860
 
861
  def __repr__(self):
862
    L = ['%s=%r' % (key, value)
863
      for key, value in self.__dict__.iteritems()]
864
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
865
 
866
  def __eq__(self, other):
867
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
868
 
869
  def __ne__(self, other):
870
    return not (self == other)
871
 
872
class createPurchaseOrder_result:
873
  """
874
  Attributes:
875
   - success
876
   - e
877
  """
878
 
879
  thrift_spec = (
880
    (0, TType.I64, 'success', None, None, ), # 0
881
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
882
  )
883
 
884
  def __init__(self, success=None, e=None,):
885
    self.success = success
886
    self.e = e
887
 
888
  def read(self, iprot):
889
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
890
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
891
      return
892
    iprot.readStructBegin()
893
    while True:
894
      (fname, ftype, fid) = iprot.readFieldBegin()
895
      if ftype == TType.STOP:
896
        break
897
      if fid == 0:
898
        if ftype == TType.I64:
899
          self.success = iprot.readI64();
900
        else:
901
          iprot.skip(ftype)
902
      elif fid == 1:
903
        if ftype == TType.STRUCT:
904
          self.e = PurchaseServiceException()
905
          self.e.read(iprot)
906
        else:
907
          iprot.skip(ftype)
908
      else:
909
        iprot.skip(ftype)
910
      iprot.readFieldEnd()
911
    iprot.readStructEnd()
912
 
913
  def write(self, oprot):
914
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
915
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
916
      return
917
    oprot.writeStructBegin('createPurchaseOrder_result')
918
    if self.success is not None:
919
      oprot.writeFieldBegin('success', TType.I64, 0)
920
      oprot.writeI64(self.success)
921
      oprot.writeFieldEnd()
922
    if self.e is not None:
923
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
924
      self.e.write(oprot)
925
      oprot.writeFieldEnd()
926
    oprot.writeFieldStop()
927
    oprot.writeStructEnd()
928
 
929
  def validate(self):
930
    return
931
 
932
 
933
  def __repr__(self):
934
    L = ['%s=%r' % (key, value)
935
      for key, value in self.__dict__.iteritems()]
936
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
937
 
938
  def __eq__(self, other):
939
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
940
 
941
  def __ne__(self, other):
942
    return not (self == other)
943
 
944
class getPurchaseOrder_args:
945
  """
946
  Attributes:
947
   - id
948
  """
949
 
950
  thrift_spec = (
951
    None, # 0
952
    (1, TType.I64, 'id', None, None, ), # 1
953
  )
954
 
955
  def __init__(self, id=None,):
956
    self.id = id
957
 
958
  def read(self, iprot):
959
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
960
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
961
      return
962
    iprot.readStructBegin()
963
    while True:
964
      (fname, ftype, fid) = iprot.readFieldBegin()
965
      if ftype == TType.STOP:
966
        break
967
      if fid == 1:
968
        if ftype == TType.I64:
969
          self.id = iprot.readI64();
970
        else:
971
          iprot.skip(ftype)
972
      else:
973
        iprot.skip(ftype)
974
      iprot.readFieldEnd()
975
    iprot.readStructEnd()
976
 
977
  def write(self, oprot):
978
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
979
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
980
      return
981
    oprot.writeStructBegin('getPurchaseOrder_args')
982
    if self.id is not None:
983
      oprot.writeFieldBegin('id', TType.I64, 1)
984
      oprot.writeI64(self.id)
985
      oprot.writeFieldEnd()
986
    oprot.writeFieldStop()
987
    oprot.writeStructEnd()
988
 
989
  def validate(self):
990
    return
991
 
992
 
993
  def __repr__(self):
994
    L = ['%s=%r' % (key, value)
995
      for key, value in self.__dict__.iteritems()]
996
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
997
 
998
  def __eq__(self, other):
999
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1000
 
1001
  def __ne__(self, other):
1002
    return not (self == other)
1003
 
1004
class getPurchaseOrder_result:
1005
  """
1006
  Attributes:
1007
   - success
1008
   - e
1009
  """
1010
 
1011
  thrift_spec = (
1012
    (0, TType.STRUCT, 'success', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 0
1013
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1014
  )
1015
 
1016
  def __init__(self, success=None, e=None,):
1017
    self.success = success
1018
    self.e = e
1019
 
1020
  def read(self, iprot):
1021
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1022
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1023
      return
1024
    iprot.readStructBegin()
1025
    while True:
1026
      (fname, ftype, fid) = iprot.readFieldBegin()
1027
      if ftype == TType.STOP:
1028
        break
1029
      if fid == 0:
1030
        if ftype == TType.STRUCT:
1031
          self.success = PurchaseOrder()
1032
          self.success.read(iprot)
1033
        else:
1034
          iprot.skip(ftype)
1035
      elif fid == 1:
1036
        if ftype == TType.STRUCT:
1037
          self.e = PurchaseServiceException()
1038
          self.e.read(iprot)
1039
        else:
1040
          iprot.skip(ftype)
1041
      else:
1042
        iprot.skip(ftype)
1043
      iprot.readFieldEnd()
1044
    iprot.readStructEnd()
1045
 
1046
  def write(self, oprot):
1047
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1048
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1049
      return
1050
    oprot.writeStructBegin('getPurchaseOrder_result')
1051
    if self.success is not None:
1052
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1053
      self.success.write(oprot)
1054
      oprot.writeFieldEnd()
1055
    if self.e is not None:
1056
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1057
      self.e.write(oprot)
1058
      oprot.writeFieldEnd()
1059
    oprot.writeFieldStop()
1060
    oprot.writeStructEnd()
1061
 
1062
  def validate(self):
1063
    return
1064
 
1065
 
1066
  def __repr__(self):
1067
    L = ['%s=%r' % (key, value)
1068
      for key, value in self.__dict__.iteritems()]
1069
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1070
 
1071
  def __eq__(self, other):
1072
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1073
 
1074
  def __ne__(self, other):
1075
    return not (self == other)
1076
 
1077
class getAllPurchaseOrders_args:
1078
  """
1079
  Attributes:
1080
   - status
1081
  """
1082
 
1083
  thrift_spec = (
1084
    None, # 0
1085
    (1, TType.I32, 'status', None, None, ), # 1
1086
  )
1087
 
1088
  def __init__(self, status=None,):
1089
    self.status = status
1090
 
1091
  def read(self, iprot):
1092
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1093
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1094
      return
1095
    iprot.readStructBegin()
1096
    while True:
1097
      (fname, ftype, fid) = iprot.readFieldBegin()
1098
      if ftype == TType.STOP:
1099
        break
1100
      if fid == 1:
1101
        if ftype == TType.I32:
1102
          self.status = iprot.readI32();
1103
        else:
1104
          iprot.skip(ftype)
1105
      else:
1106
        iprot.skip(ftype)
1107
      iprot.readFieldEnd()
1108
    iprot.readStructEnd()
1109
 
1110
  def write(self, oprot):
1111
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1112
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1113
      return
1114
    oprot.writeStructBegin('getAllPurchaseOrders_args')
1115
    if self.status is not None:
1116
      oprot.writeFieldBegin('status', TType.I32, 1)
1117
      oprot.writeI32(self.status)
1118
      oprot.writeFieldEnd()
1119
    oprot.writeFieldStop()
1120
    oprot.writeStructEnd()
1121
 
1122
  def validate(self):
1123
    return
1124
 
1125
 
1126
  def __repr__(self):
1127
    L = ['%s=%r' % (key, value)
1128
      for key, value in self.__dict__.iteritems()]
1129
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1130
 
1131
  def __eq__(self, other):
1132
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1133
 
1134
  def __ne__(self, other):
1135
    return not (self == other)
1136
 
1137
class getAllPurchaseOrders_result:
1138
  """
1139
  Attributes:
1140
   - success
1141
   - e
1142
  """
1143
 
1144
  thrift_spec = (
1145
    (0, TType.LIST, 'success', (TType.STRUCT,(PurchaseOrder, PurchaseOrder.thrift_spec)), None, ), # 0
1146
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1147
  )
1148
 
1149
  def __init__(self, success=None, e=None,):
1150
    self.success = success
1151
    self.e = e
1152
 
1153
  def read(self, iprot):
1154
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1155
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1156
      return
1157
    iprot.readStructBegin()
1158
    while True:
1159
      (fname, ftype, fid) = iprot.readFieldBegin()
1160
      if ftype == TType.STOP:
1161
        break
1162
      if fid == 0:
1163
        if ftype == TType.LIST:
1164
          self.success = []
1165
          (_etype10, _size7) = iprot.readListBegin()
1166
          for _i11 in xrange(_size7):
1167
            _elem12 = PurchaseOrder()
1168
            _elem12.read(iprot)
1169
            self.success.append(_elem12)
1170
          iprot.readListEnd()
1171
        else:
1172
          iprot.skip(ftype)
1173
      elif fid == 1:
1174
        if ftype == TType.STRUCT:
1175
          self.e = PurchaseServiceException()
1176
          self.e.read(iprot)
1177
        else:
1178
          iprot.skip(ftype)
1179
      else:
1180
        iprot.skip(ftype)
1181
      iprot.readFieldEnd()
1182
    iprot.readStructEnd()
1183
 
1184
  def write(self, oprot):
1185
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1186
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1187
      return
1188
    oprot.writeStructBegin('getAllPurchaseOrders_result')
1189
    if self.success is not None:
1190
      oprot.writeFieldBegin('success', TType.LIST, 0)
1191
      oprot.writeListBegin(TType.STRUCT, len(self.success))
1192
      for iter13 in self.success:
1193
        iter13.write(oprot)
1194
      oprot.writeListEnd()
1195
      oprot.writeFieldEnd()
1196
    if self.e is not None:
1197
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1198
      self.e.write(oprot)
1199
      oprot.writeFieldEnd()
1200
    oprot.writeFieldStop()
1201
    oprot.writeStructEnd()
1202
 
1203
  def validate(self):
1204
    return
1205
 
1206
 
1207
  def __repr__(self):
1208
    L = ['%s=%r' % (key, value)
1209
      for key, value in self.__dict__.iteritems()]
1210
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1211
 
1212
  def __eq__(self, other):
1213
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1214
 
1215
  def __ne__(self, other):
1216
    return not (self == other)
1217
 
1218
class getSupplier_args:
1219
  """
1220
  Attributes:
1221
   - id
1222
  """
1223
 
1224
  thrift_spec = (
1225
    None, # 0
1226
    (1, TType.I64, 'id', None, None, ), # 1
1227
  )
1228
 
1229
  def __init__(self, id=None,):
1230
    self.id = id
1231
 
1232
  def read(self, iprot):
1233
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1234
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1235
      return
1236
    iprot.readStructBegin()
1237
    while True:
1238
      (fname, ftype, fid) = iprot.readFieldBegin()
1239
      if ftype == TType.STOP:
1240
        break
1241
      if fid == 1:
1242
        if ftype == TType.I64:
1243
          self.id = iprot.readI64();
1244
        else:
1245
          iprot.skip(ftype)
1246
      else:
1247
        iprot.skip(ftype)
1248
      iprot.readFieldEnd()
1249
    iprot.readStructEnd()
1250
 
1251
  def write(self, oprot):
1252
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1253
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1254
      return
1255
    oprot.writeStructBegin('getSupplier_args')
1256
    if self.id is not None:
1257
      oprot.writeFieldBegin('id', TType.I64, 1)
1258
      oprot.writeI64(self.id)
1259
      oprot.writeFieldEnd()
1260
    oprot.writeFieldStop()
1261
    oprot.writeStructEnd()
1262
 
1263
  def validate(self):
1264
    return
1265
 
1266
 
1267
  def __repr__(self):
1268
    L = ['%s=%r' % (key, value)
1269
      for key, value in self.__dict__.iteritems()]
1270
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1271
 
1272
  def __eq__(self, other):
1273
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1274
 
1275
  def __ne__(self, other):
1276
    return not (self == other)
1277
 
1278
class getSupplier_result:
1279
  """
1280
  Attributes:
1281
   - success
1282
   - e
1283
  """
1284
 
1285
  thrift_spec = (
1286
    (0, TType.STRUCT, 'success', (Supplier, Supplier.thrift_spec), None, ), # 0
1287
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1288
  )
1289
 
1290
  def __init__(self, success=None, e=None,):
1291
    self.success = success
1292
    self.e = e
1293
 
1294
  def read(self, iprot):
1295
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1296
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1297
      return
1298
    iprot.readStructBegin()
1299
    while True:
1300
      (fname, ftype, fid) = iprot.readFieldBegin()
1301
      if ftype == TType.STOP:
1302
        break
1303
      if fid == 0:
1304
        if ftype == TType.STRUCT:
1305
          self.success = Supplier()
1306
          self.success.read(iprot)
1307
        else:
1308
          iprot.skip(ftype)
1309
      elif fid == 1:
1310
        if ftype == TType.STRUCT:
1311
          self.e = PurchaseServiceException()
1312
          self.e.read(iprot)
1313
        else:
1314
          iprot.skip(ftype)
1315
      else:
1316
        iprot.skip(ftype)
1317
      iprot.readFieldEnd()
1318
    iprot.readStructEnd()
1319
 
1320
  def write(self, oprot):
1321
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1322
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1323
      return
1324
    oprot.writeStructBegin('getSupplier_result')
1325
    if self.success is not None:
1326
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1327
      self.success.write(oprot)
1328
      oprot.writeFieldEnd()
1329
    if self.e is not None:
1330
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1331
      self.e.write(oprot)
1332
      oprot.writeFieldEnd()
1333
    oprot.writeFieldStop()
1334
    oprot.writeStructEnd()
1335
 
1336
  def validate(self):
1337
    return
1338
 
1339
 
1340
  def __repr__(self):
1341
    L = ['%s=%r' % (key, value)
1342
      for key, value in self.__dict__.iteritems()]
1343
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1344
 
1345
  def __eq__(self, other):
1346
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1347
 
1348
  def __ne__(self, other):
1349
    return not (self == other)
1350
 
1351
class startPurchase_args:
1352
  """
1353
  Attributes:
1354
   - purchaseOrderId
1355
   - invoiceNumber
1356
   - freightCharges
1357
  """
1358
 
1359
  thrift_spec = (
1360
    None, # 0
1361
    (1, TType.I64, 'purchaseOrderId', None, None, ), # 1
1362
    (2, TType.STRING, 'invoiceNumber', None, None, ), # 2
1363
    (3, TType.DOUBLE, 'freightCharges', None, None, ), # 3
1364
  )
1365
 
1366
  def __init__(self, purchaseOrderId=None, invoiceNumber=None, freightCharges=None,):
1367
    self.purchaseOrderId = purchaseOrderId
1368
    self.invoiceNumber = invoiceNumber
1369
    self.freightCharges = freightCharges
1370
 
1371
  def read(self, iprot):
1372
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1373
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1374
      return
1375
    iprot.readStructBegin()
1376
    while True:
1377
      (fname, ftype, fid) = iprot.readFieldBegin()
1378
      if ftype == TType.STOP:
1379
        break
1380
      if fid == 1:
1381
        if ftype == TType.I64:
1382
          self.purchaseOrderId = iprot.readI64();
1383
        else:
1384
          iprot.skip(ftype)
1385
      elif fid == 2:
1386
        if ftype == TType.STRING:
1387
          self.invoiceNumber = iprot.readString();
1388
        else:
1389
          iprot.skip(ftype)
1390
      elif fid == 3:
1391
        if ftype == TType.DOUBLE:
1392
          self.freightCharges = iprot.readDouble();
1393
        else:
1394
          iprot.skip(ftype)
1395
      else:
1396
        iprot.skip(ftype)
1397
      iprot.readFieldEnd()
1398
    iprot.readStructEnd()
1399
 
1400
  def write(self, oprot):
1401
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1402
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1403
      return
1404
    oprot.writeStructBegin('startPurchase_args')
1405
    if self.purchaseOrderId is not None:
1406
      oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)
1407
      oprot.writeI64(self.purchaseOrderId)
1408
      oprot.writeFieldEnd()
1409
    if self.invoiceNumber is not None:
1410
      oprot.writeFieldBegin('invoiceNumber', TType.STRING, 2)
1411
      oprot.writeString(self.invoiceNumber)
1412
      oprot.writeFieldEnd()
1413
    if self.freightCharges is not None:
1414
      oprot.writeFieldBegin('freightCharges', TType.DOUBLE, 3)
1415
      oprot.writeDouble(self.freightCharges)
1416
      oprot.writeFieldEnd()
1417
    oprot.writeFieldStop()
1418
    oprot.writeStructEnd()
1419
 
1420
  def validate(self):
1421
    return
1422
 
1423
 
1424
  def __repr__(self):
1425
    L = ['%s=%r' % (key, value)
1426
      for key, value in self.__dict__.iteritems()]
1427
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1428
 
1429
  def __eq__(self, other):
1430
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1431
 
1432
  def __ne__(self, other):
1433
    return not (self == other)
1434
 
1435
class startPurchase_result:
1436
  """
1437
  Attributes:
1438
   - success
1439
   - e
1440
  """
1441
 
1442
  thrift_spec = (
1443
    (0, TType.I64, 'success', None, None, ), # 0
1444
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1445
  )
1446
 
1447
  def __init__(self, success=None, e=None,):
1448
    self.success = success
1449
    self.e = e
1450
 
1451
  def read(self, iprot):
1452
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1453
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1454
      return
1455
    iprot.readStructBegin()
1456
    while True:
1457
      (fname, ftype, fid) = iprot.readFieldBegin()
1458
      if ftype == TType.STOP:
1459
        break
1460
      if fid == 0:
1461
        if ftype == TType.I64:
1462
          self.success = iprot.readI64();
1463
        else:
1464
          iprot.skip(ftype)
1465
      elif fid == 1:
1466
        if ftype == TType.STRUCT:
1467
          self.e = PurchaseServiceException()
1468
          self.e.read(iprot)
1469
        else:
1470
          iprot.skip(ftype)
1471
      else:
1472
        iprot.skip(ftype)
1473
      iprot.readFieldEnd()
1474
    iprot.readStructEnd()
1475
 
1476
  def write(self, oprot):
1477
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1478
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1479
      return
1480
    oprot.writeStructBegin('startPurchase_result')
1481
    if self.success is not None:
1482
      oprot.writeFieldBegin('success', TType.I64, 0)
1483
      oprot.writeI64(self.success)
1484
      oprot.writeFieldEnd()
1485
    if self.e is not None:
1486
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1487
      self.e.write(oprot)
1488
      oprot.writeFieldEnd()
1489
    oprot.writeFieldStop()
1490
    oprot.writeStructEnd()
1491
 
1492
  def validate(self):
1493
    return
1494
 
1495
 
1496
  def __repr__(self):
1497
    L = ['%s=%r' % (key, value)
1498
      for key, value in self.__dict__.iteritems()]
1499
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1500
 
1501
  def __eq__(self, other):
1502
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1503
 
1504
  def __ne__(self, other):
1505
    return not (self == other)
1506
 
1507
class closePurchase_args:
1508
  """
1509
  Attributes:
1510
   - purchaseId
1511
  """
1512
 
1513
  thrift_spec = (
1514
    None, # 0
1515
    (1, TType.I64, 'purchaseId', None, None, ), # 1
1516
  )
1517
 
1518
  def __init__(self, purchaseId=None,):
1519
    self.purchaseId = purchaseId
1520
 
1521
  def read(self, iprot):
1522
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1523
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1524
      return
1525
    iprot.readStructBegin()
1526
    while True:
1527
      (fname, ftype, fid) = iprot.readFieldBegin()
1528
      if ftype == TType.STOP:
1529
        break
1530
      if fid == 1:
1531
        if ftype == TType.I64:
1532
          self.purchaseId = iprot.readI64();
1533
        else:
1534
          iprot.skip(ftype)
1535
      else:
1536
        iprot.skip(ftype)
1537
      iprot.readFieldEnd()
1538
    iprot.readStructEnd()
1539
 
1540
  def write(self, oprot):
1541
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1542
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1543
      return
1544
    oprot.writeStructBegin('closePurchase_args')
1545
    if self.purchaseId is not None:
1546
      oprot.writeFieldBegin('purchaseId', TType.I64, 1)
1547
      oprot.writeI64(self.purchaseId)
1548
      oprot.writeFieldEnd()
1549
    oprot.writeFieldStop()
1550
    oprot.writeStructEnd()
1551
 
1552
  def validate(self):
1553
    return
1554
 
1555
 
1556
  def __repr__(self):
1557
    L = ['%s=%r' % (key, value)
1558
      for key, value in self.__dict__.iteritems()]
1559
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1560
 
1561
  def __eq__(self, other):
1562
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1563
 
1564
  def __ne__(self, other):
1565
    return not (self == other)
1566
 
1567
class closePurchase_result:
1568
  """
1569
  Attributes:
1570
   - success
1571
   - e
1572
  """
1573
 
1574
  thrift_spec = (
1575
    (0, TType.I64, 'success', None, None, ), # 0
1576
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1577
  )
1578
 
1579
  def __init__(self, success=None, e=None,):
1580
    self.success = success
1581
    self.e = e
1582
 
1583
  def read(self, iprot):
1584
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1585
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1586
      return
1587
    iprot.readStructBegin()
1588
    while True:
1589
      (fname, ftype, fid) = iprot.readFieldBegin()
1590
      if ftype == TType.STOP:
1591
        break
1592
      if fid == 0:
1593
        if ftype == TType.I64:
1594
          self.success = iprot.readI64();
1595
        else:
1596
          iprot.skip(ftype)
1597
      elif fid == 1:
1598
        if ftype == TType.STRUCT:
1599
          self.e = PurchaseServiceException()
1600
          self.e.read(iprot)
1601
        else:
1602
          iprot.skip(ftype)
1603
      else:
1604
        iprot.skip(ftype)
1605
      iprot.readFieldEnd()
1606
    iprot.readStructEnd()
1607
 
1608
  def write(self, oprot):
1609
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1610
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1611
      return
1612
    oprot.writeStructBegin('closePurchase_result')
1613
    if self.success is not None:
1614
      oprot.writeFieldBegin('success', TType.I64, 0)
1615
      oprot.writeI64(self.success)
1616
      oprot.writeFieldEnd()
1617
    if self.e is not None:
1618
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1619
      self.e.write(oprot)
1620
      oprot.writeFieldEnd()
1621
    oprot.writeFieldStop()
1622
    oprot.writeStructEnd()
1623
 
1624
  def validate(self):
1625
    return
1626
 
1627
 
1628
  def __repr__(self):
1629
    L = ['%s=%r' % (key, value)
1630
      for key, value in self.__dict__.iteritems()]
1631
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1632
 
1633
  def __eq__(self, other):
1634
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1635
 
1636
  def __ne__(self, other):
1637
    return not (self == other)
1638
 
1639
class getAllPurchases_args:
1640
  """
1641
  Attributes:
1642
   - purchaseOrderId
1643
   - open
1644
  """
1645
 
1646
  thrift_spec = (
1647
    None, # 0
1648
    (1, TType.I64, 'purchaseOrderId', None, None, ), # 1
1649
    (2, TType.BOOL, 'open', None, None, ), # 2
1650
  )
1651
 
1652
  def __init__(self, purchaseOrderId=None, open=None,):
1653
    self.purchaseOrderId = purchaseOrderId
1654
    self.open = open
1655
 
1656
  def read(self, iprot):
1657
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1658
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1659
      return
1660
    iprot.readStructBegin()
1661
    while True:
1662
      (fname, ftype, fid) = iprot.readFieldBegin()
1663
      if ftype == TType.STOP:
1664
        break
1665
      if fid == 1:
1666
        if ftype == TType.I64:
1667
          self.purchaseOrderId = iprot.readI64();
1668
        else:
1669
          iprot.skip(ftype)
1670
      elif fid == 2:
1671
        if ftype == TType.BOOL:
1672
          self.open = iprot.readBool();
1673
        else:
1674
          iprot.skip(ftype)
1675
      else:
1676
        iprot.skip(ftype)
1677
      iprot.readFieldEnd()
1678
    iprot.readStructEnd()
1679
 
1680
  def write(self, oprot):
1681
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1682
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1683
      return
1684
    oprot.writeStructBegin('getAllPurchases_args')
1685
    if self.purchaseOrderId is not None:
1686
      oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)
1687
      oprot.writeI64(self.purchaseOrderId)
1688
      oprot.writeFieldEnd()
1689
    if self.open is not None:
1690
      oprot.writeFieldBegin('open', TType.BOOL, 2)
1691
      oprot.writeBool(self.open)
1692
      oprot.writeFieldEnd()
1693
    oprot.writeFieldStop()
1694
    oprot.writeStructEnd()
1695
 
1696
  def validate(self):
1697
    return
1698
 
1699
 
1700
  def __repr__(self):
1701
    L = ['%s=%r' % (key, value)
1702
      for key, value in self.__dict__.iteritems()]
1703
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1704
 
1705
  def __eq__(self, other):
1706
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1707
 
1708
  def __ne__(self, other):
1709
    return not (self == other)
1710
 
1711
class getAllPurchases_result:
1712
  """
1713
  Attributes:
1714
   - success
1715
   - e
1716
  """
1717
 
1718
  thrift_spec = (
1719
    (0, TType.LIST, 'success', (TType.STRUCT,(Purchase, Purchase.thrift_spec)), None, ), # 0
1720
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1721
  )
1722
 
1723
  def __init__(self, success=None, e=None,):
1724
    self.success = success
1725
    self.e = e
1726
 
1727
  def read(self, iprot):
1728
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1729
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1730
      return
1731
    iprot.readStructBegin()
1732
    while True:
1733
      (fname, ftype, fid) = iprot.readFieldBegin()
1734
      if ftype == TType.STOP:
1735
        break
1736
      if fid == 0:
1737
        if ftype == TType.LIST:
1738
          self.success = []
1739
          (_etype17, _size14) = iprot.readListBegin()
1740
          for _i18 in xrange(_size14):
1741
            _elem19 = Purchase()
1742
            _elem19.read(iprot)
1743
            self.success.append(_elem19)
1744
          iprot.readListEnd()
1745
        else:
1746
          iprot.skip(ftype)
1747
      elif fid == 1:
1748
        if ftype == TType.STRUCT:
1749
          self.e = PurchaseServiceException()
1750
          self.e.read(iprot)
1751
        else:
1752
          iprot.skip(ftype)
1753
      else:
1754
        iprot.skip(ftype)
1755
      iprot.readFieldEnd()
1756
    iprot.readStructEnd()
1757
 
1758
  def write(self, oprot):
1759
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1760
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1761
      return
1762
    oprot.writeStructBegin('getAllPurchases_result')
1763
    if self.success is not None:
1764
      oprot.writeFieldBegin('success', TType.LIST, 0)
1765
      oprot.writeListBegin(TType.STRUCT, len(self.success))
1766
      for iter20 in self.success:
1767
        iter20.write(oprot)
1768
      oprot.writeListEnd()
1769
      oprot.writeFieldEnd()
1770
    if self.e is not None:
1771
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1772
      self.e.write(oprot)
1773
      oprot.writeFieldEnd()
1774
    oprot.writeFieldStop()
1775
    oprot.writeStructEnd()
1776
 
1777
  def validate(self):
1778
    return
1779
 
1780
 
1781
  def __repr__(self):
1782
    L = ['%s=%r' % (key, value)
1783
      for key, value in self.__dict__.iteritems()]
1784
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1785
 
1786
  def __eq__(self, other):
1787
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1788
 
1789
  def __ne__(self, other):
1790
    return not (self == other)
1791
 
4555 mandeep.dh 1792
class getPurchaseOrderForPurchase_args:
4502 mandeep.dh 1793
  """
1794
  Attributes:
1795
   - purchaseId
1796
  """
1797
 
1798
  thrift_spec = (
1799
    None, # 0
1800
    (1, TType.I64, 'purchaseId', None, None, ), # 1
1801
  )
1802
 
4555 mandeep.dh 1803
  def __init__(self, purchaseId=None,):
4502 mandeep.dh 1804
    self.purchaseId = purchaseId
1805
 
1806
  def read(self, iprot):
1807
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1808
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1809
      return
1810
    iprot.readStructBegin()
1811
    while True:
1812
      (fname, ftype, fid) = iprot.readFieldBegin()
1813
      if ftype == TType.STOP:
1814
        break
1815
      if fid == 1:
1816
        if ftype == TType.I64:
1817
          self.purchaseId = iprot.readI64();
1818
        else:
1819
          iprot.skip(ftype)
1820
      else:
1821
        iprot.skip(ftype)
1822
      iprot.readFieldEnd()
1823
    iprot.readStructEnd()
1824
 
1825
  def write(self, oprot):
1826
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1827
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1828
      return
4555 mandeep.dh 1829
    oprot.writeStructBegin('getPurchaseOrderForPurchase_args')
4502 mandeep.dh 1830
    if self.purchaseId is not None:
1831
      oprot.writeFieldBegin('purchaseId', TType.I64, 1)
1832
      oprot.writeI64(self.purchaseId)
1833
      oprot.writeFieldEnd()
1834
    oprot.writeFieldStop()
1835
    oprot.writeStructEnd()
1836
 
1837
  def validate(self):
1838
    return
1839
 
1840
 
1841
  def __repr__(self):
1842
    L = ['%s=%r' % (key, value)
1843
      for key, value in self.__dict__.iteritems()]
1844
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1845
 
1846
  def __eq__(self, other):
1847
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1848
 
1849
  def __ne__(self, other):
1850
    return not (self == other)
1851
 
4555 mandeep.dh 1852
class getPurchaseOrderForPurchase_result:
4502 mandeep.dh 1853
  """
1854
  Attributes:
1855
   - success
1856
  """
1857
 
1858
  thrift_spec = (
4555 mandeep.dh 1859
    (0, TType.STRUCT, 'success', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 0
4502 mandeep.dh 1860
  )
1861
 
1862
  def __init__(self, success=None,):
1863
    self.success = success
1864
 
1865
  def read(self, iprot):
1866
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1867
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1868
      return
1869
    iprot.readStructBegin()
1870
    while True:
1871
      (fname, ftype, fid) = iprot.readFieldBegin()
1872
      if ftype == TType.STOP:
1873
        break
1874
      if fid == 0:
4555 mandeep.dh 1875
        if ftype == TType.STRUCT:
1876
          self.success = PurchaseOrder()
1877
          self.success.read(iprot)
4502 mandeep.dh 1878
        else:
1879
          iprot.skip(ftype)
1880
      else:
1881
        iprot.skip(ftype)
1882
      iprot.readFieldEnd()
1883
    iprot.readStructEnd()
1884
 
1885
  def write(self, oprot):
1886
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1887
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1888
      return
4555 mandeep.dh 1889
    oprot.writeStructBegin('getPurchaseOrderForPurchase_result')
4502 mandeep.dh 1890
    if self.success is not None:
4555 mandeep.dh 1891
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1892
      self.success.write(oprot)
4502 mandeep.dh 1893
      oprot.writeFieldEnd()
1894
    oprot.writeFieldStop()
1895
    oprot.writeStructEnd()
1896
 
1897
  def validate(self):
1898
    return
1899
 
1900
 
1901
  def __repr__(self):
1902
    L = ['%s=%r' % (key, value)
1903
      for key, value in self.__dict__.iteritems()]
1904
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1905
 
1906
  def __eq__(self, other):
1907
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1908
 
1909
  def __ne__(self, other):
1910
    return not (self == other)
4754 mandeep.dh 1911
 
1912
class getPendingPurchaseOrders_args:
1913
  """
1914
  Attributes:
1915
   - warehouseId
1916
  """
1917
 
1918
  thrift_spec = (
1919
    None, # 0
1920
    (1, TType.I64, 'warehouseId', None, None, ), # 1
1921
  )
1922
 
1923
  def __init__(self, warehouseId=None,):
1924
    self.warehouseId = warehouseId
1925
 
1926
  def read(self, iprot):
1927
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1928
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1929
      return
1930
    iprot.readStructBegin()
1931
    while True:
1932
      (fname, ftype, fid) = iprot.readFieldBegin()
1933
      if ftype == TType.STOP:
1934
        break
1935
      if fid == 1:
1936
        if ftype == TType.I64:
1937
          self.warehouseId = iprot.readI64();
1938
        else:
1939
          iprot.skip(ftype)
1940
      else:
1941
        iprot.skip(ftype)
1942
      iprot.readFieldEnd()
1943
    iprot.readStructEnd()
1944
 
1945
  def write(self, oprot):
1946
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1947
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1948
      return
1949
    oprot.writeStructBegin('getPendingPurchaseOrders_args')
1950
    if self.warehouseId is not None:
1951
      oprot.writeFieldBegin('warehouseId', TType.I64, 1)
1952
      oprot.writeI64(self.warehouseId)
1953
      oprot.writeFieldEnd()
1954
    oprot.writeFieldStop()
1955
    oprot.writeStructEnd()
1956
 
1957
  def validate(self):
1958
    return
1959
 
1960
 
1961
  def __repr__(self):
1962
    L = ['%s=%r' % (key, value)
1963
      for key, value in self.__dict__.iteritems()]
1964
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1965
 
1966
  def __eq__(self, other):
1967
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1968
 
1969
  def __ne__(self, other):
1970
    return not (self == other)
1971
 
1972
class getPendingPurchaseOrders_result:
1973
  """
1974
  Attributes:
1975
   - success
1976
   - e
1977
  """
1978
 
1979
  thrift_spec = (
1980
    (0, TType.LIST, 'success', (TType.STRUCT,(PurchaseOrder, PurchaseOrder.thrift_spec)), None, ), # 0
1981
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1982
  )
1983
 
1984
  def __init__(self, success=None, e=None,):
1985
    self.success = success
1986
    self.e = e
1987
 
1988
  def read(self, iprot):
1989
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1990
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1991
      return
1992
    iprot.readStructBegin()
1993
    while True:
1994
      (fname, ftype, fid) = iprot.readFieldBegin()
1995
      if ftype == TType.STOP:
1996
        break
1997
      if fid == 0:
1998
        if ftype == TType.LIST:
1999
          self.success = []
2000
          (_etype24, _size21) = iprot.readListBegin()
2001
          for _i25 in xrange(_size21):
2002
            _elem26 = PurchaseOrder()
2003
            _elem26.read(iprot)
2004
            self.success.append(_elem26)
2005
          iprot.readListEnd()
2006
        else:
2007
          iprot.skip(ftype)
2008
      elif fid == 1:
2009
        if ftype == TType.STRUCT:
2010
          self.e = PurchaseServiceException()
2011
          self.e.read(iprot)
2012
        else:
2013
          iprot.skip(ftype)
2014
      else:
2015
        iprot.skip(ftype)
2016
      iprot.readFieldEnd()
2017
    iprot.readStructEnd()
2018
 
2019
  def write(self, oprot):
2020
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2021
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2022
      return
2023
    oprot.writeStructBegin('getPendingPurchaseOrders_result')
2024
    if self.success is not None:
2025
      oprot.writeFieldBegin('success', TType.LIST, 0)
2026
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2027
      for iter27 in self.success:
2028
        iter27.write(oprot)
2029
      oprot.writeListEnd()
2030
      oprot.writeFieldEnd()
2031
    if self.e is not None:
2032
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
2033
      self.e.write(oprot)
2034
      oprot.writeFieldEnd()
2035
    oprot.writeFieldStop()
2036
    oprot.writeStructEnd()
2037
 
2038
  def validate(self):
2039
    return
2040
 
2041
 
2042
  def __repr__(self):
2043
    L = ['%s=%r' % (key, value)
2044
      for key, value in self.__dict__.iteritems()]
2045
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2046
 
2047
  def __eq__(self, other):
2048
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2049
 
2050
  def __ne__(self, other):
2051
    return not (self == other)
2052
 
2053
class getSuppliers_args:
2054
 
2055
  thrift_spec = (
2056
  )
2057
 
2058
  def read(self, iprot):
2059
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2060
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2061
      return
2062
    iprot.readStructBegin()
2063
    while True:
2064
      (fname, ftype, fid) = iprot.readFieldBegin()
2065
      if ftype == TType.STOP:
2066
        break
2067
      else:
2068
        iprot.skip(ftype)
2069
      iprot.readFieldEnd()
2070
    iprot.readStructEnd()
2071
 
2072
  def write(self, oprot):
2073
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2074
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2075
      return
2076
    oprot.writeStructBegin('getSuppliers_args')
2077
    oprot.writeFieldStop()
2078
    oprot.writeStructEnd()
2079
 
2080
  def validate(self):
2081
    return
2082
 
2083
 
2084
  def __repr__(self):
2085
    L = ['%s=%r' % (key, value)
2086
      for key, value in self.__dict__.iteritems()]
2087
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2088
 
2089
  def __eq__(self, other):
2090
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2091
 
2092
  def __ne__(self, other):
2093
    return not (self == other)
2094
 
2095
class getSuppliers_result:
2096
  """
2097
  Attributes:
2098
   - success
2099
   - e
2100
  """
2101
 
2102
  thrift_spec = (
2103
    (0, TType.LIST, 'success', (TType.STRUCT,(Supplier, Supplier.thrift_spec)), None, ), # 0
2104
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
2105
  )
2106
 
2107
  def __init__(self, success=None, e=None,):
2108
    self.success = success
2109
    self.e = e
2110
 
2111
  def read(self, iprot):
2112
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2113
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2114
      return
2115
    iprot.readStructBegin()
2116
    while True:
2117
      (fname, ftype, fid) = iprot.readFieldBegin()
2118
      if ftype == TType.STOP:
2119
        break
2120
      if fid == 0:
2121
        if ftype == TType.LIST:
2122
          self.success = []
2123
          (_etype31, _size28) = iprot.readListBegin()
2124
          for _i32 in xrange(_size28):
2125
            _elem33 = Supplier()
2126
            _elem33.read(iprot)
2127
            self.success.append(_elem33)
2128
          iprot.readListEnd()
2129
        else:
2130
          iprot.skip(ftype)
2131
      elif fid == 1:
2132
        if ftype == TType.STRUCT:
2133
          self.e = PurchaseServiceException()
2134
          self.e.read(iprot)
2135
        else:
2136
          iprot.skip(ftype)
2137
      else:
2138
        iprot.skip(ftype)
2139
      iprot.readFieldEnd()
2140
    iprot.readStructEnd()
2141
 
2142
  def write(self, oprot):
2143
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2144
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2145
      return
2146
    oprot.writeStructBegin('getSuppliers_result')
2147
    if self.success is not None:
2148
      oprot.writeFieldBegin('success', TType.LIST, 0)
2149
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2150
      for iter34 in self.success:
2151
        iter34.write(oprot)
2152
      oprot.writeListEnd()
2153
      oprot.writeFieldEnd()
2154
    if self.e is not None:
2155
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
2156
      self.e.write(oprot)
2157
      oprot.writeFieldEnd()
2158
    oprot.writeFieldStop()
2159
    oprot.writeStructEnd()
2160
 
2161
  def validate(self):
2162
    return
2163
 
2164
 
2165
  def __repr__(self):
2166
    L = ['%s=%r' % (key, value)
2167
      for key, value in self.__dict__.iteritems()]
2168
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2169
 
2170
  def __eq__(self, other):
2171
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2172
 
2173
  def __ne__(self, other):
2174
    return not (self == other)
2175
 
2176
class fulfillPO_args:
2177
  """
2178
  Attributes:
2179
   - purchaseOrderId
2180
   - itemId
2181
   - quantity
2182
  """
2183
 
2184
  thrift_spec = (
2185
    None, # 0
2186
    (1, TType.I64, 'purchaseOrderId', None, None, ), # 1
2187
    (2, TType.I64, 'itemId', None, None, ), # 2
2188
    (3, TType.I64, 'quantity', None, None, ), # 3
2189
  )
2190
 
2191
  def __init__(self, purchaseOrderId=None, itemId=None, quantity=None,):
2192
    self.purchaseOrderId = purchaseOrderId
2193
    self.itemId = itemId
2194
    self.quantity = quantity
2195
 
2196
  def read(self, iprot):
2197
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2198
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2199
      return
2200
    iprot.readStructBegin()
2201
    while True:
2202
      (fname, ftype, fid) = iprot.readFieldBegin()
2203
      if ftype == TType.STOP:
2204
        break
2205
      if fid == 1:
2206
        if ftype == TType.I64:
2207
          self.purchaseOrderId = iprot.readI64();
2208
        else:
2209
          iprot.skip(ftype)
2210
      elif fid == 2:
2211
        if ftype == TType.I64:
2212
          self.itemId = iprot.readI64();
2213
        else:
2214
          iprot.skip(ftype)
2215
      elif fid == 3:
2216
        if ftype == TType.I64:
2217
          self.quantity = iprot.readI64();
2218
        else:
2219
          iprot.skip(ftype)
2220
      else:
2221
        iprot.skip(ftype)
2222
      iprot.readFieldEnd()
2223
    iprot.readStructEnd()
2224
 
2225
  def write(self, oprot):
2226
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2227
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2228
      return
2229
    oprot.writeStructBegin('fulfillPO_args')
2230
    if self.purchaseOrderId is not None:
2231
      oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)
2232
      oprot.writeI64(self.purchaseOrderId)
2233
      oprot.writeFieldEnd()
2234
    if self.itemId is not None:
2235
      oprot.writeFieldBegin('itemId', TType.I64, 2)
2236
      oprot.writeI64(self.itemId)
2237
      oprot.writeFieldEnd()
2238
    if self.quantity is not None:
2239
      oprot.writeFieldBegin('quantity', TType.I64, 3)
2240
      oprot.writeI64(self.quantity)
2241
      oprot.writeFieldEnd()
2242
    oprot.writeFieldStop()
2243
    oprot.writeStructEnd()
2244
 
2245
  def validate(self):
2246
    return
2247
 
2248
 
2249
  def __repr__(self):
2250
    L = ['%s=%r' % (key, value)
2251
      for key, value in self.__dict__.iteritems()]
2252
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2253
 
2254
  def __eq__(self, other):
2255
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2256
 
2257
  def __ne__(self, other):
2258
    return not (self == other)
2259
 
2260
class fulfillPO_result:
2261
  """
2262
  Attributes:
2263
   - e
2264
  """
2265
 
2266
  thrift_spec = (
2267
    None, # 0
2268
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
2269
  )
2270
 
2271
  def __init__(self, e=None,):
2272
    self.e = e
2273
 
2274
  def read(self, iprot):
2275
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2276
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2277
      return
2278
    iprot.readStructBegin()
2279
    while True:
2280
      (fname, ftype, fid) = iprot.readFieldBegin()
2281
      if ftype == TType.STOP:
2282
        break
2283
      if fid == 1:
2284
        if ftype == TType.STRUCT:
2285
          self.e = PurchaseServiceException()
2286
          self.e.read(iprot)
2287
        else:
2288
          iprot.skip(ftype)
2289
      else:
2290
        iprot.skip(ftype)
2291
      iprot.readFieldEnd()
2292
    iprot.readStructEnd()
2293
 
2294
  def write(self, oprot):
2295
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2296
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2297
      return
2298
    oprot.writeStructBegin('fulfillPO_result')
2299
    if self.e is not None:
2300
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
2301
      self.e.write(oprot)
2302
      oprot.writeFieldEnd()
2303
    oprot.writeFieldStop()
2304
    oprot.writeStructEnd()
2305
 
2306
  def validate(self):
2307
    return
2308
 
2309
 
2310
  def __repr__(self):
2311
    L = ['%s=%r' % (key, value)
2312
      for key, value in self.__dict__.iteritems()]
2313
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2314
 
2315
  def __eq__(self, other):
2316
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2317
 
2318
  def __ne__(self, other):
2319
    return not (self == other)
2320
 
2321
class updatePurchaseOrder_args:
2322
  """
2323
  Attributes:
2324
   - purchaseOrder
2325
  """
2326
 
2327
  thrift_spec = (
2328
    None, # 0
2329
    (1, TType.STRUCT, 'purchaseOrder', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 1
2330
  )
2331
 
2332
  def __init__(self, purchaseOrder=None,):
2333
    self.purchaseOrder = purchaseOrder
2334
 
2335
  def read(self, iprot):
2336
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2337
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2338
      return
2339
    iprot.readStructBegin()
2340
    while True:
2341
      (fname, ftype, fid) = iprot.readFieldBegin()
2342
      if ftype == TType.STOP:
2343
        break
2344
      if fid == 1:
2345
        if ftype == TType.STRUCT:
2346
          self.purchaseOrder = PurchaseOrder()
2347
          self.purchaseOrder.read(iprot)
2348
        else:
2349
          iprot.skip(ftype)
2350
      else:
2351
        iprot.skip(ftype)
2352
      iprot.readFieldEnd()
2353
    iprot.readStructEnd()
2354
 
2355
  def write(self, oprot):
2356
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2357
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2358
      return
2359
    oprot.writeStructBegin('updatePurchaseOrder_args')
2360
    if self.purchaseOrder is not None:
2361
      oprot.writeFieldBegin('purchaseOrder', TType.STRUCT, 1)
2362
      self.purchaseOrder.write(oprot)
2363
      oprot.writeFieldEnd()
2364
    oprot.writeFieldStop()
2365
    oprot.writeStructEnd()
2366
 
2367
  def validate(self):
2368
    return
2369
 
2370
 
2371
  def __repr__(self):
2372
    L = ['%s=%r' % (key, value)
2373
      for key, value in self.__dict__.iteritems()]
2374
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2375
 
2376
  def __eq__(self, other):
2377
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2378
 
2379
  def __ne__(self, other):
2380
    return not (self == other)
2381
 
2382
class updatePurchaseOrder_result:
2383
  """
2384
  Attributes:
2385
   - e
2386
  """
2387
 
2388
  thrift_spec = (
2389
    None, # 0
2390
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
2391
  )
2392
 
2393
  def __init__(self, e=None,):
2394
    self.e = e
2395
 
2396
  def read(self, iprot):
2397
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2398
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2399
      return
2400
    iprot.readStructBegin()
2401
    while True:
2402
      (fname, ftype, fid) = iprot.readFieldBegin()
2403
      if ftype == TType.STOP:
2404
        break
2405
      if fid == 1:
2406
        if ftype == TType.STRUCT:
2407
          self.e = PurchaseServiceException()
2408
          self.e.read(iprot)
2409
        else:
2410
          iprot.skip(ftype)
2411
      else:
2412
        iprot.skip(ftype)
2413
      iprot.readFieldEnd()
2414
    iprot.readStructEnd()
2415
 
2416
  def write(self, oprot):
2417
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2418
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2419
      return
2420
    oprot.writeStructBegin('updatePurchaseOrder_result')
2421
    if self.e is not None:
2422
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
2423
      self.e.write(oprot)
2424
      oprot.writeFieldEnd()
2425
    oprot.writeFieldStop()
2426
    oprot.writeStructEnd()
2427
 
2428
  def validate(self):
2429
    return
2430
 
2431
 
2432
  def __repr__(self):
2433
    L = ['%s=%r' % (key, value)
2434
      for key, value in self.__dict__.iteritems()]
2435
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2436
 
2437
  def __eq__(self, other):
2438
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2439
 
2440
  def __ne__(self, other):
2441
    return not (self == other)
5185 mandeep.dh 2442
 
2443
class unFulfillPO_args:
2444
  """
2445
  Attributes:
2446
   - purchaseId
2447
   - itemId
2448
   - quantity
2449
  """
2450
 
2451
  thrift_spec = (
2452
    None, # 0
2453
    (1, TType.I64, 'purchaseId', None, None, ), # 1
2454
    (2, TType.I64, 'itemId', None, None, ), # 2
2455
    (3, TType.I64, 'quantity', None, None, ), # 3
2456
  )
2457
 
2458
  def __init__(self, purchaseId=None, itemId=None, quantity=None,):
2459
    self.purchaseId = purchaseId
2460
    self.itemId = itemId
2461
    self.quantity = quantity
2462
 
2463
  def read(self, iprot):
2464
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2465
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2466
      return
2467
    iprot.readStructBegin()
2468
    while True:
2469
      (fname, ftype, fid) = iprot.readFieldBegin()
2470
      if ftype == TType.STOP:
2471
        break
2472
      if fid == 1:
2473
        if ftype == TType.I64:
2474
          self.purchaseId = iprot.readI64();
2475
        else:
2476
          iprot.skip(ftype)
2477
      elif fid == 2:
2478
        if ftype == TType.I64:
2479
          self.itemId = iprot.readI64();
2480
        else:
2481
          iprot.skip(ftype)
2482
      elif fid == 3:
2483
        if ftype == TType.I64:
2484
          self.quantity = iprot.readI64();
2485
        else:
2486
          iprot.skip(ftype)
2487
      else:
2488
        iprot.skip(ftype)
2489
      iprot.readFieldEnd()
2490
    iprot.readStructEnd()
2491
 
2492
  def write(self, oprot):
2493
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2494
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2495
      return
2496
    oprot.writeStructBegin('unFulfillPO_args')
2497
    if self.purchaseId is not None:
2498
      oprot.writeFieldBegin('purchaseId', TType.I64, 1)
2499
      oprot.writeI64(self.purchaseId)
2500
      oprot.writeFieldEnd()
2501
    if self.itemId is not None:
2502
      oprot.writeFieldBegin('itemId', TType.I64, 2)
2503
      oprot.writeI64(self.itemId)
2504
      oprot.writeFieldEnd()
2505
    if self.quantity is not None:
2506
      oprot.writeFieldBegin('quantity', TType.I64, 3)
2507
      oprot.writeI64(self.quantity)
2508
      oprot.writeFieldEnd()
2509
    oprot.writeFieldStop()
2510
    oprot.writeStructEnd()
2511
 
2512
  def validate(self):
2513
    return
2514
 
2515
 
2516
  def __repr__(self):
2517
    L = ['%s=%r' % (key, value)
2518
      for key, value in self.__dict__.iteritems()]
2519
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2520
 
2521
  def __eq__(self, other):
2522
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2523
 
2524
  def __ne__(self, other):
2525
    return not (self == other)
2526
 
2527
class unFulfillPO_result:
2528
  """
2529
  Attributes:
2530
   - e
2531
  """
2532
 
2533
  thrift_spec = (
2534
    None, # 0
2535
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
2536
  )
2537
 
2538
  def __init__(self, e=None,):
2539
    self.e = e
2540
 
2541
  def read(self, iprot):
2542
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2543
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2544
      return
2545
    iprot.readStructBegin()
2546
    while True:
2547
      (fname, ftype, fid) = iprot.readFieldBegin()
2548
      if ftype == TType.STOP:
2549
        break
2550
      if fid == 1:
2551
        if ftype == TType.STRUCT:
2552
          self.e = PurchaseServiceException()
2553
          self.e.read(iprot)
2554
        else:
2555
          iprot.skip(ftype)
2556
      else:
2557
        iprot.skip(ftype)
2558
      iprot.readFieldEnd()
2559
    iprot.readStructEnd()
2560
 
2561
  def write(self, oprot):
2562
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2563
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2564
      return
2565
    oprot.writeStructBegin('unFulfillPO_result')
2566
    if self.e is not None:
2567
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
2568
      self.e.write(oprot)
2569
      oprot.writeFieldEnd()
2570
    oprot.writeFieldStop()
2571
    oprot.writeStructEnd()
2572
 
2573
  def validate(self):
2574
    return
2575
 
2576
 
2577
  def __repr__(self):
2578
    L = ['%s=%r' % (key, value)
2579
      for key, value in self.__dict__.iteritems()]
2580
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2581
 
2582
  def __eq__(self, other):
2583
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2584
 
2585
  def __ne__(self, other):
2586
    return not (self == other)