| 14371 |
kshitij.so |
1 |
#
|
|
|
2 |
# Autogenerated by Thrift Compiler (0.7.0)
|
|
|
3 |
#
|
|
|
4 |
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
|
5 |
#
|
|
|
6 |
|
|
|
7 |
from thrift.Thrift import *
|
|
|
8 |
import shop2020.thriftpy.generic.GenericService
|
|
|
9 |
from ttypes import *
|
|
|
10 |
from thrift.Thrift import TProcessor
|
|
|
11 |
from thrift.transport import TTransport
|
|
|
12 |
from thrift.protocol import TBinaryProtocol, TProtocol
|
|
|
13 |
try:
|
|
|
14 |
from thrift.protocol import fastbinary
|
|
|
15 |
except:
|
|
|
16 |
fastbinary = None
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
class Iface(shop2020.thriftpy.generic.GenericService.Iface):
|
|
|
20 |
def getLatestPricing(self, skuBundleId, source_id):
|
|
|
21 |
"""
|
|
|
22 |
Parameters:
|
|
|
23 |
- skuBundleId
|
|
|
24 |
- source_id
|
|
|
25 |
"""
|
|
|
26 |
pass
|
|
|
27 |
|
| 15170 |
kshitij.so |
28 |
def updateLatestPriceForItem(self, id):
|
|
|
29 |
"""
|
|
|
30 |
Parameters:
|
|
|
31 |
- id
|
|
|
32 |
"""
|
|
|
33 |
pass
|
| 14371 |
kshitij.so |
34 |
|
| 15170 |
kshitij.so |
35 |
|
| 14371 |
kshitij.so |
36 |
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
|
|
|
37 |
def __init__(self, iprot, oprot=None):
|
|
|
38 |
shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
|
|
|
39 |
|
|
|
40 |
def getLatestPricing(self, skuBundleId, source_id):
|
|
|
41 |
"""
|
|
|
42 |
Parameters:
|
|
|
43 |
- skuBundleId
|
|
|
44 |
- source_id
|
|
|
45 |
"""
|
|
|
46 |
self.send_getLatestPricing(skuBundleId, source_id)
|
|
|
47 |
return self.recv_getLatestPricing()
|
|
|
48 |
|
|
|
49 |
def send_getLatestPricing(self, skuBundleId, source_id):
|
|
|
50 |
self._oprot.writeMessageBegin('getLatestPricing', TMessageType.CALL, self._seqid)
|
|
|
51 |
args = getLatestPricing_args()
|
|
|
52 |
args.skuBundleId = skuBundleId
|
|
|
53 |
args.source_id = source_id
|
|
|
54 |
args.write(self._oprot)
|
|
|
55 |
self._oprot.writeMessageEnd()
|
|
|
56 |
self._oprot.trans.flush()
|
|
|
57 |
|
|
|
58 |
def recv_getLatestPricing(self, ):
|
|
|
59 |
(fname, mtype, rseqid) = self._iprot.readMessageBegin()
|
|
|
60 |
if mtype == TMessageType.EXCEPTION:
|
|
|
61 |
x = TApplicationException()
|
|
|
62 |
x.read(self._iprot)
|
|
|
63 |
self._iprot.readMessageEnd()
|
|
|
64 |
raise x
|
|
|
65 |
result = getLatestPricing_result()
|
|
|
66 |
result.read(self._iprot)
|
|
|
67 |
self._iprot.readMessageEnd()
|
|
|
68 |
if result.success is not None:
|
|
|
69 |
return result.success
|
|
|
70 |
raise TApplicationException(TApplicationException.MISSING_RESULT, "getLatestPricing failed: unknown result");
|
|
|
71 |
|
| 15170 |
kshitij.so |
72 |
def updateLatestPriceForItem(self, id):
|
|
|
73 |
"""
|
|
|
74 |
Parameters:
|
|
|
75 |
- id
|
|
|
76 |
"""
|
|
|
77 |
self.send_updateLatestPriceForItem(id)
|
| 14371 |
kshitij.so |
78 |
|
| 15170 |
kshitij.so |
79 |
def send_updateLatestPriceForItem(self, id):
|
|
|
80 |
self._oprot.writeMessageBegin('updateLatestPriceForItem', TMessageType.CALL, self._seqid)
|
|
|
81 |
args = updateLatestPriceForItem_args()
|
|
|
82 |
args.id = id
|
|
|
83 |
args.write(self._oprot)
|
|
|
84 |
self._oprot.writeMessageEnd()
|
|
|
85 |
self._oprot.trans.flush()
|
|
|
86 |
|
| 14371 |
kshitij.so |
87 |
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
|
|
|
88 |
def __init__(self, handler):
|
|
|
89 |
shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
|
|
|
90 |
self._processMap["getLatestPricing"] = Processor.process_getLatestPricing
|
| 15170 |
kshitij.so |
91 |
self._processMap["updateLatestPriceForItem"] = Processor.process_updateLatestPriceForItem
|
| 14371 |
kshitij.so |
92 |
|
|
|
93 |
def process(self, iprot, oprot):
|
|
|
94 |
(name, type, seqid) = iprot.readMessageBegin()
|
|
|
95 |
if name not in self._processMap:
|
|
|
96 |
iprot.skip(TType.STRUCT)
|
|
|
97 |
iprot.readMessageEnd()
|
|
|
98 |
x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
|
|
|
99 |
oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
|
|
|
100 |
x.write(oprot)
|
|
|
101 |
oprot.writeMessageEnd()
|
|
|
102 |
oprot.trans.flush()
|
|
|
103 |
return
|
|
|
104 |
else:
|
|
|
105 |
self._processMap[name](self, seqid, iprot, oprot)
|
|
|
106 |
return True
|
|
|
107 |
|
|
|
108 |
def process_getLatestPricing(self, seqid, iprot, oprot):
|
|
|
109 |
args = getLatestPricing_args()
|
|
|
110 |
args.read(iprot)
|
|
|
111 |
iprot.readMessageEnd()
|
|
|
112 |
result = getLatestPricing_result()
|
|
|
113 |
result.success = self._handler.getLatestPricing(args.skuBundleId, args.source_id)
|
|
|
114 |
oprot.writeMessageBegin("getLatestPricing", TMessageType.REPLY, seqid)
|
|
|
115 |
result.write(oprot)
|
|
|
116 |
oprot.writeMessageEnd()
|
|
|
117 |
oprot.trans.flush()
|
|
|
118 |
|
| 15170 |
kshitij.so |
119 |
def process_updateLatestPriceForItem(self, seqid, iprot, oprot):
|
|
|
120 |
args = updateLatestPriceForItem_args()
|
|
|
121 |
args.read(iprot)
|
|
|
122 |
iprot.readMessageEnd()
|
|
|
123 |
self._handler.updateLatestPriceForItem(args.id)
|
|
|
124 |
return
|
| 14371 |
kshitij.so |
125 |
|
| 15170 |
kshitij.so |
126 |
|
| 14371 |
kshitij.so |
127 |
# HELPER FUNCTIONS AND STRUCTURES
|
|
|
128 |
|
|
|
129 |
class getLatestPricing_args:
|
|
|
130 |
"""
|
|
|
131 |
Attributes:
|
|
|
132 |
- skuBundleId
|
|
|
133 |
- source_id
|
|
|
134 |
"""
|
|
|
135 |
|
|
|
136 |
thrift_spec = (
|
|
|
137 |
None, # 0
|
|
|
138 |
(1, TType.I64, 'skuBundleId', None, None, ), # 1
|
|
|
139 |
(2, TType.I64, 'source_id', None, None, ), # 2
|
|
|
140 |
)
|
|
|
141 |
|
|
|
142 |
def __init__(self, skuBundleId=None, source_id=None,):
|
|
|
143 |
self.skuBundleId = skuBundleId
|
|
|
144 |
self.source_id = source_id
|
|
|
145 |
|
|
|
146 |
def read(self, iprot):
|
|
|
147 |
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
|
|
148 |
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
|
|
149 |
return
|
|
|
150 |
iprot.readStructBegin()
|
|
|
151 |
while True:
|
|
|
152 |
(fname, ftype, fid) = iprot.readFieldBegin()
|
|
|
153 |
if ftype == TType.STOP:
|
|
|
154 |
break
|
|
|
155 |
if fid == 1:
|
|
|
156 |
if ftype == TType.I64:
|
|
|
157 |
self.skuBundleId = iprot.readI64();
|
|
|
158 |
else:
|
|
|
159 |
iprot.skip(ftype)
|
|
|
160 |
elif fid == 2:
|
|
|
161 |
if ftype == TType.I64:
|
|
|
162 |
self.source_id = iprot.readI64();
|
|
|
163 |
else:
|
|
|
164 |
iprot.skip(ftype)
|
|
|
165 |
else:
|
|
|
166 |
iprot.skip(ftype)
|
|
|
167 |
iprot.readFieldEnd()
|
|
|
168 |
iprot.readStructEnd()
|
|
|
169 |
|
|
|
170 |
def write(self, oprot):
|
|
|
171 |
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
|
|
172 |
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
|
|
173 |
return
|
|
|
174 |
oprot.writeStructBegin('getLatestPricing_args')
|
|
|
175 |
if self.skuBundleId is not None:
|
|
|
176 |
oprot.writeFieldBegin('skuBundleId', TType.I64, 1)
|
|
|
177 |
oprot.writeI64(self.skuBundleId)
|
|
|
178 |
oprot.writeFieldEnd()
|
|
|
179 |
if self.source_id is not None:
|
|
|
180 |
oprot.writeFieldBegin('source_id', TType.I64, 2)
|
|
|
181 |
oprot.writeI64(self.source_id)
|
|
|
182 |
oprot.writeFieldEnd()
|
|
|
183 |
oprot.writeFieldStop()
|
|
|
184 |
oprot.writeStructEnd()
|
|
|
185 |
|
|
|
186 |
def validate(self):
|
|
|
187 |
return
|
|
|
188 |
|
|
|
189 |
|
|
|
190 |
def __repr__(self):
|
|
|
191 |
L = ['%s=%r' % (key, value)
|
|
|
192 |
for key, value in self.__dict__.iteritems()]
|
|
|
193 |
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
|
|
194 |
|
|
|
195 |
def __eq__(self, other):
|
|
|
196 |
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
|
|
197 |
|
|
|
198 |
def __ne__(self, other):
|
|
|
199 |
return not (self == other)
|
|
|
200 |
|
|
|
201 |
class getLatestPricing_result:
|
|
|
202 |
"""
|
|
|
203 |
Attributes:
|
|
|
204 |
- success
|
|
|
205 |
"""
|
|
|
206 |
|
|
|
207 |
thrift_spec = (
|
|
|
208 |
(0, TType.LIST, 'success', (TType.STRUCT,(LivePricing, LivePricing.thrift_spec)), None, ), # 0
|
|
|
209 |
)
|
|
|
210 |
|
|
|
211 |
def __init__(self, success=None,):
|
|
|
212 |
self.success = success
|
|
|
213 |
|
|
|
214 |
def read(self, iprot):
|
|
|
215 |
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
|
|
216 |
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
|
|
217 |
return
|
|
|
218 |
iprot.readStructBegin()
|
|
|
219 |
while True:
|
|
|
220 |
(fname, ftype, fid) = iprot.readFieldBegin()
|
|
|
221 |
if ftype == TType.STOP:
|
|
|
222 |
break
|
|
|
223 |
if fid == 0:
|
|
|
224 |
if ftype == TType.LIST:
|
|
|
225 |
self.success = []
|
|
|
226 |
(_etype3, _size0) = iprot.readListBegin()
|
|
|
227 |
for _i4 in xrange(_size0):
|
|
|
228 |
_elem5 = LivePricing()
|
|
|
229 |
_elem5.read(iprot)
|
|
|
230 |
self.success.append(_elem5)
|
|
|
231 |
iprot.readListEnd()
|
|
|
232 |
else:
|
|
|
233 |
iprot.skip(ftype)
|
|
|
234 |
else:
|
|
|
235 |
iprot.skip(ftype)
|
|
|
236 |
iprot.readFieldEnd()
|
|
|
237 |
iprot.readStructEnd()
|
|
|
238 |
|
|
|
239 |
def write(self, oprot):
|
|
|
240 |
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
|
|
241 |
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
|
|
242 |
return
|
|
|
243 |
oprot.writeStructBegin('getLatestPricing_result')
|
|
|
244 |
if self.success is not None:
|
|
|
245 |
oprot.writeFieldBegin('success', TType.LIST, 0)
|
|
|
246 |
oprot.writeListBegin(TType.STRUCT, len(self.success))
|
|
|
247 |
for iter6 in self.success:
|
|
|
248 |
iter6.write(oprot)
|
|
|
249 |
oprot.writeListEnd()
|
|
|
250 |
oprot.writeFieldEnd()
|
|
|
251 |
oprot.writeFieldStop()
|
|
|
252 |
oprot.writeStructEnd()
|
|
|
253 |
|
|
|
254 |
def validate(self):
|
|
|
255 |
return
|
|
|
256 |
|
|
|
257 |
|
|
|
258 |
def __repr__(self):
|
|
|
259 |
L = ['%s=%r' % (key, value)
|
|
|
260 |
for key, value in self.__dict__.iteritems()]
|
|
|
261 |
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
|
|
262 |
|
|
|
263 |
def __eq__(self, other):
|
|
|
264 |
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
|
|
265 |
|
|
|
266 |
def __ne__(self, other):
|
|
|
267 |
return not (self == other)
|
| 15170 |
kshitij.so |
268 |
|
|
|
269 |
class updateLatestPriceForItem_args:
|
|
|
270 |
"""
|
|
|
271 |
Attributes:
|
|
|
272 |
- id
|
|
|
273 |
"""
|
|
|
274 |
|
|
|
275 |
thrift_spec = (
|
|
|
276 |
None, # 0
|
|
|
277 |
(1, TType.I64, 'id', None, None, ), # 1
|
|
|
278 |
)
|
|
|
279 |
|
|
|
280 |
def __init__(self, id=None,):
|
|
|
281 |
self.id = id
|
|
|
282 |
|
|
|
283 |
def read(self, iprot):
|
|
|
284 |
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
|
|
285 |
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
|
|
286 |
return
|
|
|
287 |
iprot.readStructBegin()
|
|
|
288 |
while True:
|
|
|
289 |
(fname, ftype, fid) = iprot.readFieldBegin()
|
|
|
290 |
if ftype == TType.STOP:
|
|
|
291 |
break
|
|
|
292 |
if fid == 1:
|
|
|
293 |
if ftype == TType.I64:
|
|
|
294 |
self.id = iprot.readI64();
|
|
|
295 |
else:
|
|
|
296 |
iprot.skip(ftype)
|
|
|
297 |
else:
|
|
|
298 |
iprot.skip(ftype)
|
|
|
299 |
iprot.readFieldEnd()
|
|
|
300 |
iprot.readStructEnd()
|
|
|
301 |
|
|
|
302 |
def write(self, oprot):
|
|
|
303 |
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
|
|
304 |
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
|
|
305 |
return
|
|
|
306 |
oprot.writeStructBegin('updateLatestPriceForItem_args')
|
|
|
307 |
if self.id is not None:
|
|
|
308 |
oprot.writeFieldBegin('id', TType.I64, 1)
|
|
|
309 |
oprot.writeI64(self.id)
|
|
|
310 |
oprot.writeFieldEnd()
|
|
|
311 |
oprot.writeFieldStop()
|
|
|
312 |
oprot.writeStructEnd()
|
|
|
313 |
|
|
|
314 |
def validate(self):
|
|
|
315 |
return
|
|
|
316 |
|
|
|
317 |
|
|
|
318 |
def __repr__(self):
|
|
|
319 |
L = ['%s=%r' % (key, value)
|
|
|
320 |
for key, value in self.__dict__.iteritems()]
|
|
|
321 |
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
|
|
322 |
|
|
|
323 |
def __eq__(self, other):
|
|
|
324 |
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
|
|
325 |
|
|
|
326 |
def __ne__(self, other):
|
|
|
327 |
return not (self == other)
|