Subversion Repositories SmartDukaan

Rev

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