| 3893 |
chandransh |
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 pushContentToProduction(self, entityId):
|
|
|
21 |
"""
|
| 3896 |
chandransh |
22 |
Push the content of the given entity to production
|
|
|
23 |
|
| 3893 |
chandransh |
24 |
Parameters:
|
|
|
25 |
- entityId
|
|
|
26 |
"""
|
|
|
27 |
pass
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
|
|
|
31 |
def __init__(self, iprot, oprot=None):
|
|
|
32 |
shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
|
|
|
33 |
|
|
|
34 |
def pushContentToProduction(self, entityId):
|
|
|
35 |
"""
|
| 3896 |
chandransh |
36 |
Push the content of the given entity to production
|
|
|
37 |
|
| 3893 |
chandransh |
38 |
Parameters:
|
|
|
39 |
- entityId
|
|
|
40 |
"""
|
|
|
41 |
self.send_pushContentToProduction(entityId)
|
| 3896 |
chandransh |
42 |
return self.recv_pushContentToProduction()
|
| 3893 |
chandransh |
43 |
|
|
|
44 |
def send_pushContentToProduction(self, entityId):
|
|
|
45 |
self._oprot.writeMessageBegin('pushContentToProduction', TMessageType.CALL, self._seqid)
|
|
|
46 |
args = pushContentToProduction_args()
|
|
|
47 |
args.entityId = entityId
|
|
|
48 |
args.write(self._oprot)
|
|
|
49 |
self._oprot.writeMessageEnd()
|
|
|
50 |
self._oprot.trans.flush()
|
|
|
51 |
|
|
|
52 |
def recv_pushContentToProduction(self, ):
|
|
|
53 |
(fname, mtype, rseqid) = self._iprot.readMessageBegin()
|
|
|
54 |
if mtype == TMessageType.EXCEPTION:
|
|
|
55 |
x = TApplicationException()
|
|
|
56 |
x.read(self._iprot)
|
|
|
57 |
self._iprot.readMessageEnd()
|
|
|
58 |
raise x
|
|
|
59 |
result = pushContentToProduction_result()
|
|
|
60 |
result.read(self._iprot)
|
|
|
61 |
self._iprot.readMessageEnd()
|
| 3896 |
chandransh |
62 |
if result.success is not None:
|
|
|
63 |
return result.success
|
|
|
64 |
if result.cse is not None:
|
|
|
65 |
raise result.cse
|
|
|
66 |
raise TApplicationException(TApplicationException.MISSING_RESULT, "pushContentToProduction failed: unknown result");
|
| 3893 |
chandransh |
67 |
|
|
|
68 |
|
|
|
69 |
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
|
|
|
70 |
def __init__(self, handler):
|
|
|
71 |
shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
|
|
|
72 |
self._processMap["pushContentToProduction"] = Processor.process_pushContentToProduction
|
|
|
73 |
|
|
|
74 |
def process(self, iprot, oprot):
|
|
|
75 |
(name, type, seqid) = iprot.readMessageBegin()
|
|
|
76 |
if name not in self._processMap:
|
|
|
77 |
iprot.skip(TType.STRUCT)
|
|
|
78 |
iprot.readMessageEnd()
|
|
|
79 |
x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
|
|
|
80 |
oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
|
|
|
81 |
x.write(oprot)
|
|
|
82 |
oprot.writeMessageEnd()
|
|
|
83 |
oprot.trans.flush()
|
|
|
84 |
return
|
|
|
85 |
else:
|
|
|
86 |
self._processMap[name](self, seqid, iprot, oprot)
|
|
|
87 |
return True
|
|
|
88 |
|
|
|
89 |
def process_pushContentToProduction(self, seqid, iprot, oprot):
|
|
|
90 |
args = pushContentToProduction_args()
|
|
|
91 |
args.read(iprot)
|
|
|
92 |
iprot.readMessageEnd()
|
|
|
93 |
result = pushContentToProduction_result()
|
| 3896 |
chandransh |
94 |
try:
|
|
|
95 |
result.success = self._handler.pushContentToProduction(args.entityId)
|
|
|
96 |
except ContentServiceException, cse:
|
|
|
97 |
result.cse = cse
|
| 3893 |
chandransh |
98 |
oprot.writeMessageBegin("pushContentToProduction", TMessageType.REPLY, seqid)
|
|
|
99 |
result.write(oprot)
|
|
|
100 |
oprot.writeMessageEnd()
|
|
|
101 |
oprot.trans.flush()
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
# HELPER FUNCTIONS AND STRUCTURES
|
|
|
105 |
|
|
|
106 |
class pushContentToProduction_args:
|
|
|
107 |
"""
|
|
|
108 |
Attributes:
|
|
|
109 |
- entityId
|
|
|
110 |
"""
|
|
|
111 |
|
|
|
112 |
thrift_spec = (
|
|
|
113 |
None, # 0
|
|
|
114 |
(1, TType.I64, 'entityId', None, None, ), # 1
|
|
|
115 |
)
|
|
|
116 |
|
|
|
117 |
def __init__(self, entityId=None,):
|
|
|
118 |
self.entityId = entityId
|
|
|
119 |
|
|
|
120 |
def read(self, iprot):
|
|
|
121 |
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
|
|
122 |
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
|
|
123 |
return
|
|
|
124 |
iprot.readStructBegin()
|
|
|
125 |
while True:
|
|
|
126 |
(fname, ftype, fid) = iprot.readFieldBegin()
|
|
|
127 |
if ftype == TType.STOP:
|
|
|
128 |
break
|
|
|
129 |
if fid == 1:
|
|
|
130 |
if ftype == TType.I64:
|
|
|
131 |
self.entityId = iprot.readI64();
|
|
|
132 |
else:
|
|
|
133 |
iprot.skip(ftype)
|
|
|
134 |
else:
|
|
|
135 |
iprot.skip(ftype)
|
|
|
136 |
iprot.readFieldEnd()
|
|
|
137 |
iprot.readStructEnd()
|
|
|
138 |
|
|
|
139 |
def write(self, oprot):
|
|
|
140 |
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
|
|
141 |
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
|
|
142 |
return
|
|
|
143 |
oprot.writeStructBegin('pushContentToProduction_args')
|
|
|
144 |
if self.entityId is not None:
|
|
|
145 |
oprot.writeFieldBegin('entityId', TType.I64, 1)
|
|
|
146 |
oprot.writeI64(self.entityId)
|
|
|
147 |
oprot.writeFieldEnd()
|
|
|
148 |
oprot.writeFieldStop()
|
|
|
149 |
oprot.writeStructEnd()
|
|
|
150 |
|
|
|
151 |
def validate(self):
|
|
|
152 |
return
|
|
|
153 |
|
|
|
154 |
|
|
|
155 |
def __repr__(self):
|
|
|
156 |
L = ['%s=%r' % (key, value)
|
|
|
157 |
for key, value in self.__dict__.iteritems()]
|
|
|
158 |
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
|
|
159 |
|
|
|
160 |
def __eq__(self, other):
|
|
|
161 |
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
|
|
162 |
|
|
|
163 |
def __ne__(self, other):
|
|
|
164 |
return not (self == other)
|
|
|
165 |
|
|
|
166 |
class pushContentToProduction_result:
|
| 3896 |
chandransh |
167 |
"""
|
|
|
168 |
Attributes:
|
|
|
169 |
- success
|
|
|
170 |
- cse
|
|
|
171 |
"""
|
| 3893 |
chandransh |
172 |
|
|
|
173 |
thrift_spec = (
|
| 3896 |
chandransh |
174 |
(0, TType.BOOL, 'success', None, None, ), # 0
|
|
|
175 |
(1, TType.STRUCT, 'cse', (ContentServiceException, ContentServiceException.thrift_spec), None, ), # 1
|
| 3893 |
chandransh |
176 |
)
|
|
|
177 |
|
| 3896 |
chandransh |
178 |
def __init__(self, success=None, cse=None,):
|
|
|
179 |
self.success = success
|
|
|
180 |
self.cse = cse
|
|
|
181 |
|
| 3893 |
chandransh |
182 |
def read(self, iprot):
|
|
|
183 |
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
|
|
184 |
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
|
|
185 |
return
|
|
|
186 |
iprot.readStructBegin()
|
|
|
187 |
while True:
|
|
|
188 |
(fname, ftype, fid) = iprot.readFieldBegin()
|
|
|
189 |
if ftype == TType.STOP:
|
|
|
190 |
break
|
| 3896 |
chandransh |
191 |
if fid == 0:
|
|
|
192 |
if ftype == TType.BOOL:
|
|
|
193 |
self.success = iprot.readBool();
|
|
|
194 |
else:
|
|
|
195 |
iprot.skip(ftype)
|
|
|
196 |
elif fid == 1:
|
|
|
197 |
if ftype == TType.STRUCT:
|
|
|
198 |
self.cse = ContentServiceException()
|
|
|
199 |
self.cse.read(iprot)
|
|
|
200 |
else:
|
|
|
201 |
iprot.skip(ftype)
|
| 3893 |
chandransh |
202 |
else:
|
|
|
203 |
iprot.skip(ftype)
|
|
|
204 |
iprot.readFieldEnd()
|
|
|
205 |
iprot.readStructEnd()
|
|
|
206 |
|
|
|
207 |
def write(self, oprot):
|
|
|
208 |
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
|
|
209 |
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
|
|
210 |
return
|
|
|
211 |
oprot.writeStructBegin('pushContentToProduction_result')
|
| 3896 |
chandransh |
212 |
if self.success is not None:
|
|
|
213 |
oprot.writeFieldBegin('success', TType.BOOL, 0)
|
|
|
214 |
oprot.writeBool(self.success)
|
|
|
215 |
oprot.writeFieldEnd()
|
|
|
216 |
if self.cse is not None:
|
|
|
217 |
oprot.writeFieldBegin('cse', TType.STRUCT, 1)
|
|
|
218 |
self.cse.write(oprot)
|
|
|
219 |
oprot.writeFieldEnd()
|
| 3893 |
chandransh |
220 |
oprot.writeFieldStop()
|
|
|
221 |
oprot.writeStructEnd()
|
|
|
222 |
|
|
|
223 |
def validate(self):
|
|
|
224 |
return
|
|
|
225 |
|
|
|
226 |
|
|
|
227 |
def __repr__(self):
|
|
|
228 |
L = ['%s=%r' % (key, value)
|
|
|
229 |
for key, value in self.__dict__.iteritems()]
|
|
|
230 |
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
|
|
231 |
|
|
|
232 |
def __eq__(self, other):
|
|
|
233 |
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
|
|
234 |
|
|
|
235 |
def __ne__(self, other):
|
|
|
236 |
return not (self == other)
|