Subversion Repositories SmartDukaan

Rev

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