Subversion Repositories SmartDukaan

Rev

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

Rev 15170 Rev 19247
Line 30... Line 30...
30
    Parameters:
30
    Parameters:
31
     - id
31
     - id
32
    """
32
    """
33
    pass
33
    pass
34
 
34
 
-
 
35
  def addItemsInBulk(self, bulkItemsList):
-
 
36
    """
-
 
37
    Parameters:
-
 
38
     - bulkItemsList
-
 
39
    """
-
 
40
    pass
-
 
41
 
35
 
42
 
36
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
43
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
37
  def __init__(self, iprot, oprot=None):
44
  def __init__(self, iprot, oprot=None):
38
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
45
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
39
 
46
 
Line 81... Line 88...
81
    args = updateLatestPriceForItem_args()
88
    args = updateLatestPriceForItem_args()
82
    args.id = id
89
    args.id = id
83
    args.write(self._oprot)
90
    args.write(self._oprot)
84
    self._oprot.writeMessageEnd()
91
    self._oprot.writeMessageEnd()
85
    self._oprot.trans.flush()
92
    self._oprot.trans.flush()
-
 
93
  def addItemsInBulk(self, bulkItemsList):
-
 
94
    """
-
 
95
    Parameters:
-
 
96
     - bulkItemsList
-
 
97
    """
-
 
98
    self.send_addItemsInBulk(bulkItemsList)
-
 
99
    return self.recv_addItemsInBulk()
-
 
100
 
-
 
101
  def send_addItemsInBulk(self, bulkItemsList):
-
 
102
    self._oprot.writeMessageBegin('addItemsInBulk', TMessageType.CALL, self._seqid)
-
 
103
    args = addItemsInBulk_args()
-
 
104
    args.bulkItemsList = bulkItemsList
-
 
105
    args.write(self._oprot)
-
 
106
    self._oprot.writeMessageEnd()
-
 
107
    self._oprot.trans.flush()
-
 
108
 
-
 
109
  def recv_addItemsInBulk(self, ):
-
 
110
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
111
    if mtype == TMessageType.EXCEPTION:
-
 
112
      x = TApplicationException()
-
 
113
      x.read(self._iprot)
-
 
114
      self._iprot.readMessageEnd()
-
 
115
      raise x
-
 
116
    result = addItemsInBulk_result()
-
 
117
    result.read(self._iprot)
-
 
118
    self._iprot.readMessageEnd()
-
 
119
    if result.success is not None:
-
 
120
      return result.success
-
 
121
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addItemsInBulk failed: unknown result");
-
 
122
 
86
 
123
 
87
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
124
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
88
  def __init__(self, handler):
125
  def __init__(self, handler):
89
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
126
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
90
    self._processMap["getLatestPricing"] = Processor.process_getLatestPricing
127
    self._processMap["getLatestPricing"] = Processor.process_getLatestPricing
91
    self._processMap["updateLatestPriceForItem"] = Processor.process_updateLatestPriceForItem
128
    self._processMap["updateLatestPriceForItem"] = Processor.process_updateLatestPriceForItem
-
 
129
    self._processMap["addItemsInBulk"] = Processor.process_addItemsInBulk
92
 
130
 
93
  def process(self, iprot, oprot):
131
  def process(self, iprot, oprot):
94
    (name, type, seqid) = iprot.readMessageBegin()
132
    (name, type, seqid) = iprot.readMessageBegin()
95
    if name not in self._processMap:
133
    if name not in self._processMap:
96
      iprot.skip(TType.STRUCT)
134
      iprot.skip(TType.STRUCT)
Line 121... Line 159...
121
    args.read(iprot)
159
    args.read(iprot)
122
    iprot.readMessageEnd()
160
    iprot.readMessageEnd()
123
    self._handler.updateLatestPriceForItem(args.id)
161
    self._handler.updateLatestPriceForItem(args.id)
124
    return
162
    return
125
 
163
 
-
 
164
  def process_addItemsInBulk(self, seqid, iprot, oprot):
-
 
165
    args = addItemsInBulk_args()
-
 
166
    args.read(iprot)
-
 
167
    iprot.readMessageEnd()
-
 
168
    result = addItemsInBulk_result()
-
 
169
    result.success = self._handler.addItemsInBulk(args.bulkItemsList)
-
 
170
    oprot.writeMessageBegin("addItemsInBulk", TMessageType.REPLY, seqid)
-
 
171
    result.write(oprot)
-
 
172
    oprot.writeMessageEnd()
-
 
173
    oprot.trans.flush()
-
 
174
 
126
 
175
 
127
# HELPER FUNCTIONS AND STRUCTURES
176
# HELPER FUNCTIONS AND STRUCTURES
128
 
177
 
129
class getLatestPricing_args:
178
class getLatestPricing_args:
130
  """
179
  """
Line 310... Line 359...
310
      oprot.writeFieldEnd()
359
      oprot.writeFieldEnd()
311
    oprot.writeFieldStop()
360
    oprot.writeFieldStop()
312
    oprot.writeStructEnd()
361
    oprot.writeStructEnd()
313
 
362
 
314
  def validate(self):
363
  def validate(self):
-
 
364
    return
-
 
365
 
-
 
366
 
-
 
367
  def __repr__(self):
-
 
368
    L = ['%s=%r' % (key, value)
-
 
369
      for key, value in self.__dict__.iteritems()]
-
 
370
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
371
 
-
 
372
  def __eq__(self, other):
-
 
373
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
374
 
-
 
375
  def __ne__(self, other):
-
 
376
    return not (self == other)
-
 
377
 
-
 
378
class addItemsInBulk_args:
-
 
379
  """
-
 
380
  Attributes:
-
 
381
   - bulkItemsList
-
 
382
  """
-
 
383
 
-
 
384
  thrift_spec = (
-
 
385
    None, # 0
-
 
386
    (1, TType.LIST, 'bulkItemsList', (TType.STRUCT,(BulkItems, BulkItems.thrift_spec)), None, ), # 1
-
 
387
  )
-
 
388
 
-
 
389
  def __init__(self, bulkItemsList=None,):
-
 
390
    self.bulkItemsList = bulkItemsList
-
 
391
 
-
 
392
  def read(self, iprot):
-
 
393
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
394
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
395
      return
-
 
396
    iprot.readStructBegin()
-
 
397
    while True:
-
 
398
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
399
      if ftype == TType.STOP:
-
 
400
        break
-
 
401
      if fid == 1:
-
 
402
        if ftype == TType.LIST:
-
 
403
          self.bulkItemsList = []
-
 
404
          (_etype10, _size7) = iprot.readListBegin()
-
 
405
          for _i11 in xrange(_size7):
-
 
406
            _elem12 = BulkItems()
-
 
407
            _elem12.read(iprot)
-
 
408
            self.bulkItemsList.append(_elem12)
-
 
409
          iprot.readListEnd()
-
 
410
        else:
-
 
411
          iprot.skip(ftype)
-
 
412
      else:
-
 
413
        iprot.skip(ftype)
-
 
414
      iprot.readFieldEnd()
-
 
415
    iprot.readStructEnd()
-
 
416
 
-
 
417
  def write(self, oprot):
-
 
418
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
419
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
420
      return
-
 
421
    oprot.writeStructBegin('addItemsInBulk_args')
-
 
422
    if self.bulkItemsList is not None:
-
 
423
      oprot.writeFieldBegin('bulkItemsList', TType.LIST, 1)
-
 
424
      oprot.writeListBegin(TType.STRUCT, len(self.bulkItemsList))
-
 
425
      for iter13 in self.bulkItemsList:
-
 
426
        iter13.write(oprot)
-
 
427
      oprot.writeListEnd()
-
 
428
      oprot.writeFieldEnd()
-
 
429
    oprot.writeFieldStop()
-
 
430
    oprot.writeStructEnd()
-
 
431
 
-
 
432
  def validate(self):
-
 
433
    return
-
 
434
 
-
 
435
 
-
 
436
  def __repr__(self):
-
 
437
    L = ['%s=%r' % (key, value)
-
 
438
      for key, value in self.__dict__.iteritems()]
-
 
439
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
440
 
-
 
441
  def __eq__(self, other):
-
 
442
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
443
 
-
 
444
  def __ne__(self, other):
-
 
445
    return not (self == other)
-
 
446
 
-
 
447
class addItemsInBulk_result:
-
 
448
  """
-
 
449
  Attributes:
-
 
450
   - success
-
 
451
  """
-
 
452
 
-
 
453
  thrift_spec = (
-
 
454
    (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0
-
 
455
  )
-
 
456
 
-
 
457
  def __init__(self, success=None,):
-
 
458
    self.success = success
-
 
459
 
-
 
460
  def read(self, iprot):
-
 
461
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
462
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
463
      return
-
 
464
    iprot.readStructBegin()
-
 
465
    while True:
-
 
466
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
467
      if ftype == TType.STOP:
-
 
468
        break
-
 
469
      if fid == 0:
-
 
470
        if ftype == TType.LIST:
-
 
471
          self.success = []
-
 
472
          (_etype17, _size14) = iprot.readListBegin()
-
 
473
          for _i18 in xrange(_size14):
-
 
474
            _elem19 = iprot.readString();
-
 
475
            self.success.append(_elem19)
-
 
476
          iprot.readListEnd()
-
 
477
        else:
-
 
478
          iprot.skip(ftype)
-
 
479
      else:
-
 
480
        iprot.skip(ftype)
-
 
481
      iprot.readFieldEnd()
-
 
482
    iprot.readStructEnd()
-
 
483
 
-
 
484
  def write(self, oprot):
-
 
485
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
486
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
487
      return
-
 
488
    oprot.writeStructBegin('addItemsInBulk_result')
-
 
489
    if self.success is not None:
-
 
490
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
491
      oprot.writeListBegin(TType.STRING, len(self.success))
-
 
492
      for iter20 in self.success:
-
 
493
        oprot.writeString(iter20)
-
 
494
      oprot.writeListEnd()
-
 
495
      oprot.writeFieldEnd()
-
 
496
    oprot.writeFieldStop()
-
 
497
    oprot.writeStructEnd()
-
 
498
 
-
 
499
  def validate(self):
315
    return
500
    return
316
 
501
 
317
 
502
 
318
  def __repr__(self):
503
  def __repr__(self):
319
    L = ['%s=%r' % (key, value)
504
    L = ['%s=%r' % (key, value)