Subversion Repositories SmartDukaan

Rev

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