Subversion Repositories SmartDukaan

Rev

Rev 3896 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3896 Rev 19686
Line 24... Line 24...
24
    Parameters:
24
    Parameters:
25
     - entityId
25
     - entityId
26
    """
26
    """
27
    pass
27
    pass
28
 
28
 
-
 
29
  def uploadContent(self, bulkUploadContentList):
-
 
30
    """
-
 
31
    Parameters:
-
 
32
     - bulkUploadContentList
-
 
33
    """
-
 
34
    pass
-
 
35
 
29
 
36
 
30
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
37
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
31
  def __init__(self, iprot, oprot=None):
38
  def __init__(self, iprot, oprot=None):
32
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
39
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
33
 
40
 
Line 63... Line 70...
63
      return result.success
70
      return result.success
64
    if result.cse is not None:
71
    if result.cse is not None:
65
      raise result.cse
72
      raise result.cse
66
    raise TApplicationException(TApplicationException.MISSING_RESULT, "pushContentToProduction failed: unknown result");
73
    raise TApplicationException(TApplicationException.MISSING_RESULT, "pushContentToProduction failed: unknown result");
67
 
74
 
-
 
75
  def uploadContent(self, bulkUploadContentList):
-
 
76
    """
-
 
77
    Parameters:
-
 
78
     - bulkUploadContentList
-
 
79
    """
-
 
80
    self.send_uploadContent(bulkUploadContentList)
-
 
81
    return self.recv_uploadContent()
-
 
82
 
-
 
83
  def send_uploadContent(self, bulkUploadContentList):
-
 
84
    self._oprot.writeMessageBegin('uploadContent', TMessageType.CALL, self._seqid)
-
 
85
    args = uploadContent_args()
-
 
86
    args.bulkUploadContentList = bulkUploadContentList
-
 
87
    args.write(self._oprot)
-
 
88
    self._oprot.writeMessageEnd()
-
 
89
    self._oprot.trans.flush()
-
 
90
 
-
 
91
  def recv_uploadContent(self, ):
-
 
92
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
93
    if mtype == TMessageType.EXCEPTION:
-
 
94
      x = TApplicationException()
-
 
95
      x.read(self._iprot)
-
 
96
      self._iprot.readMessageEnd()
-
 
97
      raise x
-
 
98
    result = uploadContent_result()
-
 
99
    result.read(self._iprot)
-
 
100
    self._iprot.readMessageEnd()
-
 
101
    if result.success is not None:
-
 
102
      return result.success
-
 
103
    raise TApplicationException(TApplicationException.MISSING_RESULT, "uploadContent failed: unknown result");
-
 
104
 
68
 
105
 
69
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
106
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
70
  def __init__(self, handler):
107
  def __init__(self, handler):
71
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
108
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
72
    self._processMap["pushContentToProduction"] = Processor.process_pushContentToProduction
109
    self._processMap["pushContentToProduction"] = Processor.process_pushContentToProduction
-
 
110
    self._processMap["uploadContent"] = Processor.process_uploadContent
73
 
111
 
74
  def process(self, iprot, oprot):
112
  def process(self, iprot, oprot):
75
    (name, type, seqid) = iprot.readMessageBegin()
113
    (name, type, seqid) = iprot.readMessageBegin()
76
    if name not in self._processMap:
114
    if name not in self._processMap:
77
      iprot.skip(TType.STRUCT)
115
      iprot.skip(TType.STRUCT)
Line 98... Line 136...
98
    oprot.writeMessageBegin("pushContentToProduction", TMessageType.REPLY, seqid)
136
    oprot.writeMessageBegin("pushContentToProduction", TMessageType.REPLY, seqid)
99
    result.write(oprot)
137
    result.write(oprot)
100
    oprot.writeMessageEnd()
138
    oprot.writeMessageEnd()
101
    oprot.trans.flush()
139
    oprot.trans.flush()
102
 
140
 
-
 
141
  def process_uploadContent(self, seqid, iprot, oprot):
-
 
142
    args = uploadContent_args()
-
 
143
    args.read(iprot)
-
 
144
    iprot.readMessageEnd()
-
 
145
    result = uploadContent_result()
-
 
146
    result.success = self._handler.uploadContent(args.bulkUploadContentList)
-
 
147
    oprot.writeMessageBegin("uploadContent", TMessageType.REPLY, seqid)
-
 
148
    result.write(oprot)
-
 
149
    oprot.writeMessageEnd()
-
 
150
    oprot.trans.flush()
-
 
151
 
103
 
152
 
104
# HELPER FUNCTIONS AND STRUCTURES
153
# HELPER FUNCTIONS AND STRUCTURES
105
 
154
 
106
class pushContentToProduction_args:
155
class pushContentToProduction_args:
107
  """
156
  """
Line 219... Line 268...
219
      oprot.writeFieldEnd()
268
      oprot.writeFieldEnd()
220
    oprot.writeFieldStop()
269
    oprot.writeFieldStop()
221
    oprot.writeStructEnd()
270
    oprot.writeStructEnd()
222
 
271
 
223
  def validate(self):
272
  def validate(self):
-
 
273
    return
-
 
274
 
-
 
275
 
-
 
276
  def __repr__(self):
-
 
277
    L = ['%s=%r' % (key, value)
-
 
278
      for key, value in self.__dict__.iteritems()]
-
 
279
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
280
 
-
 
281
  def __eq__(self, other):
-
 
282
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
283
 
-
 
284
  def __ne__(self, other):
-
 
285
    return not (self == other)
-
 
286
 
-
 
287
class uploadContent_args:
-
 
288
  """
-
 
289
  Attributes:
-
 
290
   - bulkUploadContentList
-
 
291
  """
-
 
292
 
-
 
293
  thrift_spec = (
-
 
294
    None, # 0
-
 
295
    (1, TType.LIST, 'bulkUploadContentList', (TType.STRUCT,(BulkContentUpload, BulkContentUpload.thrift_spec)), None, ), # 1
-
 
296
  )
-
 
297
 
-
 
298
  def __init__(self, bulkUploadContentList=None,):
-
 
299
    self.bulkUploadContentList = bulkUploadContentList
-
 
300
 
-
 
301
  def read(self, iprot):
-
 
302
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
303
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
304
      return
-
 
305
    iprot.readStructBegin()
-
 
306
    while True:
-
 
307
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
308
      if ftype == TType.STOP:
-
 
309
        break
-
 
310
      if fid == 1:
-
 
311
        if ftype == TType.LIST:
-
 
312
          self.bulkUploadContentList = []
-
 
313
          (_etype3, _size0) = iprot.readListBegin()
-
 
314
          for _i4 in xrange(_size0):
-
 
315
            _elem5 = BulkContentUpload()
-
 
316
            _elem5.read(iprot)
-
 
317
            self.bulkUploadContentList.append(_elem5)
-
 
318
          iprot.readListEnd()
-
 
319
        else:
-
 
320
          iprot.skip(ftype)
-
 
321
      else:
-
 
322
        iprot.skip(ftype)
-
 
323
      iprot.readFieldEnd()
-
 
324
    iprot.readStructEnd()
-
 
325
 
-
 
326
  def write(self, oprot):
-
 
327
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
328
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
329
      return
-
 
330
    oprot.writeStructBegin('uploadContent_args')
-
 
331
    if self.bulkUploadContentList is not None:
-
 
332
      oprot.writeFieldBegin('bulkUploadContentList', TType.LIST, 1)
-
 
333
      oprot.writeListBegin(TType.STRUCT, len(self.bulkUploadContentList))
-
 
334
      for iter6 in self.bulkUploadContentList:
-
 
335
        iter6.write(oprot)
-
 
336
      oprot.writeListEnd()
-
 
337
      oprot.writeFieldEnd()
-
 
338
    oprot.writeFieldStop()
-
 
339
    oprot.writeStructEnd()
-
 
340
 
-
 
341
  def validate(self):
-
 
342
    return
-
 
343
 
-
 
344
 
-
 
345
  def __repr__(self):
-
 
346
    L = ['%s=%r' % (key, value)
-
 
347
      for key, value in self.__dict__.iteritems()]
-
 
348
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
349
 
-
 
350
  def __eq__(self, other):
-
 
351
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
352
 
-
 
353
  def __ne__(self, other):
-
 
354
    return not (self == other)
-
 
355
 
-
 
356
class uploadContent_result:
-
 
357
  """
-
 
358
  Attributes:
-
 
359
   - success
-
 
360
  """
-
 
361
 
-
 
362
  thrift_spec = (
-
 
363
    (0, TType.LIST, 'success', (TType.STRUCT,(BulkContentUploadResult, BulkContentUploadResult.thrift_spec)), None, ), # 0
-
 
364
  )
-
 
365
 
-
 
366
  def __init__(self, success=None,):
-
 
367
    self.success = success
-
 
368
 
-
 
369
  def read(self, iprot):
-
 
370
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
371
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
372
      return
-
 
373
    iprot.readStructBegin()
-
 
374
    while True:
-
 
375
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
376
      if ftype == TType.STOP:
-
 
377
        break
-
 
378
      if fid == 0:
-
 
379
        if ftype == TType.LIST:
-
 
380
          self.success = []
-
 
381
          (_etype10, _size7) = iprot.readListBegin()
-
 
382
          for _i11 in xrange(_size7):
-
 
383
            _elem12 = BulkContentUploadResult()
-
 
384
            _elem12.read(iprot)
-
 
385
            self.success.append(_elem12)
-
 
386
          iprot.readListEnd()
-
 
387
        else:
-
 
388
          iprot.skip(ftype)
-
 
389
      else:
-
 
390
        iprot.skip(ftype)
-
 
391
      iprot.readFieldEnd()
-
 
392
    iprot.readStructEnd()
-
 
393
 
-
 
394
  def write(self, oprot):
-
 
395
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
396
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
397
      return
-
 
398
    oprot.writeStructBegin('uploadContent_result')
-
 
399
    if self.success is not None:
-
 
400
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
401
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
402
      for iter13 in self.success:
-
 
403
        iter13.write(oprot)
-
 
404
      oprot.writeListEnd()
-
 
405
      oprot.writeFieldEnd()
-
 
406
    oprot.writeFieldStop()
-
 
407
    oprot.writeStructEnd()
-
 
408
 
-
 
409
  def validate(self):
224
    return
410
    return
225
 
411
 
226
 
412
 
227
  def __repr__(self):
413
  def __repr__(self):
228
    L = ['%s=%r' % (key, value)
414
    L = ['%s=%r' % (key, value)