9 from thrift.Thrift
import TType, TMessageType, TFrozenDict, TException, TApplicationException
10 from thrift.protocol.TProtocol
import TProtocolException
11 from thrift.TRecursive
import fix_spec
15 from thrift.transport
import TTransport
62 def __init__(self, type=None, hints=None, replaced=None,):
68 if iprot._fast_decode
is not None and isinstance(iprot.trans, TTransport.CReadableTransport)
and self.thrift_spec
is not None:
69 iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
71 iprot.readStructBegin()
73 (fname, ftype, fid) = iprot.readFieldBegin()
74 if ftype == TType.STOP:
77 if ftype == TType.I32:
78 self.
type = iprot.readI32()
82 if ftype == TType.LIST:
84 (_etype3, _size0) = iprot.readListBegin()
85 for _i4
in range(_size0):
86 _elem5 = iprot.readString().decode(
'utf-8', errors=
'replace')
if sys.version_info[0] == 2
else iprot.readString()
87 self.hints.append(_elem5)
92 if ftype == TType.STRING:
93 self.
replaced = iprot.readString().decode(
'utf-8', errors=
'replace')
if sys.version_info[0] == 2
else iprot.readString()
102 if oprot._fast_encode
is not None and self.thrift_spec
is not None:
103 oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
105 oprot.writeStructBegin(
'TCompletionHint')
106 if self.
type is not None:
107 oprot.writeFieldBegin(
'type', TType.I32, 1)
108 oprot.writeI32(self.
type)
109 oprot.writeFieldEnd()
110 if self.
hints is not None:
111 oprot.writeFieldBegin(
'hints', TType.LIST, 2)
112 oprot.writeListBegin(TType.STRING, len(self.
hints))
113 for iter6
in self.
hints:
114 oprot.writeString(iter6.encode(
'utf-8')
if sys.version_info[0] == 2
else iter6)
116 oprot.writeFieldEnd()
118 oprot.writeFieldBegin(
'replaced', TType.STRING, 3)
119 oprot.writeString(self.replaced.encode(
'utf-8')
if sys.version_info[0] == 2
else self.
replaced)
120 oprot.writeFieldEnd()
121 oprot.writeFieldStop()
122 oprot.writeStructEnd()
128 L = [
'%s=%r' % (key, value)
129 for key, value
in self.__dict__.items()]
130 return '%s(%s)' % (self.__class__.__name__,
', '.
join(L))
133 return isinstance(other, self.__class__)
and self.
__dict__ == other.__dict__
136 return not (self == other)
137 all_structs.append(TCompletionHint)
138 TCompletionHint.thrift_spec = (
140 (1, TType.I32,
'type',
None,
None, ),
141 (2, TType.LIST,
'hints', (TType.STRING,
'UTF8',
False),
None, ),
142 (3, TType.STRING,
'replaced',
'UTF8',
None, ),
144 fix_spec(all_structs)