Subversion Repositories SmartDukaan

Rev

Rev 353 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
349 ashish 1
#
2
# Autogenerated by Thrift
3
#
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
#
6
 
7
from thrift.Thrift import *
8
from ttypes import *
9
from thrift.Thrift import TProcessor
10
from thrift.transport import TTransport
11
from thrift.protocol import TBinaryProtocol
12
try:
13
  from thrift.protocol import fastbinary
14
except:
15
  fastbinary = None
16
 
17
 
18
class Iface:
19
  def getLogisticsEstimation(self, itemId, location):
20
    """
21
    Parameters:
22
     - itemId
23
     - location
24
    """
25
    pass
26
 
27
  def sendMail(self, mail):
28
    """
29
    Parameters:
30
     - mail
31
    """
32
    pass
33
 
34
  def sendText(self, message):
35
    """
36
    Parameters:
37
     - message
38
    """
39
    pass
40
 
41
  def addMessage(self, message):
42
    """
43
    Parameters:
44
     - message
45
    """
46
    pass
47
 
48
  def updateMessage(self, id, message):
49
    """
50
    Parameters:
51
     - id
52
     - message
53
    """
54
    pass
55
 
56
  def getMessage(self, id):
57
    """
58
    Parameters:
59
     - id
60
    """
61
    pass
62
 
63
  def getSubstitutedMessage(self, id, params):
64
    """
65
    Parameters:
66
     - id
67
     - params
68
    """
69
    pass
70
 
71
 
72
class Client(Iface):
73
  def __init__(self, iprot, oprot=None):
74
    self._iprot = self._oprot = iprot
75
    if oprot != None:
76
      self._oprot = oprot
77
    self._seqid = 0
78
 
79
  def getLogisticsEstimation(self, itemId, location):
80
    """
81
    Parameters:
82
     - itemId
83
     - location
84
    """
85
    self.send_getLogisticsEstimation(itemId, location)
86
    return self.recv_getLogisticsEstimation()
87
 
88
  def send_getLogisticsEstimation(self, itemId, location):
89
    self._oprot.writeMessageBegin('getLogisticsEstimation', TMessageType.CALL, self._seqid)
90
    args = getLogisticsEstimation_args()
91
    args.itemId = itemId
92
    args.location = location
93
    args.write(self._oprot)
94
    self._oprot.writeMessageEnd()
95
    self._oprot.trans.flush()
96
 
97
  def recv_getLogisticsEstimation(self, ):
98
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
99
    if mtype == TMessageType.EXCEPTION:
100
      x = TApplicationException()
101
      x.read(self._iprot)
102
      self._iprot.readMessageEnd()
103
      raise x
104
    result = getLogisticsEstimation_result()
105
    result.read(self._iprot)
106
    self._iprot.readMessageEnd()
107
    if result.success != None:
108
      return result.success
109
    if result.se != None:
110
      raise result.se
111
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsEstimation failed: unknown result");
112
 
113
  def sendMail(self, mail):
114
    """
115
    Parameters:
116
     - mail
117
    """
118
    self.send_sendMail(mail)
119
    self.recv_sendMail()
120
 
121
  def send_sendMail(self, mail):
122
    self._oprot.writeMessageBegin('sendMail', TMessageType.CALL, self._seqid)
123
    args = sendMail_args()
124
    args.mail = mail
125
    args.write(self._oprot)
126
    self._oprot.writeMessageEnd()
127
    self._oprot.trans.flush()
128
 
129
  def recv_sendMail(self, ):
130
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
131
    if mtype == TMessageType.EXCEPTION:
132
      x = TApplicationException()
133
      x.read(self._iprot)
134
      self._iprot.readMessageEnd()
135
      raise x
136
    result = sendMail_result()
137
    result.read(self._iprot)
138
    self._iprot.readMessageEnd()
139
    if result.se != None:
140
      raise result.se
141
    return
142
 
143
  def sendText(self, message):
144
    """
145
    Parameters:
146
     - message
147
    """
148
    self.send_sendText(message)
149
    self.recv_sendText()
150
 
151
  def send_sendText(self, message):
152
    self._oprot.writeMessageBegin('sendText', TMessageType.CALL, self._seqid)
153
    args = sendText_args()
154
    args.message = message
155
    args.write(self._oprot)
156
    self._oprot.writeMessageEnd()
157
    self._oprot.trans.flush()
158
 
159
  def recv_sendText(self, ):
160
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
161
    if mtype == TMessageType.EXCEPTION:
162
      x = TApplicationException()
163
      x.read(self._iprot)
164
      self._iprot.readMessageEnd()
165
      raise x
166
    result = sendText_result()
167
    result.read(self._iprot)
168
    self._iprot.readMessageEnd()
169
    if result.se != None:
170
      raise result.se
171
    return
172
 
173
  def addMessage(self, message):
174
    """
175
    Parameters:
176
     - message
177
    """
178
    self.send_addMessage(message)
179
    self.recv_addMessage()
180
 
181
  def send_addMessage(self, message):
182
    self._oprot.writeMessageBegin('addMessage', TMessageType.CALL, self._seqid)
183
    args = addMessage_args()
184
    args.message = message
185
    args.write(self._oprot)
186
    self._oprot.writeMessageEnd()
187
    self._oprot.trans.flush()
188
 
189
  def recv_addMessage(self, ):
190
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
191
    if mtype == TMessageType.EXCEPTION:
192
      x = TApplicationException()
193
      x.read(self._iprot)
194
      self._iprot.readMessageEnd()
195
      raise x
196
    result = addMessage_result()
197
    result.read(self._iprot)
198
    self._iprot.readMessageEnd()
199
    if result.se != None:
200
      raise result.se
201
    return
202
 
203
  def updateMessage(self, id, message):
204
    """
205
    Parameters:
206
     - id
207
     - message
208
    """
209
    self.send_updateMessage(id, message)
210
    self.recv_updateMessage()
211
 
212
  def send_updateMessage(self, id, message):
213
    self._oprot.writeMessageBegin('updateMessage', TMessageType.CALL, self._seqid)
214
    args = updateMessage_args()
215
    args.id = id
216
    args.message = message
217
    args.write(self._oprot)
218
    self._oprot.writeMessageEnd()
219
    self._oprot.trans.flush()
220
 
221
  def recv_updateMessage(self, ):
222
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
223
    if mtype == TMessageType.EXCEPTION:
224
      x = TApplicationException()
225
      x.read(self._iprot)
226
      self._iprot.readMessageEnd()
227
      raise x
228
    result = updateMessage_result()
229
    result.read(self._iprot)
230
    self._iprot.readMessageEnd()
231
    if result.se != None:
232
      raise result.se
233
    return
234
 
235
  def getMessage(self, id):
236
    """
237
    Parameters:
238
     - id
239
    """
240
    self.send_getMessage(id)
241
    self.recv_getMessage()
242
 
243
  def send_getMessage(self, id):
244
    self._oprot.writeMessageBegin('getMessage', TMessageType.CALL, self._seqid)
245
    args = getMessage_args()
246
    args.id = id
247
    args.write(self._oprot)
248
    self._oprot.writeMessageEnd()
249
    self._oprot.trans.flush()
250
 
251
  def recv_getMessage(self, ):
252
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
253
    if mtype == TMessageType.EXCEPTION:
254
      x = TApplicationException()
255
      x.read(self._iprot)
256
      self._iprot.readMessageEnd()
257
      raise x
258
    result = getMessage_result()
259
    result.read(self._iprot)
260
    self._iprot.readMessageEnd()
261
    if result.se != None:
262
      raise result.se
263
    return
264
 
265
  def getSubstitutedMessage(self, id, params):
266
    """
267
    Parameters:
268
     - id
269
     - params
270
    """
271
    self.send_getSubstitutedMessage(id, params)
272
    self.recv_getSubstitutedMessage()
273
 
274
  def send_getSubstitutedMessage(self, id, params):
275
    self._oprot.writeMessageBegin('getSubstitutedMessage', TMessageType.CALL, self._seqid)
276
    args = getSubstitutedMessage_args()
277
    args.id = id
278
    args.params = params
279
    args.write(self._oprot)
280
    self._oprot.writeMessageEnd()
281
    self._oprot.trans.flush()
282
 
283
  def recv_getSubstitutedMessage(self, ):
284
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
285
    if mtype == TMessageType.EXCEPTION:
286
      x = TApplicationException()
287
      x.read(self._iprot)
288
      self._iprot.readMessageEnd()
289
      raise x
290
    result = getSubstitutedMessage_result()
291
    result.read(self._iprot)
292
    self._iprot.readMessageEnd()
293
    if result.se != None:
294
      raise result.se
295
    return
296
 
297
 
298
class Processor(Iface, TProcessor):
299
  def __init__(self, handler):
300
    self._handler = handler
301
    self._processMap = {}
302
    self._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimation
303
    self._processMap["sendMail"] = Processor.process_sendMail
304
    self._processMap["sendText"] = Processor.process_sendText
305
    self._processMap["addMessage"] = Processor.process_addMessage
306
    self._processMap["updateMessage"] = Processor.process_updateMessage
307
    self._processMap["getMessage"] = Processor.process_getMessage
308
    self._processMap["getSubstitutedMessage"] = Processor.process_getSubstitutedMessage
309
 
310
  def process(self, iprot, oprot):
311
    (name, type, seqid) = iprot.readMessageBegin()
312
    if name not in self._processMap:
313
      iprot.skip(TType.STRUCT)
314
      iprot.readMessageEnd()
315
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
316
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
317
      x.write(oprot)
318
      oprot.writeMessageEnd()
319
      oprot.trans.flush()
320
      return
321
    else:
322
      self._processMap[name](self, seqid, iprot, oprot)
323
    return True
324
 
325
  def process_getLogisticsEstimation(self, seqid, iprot, oprot):
326
    args = getLogisticsEstimation_args()
327
    args.read(iprot)
328
    iprot.readMessageEnd()
329
    result = getLogisticsEstimation_result()
330
    try:
331
      result.success = self._handler.getLogisticsEstimation(args.itemId, args.location)
332
    except HelperServiceException, se:
333
      result.se = se
334
    oprot.writeMessageBegin("getLogisticsEstimation", TMessageType.REPLY, seqid)
335
    result.write(oprot)
336
    oprot.writeMessageEnd()
337
    oprot.trans.flush()
338
 
339
  def process_sendMail(self, seqid, iprot, oprot):
340
    args = sendMail_args()
341
    args.read(iprot)
342
    iprot.readMessageEnd()
343
    result = sendMail_result()
344
    try:
345
      self._handler.sendMail(args.mail)
346
    except HelperServiceException, se:
347
      result.se = se
348
    oprot.writeMessageBegin("sendMail", TMessageType.REPLY, seqid)
349
    result.write(oprot)
350
    oprot.writeMessageEnd()
351
    oprot.trans.flush()
352
 
353
  def process_sendText(self, seqid, iprot, oprot):
354
    args = sendText_args()
355
    args.read(iprot)
356
    iprot.readMessageEnd()
357
    result = sendText_result()
358
    try:
359
      self._handler.sendText(args.message)
360
    except HelperServiceException, se:
361
      result.se = se
362
    oprot.writeMessageBegin("sendText", TMessageType.REPLY, seqid)
363
    result.write(oprot)
364
    oprot.writeMessageEnd()
365
    oprot.trans.flush()
366
 
367
  def process_addMessage(self, seqid, iprot, oprot):
368
    args = addMessage_args()
369
    args.read(iprot)
370
    iprot.readMessageEnd()
371
    result = addMessage_result()
372
    try:
373
      self._handler.addMessage(args.message)
374
    except HelperServiceException, se:
375
      result.se = se
376
    oprot.writeMessageBegin("addMessage", TMessageType.REPLY, seqid)
377
    result.write(oprot)
378
    oprot.writeMessageEnd()
379
    oprot.trans.flush()
380
 
381
  def process_updateMessage(self, seqid, iprot, oprot):
382
    args = updateMessage_args()
383
    args.read(iprot)
384
    iprot.readMessageEnd()
385
    result = updateMessage_result()
386
    try:
387
      self._handler.updateMessage(args.id, args.message)
388
    except HelperServiceException, se:
389
      result.se = se
390
    oprot.writeMessageBegin("updateMessage", TMessageType.REPLY, seqid)
391
    result.write(oprot)
392
    oprot.writeMessageEnd()
393
    oprot.trans.flush()
394
 
395
  def process_getMessage(self, seqid, iprot, oprot):
396
    args = getMessage_args()
397
    args.read(iprot)
398
    iprot.readMessageEnd()
399
    result = getMessage_result()
400
    try:
401
      self._handler.getMessage(args.id)
402
    except HelperServiceException, se:
403
      result.se = se
404
    oprot.writeMessageBegin("getMessage", TMessageType.REPLY, seqid)
405
    result.write(oprot)
406
    oprot.writeMessageEnd()
407
    oprot.trans.flush()
408
 
409
  def process_getSubstitutedMessage(self, seqid, iprot, oprot):
410
    args = getSubstitutedMessage_args()
411
    args.read(iprot)
412
    iprot.readMessageEnd()
413
    result = getSubstitutedMessage_result()
414
    try:
415
      self._handler.getSubstitutedMessage(args.id, args.params)
416
    except HelperServiceException, se:
417
      result.se = se
418
    oprot.writeMessageBegin("getSubstitutedMessage", TMessageType.REPLY, seqid)
419
    result.write(oprot)
420
    oprot.writeMessageEnd()
421
    oprot.trans.flush()
422
 
423
 
424
# HELPER FUNCTIONS AND STRUCTURES
425
 
426
class getLogisticsEstimation_args:
427
  """
428
  Attributes:
429
   - itemId
430
   - location
431
  """
432
 
433
  thrift_spec = (
434
    None, # 0
435
    (1, TType.I64, 'itemId', None, None, ), # 1
436
    (2, TType.MAP, 'location', (TType.STRING,None,TType.STRING,None), None, ), # 2
437
  )
438
 
439
  def __init__(self, itemId=None, location=None,):
440
    self.itemId = itemId
441
    self.location = location
442
 
443
  def read(self, iprot):
444
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
445
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
446
      return
447
    iprot.readStructBegin()
448
    while True:
449
      (fname, ftype, fid) = iprot.readFieldBegin()
450
      if ftype == TType.STOP:
451
        break
452
      if fid == 1:
453
        if ftype == TType.I64:
454
          self.itemId = iprot.readI64();
455
        else:
456
          iprot.skip(ftype)
457
      elif fid == 2:
458
        if ftype == TType.MAP:
459
          self.location = {}
460
          (_ktype8, _vtype9, _size7 ) = iprot.readMapBegin() 
461
          for _i11 in xrange(_size7):
462
            _key12 = iprot.readString();
463
            _val13 = iprot.readString();
464
            self.location[_key12] = _val13
465
          iprot.readMapEnd()
466
        else:
467
          iprot.skip(ftype)
468
      else:
469
        iprot.skip(ftype)
470
      iprot.readFieldEnd()
471
    iprot.readStructEnd()
472
 
473
  def write(self, oprot):
474
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
475
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
476
      return
477
    oprot.writeStructBegin('getLogisticsEstimation_args')
478
    if self.itemId != None:
479
      oprot.writeFieldBegin('itemId', TType.I64, 1)
480
      oprot.writeI64(self.itemId)
481
      oprot.writeFieldEnd()
482
    if self.location != None:
483
      oprot.writeFieldBegin('location', TType.MAP, 2)
484
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.location))
485
      for kiter14,viter15 in self.location.items():
486
        oprot.writeString(kiter14)
487
        oprot.writeString(viter15)
488
      oprot.writeMapEnd()
489
      oprot.writeFieldEnd()
490
    oprot.writeFieldStop()
491
    oprot.writeStructEnd()
492
 
493
  def __repr__(self):
494
    L = ['%s=%r' % (key, value)
495
      for key, value in self.__dict__.iteritems()]
496
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
497
 
498
  def __eq__(self, other):
499
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
500
 
501
  def __ne__(self, other):
502
    return not (self == other)
503
 
504
class getLogisticsEstimation_result:
505
  """
506
  Attributes:
507
   - success
508
   - se
509
  """
510
 
511
  thrift_spec = (
512
    (0, TType.LIST, 'success', (TType.STRUCT,(ItemLogistics, ItemLogistics.thrift_spec)), None, ), # 0
513
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
514
  )
515
 
516
  def __init__(self, success=None, se=None,):
517
    self.success = success
518
    self.se = se
519
 
520
  def read(self, iprot):
521
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
522
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
523
      return
524
    iprot.readStructBegin()
525
    while True:
526
      (fname, ftype, fid) = iprot.readFieldBegin()
527
      if ftype == TType.STOP:
528
        break
529
      if fid == 0:
530
        if ftype == TType.LIST:
531
          self.success = []
532
          (_etype19, _size16) = iprot.readListBegin()
533
          for _i20 in xrange(_size16):
534
            _elem21 = ItemLogistics()
535
            _elem21.read(iprot)
536
            self.success.append(_elem21)
537
          iprot.readListEnd()
538
        else:
539
          iprot.skip(ftype)
540
      elif fid == 1:
541
        if ftype == TType.STRUCT:
542
          self.se = HelperServiceException()
543
          self.se.read(iprot)
544
        else:
545
          iprot.skip(ftype)
546
      else:
547
        iprot.skip(ftype)
548
      iprot.readFieldEnd()
549
    iprot.readStructEnd()
550
 
551
  def write(self, oprot):
552
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
553
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
554
      return
555
    oprot.writeStructBegin('getLogisticsEstimation_result')
556
    if self.success != None:
557
      oprot.writeFieldBegin('success', TType.LIST, 0)
558
      oprot.writeListBegin(TType.STRUCT, len(self.success))
559
      for iter22 in self.success:
560
        iter22.write(oprot)
561
      oprot.writeListEnd()
562
      oprot.writeFieldEnd()
563
    if self.se != None:
564
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
565
      self.se.write(oprot)
566
      oprot.writeFieldEnd()
567
    oprot.writeFieldStop()
568
    oprot.writeStructEnd()
569
 
570
  def __repr__(self):
571
    L = ['%s=%r' % (key, value)
572
      for key, value in self.__dict__.iteritems()]
573
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
574
 
575
  def __eq__(self, other):
576
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
577
 
578
  def __ne__(self, other):
579
    return not (self == other)
580
 
581
class sendMail_args:
582
  """
583
  Attributes:
584
   - mail
585
  """
586
 
587
  thrift_spec = (
588
    None, # 0
589
    (1, TType.STRUCT, 'mail', (Mail, Mail.thrift_spec), None, ), # 1
590
  )
591
 
592
  def __init__(self, mail=None,):
593
    self.mail = mail
594
 
595
  def read(self, iprot):
596
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
597
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
598
      return
599
    iprot.readStructBegin()
600
    while True:
601
      (fname, ftype, fid) = iprot.readFieldBegin()
602
      if ftype == TType.STOP:
603
        break
604
      if fid == 1:
605
        if ftype == TType.STRUCT:
606
          self.mail = Mail()
607
          self.mail.read(iprot)
608
        else:
609
          iprot.skip(ftype)
610
      else:
611
        iprot.skip(ftype)
612
      iprot.readFieldEnd()
613
    iprot.readStructEnd()
614
 
615
  def write(self, oprot):
616
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
617
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
618
      return
619
    oprot.writeStructBegin('sendMail_args')
620
    if self.mail != None:
621
      oprot.writeFieldBegin('mail', TType.STRUCT, 1)
622
      self.mail.write(oprot)
623
      oprot.writeFieldEnd()
624
    oprot.writeFieldStop()
625
    oprot.writeStructEnd()
626
 
627
  def __repr__(self):
628
    L = ['%s=%r' % (key, value)
629
      for key, value in self.__dict__.iteritems()]
630
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
631
 
632
  def __eq__(self, other):
633
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
634
 
635
  def __ne__(self, other):
636
    return not (self == other)
637
 
638
class sendMail_result:
639
  """
640
  Attributes:
641
   - se
642
  """
643
 
644
  thrift_spec = (
645
    None, # 0
646
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
647
  )
648
 
649
  def __init__(self, se=None,):
650
    self.se = se
651
 
652
  def read(self, iprot):
653
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
654
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
655
      return
656
    iprot.readStructBegin()
657
    while True:
658
      (fname, ftype, fid) = iprot.readFieldBegin()
659
      if ftype == TType.STOP:
660
        break
661
      if fid == 1:
662
        if ftype == TType.STRUCT:
663
          self.se = HelperServiceException()
664
          self.se.read(iprot)
665
        else:
666
          iprot.skip(ftype)
667
      else:
668
        iprot.skip(ftype)
669
      iprot.readFieldEnd()
670
    iprot.readStructEnd()
671
 
672
  def write(self, oprot):
673
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
674
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
675
      return
676
    oprot.writeStructBegin('sendMail_result')
677
    if self.se != None:
678
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
679
      self.se.write(oprot)
680
      oprot.writeFieldEnd()
681
    oprot.writeFieldStop()
682
    oprot.writeStructEnd()
683
 
684
  def __repr__(self):
685
    L = ['%s=%r' % (key, value)
686
      for key, value in self.__dict__.iteritems()]
687
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
688
 
689
  def __eq__(self, other):
690
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
691
 
692
  def __ne__(self, other):
693
    return not (self == other)
694
 
695
class sendText_args:
696
  """
697
  Attributes:
698
   - message
699
  """
700
 
701
  thrift_spec = (
702
    None, # 0
703
    (1, TType.STRUCT, 'message', (TextMessage, TextMessage.thrift_spec), None, ), # 1
704
  )
705
 
706
  def __init__(self, message=None,):
707
    self.message = message
708
 
709
  def read(self, iprot):
710
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
711
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
712
      return
713
    iprot.readStructBegin()
714
    while True:
715
      (fname, ftype, fid) = iprot.readFieldBegin()
716
      if ftype == TType.STOP:
717
        break
718
      if fid == 1:
719
        if ftype == TType.STRUCT:
720
          self.message = TextMessage()
721
          self.message.read(iprot)
722
        else:
723
          iprot.skip(ftype)
724
      else:
725
        iprot.skip(ftype)
726
      iprot.readFieldEnd()
727
    iprot.readStructEnd()
728
 
729
  def write(self, oprot):
730
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
731
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
732
      return
733
    oprot.writeStructBegin('sendText_args')
734
    if self.message != None:
735
      oprot.writeFieldBegin('message', TType.STRUCT, 1)
736
      self.message.write(oprot)
737
      oprot.writeFieldEnd()
738
    oprot.writeFieldStop()
739
    oprot.writeStructEnd()
740
 
741
  def __repr__(self):
742
    L = ['%s=%r' % (key, value)
743
      for key, value in self.__dict__.iteritems()]
744
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
745
 
746
  def __eq__(self, other):
747
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
748
 
749
  def __ne__(self, other):
750
    return not (self == other)
751
 
752
class sendText_result:
753
  """
754
  Attributes:
755
   - se
756
  """
757
 
758
  thrift_spec = (
759
    None, # 0
760
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
761
  )
762
 
763
  def __init__(self, se=None,):
764
    self.se = se
765
 
766
  def read(self, iprot):
767
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
768
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
769
      return
770
    iprot.readStructBegin()
771
    while True:
772
      (fname, ftype, fid) = iprot.readFieldBegin()
773
      if ftype == TType.STOP:
774
        break
775
      if fid == 1:
776
        if ftype == TType.STRUCT:
777
          self.se = HelperServiceException()
778
          self.se.read(iprot)
779
        else:
780
          iprot.skip(ftype)
781
      else:
782
        iprot.skip(ftype)
783
      iprot.readFieldEnd()
784
    iprot.readStructEnd()
785
 
786
  def write(self, oprot):
787
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
788
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
789
      return
790
    oprot.writeStructBegin('sendText_result')
791
    if self.se != None:
792
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
793
      self.se.write(oprot)
794
      oprot.writeFieldEnd()
795
    oprot.writeFieldStop()
796
    oprot.writeStructEnd()
797
 
798
  def __repr__(self):
799
    L = ['%s=%r' % (key, value)
800
      for key, value in self.__dict__.iteritems()]
801
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
802
 
803
  def __eq__(self, other):
804
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
805
 
806
  def __ne__(self, other):
807
    return not (self == other)
808
 
809
class addMessage_args:
810
  """
811
  Attributes:
812
   - message
813
  """
814
 
815
  thrift_spec = (
816
    None, # 0
817
    (1, TType.STRUCT, 'message', (Message, Message.thrift_spec), None, ), # 1
818
  )
819
 
820
  def __init__(self, message=None,):
821
    self.message = message
822
 
823
  def read(self, iprot):
824
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
825
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
826
      return
827
    iprot.readStructBegin()
828
    while True:
829
      (fname, ftype, fid) = iprot.readFieldBegin()
830
      if ftype == TType.STOP:
831
        break
832
      if fid == 1:
833
        if ftype == TType.STRUCT:
834
          self.message = Message()
835
          self.message.read(iprot)
836
        else:
837
          iprot.skip(ftype)
838
      else:
839
        iprot.skip(ftype)
840
      iprot.readFieldEnd()
841
    iprot.readStructEnd()
842
 
843
  def write(self, oprot):
844
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
845
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
846
      return
847
    oprot.writeStructBegin('addMessage_args')
848
    if self.message != None:
849
      oprot.writeFieldBegin('message', TType.STRUCT, 1)
850
      self.message.write(oprot)
851
      oprot.writeFieldEnd()
852
    oprot.writeFieldStop()
853
    oprot.writeStructEnd()
854
 
855
  def __repr__(self):
856
    L = ['%s=%r' % (key, value)
857
      for key, value in self.__dict__.iteritems()]
858
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
859
 
860
  def __eq__(self, other):
861
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
862
 
863
  def __ne__(self, other):
864
    return not (self == other)
865
 
866
class addMessage_result:
867
  """
868
  Attributes:
869
   - se
870
  """
871
 
872
  thrift_spec = (
873
    None, # 0
874
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
875
  )
876
 
877
  def __init__(self, se=None,):
878
    self.se = se
879
 
880
  def read(self, iprot):
881
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
882
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
883
      return
884
    iprot.readStructBegin()
885
    while True:
886
      (fname, ftype, fid) = iprot.readFieldBegin()
887
      if ftype == TType.STOP:
888
        break
889
      if fid == 1:
890
        if ftype == TType.STRUCT:
891
          self.se = HelperServiceException()
892
          self.se.read(iprot)
893
        else:
894
          iprot.skip(ftype)
895
      else:
896
        iprot.skip(ftype)
897
      iprot.readFieldEnd()
898
    iprot.readStructEnd()
899
 
900
  def write(self, oprot):
901
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
902
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
903
      return
904
    oprot.writeStructBegin('addMessage_result')
905
    if self.se != None:
906
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
907
      self.se.write(oprot)
908
      oprot.writeFieldEnd()
909
    oprot.writeFieldStop()
910
    oprot.writeStructEnd()
911
 
912
  def __repr__(self):
913
    L = ['%s=%r' % (key, value)
914
      for key, value in self.__dict__.iteritems()]
915
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
916
 
917
  def __eq__(self, other):
918
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
919
 
920
  def __ne__(self, other):
921
    return not (self == other)
922
 
923
class updateMessage_args:
924
  """
925
  Attributes:
926
   - id
927
   - message
928
  """
929
 
930
  thrift_spec = (
931
    None, # 0
932
    (1, TType.I64, 'id', None, None, ), # 1
933
    (2, TType.STRING, 'message', None, None, ), # 2
934
  )
935
 
936
  def __init__(self, id=None, message=None,):
937
    self.id = id
938
    self.message = message
939
 
940
  def read(self, iprot):
941
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
942
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
943
      return
944
    iprot.readStructBegin()
945
    while True:
946
      (fname, ftype, fid) = iprot.readFieldBegin()
947
      if ftype == TType.STOP:
948
        break
949
      if fid == 1:
950
        if ftype == TType.I64:
951
          self.id = iprot.readI64();
952
        else:
953
          iprot.skip(ftype)
954
      elif fid == 2:
955
        if ftype == TType.STRING:
956
          self.message = iprot.readString();
957
        else:
958
          iprot.skip(ftype)
959
      else:
960
        iprot.skip(ftype)
961
      iprot.readFieldEnd()
962
    iprot.readStructEnd()
963
 
964
  def write(self, oprot):
965
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
966
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
967
      return
968
    oprot.writeStructBegin('updateMessage_args')
969
    if self.id != None:
970
      oprot.writeFieldBegin('id', TType.I64, 1)
971
      oprot.writeI64(self.id)
972
      oprot.writeFieldEnd()
973
    if self.message != None:
974
      oprot.writeFieldBegin('message', TType.STRING, 2)
975
      oprot.writeString(self.message)
976
      oprot.writeFieldEnd()
977
    oprot.writeFieldStop()
978
    oprot.writeStructEnd()
979
 
980
  def __repr__(self):
981
    L = ['%s=%r' % (key, value)
982
      for key, value in self.__dict__.iteritems()]
983
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
984
 
985
  def __eq__(self, other):
986
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
987
 
988
  def __ne__(self, other):
989
    return not (self == other)
990
 
991
class updateMessage_result:
992
  """
993
  Attributes:
994
   - se
995
  """
996
 
997
  thrift_spec = (
998
    None, # 0
999
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
1000
  )
1001
 
1002
  def __init__(self, se=None,):
1003
    self.se = se
1004
 
1005
  def read(self, iprot):
1006
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1007
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1008
      return
1009
    iprot.readStructBegin()
1010
    while True:
1011
      (fname, ftype, fid) = iprot.readFieldBegin()
1012
      if ftype == TType.STOP:
1013
        break
1014
      if fid == 1:
1015
        if ftype == TType.STRUCT:
1016
          self.se = HelperServiceException()
1017
          self.se.read(iprot)
1018
        else:
1019
          iprot.skip(ftype)
1020
      else:
1021
        iprot.skip(ftype)
1022
      iprot.readFieldEnd()
1023
    iprot.readStructEnd()
1024
 
1025
  def write(self, oprot):
1026
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1027
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1028
      return
1029
    oprot.writeStructBegin('updateMessage_result')
1030
    if self.se != None:
1031
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1032
      self.se.write(oprot)
1033
      oprot.writeFieldEnd()
1034
    oprot.writeFieldStop()
1035
    oprot.writeStructEnd()
1036
 
1037
  def __repr__(self):
1038
    L = ['%s=%r' % (key, value)
1039
      for key, value in self.__dict__.iteritems()]
1040
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1041
 
1042
  def __eq__(self, other):
1043
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1044
 
1045
  def __ne__(self, other):
1046
    return not (self == other)
1047
 
1048
class getMessage_args:
1049
  """
1050
  Attributes:
1051
   - id
1052
  """
1053
 
1054
  thrift_spec = (
1055
    None, # 0
1056
    (1, TType.I64, 'id', None, None, ), # 1
1057
  )
1058
 
1059
  def __init__(self, id=None,):
1060
    self.id = id
1061
 
1062
  def read(self, iprot):
1063
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1064
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1065
      return
1066
    iprot.readStructBegin()
1067
    while True:
1068
      (fname, ftype, fid) = iprot.readFieldBegin()
1069
      if ftype == TType.STOP:
1070
        break
1071
      if fid == 1:
1072
        if ftype == TType.I64:
1073
          self.id = iprot.readI64();
1074
        else:
1075
          iprot.skip(ftype)
1076
      else:
1077
        iprot.skip(ftype)
1078
      iprot.readFieldEnd()
1079
    iprot.readStructEnd()
1080
 
1081
  def write(self, oprot):
1082
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1083
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1084
      return
1085
    oprot.writeStructBegin('getMessage_args')
1086
    if self.id != None:
1087
      oprot.writeFieldBegin('id', TType.I64, 1)
1088
      oprot.writeI64(self.id)
1089
      oprot.writeFieldEnd()
1090
    oprot.writeFieldStop()
1091
    oprot.writeStructEnd()
1092
 
1093
  def __repr__(self):
1094
    L = ['%s=%r' % (key, value)
1095
      for key, value in self.__dict__.iteritems()]
1096
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1097
 
1098
  def __eq__(self, other):
1099
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1100
 
1101
  def __ne__(self, other):
1102
    return not (self == other)
1103
 
1104
class getMessage_result:
1105
  """
1106
  Attributes:
1107
   - se
1108
  """
1109
 
1110
  thrift_spec = (
1111
    None, # 0
1112
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
1113
  )
1114
 
1115
  def __init__(self, se=None,):
1116
    self.se = se
1117
 
1118
  def read(self, iprot):
1119
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1120
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1121
      return
1122
    iprot.readStructBegin()
1123
    while True:
1124
      (fname, ftype, fid) = iprot.readFieldBegin()
1125
      if ftype == TType.STOP:
1126
        break
1127
      if fid == 1:
1128
        if ftype == TType.STRUCT:
1129
          self.se = HelperServiceException()
1130
          self.se.read(iprot)
1131
        else:
1132
          iprot.skip(ftype)
1133
      else:
1134
        iprot.skip(ftype)
1135
      iprot.readFieldEnd()
1136
    iprot.readStructEnd()
1137
 
1138
  def write(self, oprot):
1139
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1140
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1141
      return
1142
    oprot.writeStructBegin('getMessage_result')
1143
    if self.se != None:
1144
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1145
      self.se.write(oprot)
1146
      oprot.writeFieldEnd()
1147
    oprot.writeFieldStop()
1148
    oprot.writeStructEnd()
1149
 
1150
  def __repr__(self):
1151
    L = ['%s=%r' % (key, value)
1152
      for key, value in self.__dict__.iteritems()]
1153
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1154
 
1155
  def __eq__(self, other):
1156
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1157
 
1158
  def __ne__(self, other):
1159
    return not (self == other)
1160
 
1161
class getSubstitutedMessage_args:
1162
  """
1163
  Attributes:
1164
   - id
1165
   - params
1166
  """
1167
 
1168
  thrift_spec = (
1169
    None, # 0
1170
    (1, TType.I64, 'id', None, None, ), # 1
1171
    (2, TType.MAP, 'params', (TType.STRING,None,TType.STRING,None), None, ), # 2
1172
  )
1173
 
1174
  def __init__(self, id=None, params=None,):
1175
    self.id = id
1176
    self.params = params
1177
 
1178
  def read(self, iprot):
1179
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1180
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1181
      return
1182
    iprot.readStructBegin()
1183
    while True:
1184
      (fname, ftype, fid) = iprot.readFieldBegin()
1185
      if ftype == TType.STOP:
1186
        break
1187
      if fid == 1:
1188
        if ftype == TType.I64:
1189
          self.id = iprot.readI64();
1190
        else:
1191
          iprot.skip(ftype)
1192
      elif fid == 2:
1193
        if ftype == TType.MAP:
1194
          self.params = {}
1195
          (_ktype24, _vtype25, _size23 ) = iprot.readMapBegin() 
1196
          for _i27 in xrange(_size23):
1197
            _key28 = iprot.readString();
1198
            _val29 = iprot.readString();
1199
            self.params[_key28] = _val29
1200
          iprot.readMapEnd()
1201
        else:
1202
          iprot.skip(ftype)
1203
      else:
1204
        iprot.skip(ftype)
1205
      iprot.readFieldEnd()
1206
    iprot.readStructEnd()
1207
 
1208
  def write(self, oprot):
1209
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1210
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1211
      return
1212
    oprot.writeStructBegin('getSubstitutedMessage_args')
1213
    if self.id != None:
1214
      oprot.writeFieldBegin('id', TType.I64, 1)
1215
      oprot.writeI64(self.id)
1216
      oprot.writeFieldEnd()
1217
    if self.params != None:
1218
      oprot.writeFieldBegin('params', TType.MAP, 2)
1219
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.params))
1220
      for kiter30,viter31 in self.params.items():
1221
        oprot.writeString(kiter30)
1222
        oprot.writeString(viter31)
1223
      oprot.writeMapEnd()
1224
      oprot.writeFieldEnd()
1225
    oprot.writeFieldStop()
1226
    oprot.writeStructEnd()
1227
 
1228
  def __repr__(self):
1229
    L = ['%s=%r' % (key, value)
1230
      for key, value in self.__dict__.iteritems()]
1231
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1232
 
1233
  def __eq__(self, other):
1234
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1235
 
1236
  def __ne__(self, other):
1237
    return not (self == other)
1238
 
1239
class getSubstitutedMessage_result:
1240
  """
1241
  Attributes:
1242
   - se
1243
  """
1244
 
1245
  thrift_spec = (
1246
    None, # 0
1247
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
1248
  )
1249
 
1250
  def __init__(self, se=None,):
1251
    self.se = se
1252
 
1253
  def read(self, iprot):
1254
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1255
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1256
      return
1257
    iprot.readStructBegin()
1258
    while True:
1259
      (fname, ftype, fid) = iprot.readFieldBegin()
1260
      if ftype == TType.STOP:
1261
        break
1262
      if fid == 1:
1263
        if ftype == TType.STRUCT:
1264
          self.se = HelperServiceException()
1265
          self.se.read(iprot)
1266
        else:
1267
          iprot.skip(ftype)
1268
      else:
1269
        iprot.skip(ftype)
1270
      iprot.readFieldEnd()
1271
    iprot.readStructEnd()
1272
 
1273
  def write(self, oprot):
1274
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1275
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1276
      return
1277
    oprot.writeStructBegin('getSubstitutedMessage_result')
1278
    if self.se != None:
1279
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1280
      self.se.write(oprot)
1281
      oprot.writeFieldEnd()
1282
    oprot.writeFieldStop()
1283
    oprot.writeStructEnd()
1284
 
1285
  def __repr__(self):
1286
    L = ['%s=%r' % (key, value)
1287
      for key, value in self.__dict__.iteritems()]
1288
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1289
 
1290
  def __eq__(self, other):
1291
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1292
 
1293
  def __ne__(self, other):
1294
    return not (self == other)
1295
 
1296