Subversion Repositories SmartDukaan

Rev

Rev 6962 | Rev 7256 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6962 Rev 7190
Line 653... Line 653...
653
     - insurerId
653
     - insurerId
654
     - amount
654
     - amount
655
    """
655
    """
656
    pass
656
    pass
657
 
657
 
-
 
658
  def getFreebieForItem(self, itemId):
-
 
659
    """
-
 
660
    Parameters:
-
 
661
     - itemId
-
 
662
    """
-
 
663
    pass
-
 
664
 
-
 
665
  def addOrUpdateFreebieForItem(self, freebieItem):
-
 
666
    """
-
 
667
    Parameters:
-
 
668
     - freebieItem
-
 
669
    """
-
 
670
    pass
-
 
671
 
658
 
672
 
659
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
673
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
660
  def __init__(self, iprot, oprot=None):
674
  def __init__(self, iprot, oprot=None):
661
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
675
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
662
 
676
 
Line 3304... Line 3318...
3304
    result = updateInsuranceDeclaredAmount_result()
3318
    result = updateInsuranceDeclaredAmount_result()
3305
    result.read(self._iprot)
3319
    result.read(self._iprot)
3306
    self._iprot.readMessageEnd()
3320
    self._iprot.readMessageEnd()
3307
    return
3321
    return
3308
 
3322
 
-
 
3323
  def getFreebieForItem(self, itemId):
-
 
3324
    """
-
 
3325
    Parameters:
-
 
3326
     - itemId
-
 
3327
    """
-
 
3328
    self.send_getFreebieForItem(itemId)
-
 
3329
    return self.recv_getFreebieForItem()
-
 
3330
 
-
 
3331
  def send_getFreebieForItem(self, itemId):
-
 
3332
    self._oprot.writeMessageBegin('getFreebieForItem', TMessageType.CALL, self._seqid)
-
 
3333
    args = getFreebieForItem_args()
-
 
3334
    args.itemId = itemId
-
 
3335
    args.write(self._oprot)
-
 
3336
    self._oprot.writeMessageEnd()
-
 
3337
    self._oprot.trans.flush()
-
 
3338
 
-
 
3339
  def recv_getFreebieForItem(self, ):
-
 
3340
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3341
    if mtype == TMessageType.EXCEPTION:
-
 
3342
      x = TApplicationException()
-
 
3343
      x.read(self._iprot)
-
 
3344
      self._iprot.readMessageEnd()
-
 
3345
      raise x
-
 
3346
    result = getFreebieForItem_result()
-
 
3347
    result.read(self._iprot)
-
 
3348
    self._iprot.readMessageEnd()
-
 
3349
    if result.success is not None:
-
 
3350
      return result.success
-
 
3351
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getFreebieForItem failed: unknown result");
-
 
3352
 
-
 
3353
  def addOrUpdateFreebieForItem(self, freebieItem):
-
 
3354
    """
-
 
3355
    Parameters:
-
 
3356
     - freebieItem
-
 
3357
    """
-
 
3358
    self.send_addOrUpdateFreebieForItem(freebieItem)
-
 
3359
    self.recv_addOrUpdateFreebieForItem()
-
 
3360
 
-
 
3361
  def send_addOrUpdateFreebieForItem(self, freebieItem):
-
 
3362
    self._oprot.writeMessageBegin('addOrUpdateFreebieForItem', TMessageType.CALL, self._seqid)
-
 
3363
    args = addOrUpdateFreebieForItem_args()
-
 
3364
    args.freebieItem = freebieItem
-
 
3365
    args.write(self._oprot)
-
 
3366
    self._oprot.writeMessageEnd()
-
 
3367
    self._oprot.trans.flush()
-
 
3368
 
-
 
3369
  def recv_addOrUpdateFreebieForItem(self, ):
-
 
3370
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3371
    if mtype == TMessageType.EXCEPTION:
-
 
3372
      x = TApplicationException()
-
 
3373
      x.read(self._iprot)
-
 
3374
      self._iprot.readMessageEnd()
-
 
3375
      raise x
-
 
3376
    result = addOrUpdateFreebieForItem_result()
-
 
3377
    result.read(self._iprot)
-
 
3378
    self._iprot.readMessageEnd()
-
 
3379
    return
-
 
3380
 
3309
 
3381
 
3310
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3382
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3311
  def __init__(self, handler):
3383
  def __init__(self, handler):
3312
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3384
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3313
    self._processMap["addItem"] = Processor.process_addItem
3385
    self._processMap["addItem"] = Processor.process_addItem
Line 3391... Line 3463...
3391
    self._processMap["getAllAliveItems"] = Processor.process_getAllAliveItems
3463
    self._processMap["getAllAliveItems"] = Processor.process_getAllAliveItems
3392
    self._processMap["getInsuranceAmount"] = Processor.process_getInsuranceAmount
3464
    self._processMap["getInsuranceAmount"] = Processor.process_getInsuranceAmount
3393
    self._processMap["getInsurer"] = Processor.process_getInsurer
3465
    self._processMap["getInsurer"] = Processor.process_getInsurer
3394
    self._processMap["getAllInsurers"] = Processor.process_getAllInsurers
3466
    self._processMap["getAllInsurers"] = Processor.process_getAllInsurers
3395
    self._processMap["updateInsuranceDeclaredAmount"] = Processor.process_updateInsuranceDeclaredAmount
3467
    self._processMap["updateInsuranceDeclaredAmount"] = Processor.process_updateInsuranceDeclaredAmount
-
 
3468
    self._processMap["getFreebieForItem"] = Processor.process_getFreebieForItem
-
 
3469
    self._processMap["addOrUpdateFreebieForItem"] = Processor.process_addOrUpdateFreebieForItem
3396
 
3470
 
3397
  def process(self, iprot, oprot):
3471
  def process(self, iprot, oprot):
3398
    (name, type, seqid) = iprot.readMessageBegin()
3472
    (name, type, seqid) = iprot.readMessageBegin()
3399
    if name not in self._processMap:
3473
    if name not in self._processMap:
3400
      iprot.skip(TType.STRUCT)
3474
      iprot.skip(TType.STRUCT)
Line 4431... Line 4505...
4431
    oprot.writeMessageBegin("updateInsuranceDeclaredAmount", TMessageType.REPLY, seqid)
4505
    oprot.writeMessageBegin("updateInsuranceDeclaredAmount", TMessageType.REPLY, seqid)
4432
    result.write(oprot)
4506
    result.write(oprot)
4433
    oprot.writeMessageEnd()
4507
    oprot.writeMessageEnd()
4434
    oprot.trans.flush()
4508
    oprot.trans.flush()
4435
 
4509
 
-
 
4510
  def process_getFreebieForItem(self, seqid, iprot, oprot):
-
 
4511
    args = getFreebieForItem_args()
-
 
4512
    args.read(iprot)
-
 
4513
    iprot.readMessageEnd()
-
 
4514
    result = getFreebieForItem_result()
-
 
4515
    result.success = self._handler.getFreebieForItem(args.itemId)
-
 
4516
    oprot.writeMessageBegin("getFreebieForItem", TMessageType.REPLY, seqid)
-
 
4517
    result.write(oprot)
-
 
4518
    oprot.writeMessageEnd()
-
 
4519
    oprot.trans.flush()
-
 
4520
 
-
 
4521
  def process_addOrUpdateFreebieForItem(self, seqid, iprot, oprot):
-
 
4522
    args = addOrUpdateFreebieForItem_args()
-
 
4523
    args.read(iprot)
-
 
4524
    iprot.readMessageEnd()
-
 
4525
    result = addOrUpdateFreebieForItem_result()
-
 
4526
    self._handler.addOrUpdateFreebieForItem(args.freebieItem)
-
 
4527
    oprot.writeMessageBegin("addOrUpdateFreebieForItem", TMessageType.REPLY, seqid)
-
 
4528
    result.write(oprot)
-
 
4529
    oprot.writeMessageEnd()
-
 
4530
    oprot.trans.flush()
-
 
4531
 
4436
 
4532
 
4437
# HELPER FUNCTIONS AND STRUCTURES
4533
# HELPER FUNCTIONS AND STRUCTURES
4438
 
4534
 
4439
class addItem_args:
4535
class addItem_args:
4440
  """
4536
  """
Line 15388... Line 15484...
15388
    oprot.writeFieldStop()
15484
    oprot.writeFieldStop()
15389
    oprot.writeStructEnd()
15485
    oprot.writeStructEnd()
15390
 
15486
 
15391
  def validate(self):
15487
  def validate(self):
15392
    return
15488
    return
-
 
15489
 
-
 
15490
 
-
 
15491
  def __repr__(self):
-
 
15492
    L = ['%s=%r' % (key, value)
-
 
15493
      for key, value in self.__dict__.iteritems()]
-
 
15494
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15495
 
-
 
15496
  def __eq__(self, other):
-
 
15497
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15498
 
-
 
15499
  def __ne__(self, other):
-
 
15500
    return not (self == other)
-
 
15501
 
-
 
15502
class getFreebieForItem_args:
-
 
15503
  """
-
 
15504
  Attributes:
-
 
15505
   - itemId
-
 
15506
  """
-
 
15507
 
-
 
15508
  thrift_spec = (
-
 
15509
    None, # 0
-
 
15510
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
15511
  )
-
 
15512
 
-
 
15513
  def __init__(self, itemId=None,):
-
 
15514
    self.itemId = itemId
-
 
15515
 
-
 
15516
  def read(self, iprot):
-
 
15517
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15518
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15519
      return
-
 
15520
    iprot.readStructBegin()
-
 
15521
    while True:
-
 
15522
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15523
      if ftype == TType.STOP:
-
 
15524
        break
-
 
15525
      if fid == 1:
-
 
15526
        if ftype == TType.I64:
-
 
15527
          self.itemId = iprot.readI64();
-
 
15528
        else:
-
 
15529
          iprot.skip(ftype)
-
 
15530
      else:
-
 
15531
        iprot.skip(ftype)
-
 
15532
      iprot.readFieldEnd()
-
 
15533
    iprot.readStructEnd()
-
 
15534
 
-
 
15535
  def write(self, oprot):
-
 
15536
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15537
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15538
      return
-
 
15539
    oprot.writeStructBegin('getFreebieForItem_args')
-
 
15540
    if self.itemId is not None:
-
 
15541
      oprot.writeFieldBegin('itemId', TType.I64, 1)
-
 
15542
      oprot.writeI64(self.itemId)
-
 
15543
      oprot.writeFieldEnd()
-
 
15544
    oprot.writeFieldStop()
-
 
15545
    oprot.writeStructEnd()
-
 
15546
 
-
 
15547
  def validate(self):
-
 
15548
    return
-
 
15549
 
-
 
15550
 
-
 
15551
  def __repr__(self):
-
 
15552
    L = ['%s=%r' % (key, value)
-
 
15553
      for key, value in self.__dict__.iteritems()]
-
 
15554
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15555
 
-
 
15556
  def __eq__(self, other):
-
 
15557
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15558
 
-
 
15559
  def __ne__(self, other):
-
 
15560
    return not (self == other)
-
 
15561
 
-
 
15562
class getFreebieForItem_result:
-
 
15563
  """
-
 
15564
  Attributes:
-
 
15565
   - success
-
 
15566
  """
-
 
15567
 
-
 
15568
  thrift_spec = (
-
 
15569
    (0, TType.I64, 'success', None, None, ), # 0
-
 
15570
  )
-
 
15571
 
-
 
15572
  def __init__(self, success=None,):
-
 
15573
    self.success = success
-
 
15574
 
-
 
15575
  def read(self, iprot):
-
 
15576
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15577
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15578
      return
-
 
15579
    iprot.readStructBegin()
-
 
15580
    while True:
-
 
15581
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15582
      if ftype == TType.STOP:
-
 
15583
        break
-
 
15584
      if fid == 0:
-
 
15585
        if ftype == TType.I64:
-
 
15586
          self.success = iprot.readI64();
-
 
15587
        else:
-
 
15588
          iprot.skip(ftype)
-
 
15589
      else:
-
 
15590
        iprot.skip(ftype)
-
 
15591
      iprot.readFieldEnd()
-
 
15592
    iprot.readStructEnd()
-
 
15593
 
-
 
15594
  def write(self, oprot):
-
 
15595
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15596
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15597
      return
-
 
15598
    oprot.writeStructBegin('getFreebieForItem_result')
-
 
15599
    if self.success is not None:
-
 
15600
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
15601
      oprot.writeI64(self.success)
-
 
15602
      oprot.writeFieldEnd()
-
 
15603
    oprot.writeFieldStop()
-
 
15604
    oprot.writeStructEnd()
-
 
15605
 
-
 
15606
  def validate(self):
-
 
15607
    return
-
 
15608
 
-
 
15609
 
-
 
15610
  def __repr__(self):
-
 
15611
    L = ['%s=%r' % (key, value)
-
 
15612
      for key, value in self.__dict__.iteritems()]
-
 
15613
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15614
 
-
 
15615
  def __eq__(self, other):
-
 
15616
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15617
 
-
 
15618
  def __ne__(self, other):
-
 
15619
    return not (self == other)
-
 
15620
 
-
 
15621
class addOrUpdateFreebieForItem_args:
-
 
15622
  """
-
 
15623
  Attributes:
-
 
15624
   - freebieItem
-
 
15625
  """
-
 
15626
 
-
 
15627
  thrift_spec = (
-
 
15628
    None, # 0
-
 
15629
    (1, TType.STRUCT, 'freebieItem', (FreebieItem, FreebieItem.thrift_spec), None, ), # 1
-
 
15630
  )
-
 
15631
 
-
 
15632
  def __init__(self, freebieItem=None,):
-
 
15633
    self.freebieItem = freebieItem
-
 
15634
 
-
 
15635
  def read(self, iprot):
-
 
15636
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15637
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15638
      return
-
 
15639
    iprot.readStructBegin()
-
 
15640
    while True:
-
 
15641
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15642
      if ftype == TType.STOP:
-
 
15643
        break
-
 
15644
      if fid == 1:
-
 
15645
        if ftype == TType.STRUCT:
-
 
15646
          self.freebieItem = FreebieItem()
-
 
15647
          self.freebieItem.read(iprot)
-
 
15648
        else:
-
 
15649
          iprot.skip(ftype)
-
 
15650
      else:
-
 
15651
        iprot.skip(ftype)
-
 
15652
      iprot.readFieldEnd()
-
 
15653
    iprot.readStructEnd()
-
 
15654
 
-
 
15655
  def write(self, oprot):
-
 
15656
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15657
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15658
      return
-
 
15659
    oprot.writeStructBegin('addOrUpdateFreebieForItem_args')
-
 
15660
    if self.freebieItem is not None:
-
 
15661
      oprot.writeFieldBegin('freebieItem', TType.STRUCT, 1)
-
 
15662
      self.freebieItem.write(oprot)
-
 
15663
      oprot.writeFieldEnd()
-
 
15664
    oprot.writeFieldStop()
-
 
15665
    oprot.writeStructEnd()
-
 
15666
 
-
 
15667
  def validate(self):
-
 
15668
    return
-
 
15669
 
-
 
15670
 
-
 
15671
  def __repr__(self):
-
 
15672
    L = ['%s=%r' % (key, value)
-
 
15673
      for key, value in self.__dict__.iteritems()]
-
 
15674
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15675
 
-
 
15676
  def __eq__(self, other):
-
 
15677
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15678
 
-
 
15679
  def __ne__(self, other):
-
 
15680
    return not (self == other)
-
 
15681
 
-
 
15682
class addOrUpdateFreebieForItem_result:
-
 
15683
 
-
 
15684
  thrift_spec = (
-
 
15685
  )
-
 
15686
 
-
 
15687
  def read(self, iprot):
-
 
15688
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15689
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15690
      return
-
 
15691
    iprot.readStructBegin()
-
 
15692
    while True:
-
 
15693
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15694
      if ftype == TType.STOP:
-
 
15695
        break
-
 
15696
      else:
-
 
15697
        iprot.skip(ftype)
-
 
15698
      iprot.readFieldEnd()
-
 
15699
    iprot.readStructEnd()
-
 
15700
 
-
 
15701
  def write(self, oprot):
-
 
15702
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15703
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15704
      return
-
 
15705
    oprot.writeStructBegin('addOrUpdateFreebieForItem_result')
-
 
15706
    oprot.writeFieldStop()
-
 
15707
    oprot.writeStructEnd()
-
 
15708
 
-
 
15709
  def validate(self):
-
 
15710
    return
15393
 
15711
 
15394
 
15712
 
15395
  def __repr__(self):
15713
  def __repr__(self):
15396
    L = ['%s=%r' % (key, value)
15714
    L = ['%s=%r' % (key, value)
15397
      for key, value in self.__dict__.iteritems()]
15715
      for key, value in self.__dict__.iteritems()]