Subversion Repositories SmartDukaan

Rev

Rev 4555 | Go to most recent revision | Details | 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
 
89
  def getPrice(self, purchaseId, itemId):
90
    """
91
    Returns the price at which we bought an item from a supplier
92
 
93
    Parameters:
94
     - purchaseId
95
     - itemId
96
    """
97
    pass
98
 
99
 
100
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
101
  def __init__(self, iprot, oprot=None):
102
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
103
 
104
  def createPurchaseOrder(self, purchaseOrder):
105
    """
106
    Creates a purchase order based on the data in the given purchase order object.
107
    This method populates a nummber of missing fields
108
 
109
    Parameters:
110
     - purchaseOrder
111
    """
112
    self.send_createPurchaseOrder(purchaseOrder)
113
    return self.recv_createPurchaseOrder()
114
 
115
  def send_createPurchaseOrder(self, purchaseOrder):
116
    self._oprot.writeMessageBegin('createPurchaseOrder', TMessageType.CALL, self._seqid)
117
    args = createPurchaseOrder_args()
118
    args.purchaseOrder = purchaseOrder
119
    args.write(self._oprot)
120
    self._oprot.writeMessageEnd()
121
    self._oprot.trans.flush()
122
 
123
  def recv_createPurchaseOrder(self, ):
124
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
125
    if mtype == TMessageType.EXCEPTION:
126
      x = TApplicationException()
127
      x.read(self._iprot)
128
      self._iprot.readMessageEnd()
129
      raise x
130
    result = createPurchaseOrder_result()
131
    result.read(self._iprot)
132
    self._iprot.readMessageEnd()
133
    if result.success is not None:
134
      return result.success
135
    if result.e is not None:
136
      raise result.e
137
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createPurchaseOrder failed: unknown result");
138
 
139
  def getPurchaseOrder(self, id):
140
    """
141
    Returns the purchase order with the given id. Throws an exception if there is no such purchase order.
142
 
143
    Parameters:
144
     - id
145
    """
146
    self.send_getPurchaseOrder(id)
147
    return self.recv_getPurchaseOrder()
148
 
149
  def send_getPurchaseOrder(self, id):
150
    self._oprot.writeMessageBegin('getPurchaseOrder', TMessageType.CALL, self._seqid)
151
    args = getPurchaseOrder_args()
152
    args.id = id
153
    args.write(self._oprot)
154
    self._oprot.writeMessageEnd()
155
    self._oprot.trans.flush()
156
 
157
  def recv_getPurchaseOrder(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 = getPurchaseOrder_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, "getPurchaseOrder failed: unknown result");
172
 
173
  def getAllPurchaseOrders(self, status):
174
    """
175
    Returns a list of all the purchase orders in the given state
176
 
177
    Parameters:
178
     - status
179
    """
180
    self.send_getAllPurchaseOrders(status)
181
    return self.recv_getAllPurchaseOrders()
182
 
183
  def send_getAllPurchaseOrders(self, status):
184
    self._oprot.writeMessageBegin('getAllPurchaseOrders', TMessageType.CALL, self._seqid)
185
    args = getAllPurchaseOrders_args()
186
    args.status = status
187
    args.write(self._oprot)
188
    self._oprot.writeMessageEnd()
189
    self._oprot.trans.flush()
190
 
191
  def recv_getAllPurchaseOrders(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 = getAllPurchaseOrders_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, "getAllPurchaseOrders failed: unknown result");
206
 
207
  def getSupplier(self, id):
208
    """
209
    Returns the supplier with the given order id. Throws an exception if there is no such supplier.
210
 
211
    Parameters:
212
     - id
213
    """
214
    self.send_getSupplier(id)
215
    return self.recv_getSupplier()
216
 
217
  def send_getSupplier(self, id):
218
    self._oprot.writeMessageBegin('getSupplier', TMessageType.CALL, self._seqid)
219
    args = getSupplier_args()
220
    args.id = id
221
    args.write(self._oprot)
222
    self._oprot.writeMessageEnd()
223
    self._oprot.trans.flush()
224
 
225
  def recv_getSupplier(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 = getSupplier_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, "getSupplier failed: unknown result");
240
 
241
  def startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges):
242
    """
243
    Creates a purchase for the given purchase order.
244
    Throws an exception if no more purchases are allowed against the given purchase order.
245
 
246
    Parameters:
247
     - purchaseOrderId
248
     - invoiceNumber
249
     - freightCharges
250
    """
251
    self.send_startPurchase(purchaseOrderId, invoiceNumber, freightCharges)
252
    return self.recv_startPurchase()
253
 
254
  def send_startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges):
255
    self._oprot.writeMessageBegin('startPurchase', TMessageType.CALL, self._seqid)
256
    args = startPurchase_args()
257
    args.purchaseOrderId = purchaseOrderId
258
    args.invoiceNumber = invoiceNumber
259
    args.freightCharges = freightCharges
260
    args.write(self._oprot)
261
    self._oprot.writeMessageEnd()
262
    self._oprot.trans.flush()
263
 
264
  def recv_startPurchase(self, ):
265
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
266
    if mtype == TMessageType.EXCEPTION:
267
      x = TApplicationException()
268
      x.read(self._iprot)
269
      self._iprot.readMessageEnd()
270
      raise x
271
    result = startPurchase_result()
272
    result.read(self._iprot)
273
    self._iprot.readMessageEnd()
274
    if result.success is not None:
275
      return result.success
276
    if result.e is not None:
277
      raise result.e
278
    raise TApplicationException(TApplicationException.MISSING_RESULT, "startPurchase failed: unknown result");
279
 
280
  def closePurchase(self, purchaseId):
281
    """
282
    Marks a purchase as complete and updates the receivedOn time.
283
    Throws an exception if no such purchase exists.
284
 
285
    Parameters:
286
     - purchaseId
287
    """
288
    self.send_closePurchase(purchaseId)
289
    return self.recv_closePurchase()
290
 
291
  def send_closePurchase(self, purchaseId):
292
    self._oprot.writeMessageBegin('closePurchase', TMessageType.CALL, self._seqid)
293
    args = closePurchase_args()
294
    args.purchaseId = purchaseId
295
    args.write(self._oprot)
296
    self._oprot.writeMessageEnd()
297
    self._oprot.trans.flush()
298
 
299
  def recv_closePurchase(self, ):
300
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
301
    if mtype == TMessageType.EXCEPTION:
302
      x = TApplicationException()
303
      x.read(self._iprot)
304
      self._iprot.readMessageEnd()
305
      raise x
306
    result = closePurchase_result()
307
    result.read(self._iprot)
308
    self._iprot.readMessageEnd()
309
    if result.success is not None:
310
      return result.success
311
    if result.e is not None:
312
      raise result.e
313
    raise TApplicationException(TApplicationException.MISSING_RESULT, "closePurchase failed: unknown result");
314
 
315
  def getAllPurchases(self, purchaseOrderId, open):
316
    """
317
    Returns all open or closed purchases for the given purchase order. Throws an exception if no such purchase order exists
318
 
319
    Parameters:
320
     - purchaseOrderId
321
     - open
322
    """
323
    self.send_getAllPurchases(purchaseOrderId, open)
324
    return self.recv_getAllPurchases()
325
 
326
  def send_getAllPurchases(self, purchaseOrderId, open):
327
    self._oprot.writeMessageBegin('getAllPurchases', TMessageType.CALL, self._seqid)
328
    args = getAllPurchases_args()
329
    args.purchaseOrderId = purchaseOrderId
330
    args.open = open
331
    args.write(self._oprot)
332
    self._oprot.writeMessageEnd()
333
    self._oprot.trans.flush()
334
 
335
  def recv_getAllPurchases(self, ):
336
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
337
    if mtype == TMessageType.EXCEPTION:
338
      x = TApplicationException()
339
      x.read(self._iprot)
340
      self._iprot.readMessageEnd()
341
      raise x
342
    result = getAllPurchases_result()
343
    result.read(self._iprot)
344
    self._iprot.readMessageEnd()
345
    if result.success is not None:
346
      return result.success
347
    if result.e is not None:
348
      raise result.e
349
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");
350
 
351
  def getPrice(self, purchaseId, itemId):
352
    """
353
    Returns the price at which we bought an item from a supplier
354
 
355
    Parameters:
356
     - purchaseId
357
     - itemId
358
    """
359
    self.send_getPrice(purchaseId, itemId)
360
    return self.recv_getPrice()
361
 
362
  def send_getPrice(self, purchaseId, itemId):
363
    self._oprot.writeMessageBegin('getPrice', TMessageType.CALL, self._seqid)
364
    args = getPrice_args()
365
    args.purchaseId = purchaseId
366
    args.itemId = itemId
367
    args.write(self._oprot)
368
    self._oprot.writeMessageEnd()
369
    self._oprot.trans.flush()
370
 
371
  def recv_getPrice(self, ):
372
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
373
    if mtype == TMessageType.EXCEPTION:
374
      x = TApplicationException()
375
      x.read(self._iprot)
376
      self._iprot.readMessageEnd()
377
      raise x
378
    result = getPrice_result()
379
    result.read(self._iprot)
380
    self._iprot.readMessageEnd()
381
    if result.success is not None:
382
      return result.success
383
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPrice failed: unknown result");
384
 
385
 
386
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
387
  def __init__(self, handler):
388
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
389
    self._processMap["createPurchaseOrder"] = Processor.process_createPurchaseOrder
390
    self._processMap["getPurchaseOrder"] = Processor.process_getPurchaseOrder
391
    self._processMap["getAllPurchaseOrders"] = Processor.process_getAllPurchaseOrders
392
    self._processMap["getSupplier"] = Processor.process_getSupplier
393
    self._processMap["startPurchase"] = Processor.process_startPurchase
394
    self._processMap["closePurchase"] = Processor.process_closePurchase
395
    self._processMap["getAllPurchases"] = Processor.process_getAllPurchases
396
    self._processMap["getPrice"] = Processor.process_getPrice
397
 
398
  def process(self, iprot, oprot):
399
    (name, type, seqid) = iprot.readMessageBegin()
400
    if name not in self._processMap:
401
      iprot.skip(TType.STRUCT)
402
      iprot.readMessageEnd()
403
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
404
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
405
      x.write(oprot)
406
      oprot.writeMessageEnd()
407
      oprot.trans.flush()
408
      return
409
    else:
410
      self._processMap[name](self, seqid, iprot, oprot)
411
    return True
412
 
413
  def process_createPurchaseOrder(self, seqid, iprot, oprot):
414
    args = createPurchaseOrder_args()
415
    args.read(iprot)
416
    iprot.readMessageEnd()
417
    result = createPurchaseOrder_result()
418
    try:
419
      result.success = self._handler.createPurchaseOrder(args.purchaseOrder)
420
    except PurchaseServiceException, e:
421
      result.e = e
422
    oprot.writeMessageBegin("createPurchaseOrder", TMessageType.REPLY, seqid)
423
    result.write(oprot)
424
    oprot.writeMessageEnd()
425
    oprot.trans.flush()
426
 
427
  def process_getPurchaseOrder(self, seqid, iprot, oprot):
428
    args = getPurchaseOrder_args()
429
    args.read(iprot)
430
    iprot.readMessageEnd()
431
    result = getPurchaseOrder_result()
432
    try:
433
      result.success = self._handler.getPurchaseOrder(args.id)
434
    except PurchaseServiceException, e:
435
      result.e = e
436
    oprot.writeMessageBegin("getPurchaseOrder", TMessageType.REPLY, seqid)
437
    result.write(oprot)
438
    oprot.writeMessageEnd()
439
    oprot.trans.flush()
440
 
441
  def process_getAllPurchaseOrders(self, seqid, iprot, oprot):
442
    args = getAllPurchaseOrders_args()
443
    args.read(iprot)
444
    iprot.readMessageEnd()
445
    result = getAllPurchaseOrders_result()
446
    try:
447
      result.success = self._handler.getAllPurchaseOrders(args.status)
448
    except PurchaseServiceException, e:
449
      result.e = e
450
    oprot.writeMessageBegin("getAllPurchaseOrders", TMessageType.REPLY, seqid)
451
    result.write(oprot)
452
    oprot.writeMessageEnd()
453
    oprot.trans.flush()
454
 
455
  def process_getSupplier(self, seqid, iprot, oprot):
456
    args = getSupplier_args()
457
    args.read(iprot)
458
    iprot.readMessageEnd()
459
    result = getSupplier_result()
460
    try:
461
      result.success = self._handler.getSupplier(args.id)
462
    except PurchaseServiceException, e:
463
      result.e = e
464
    oprot.writeMessageBegin("getSupplier", TMessageType.REPLY, seqid)
465
    result.write(oprot)
466
    oprot.writeMessageEnd()
467
    oprot.trans.flush()
468
 
469
  def process_startPurchase(self, seqid, iprot, oprot):
470
    args = startPurchase_args()
471
    args.read(iprot)
472
    iprot.readMessageEnd()
473
    result = startPurchase_result()
474
    try:
475
      result.success = self._handler.startPurchase(args.purchaseOrderId, args.invoiceNumber, args.freightCharges)
476
    except PurchaseServiceException, e:
477
      result.e = e
478
    oprot.writeMessageBegin("startPurchase", TMessageType.REPLY, seqid)
479
    result.write(oprot)
480
    oprot.writeMessageEnd()
481
    oprot.trans.flush()
482
 
483
  def process_closePurchase(self, seqid, iprot, oprot):
484
    args = closePurchase_args()
485
    args.read(iprot)
486
    iprot.readMessageEnd()
487
    result = closePurchase_result()
488
    try:
489
      result.success = self._handler.closePurchase(args.purchaseId)
490
    except PurchaseServiceException, e:
491
      result.e = e
492
    oprot.writeMessageBegin("closePurchase", TMessageType.REPLY, seqid)
493
    result.write(oprot)
494
    oprot.writeMessageEnd()
495
    oprot.trans.flush()
496
 
497
  def process_getAllPurchases(self, seqid, iprot, oprot):
498
    args = getAllPurchases_args()
499
    args.read(iprot)
500
    iprot.readMessageEnd()
501
    result = getAllPurchases_result()
502
    try:
503
      result.success = self._handler.getAllPurchases(args.purchaseOrderId, args.open)
504
    except PurchaseServiceException, e:
505
      result.e = e
506
    oprot.writeMessageBegin("getAllPurchases", TMessageType.REPLY, seqid)
507
    result.write(oprot)
508
    oprot.writeMessageEnd()
509
    oprot.trans.flush()
510
 
511
  def process_getPrice(self, seqid, iprot, oprot):
512
    args = getPrice_args()
513
    args.read(iprot)
514
    iprot.readMessageEnd()
515
    result = getPrice_result()
516
    result.success = self._handler.getPrice(args.purchaseId, args.itemId)
517
    oprot.writeMessageBegin("getPrice", TMessageType.REPLY, seqid)
518
    result.write(oprot)
519
    oprot.writeMessageEnd()
520
    oprot.trans.flush()
521
 
522
 
523
# HELPER FUNCTIONS AND STRUCTURES
524
 
525
class createPurchaseOrder_args:
526
  """
527
  Attributes:
528
   - purchaseOrder
529
  """
530
 
531
  thrift_spec = (
532
    None, # 0
533
    (1, TType.STRUCT, 'purchaseOrder', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 1
534
  )
535
 
536
  def __init__(self, purchaseOrder=None,):
537
    self.purchaseOrder = purchaseOrder
538
 
539
  def read(self, iprot):
540
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
541
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
542
      return
543
    iprot.readStructBegin()
544
    while True:
545
      (fname, ftype, fid) = iprot.readFieldBegin()
546
      if ftype == TType.STOP:
547
        break
548
      if fid == 1:
549
        if ftype == TType.STRUCT:
550
          self.purchaseOrder = PurchaseOrder()
551
          self.purchaseOrder.read(iprot)
552
        else:
553
          iprot.skip(ftype)
554
      else:
555
        iprot.skip(ftype)
556
      iprot.readFieldEnd()
557
    iprot.readStructEnd()
558
 
559
  def write(self, oprot):
560
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
561
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
562
      return
563
    oprot.writeStructBegin('createPurchaseOrder_args')
564
    if self.purchaseOrder is not None:
565
      oprot.writeFieldBegin('purchaseOrder', TType.STRUCT, 1)
566
      self.purchaseOrder.write(oprot)
567
      oprot.writeFieldEnd()
568
    oprot.writeFieldStop()
569
    oprot.writeStructEnd()
570
 
571
  def validate(self):
572
    return
573
 
574
 
575
  def __repr__(self):
576
    L = ['%s=%r' % (key, value)
577
      for key, value in self.__dict__.iteritems()]
578
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
579
 
580
  def __eq__(self, other):
581
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
582
 
583
  def __ne__(self, other):
584
    return not (self == other)
585
 
586
class createPurchaseOrder_result:
587
  """
588
  Attributes:
589
   - success
590
   - e
591
  """
592
 
593
  thrift_spec = (
594
    (0, TType.I64, 'success', None, None, ), # 0
595
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
596
  )
597
 
598
  def __init__(self, success=None, e=None,):
599
    self.success = success
600
    self.e = e
601
 
602
  def read(self, iprot):
603
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
604
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
605
      return
606
    iprot.readStructBegin()
607
    while True:
608
      (fname, ftype, fid) = iprot.readFieldBegin()
609
      if ftype == TType.STOP:
610
        break
611
      if fid == 0:
612
        if ftype == TType.I64:
613
          self.success = iprot.readI64();
614
        else:
615
          iprot.skip(ftype)
616
      elif fid == 1:
617
        if ftype == TType.STRUCT:
618
          self.e = PurchaseServiceException()
619
          self.e.read(iprot)
620
        else:
621
          iprot.skip(ftype)
622
      else:
623
        iprot.skip(ftype)
624
      iprot.readFieldEnd()
625
    iprot.readStructEnd()
626
 
627
  def write(self, oprot):
628
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
629
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
630
      return
631
    oprot.writeStructBegin('createPurchaseOrder_result')
632
    if self.success is not None:
633
      oprot.writeFieldBegin('success', TType.I64, 0)
634
      oprot.writeI64(self.success)
635
      oprot.writeFieldEnd()
636
    if self.e is not None:
637
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
638
      self.e.write(oprot)
639
      oprot.writeFieldEnd()
640
    oprot.writeFieldStop()
641
    oprot.writeStructEnd()
642
 
643
  def validate(self):
644
    return
645
 
646
 
647
  def __repr__(self):
648
    L = ['%s=%r' % (key, value)
649
      for key, value in self.__dict__.iteritems()]
650
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
651
 
652
  def __eq__(self, other):
653
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
654
 
655
  def __ne__(self, other):
656
    return not (self == other)
657
 
658
class getPurchaseOrder_args:
659
  """
660
  Attributes:
661
   - id
662
  """
663
 
664
  thrift_spec = (
665
    None, # 0
666
    (1, TType.I64, 'id', None, None, ), # 1
667
  )
668
 
669
  def __init__(self, id=None,):
670
    self.id = id
671
 
672
  def read(self, iprot):
673
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
674
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
675
      return
676
    iprot.readStructBegin()
677
    while True:
678
      (fname, ftype, fid) = iprot.readFieldBegin()
679
      if ftype == TType.STOP:
680
        break
681
      if fid == 1:
682
        if ftype == TType.I64:
683
          self.id = iprot.readI64();
684
        else:
685
          iprot.skip(ftype)
686
      else:
687
        iprot.skip(ftype)
688
      iprot.readFieldEnd()
689
    iprot.readStructEnd()
690
 
691
  def write(self, oprot):
692
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
693
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
694
      return
695
    oprot.writeStructBegin('getPurchaseOrder_args')
696
    if self.id is not None:
697
      oprot.writeFieldBegin('id', TType.I64, 1)
698
      oprot.writeI64(self.id)
699
      oprot.writeFieldEnd()
700
    oprot.writeFieldStop()
701
    oprot.writeStructEnd()
702
 
703
  def validate(self):
704
    return
705
 
706
 
707
  def __repr__(self):
708
    L = ['%s=%r' % (key, value)
709
      for key, value in self.__dict__.iteritems()]
710
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
711
 
712
  def __eq__(self, other):
713
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
714
 
715
  def __ne__(self, other):
716
    return not (self == other)
717
 
718
class getPurchaseOrder_result:
719
  """
720
  Attributes:
721
   - success
722
   - e
723
  """
724
 
725
  thrift_spec = (
726
    (0, TType.STRUCT, 'success', (PurchaseOrder, PurchaseOrder.thrift_spec), None, ), # 0
727
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
728
  )
729
 
730
  def __init__(self, success=None, e=None,):
731
    self.success = success
732
    self.e = e
733
 
734
  def read(self, iprot):
735
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
736
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
737
      return
738
    iprot.readStructBegin()
739
    while True:
740
      (fname, ftype, fid) = iprot.readFieldBegin()
741
      if ftype == TType.STOP:
742
        break
743
      if fid == 0:
744
        if ftype == TType.STRUCT:
745
          self.success = PurchaseOrder()
746
          self.success.read(iprot)
747
        else:
748
          iprot.skip(ftype)
749
      elif fid == 1:
750
        if ftype == TType.STRUCT:
751
          self.e = PurchaseServiceException()
752
          self.e.read(iprot)
753
        else:
754
          iprot.skip(ftype)
755
      else:
756
        iprot.skip(ftype)
757
      iprot.readFieldEnd()
758
    iprot.readStructEnd()
759
 
760
  def write(self, oprot):
761
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
762
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
763
      return
764
    oprot.writeStructBegin('getPurchaseOrder_result')
765
    if self.success is not None:
766
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
767
      self.success.write(oprot)
768
      oprot.writeFieldEnd()
769
    if self.e is not None:
770
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
771
      self.e.write(oprot)
772
      oprot.writeFieldEnd()
773
    oprot.writeFieldStop()
774
    oprot.writeStructEnd()
775
 
776
  def validate(self):
777
    return
778
 
779
 
780
  def __repr__(self):
781
    L = ['%s=%r' % (key, value)
782
      for key, value in self.__dict__.iteritems()]
783
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
784
 
785
  def __eq__(self, other):
786
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
787
 
788
  def __ne__(self, other):
789
    return not (self == other)
790
 
791
class getAllPurchaseOrders_args:
792
  """
793
  Attributes:
794
   - status
795
  """
796
 
797
  thrift_spec = (
798
    None, # 0
799
    (1, TType.I32, 'status', None, None, ), # 1
800
  )
801
 
802
  def __init__(self, status=None,):
803
    self.status = status
804
 
805
  def read(self, iprot):
806
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
807
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
808
      return
809
    iprot.readStructBegin()
810
    while True:
811
      (fname, ftype, fid) = iprot.readFieldBegin()
812
      if ftype == TType.STOP:
813
        break
814
      if fid == 1:
815
        if ftype == TType.I32:
816
          self.status = iprot.readI32();
817
        else:
818
          iprot.skip(ftype)
819
      else:
820
        iprot.skip(ftype)
821
      iprot.readFieldEnd()
822
    iprot.readStructEnd()
823
 
824
  def write(self, oprot):
825
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
826
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
827
      return
828
    oprot.writeStructBegin('getAllPurchaseOrders_args')
829
    if self.status is not None:
830
      oprot.writeFieldBegin('status', TType.I32, 1)
831
      oprot.writeI32(self.status)
832
      oprot.writeFieldEnd()
833
    oprot.writeFieldStop()
834
    oprot.writeStructEnd()
835
 
836
  def validate(self):
837
    return
838
 
839
 
840
  def __repr__(self):
841
    L = ['%s=%r' % (key, value)
842
      for key, value in self.__dict__.iteritems()]
843
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
844
 
845
  def __eq__(self, other):
846
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
847
 
848
  def __ne__(self, other):
849
    return not (self == other)
850
 
851
class getAllPurchaseOrders_result:
852
  """
853
  Attributes:
854
   - success
855
   - e
856
  """
857
 
858
  thrift_spec = (
859
    (0, TType.LIST, 'success', (TType.STRUCT,(PurchaseOrder, PurchaseOrder.thrift_spec)), None, ), # 0
860
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
861
  )
862
 
863
  def __init__(self, success=None, e=None,):
864
    self.success = success
865
    self.e = e
866
 
867
  def read(self, iprot):
868
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
869
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
870
      return
871
    iprot.readStructBegin()
872
    while True:
873
      (fname, ftype, fid) = iprot.readFieldBegin()
874
      if ftype == TType.STOP:
875
        break
876
      if fid == 0:
877
        if ftype == TType.LIST:
878
          self.success = []
879
          (_etype10, _size7) = iprot.readListBegin()
880
          for _i11 in xrange(_size7):
881
            _elem12 = PurchaseOrder()
882
            _elem12.read(iprot)
883
            self.success.append(_elem12)
884
          iprot.readListEnd()
885
        else:
886
          iprot.skip(ftype)
887
      elif fid == 1:
888
        if ftype == TType.STRUCT:
889
          self.e = PurchaseServiceException()
890
          self.e.read(iprot)
891
        else:
892
          iprot.skip(ftype)
893
      else:
894
        iprot.skip(ftype)
895
      iprot.readFieldEnd()
896
    iprot.readStructEnd()
897
 
898
  def write(self, oprot):
899
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
900
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
901
      return
902
    oprot.writeStructBegin('getAllPurchaseOrders_result')
903
    if self.success is not None:
904
      oprot.writeFieldBegin('success', TType.LIST, 0)
905
      oprot.writeListBegin(TType.STRUCT, len(self.success))
906
      for iter13 in self.success:
907
        iter13.write(oprot)
908
      oprot.writeListEnd()
909
      oprot.writeFieldEnd()
910
    if self.e is not None:
911
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
912
      self.e.write(oprot)
913
      oprot.writeFieldEnd()
914
    oprot.writeFieldStop()
915
    oprot.writeStructEnd()
916
 
917
  def validate(self):
918
    return
919
 
920
 
921
  def __repr__(self):
922
    L = ['%s=%r' % (key, value)
923
      for key, value in self.__dict__.iteritems()]
924
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
925
 
926
  def __eq__(self, other):
927
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
928
 
929
  def __ne__(self, other):
930
    return not (self == other)
931
 
932
class getSupplier_args:
933
  """
934
  Attributes:
935
   - id
936
  """
937
 
938
  thrift_spec = (
939
    None, # 0
940
    (1, TType.I64, 'id', None, None, ), # 1
941
  )
942
 
943
  def __init__(self, id=None,):
944
    self.id = id
945
 
946
  def read(self, iprot):
947
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
948
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
949
      return
950
    iprot.readStructBegin()
951
    while True:
952
      (fname, ftype, fid) = iprot.readFieldBegin()
953
      if ftype == TType.STOP:
954
        break
955
      if fid == 1:
956
        if ftype == TType.I64:
957
          self.id = iprot.readI64();
958
        else:
959
          iprot.skip(ftype)
960
      else:
961
        iprot.skip(ftype)
962
      iprot.readFieldEnd()
963
    iprot.readStructEnd()
964
 
965
  def write(self, oprot):
966
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
967
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
968
      return
969
    oprot.writeStructBegin('getSupplier_args')
970
    if self.id is not None:
971
      oprot.writeFieldBegin('id', TType.I64, 1)
972
      oprot.writeI64(self.id)
973
      oprot.writeFieldEnd()
974
    oprot.writeFieldStop()
975
    oprot.writeStructEnd()
976
 
977
  def validate(self):
978
    return
979
 
980
 
981
  def __repr__(self):
982
    L = ['%s=%r' % (key, value)
983
      for key, value in self.__dict__.iteritems()]
984
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
985
 
986
  def __eq__(self, other):
987
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
988
 
989
  def __ne__(self, other):
990
    return not (self == other)
991
 
992
class getSupplier_result:
993
  """
994
  Attributes:
995
   - success
996
   - e
997
  """
998
 
999
  thrift_spec = (
1000
    (0, TType.STRUCT, 'success', (Supplier, Supplier.thrift_spec), None, ), # 0
1001
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1002
  )
1003
 
1004
  def __init__(self, success=None, e=None,):
1005
    self.success = success
1006
    self.e = e
1007
 
1008
  def read(self, iprot):
1009
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1010
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1011
      return
1012
    iprot.readStructBegin()
1013
    while True:
1014
      (fname, ftype, fid) = iprot.readFieldBegin()
1015
      if ftype == TType.STOP:
1016
        break
1017
      if fid == 0:
1018
        if ftype == TType.STRUCT:
1019
          self.success = Supplier()
1020
          self.success.read(iprot)
1021
        else:
1022
          iprot.skip(ftype)
1023
      elif fid == 1:
1024
        if ftype == TType.STRUCT:
1025
          self.e = PurchaseServiceException()
1026
          self.e.read(iprot)
1027
        else:
1028
          iprot.skip(ftype)
1029
      else:
1030
        iprot.skip(ftype)
1031
      iprot.readFieldEnd()
1032
    iprot.readStructEnd()
1033
 
1034
  def write(self, oprot):
1035
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1036
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1037
      return
1038
    oprot.writeStructBegin('getSupplier_result')
1039
    if self.success is not None:
1040
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1041
      self.success.write(oprot)
1042
      oprot.writeFieldEnd()
1043
    if self.e is not None:
1044
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1045
      self.e.write(oprot)
1046
      oprot.writeFieldEnd()
1047
    oprot.writeFieldStop()
1048
    oprot.writeStructEnd()
1049
 
1050
  def validate(self):
1051
    return
1052
 
1053
 
1054
  def __repr__(self):
1055
    L = ['%s=%r' % (key, value)
1056
      for key, value in self.__dict__.iteritems()]
1057
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1058
 
1059
  def __eq__(self, other):
1060
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1061
 
1062
  def __ne__(self, other):
1063
    return not (self == other)
1064
 
1065
class startPurchase_args:
1066
  """
1067
  Attributes:
1068
   - purchaseOrderId
1069
   - invoiceNumber
1070
   - freightCharges
1071
  """
1072
 
1073
  thrift_spec = (
1074
    None, # 0
1075
    (1, TType.I64, 'purchaseOrderId', None, None, ), # 1
1076
    (2, TType.STRING, 'invoiceNumber', None, None, ), # 2
1077
    (3, TType.DOUBLE, 'freightCharges', None, None, ), # 3
1078
  )
1079
 
1080
  def __init__(self, purchaseOrderId=None, invoiceNumber=None, freightCharges=None,):
1081
    self.purchaseOrderId = purchaseOrderId
1082
    self.invoiceNumber = invoiceNumber
1083
    self.freightCharges = freightCharges
1084
 
1085
  def read(self, iprot):
1086
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1087
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1088
      return
1089
    iprot.readStructBegin()
1090
    while True:
1091
      (fname, ftype, fid) = iprot.readFieldBegin()
1092
      if ftype == TType.STOP:
1093
        break
1094
      if fid == 1:
1095
        if ftype == TType.I64:
1096
          self.purchaseOrderId = iprot.readI64();
1097
        else:
1098
          iprot.skip(ftype)
1099
      elif fid == 2:
1100
        if ftype == TType.STRING:
1101
          self.invoiceNumber = iprot.readString();
1102
        else:
1103
          iprot.skip(ftype)
1104
      elif fid == 3:
1105
        if ftype == TType.DOUBLE:
1106
          self.freightCharges = iprot.readDouble();
1107
        else:
1108
          iprot.skip(ftype)
1109
      else:
1110
        iprot.skip(ftype)
1111
      iprot.readFieldEnd()
1112
    iprot.readStructEnd()
1113
 
1114
  def write(self, oprot):
1115
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1116
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1117
      return
1118
    oprot.writeStructBegin('startPurchase_args')
1119
    if self.purchaseOrderId is not None:
1120
      oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)
1121
      oprot.writeI64(self.purchaseOrderId)
1122
      oprot.writeFieldEnd()
1123
    if self.invoiceNumber is not None:
1124
      oprot.writeFieldBegin('invoiceNumber', TType.STRING, 2)
1125
      oprot.writeString(self.invoiceNumber)
1126
      oprot.writeFieldEnd()
1127
    if self.freightCharges is not None:
1128
      oprot.writeFieldBegin('freightCharges', TType.DOUBLE, 3)
1129
      oprot.writeDouble(self.freightCharges)
1130
      oprot.writeFieldEnd()
1131
    oprot.writeFieldStop()
1132
    oprot.writeStructEnd()
1133
 
1134
  def validate(self):
1135
    return
1136
 
1137
 
1138
  def __repr__(self):
1139
    L = ['%s=%r' % (key, value)
1140
      for key, value in self.__dict__.iteritems()]
1141
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1142
 
1143
  def __eq__(self, other):
1144
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1145
 
1146
  def __ne__(self, other):
1147
    return not (self == other)
1148
 
1149
class startPurchase_result:
1150
  """
1151
  Attributes:
1152
   - success
1153
   - e
1154
  """
1155
 
1156
  thrift_spec = (
1157
    (0, TType.I64, 'success', None, None, ), # 0
1158
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1159
  )
1160
 
1161
  def __init__(self, success=None, e=None,):
1162
    self.success = success
1163
    self.e = e
1164
 
1165
  def read(self, iprot):
1166
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1167
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1168
      return
1169
    iprot.readStructBegin()
1170
    while True:
1171
      (fname, ftype, fid) = iprot.readFieldBegin()
1172
      if ftype == TType.STOP:
1173
        break
1174
      if fid == 0:
1175
        if ftype == TType.I64:
1176
          self.success = iprot.readI64();
1177
        else:
1178
          iprot.skip(ftype)
1179
      elif fid == 1:
1180
        if ftype == TType.STRUCT:
1181
          self.e = PurchaseServiceException()
1182
          self.e.read(iprot)
1183
        else:
1184
          iprot.skip(ftype)
1185
      else:
1186
        iprot.skip(ftype)
1187
      iprot.readFieldEnd()
1188
    iprot.readStructEnd()
1189
 
1190
  def write(self, oprot):
1191
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1192
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1193
      return
1194
    oprot.writeStructBegin('startPurchase_result')
1195
    if self.success is not None:
1196
      oprot.writeFieldBegin('success', TType.I64, 0)
1197
      oprot.writeI64(self.success)
1198
      oprot.writeFieldEnd()
1199
    if self.e is not None:
1200
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1201
      self.e.write(oprot)
1202
      oprot.writeFieldEnd()
1203
    oprot.writeFieldStop()
1204
    oprot.writeStructEnd()
1205
 
1206
  def validate(self):
1207
    return
1208
 
1209
 
1210
  def __repr__(self):
1211
    L = ['%s=%r' % (key, value)
1212
      for key, value in self.__dict__.iteritems()]
1213
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1214
 
1215
  def __eq__(self, other):
1216
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1217
 
1218
  def __ne__(self, other):
1219
    return not (self == other)
1220
 
1221
class closePurchase_args:
1222
  """
1223
  Attributes:
1224
   - purchaseId
1225
  """
1226
 
1227
  thrift_spec = (
1228
    None, # 0
1229
    (1, TType.I64, 'purchaseId', None, None, ), # 1
1230
  )
1231
 
1232
  def __init__(self, purchaseId=None,):
1233
    self.purchaseId = purchaseId
1234
 
1235
  def read(self, iprot):
1236
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1237
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1238
      return
1239
    iprot.readStructBegin()
1240
    while True:
1241
      (fname, ftype, fid) = iprot.readFieldBegin()
1242
      if ftype == TType.STOP:
1243
        break
1244
      if fid == 1:
1245
        if ftype == TType.I64:
1246
          self.purchaseId = iprot.readI64();
1247
        else:
1248
          iprot.skip(ftype)
1249
      else:
1250
        iprot.skip(ftype)
1251
      iprot.readFieldEnd()
1252
    iprot.readStructEnd()
1253
 
1254
  def write(self, oprot):
1255
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1256
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1257
      return
1258
    oprot.writeStructBegin('closePurchase_args')
1259
    if self.purchaseId is not None:
1260
      oprot.writeFieldBegin('purchaseId', TType.I64, 1)
1261
      oprot.writeI64(self.purchaseId)
1262
      oprot.writeFieldEnd()
1263
    oprot.writeFieldStop()
1264
    oprot.writeStructEnd()
1265
 
1266
  def validate(self):
1267
    return
1268
 
1269
 
1270
  def __repr__(self):
1271
    L = ['%s=%r' % (key, value)
1272
      for key, value in self.__dict__.iteritems()]
1273
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1274
 
1275
  def __eq__(self, other):
1276
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1277
 
1278
  def __ne__(self, other):
1279
    return not (self == other)
1280
 
1281
class closePurchase_result:
1282
  """
1283
  Attributes:
1284
   - success
1285
   - e
1286
  """
1287
 
1288
  thrift_spec = (
1289
    (0, TType.I64, 'success', None, None, ), # 0
1290
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1291
  )
1292
 
1293
  def __init__(self, success=None, e=None,):
1294
    self.success = success
1295
    self.e = e
1296
 
1297
  def read(self, iprot):
1298
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1299
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1300
      return
1301
    iprot.readStructBegin()
1302
    while True:
1303
      (fname, ftype, fid) = iprot.readFieldBegin()
1304
      if ftype == TType.STOP:
1305
        break
1306
      if fid == 0:
1307
        if ftype == TType.I64:
1308
          self.success = iprot.readI64();
1309
        else:
1310
          iprot.skip(ftype)
1311
      elif fid == 1:
1312
        if ftype == TType.STRUCT:
1313
          self.e = PurchaseServiceException()
1314
          self.e.read(iprot)
1315
        else:
1316
          iprot.skip(ftype)
1317
      else:
1318
        iprot.skip(ftype)
1319
      iprot.readFieldEnd()
1320
    iprot.readStructEnd()
1321
 
1322
  def write(self, oprot):
1323
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1324
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1325
      return
1326
    oprot.writeStructBegin('closePurchase_result')
1327
    if self.success is not None:
1328
      oprot.writeFieldBegin('success', TType.I64, 0)
1329
      oprot.writeI64(self.success)
1330
      oprot.writeFieldEnd()
1331
    if self.e is not None:
1332
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1333
      self.e.write(oprot)
1334
      oprot.writeFieldEnd()
1335
    oprot.writeFieldStop()
1336
    oprot.writeStructEnd()
1337
 
1338
  def validate(self):
1339
    return
1340
 
1341
 
1342
  def __repr__(self):
1343
    L = ['%s=%r' % (key, value)
1344
      for key, value in self.__dict__.iteritems()]
1345
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1346
 
1347
  def __eq__(self, other):
1348
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1349
 
1350
  def __ne__(self, other):
1351
    return not (self == other)
1352
 
1353
class getAllPurchases_args:
1354
  """
1355
  Attributes:
1356
   - purchaseOrderId
1357
   - open
1358
  """
1359
 
1360
  thrift_spec = (
1361
    None, # 0
1362
    (1, TType.I64, 'purchaseOrderId', None, None, ), # 1
1363
    (2, TType.BOOL, 'open', None, None, ), # 2
1364
  )
1365
 
1366
  def __init__(self, purchaseOrderId=None, open=None,):
1367
    self.purchaseOrderId = purchaseOrderId
1368
    self.open = open
1369
 
1370
  def read(self, iprot):
1371
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1372
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1373
      return
1374
    iprot.readStructBegin()
1375
    while True:
1376
      (fname, ftype, fid) = iprot.readFieldBegin()
1377
      if ftype == TType.STOP:
1378
        break
1379
      if fid == 1:
1380
        if ftype == TType.I64:
1381
          self.purchaseOrderId = iprot.readI64();
1382
        else:
1383
          iprot.skip(ftype)
1384
      elif fid == 2:
1385
        if ftype == TType.BOOL:
1386
          self.open = iprot.readBool();
1387
        else:
1388
          iprot.skip(ftype)
1389
      else:
1390
        iprot.skip(ftype)
1391
      iprot.readFieldEnd()
1392
    iprot.readStructEnd()
1393
 
1394
  def write(self, oprot):
1395
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1396
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1397
      return
1398
    oprot.writeStructBegin('getAllPurchases_args')
1399
    if self.purchaseOrderId is not None:
1400
      oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)
1401
      oprot.writeI64(self.purchaseOrderId)
1402
      oprot.writeFieldEnd()
1403
    if self.open is not None:
1404
      oprot.writeFieldBegin('open', TType.BOOL, 2)
1405
      oprot.writeBool(self.open)
1406
      oprot.writeFieldEnd()
1407
    oprot.writeFieldStop()
1408
    oprot.writeStructEnd()
1409
 
1410
  def validate(self):
1411
    return
1412
 
1413
 
1414
  def __repr__(self):
1415
    L = ['%s=%r' % (key, value)
1416
      for key, value in self.__dict__.iteritems()]
1417
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1418
 
1419
  def __eq__(self, other):
1420
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1421
 
1422
  def __ne__(self, other):
1423
    return not (self == other)
1424
 
1425
class getAllPurchases_result:
1426
  """
1427
  Attributes:
1428
   - success
1429
   - e
1430
  """
1431
 
1432
  thrift_spec = (
1433
    (0, TType.LIST, 'success', (TType.STRUCT,(Purchase, Purchase.thrift_spec)), None, ), # 0
1434
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
1435
  )
1436
 
1437
  def __init__(self, success=None, e=None,):
1438
    self.success = success
1439
    self.e = e
1440
 
1441
  def read(self, iprot):
1442
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1443
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1444
      return
1445
    iprot.readStructBegin()
1446
    while True:
1447
      (fname, ftype, fid) = iprot.readFieldBegin()
1448
      if ftype == TType.STOP:
1449
        break
1450
      if fid == 0:
1451
        if ftype == TType.LIST:
1452
          self.success = []
1453
          (_etype17, _size14) = iprot.readListBegin()
1454
          for _i18 in xrange(_size14):
1455
            _elem19 = Purchase()
1456
            _elem19.read(iprot)
1457
            self.success.append(_elem19)
1458
          iprot.readListEnd()
1459
        else:
1460
          iprot.skip(ftype)
1461
      elif fid == 1:
1462
        if ftype == TType.STRUCT:
1463
          self.e = PurchaseServiceException()
1464
          self.e.read(iprot)
1465
        else:
1466
          iprot.skip(ftype)
1467
      else:
1468
        iprot.skip(ftype)
1469
      iprot.readFieldEnd()
1470
    iprot.readStructEnd()
1471
 
1472
  def write(self, oprot):
1473
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1474
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1475
      return
1476
    oprot.writeStructBegin('getAllPurchases_result')
1477
    if self.success is not None:
1478
      oprot.writeFieldBegin('success', TType.LIST, 0)
1479
      oprot.writeListBegin(TType.STRUCT, len(self.success))
1480
      for iter20 in self.success:
1481
        iter20.write(oprot)
1482
      oprot.writeListEnd()
1483
      oprot.writeFieldEnd()
1484
    if self.e is not None:
1485
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
1486
      self.e.write(oprot)
1487
      oprot.writeFieldEnd()
1488
    oprot.writeFieldStop()
1489
    oprot.writeStructEnd()
1490
 
1491
  def validate(self):
1492
    return
1493
 
1494
 
1495
  def __repr__(self):
1496
    L = ['%s=%r' % (key, value)
1497
      for key, value in self.__dict__.iteritems()]
1498
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1499
 
1500
  def __eq__(self, other):
1501
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1502
 
1503
  def __ne__(self, other):
1504
    return not (self == other)
1505
 
1506
class getPrice_args:
1507
  """
1508
  Attributes:
1509
   - purchaseId
1510
   - itemId
1511
  """
1512
 
1513
  thrift_spec = (
1514
    None, # 0
1515
    (1, TType.I64, 'purchaseId', None, None, ), # 1
1516
    (2, TType.I64, 'itemId', None, None, ), # 2
1517
  )
1518
 
1519
  def __init__(self, purchaseId=None, itemId=None,):
1520
    self.purchaseId = purchaseId
1521
    self.itemId = itemId
1522
 
1523
  def read(self, iprot):
1524
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1525
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1526
      return
1527
    iprot.readStructBegin()
1528
    while True:
1529
      (fname, ftype, fid) = iprot.readFieldBegin()
1530
      if ftype == TType.STOP:
1531
        break
1532
      if fid == 1:
1533
        if ftype == TType.I64:
1534
          self.purchaseId = iprot.readI64();
1535
        else:
1536
          iprot.skip(ftype)
1537
      elif fid == 2:
1538
        if ftype == TType.I64:
1539
          self.itemId = iprot.readI64();
1540
        else:
1541
          iprot.skip(ftype)
1542
      else:
1543
        iprot.skip(ftype)
1544
      iprot.readFieldEnd()
1545
    iprot.readStructEnd()
1546
 
1547
  def write(self, oprot):
1548
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1549
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1550
      return
1551
    oprot.writeStructBegin('getPrice_args')
1552
    if self.purchaseId is not None:
1553
      oprot.writeFieldBegin('purchaseId', TType.I64, 1)
1554
      oprot.writeI64(self.purchaseId)
1555
      oprot.writeFieldEnd()
1556
    if self.itemId is not None:
1557
      oprot.writeFieldBegin('itemId', TType.I64, 2)
1558
      oprot.writeI64(self.itemId)
1559
      oprot.writeFieldEnd()
1560
    oprot.writeFieldStop()
1561
    oprot.writeStructEnd()
1562
 
1563
  def validate(self):
1564
    return
1565
 
1566
 
1567
  def __repr__(self):
1568
    L = ['%s=%r' % (key, value)
1569
      for key, value in self.__dict__.iteritems()]
1570
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1571
 
1572
  def __eq__(self, other):
1573
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1574
 
1575
  def __ne__(self, other):
1576
    return not (self == other)
1577
 
1578
class getPrice_result:
1579
  """
1580
  Attributes:
1581
   - success
1582
  """
1583
 
1584
  thrift_spec = (
1585
    (0, TType.I64, 'success', None, None, ), # 0
1586
  )
1587
 
1588
  def __init__(self, success=None,):
1589
    self.success = success
1590
 
1591
  def read(self, iprot):
1592
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1593
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1594
      return
1595
    iprot.readStructBegin()
1596
    while True:
1597
      (fname, ftype, fid) = iprot.readFieldBegin()
1598
      if ftype == TType.STOP:
1599
        break
1600
      if fid == 0:
1601
        if ftype == TType.I64:
1602
          self.success = iprot.readI64();
1603
        else:
1604
          iprot.skip(ftype)
1605
      else:
1606
        iprot.skip(ftype)
1607
      iprot.readFieldEnd()
1608
    iprot.readStructEnd()
1609
 
1610
  def write(self, oprot):
1611
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1612
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1613
      return
1614
    oprot.writeStructBegin('getPrice_result')
1615
    if self.success is not None:
1616
      oprot.writeFieldBegin('success', TType.I64, 0)
1617
      oprot.writeI64(self.success)
1618
      oprot.writeFieldEnd()
1619
    oprot.writeFieldStop()
1620
    oprot.writeStructEnd()
1621
 
1622
  def validate(self):
1623
    return
1624
 
1625
 
1626
  def __repr__(self):
1627
    L = ['%s=%r' % (key, value)
1628
      for key, value in self.__dict__.iteritems()]
1629
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1630
 
1631
  def __eq__(self, other):
1632
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1633
 
1634
  def __ne__(self, other):
1635
    return not (self == other)