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