Subversion Repositories SmartDukaan

Rev

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

Rev 6269 Rev 6289
Line 1401... Line 1401...
1401
    Parameters:
1401
    Parameters:
1402
     - operatorId
1402
     - operatorId
1403
    """
1403
    """
1404
    pass
1404
    pass
1405
 
1405
 
-
 
1406
  def getRechargeDenominations(self, operatorId, circleName, denominationType):
-
 
1407
    """
-
 
1408
    Returns denominations for a given operator and circle
-
 
1409
 
-
 
1410
    Parameters:
-
 
1411
     - operatorId
-
 
1412
     - circleName
-
 
1413
     - denominationType
-
 
1414
    """
-
 
1415
    pass
-
 
1416
 
1406
 
1417
 
1407
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1418
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1408
  def __init__(self, iprot, oprot=None):
1419
  def __init__(self, iprot, oprot=None):
1409
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1420
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1410
 
1421
 
Line 6338... Line 6349...
6338
    self._iprot.readMessageEnd()
6349
    self._iprot.readMessageEnd()
6339
    if result.success is not None:
6350
    if result.success is not None:
6340
      return result.success
6351
      return result.success
6341
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPlansForOperator failed: unknown result");
6352
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPlansForOperator failed: unknown result");
6342
 
6353
 
-
 
6354
  def getRechargeDenominations(self, operatorId, circleName, denominationType):
-
 
6355
    """
-
 
6356
    Returns denominations for a given operator and circle
-
 
6357
 
-
 
6358
    Parameters:
-
 
6359
     - operatorId
-
 
6360
     - circleName
-
 
6361
     - denominationType
-
 
6362
    """
-
 
6363
    self.send_getRechargeDenominations(operatorId, circleName, denominationType)
-
 
6364
    return self.recv_getRechargeDenominations()
-
 
6365
 
-
 
6366
  def send_getRechargeDenominations(self, operatorId, circleName, denominationType):
-
 
6367
    self._oprot.writeMessageBegin('getRechargeDenominations', TMessageType.CALL, self._seqid)
-
 
6368
    args = getRechargeDenominations_args()
-
 
6369
    args.operatorId = operatorId
-
 
6370
    args.circleName = circleName
-
 
6371
    args.denominationType = denominationType
-
 
6372
    args.write(self._oprot)
-
 
6373
    self._oprot.writeMessageEnd()
-
 
6374
    self._oprot.trans.flush()
-
 
6375
 
-
 
6376
  def recv_getRechargeDenominations(self, ):
-
 
6377
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
6378
    if mtype == TMessageType.EXCEPTION:
-
 
6379
      x = TApplicationException()
-
 
6380
      x.read(self._iprot)
-
 
6381
      self._iprot.readMessageEnd()
-
 
6382
      raise x
-
 
6383
    result = getRechargeDenominations_result()
-
 
6384
    result.read(self._iprot)
-
 
6385
    self._iprot.readMessageEnd()
-
 
6386
    if result.success is not None:
-
 
6387
      return result.success
-
 
6388
    if result.ex is not None:
-
 
6389
      raise result.ex
-
 
6390
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getRechargeDenominations failed: unknown result");
-
 
6391
 
6343
 
6392
 
6344
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
6393
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
6345
  def __init__(self, handler):
6394
  def __init__(self, handler):
6346
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
6395
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
6347
    self._processMap["createTransaction"] = Processor.process_createTransaction
6396
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 6485... Line 6534...
6485
    self._processMap["getRechargeOrdersForDevice"] = Processor.process_getRechargeOrdersForDevice
6534
    self._processMap["getRechargeOrdersForDevice"] = Processor.process_getRechargeOrdersForDevice
6486
    self._processMap["addAmountToWallet"] = Processor.process_addAmountToWallet
6535
    self._processMap["addAmountToWallet"] = Processor.process_addAmountToWallet
6487
    self._processMap["getRechargeStatistics"] = Processor.process_getRechargeStatistics
6536
    self._processMap["getRechargeStatistics"] = Processor.process_getRechargeStatistics
6488
    self._processMap["getRechargeOrdersForStatus"] = Processor.process_getRechargeOrdersForStatus
6537
    self._processMap["getRechargeOrdersForStatus"] = Processor.process_getRechargeOrdersForStatus
6489
    self._processMap["getPlansForOperator"] = Processor.process_getPlansForOperator
6538
    self._processMap["getPlansForOperator"] = Processor.process_getPlansForOperator
-
 
6539
    self._processMap["getRechargeDenominations"] = Processor.process_getRechargeDenominations
6490
 
6540
 
6491
  def process(self, iprot, oprot):
6541
  def process(self, iprot, oprot):
6492
    (name, type, seqid) = iprot.readMessageBegin()
6542
    (name, type, seqid) = iprot.readMessageBegin()
6493
    if name not in self._processMap:
6543
    if name not in self._processMap:
6494
      iprot.skip(TType.STRUCT)
6544
      iprot.skip(TType.STRUCT)
Line 8362... Line 8412...
8362
    oprot.writeMessageBegin("getPlansForOperator", TMessageType.REPLY, seqid)
8412
    oprot.writeMessageBegin("getPlansForOperator", TMessageType.REPLY, seqid)
8363
    result.write(oprot)
8413
    result.write(oprot)
8364
    oprot.writeMessageEnd()
8414
    oprot.writeMessageEnd()
8365
    oprot.trans.flush()
8415
    oprot.trans.flush()
8366
 
8416
 
-
 
8417
  def process_getRechargeDenominations(self, seqid, iprot, oprot):
-
 
8418
    args = getRechargeDenominations_args()
-
 
8419
    args.read(iprot)
-
 
8420
    iprot.readMessageEnd()
-
 
8421
    result = getRechargeDenominations_result()
-
 
8422
    try:
-
 
8423
      result.success = self._handler.getRechargeDenominations(args.operatorId, args.circleName, args.denominationType)
-
 
8424
    except TransactionServiceException, ex:
-
 
8425
      result.ex = ex
-
 
8426
    oprot.writeMessageBegin("getRechargeDenominations", TMessageType.REPLY, seqid)
-
 
8427
    result.write(oprot)
-
 
8428
    oprot.writeMessageEnd()
-
 
8429
    oprot.trans.flush()
-
 
8430
 
8367
 
8431
 
8368
# HELPER FUNCTIONS AND STRUCTURES
8432
# HELPER FUNCTIONS AND STRUCTURES
8369
 
8433
 
8370
class createTransaction_args:
8434
class createTransaction_args:
8371
  """
8435
  """
Line 27691... Line 27755...
27691
  Attributes:
27755
  Attributes:
27692
   - success
27756
   - success
27693
  """
27757
  """
27694
 
27758
 
27695
  thrift_spec = (
27759
  thrift_spec = (
27696
    (0, TType.I64, 'success', None, None, ), # 0
27760
    (0, TType.STRUCT, 'success', (DeviceNumberInfo, DeviceNumberInfo.thrift_spec), None, ), # 0
27697
  )
27761
  )
27698
 
27762
 
27699
  def __init__(self, success=None,):
27763
  def __init__(self, success=None,):
27700
    self.success = success
27764
    self.success = success
27701
 
27765
 
Line 27707... Line 27771...
27707
    while True:
27771
    while True:
27708
      (fname, ftype, fid) = iprot.readFieldBegin()
27772
      (fname, ftype, fid) = iprot.readFieldBegin()
27709
      if ftype == TType.STOP:
27773
      if ftype == TType.STOP:
27710
        break
27774
        break
27711
      if fid == 0:
27775
      if fid == 0:
27712
        if ftype == TType.I64:
27776
        if ftype == TType.STRUCT:
27713
          self.success = iprot.readI64();
27777
          self.success = DeviceNumberInfo()
-
 
27778
          self.success.read(iprot)
27714
        else:
27779
        else:
27715
          iprot.skip(ftype)
27780
          iprot.skip(ftype)
27716
      else:
27781
      else:
27717
        iprot.skip(ftype)
27782
        iprot.skip(ftype)
27718
      iprot.readFieldEnd()
27783
      iprot.readFieldEnd()
Line 27722... Line 27787...
27722
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
27787
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
27723
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
27788
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
27724
      return
27789
      return
27725
    oprot.writeStructBegin('getServiceProviderForDevice_result')
27790
    oprot.writeStructBegin('getServiceProviderForDevice_result')
27726
    if self.success is not None:
27791
    if self.success is not None:
27727
      oprot.writeFieldBegin('success', TType.I64, 0)
27792
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
27728
      oprot.writeI64(self.success)
27793
      self.success.write(oprot)
27729
      oprot.writeFieldEnd()
27794
      oprot.writeFieldEnd()
27730
    oprot.writeFieldStop()
27795
    oprot.writeFieldStop()
27731
    oprot.writeStructEnd()
27796
    oprot.writeStructEnd()
27732
 
27797
 
27733
  def validate(self):
27798
  def validate(self):
Line 28472... Line 28537...
28472
      oprot.writeFieldEnd()
28537
      oprot.writeFieldEnd()
28473
    oprot.writeFieldStop()
28538
    oprot.writeFieldStop()
28474
    oprot.writeStructEnd()
28539
    oprot.writeStructEnd()
28475
 
28540
 
28476
  def validate(self):
28541
  def validate(self):
-
 
28542
    return
-
 
28543
 
-
 
28544
 
-
 
28545
  def __repr__(self):
-
 
28546
    L = ['%s=%r' % (key, value)
-
 
28547
      for key, value in self.__dict__.iteritems()]
-
 
28548
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
28549
 
-
 
28550
  def __eq__(self, other):
-
 
28551
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
28552
 
-
 
28553
  def __ne__(self, other):
-
 
28554
    return not (self == other)
-
 
28555
 
-
 
28556
class getRechargeDenominations_args:
-
 
28557
  """
-
 
28558
  Attributes:
-
 
28559
   - operatorId
-
 
28560
   - circleName
-
 
28561
   - denominationType
-
 
28562
  """
-
 
28563
 
-
 
28564
  thrift_spec = (
-
 
28565
    None, # 0
-
 
28566
    (1, TType.I64, 'operatorId', None, None, ), # 1
-
 
28567
    (2, TType.STRING, 'circleName', None, None, ), # 2
-
 
28568
    (3, TType.I32, 'denominationType', None, None, ), # 3
-
 
28569
  )
-
 
28570
 
-
 
28571
  def __init__(self, operatorId=None, circleName=None, denominationType=None,):
-
 
28572
    self.operatorId = operatorId
-
 
28573
    self.circleName = circleName
-
 
28574
    self.denominationType = denominationType
-
 
28575
 
-
 
28576
  def read(self, iprot):
-
 
28577
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
28578
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
28579
      return
-
 
28580
    iprot.readStructBegin()
-
 
28581
    while True:
-
 
28582
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
28583
      if ftype == TType.STOP:
-
 
28584
        break
-
 
28585
      if fid == 1:
-
 
28586
        if ftype == TType.I64:
-
 
28587
          self.operatorId = iprot.readI64();
-
 
28588
        else:
-
 
28589
          iprot.skip(ftype)
-
 
28590
      elif fid == 2:
-
 
28591
        if ftype == TType.STRING:
-
 
28592
          self.circleName = iprot.readString();
-
 
28593
        else:
-
 
28594
          iprot.skip(ftype)
-
 
28595
      elif fid == 3:
-
 
28596
        if ftype == TType.I32:
-
 
28597
          self.denominationType = iprot.readI32();
-
 
28598
        else:
-
 
28599
          iprot.skip(ftype)
-
 
28600
      else:
-
 
28601
        iprot.skip(ftype)
-
 
28602
      iprot.readFieldEnd()
-
 
28603
    iprot.readStructEnd()
-
 
28604
 
-
 
28605
  def write(self, oprot):
-
 
28606
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
28607
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
28608
      return
-
 
28609
    oprot.writeStructBegin('getRechargeDenominations_args')
-
 
28610
    if self.operatorId is not None:
-
 
28611
      oprot.writeFieldBegin('operatorId', TType.I64, 1)
-
 
28612
      oprot.writeI64(self.operatorId)
-
 
28613
      oprot.writeFieldEnd()
-
 
28614
    if self.circleName is not None:
-
 
28615
      oprot.writeFieldBegin('circleName', TType.STRING, 2)
-
 
28616
      oprot.writeString(self.circleName)
-
 
28617
      oprot.writeFieldEnd()
-
 
28618
    if self.denominationType is not None:
-
 
28619
      oprot.writeFieldBegin('denominationType', TType.I32, 3)
-
 
28620
      oprot.writeI32(self.denominationType)
-
 
28621
      oprot.writeFieldEnd()
-
 
28622
    oprot.writeFieldStop()
-
 
28623
    oprot.writeStructEnd()
-
 
28624
 
-
 
28625
  def validate(self):
-
 
28626
    return
-
 
28627
 
-
 
28628
 
-
 
28629
  def __repr__(self):
-
 
28630
    L = ['%s=%r' % (key, value)
-
 
28631
      for key, value in self.__dict__.iteritems()]
-
 
28632
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
28633
 
-
 
28634
  def __eq__(self, other):
-
 
28635
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
28636
 
-
 
28637
  def __ne__(self, other):
-
 
28638
    return not (self == other)
-
 
28639
 
-
 
28640
class getRechargeDenominations_result:
-
 
28641
  """
-
 
28642
  Attributes:
-
 
28643
   - success
-
 
28644
   - ex
-
 
28645
  """
-
 
28646
 
-
 
28647
  thrift_spec = (
-
 
28648
    (0, TType.LIST, 'success', (TType.STRUCT,(RechargeDenomination, RechargeDenomination.thrift_spec)), None, ), # 0
-
 
28649
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
28650
  )
-
 
28651
 
-
 
28652
  def __init__(self, success=None, ex=None,):
-
 
28653
    self.success = success
-
 
28654
    self.ex = ex
-
 
28655
 
-
 
28656
  def read(self, iprot):
-
 
28657
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
28658
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
28659
      return
-
 
28660
    iprot.readStructBegin()
-
 
28661
    while True:
-
 
28662
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
28663
      if ftype == TType.STOP:
-
 
28664
        break
-
 
28665
      if fid == 0:
-
 
28666
        if ftype == TType.LIST:
-
 
28667
          self.success = []
-
 
28668
          (_etype703, _size700) = iprot.readListBegin()
-
 
28669
          for _i704 in xrange(_size700):
-
 
28670
            _elem705 = RechargeDenomination()
-
 
28671
            _elem705.read(iprot)
-
 
28672
            self.success.append(_elem705)
-
 
28673
          iprot.readListEnd()
-
 
28674
        else:
-
 
28675
          iprot.skip(ftype)
-
 
28676
      elif fid == 1:
-
 
28677
        if ftype == TType.STRUCT:
-
 
28678
          self.ex = TransactionServiceException()
-
 
28679
          self.ex.read(iprot)
-
 
28680
        else:
-
 
28681
          iprot.skip(ftype)
-
 
28682
      else:
-
 
28683
        iprot.skip(ftype)
-
 
28684
      iprot.readFieldEnd()
-
 
28685
    iprot.readStructEnd()
-
 
28686
 
-
 
28687
  def write(self, oprot):
-
 
28688
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
28689
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
28690
      return
-
 
28691
    oprot.writeStructBegin('getRechargeDenominations_result')
-
 
28692
    if self.success is not None:
-
 
28693
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
28694
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
28695
      for iter706 in self.success:
-
 
28696
        iter706.write(oprot)
-
 
28697
      oprot.writeListEnd()
-
 
28698
      oprot.writeFieldEnd()
-
 
28699
    if self.ex is not None:
-
 
28700
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
28701
      self.ex.write(oprot)
-
 
28702
      oprot.writeFieldEnd()
-
 
28703
    oprot.writeFieldStop()
-
 
28704
    oprot.writeStructEnd()
-
 
28705
 
-
 
28706
  def validate(self):
28477
    return
28707
    return
28478
 
28708
 
28479
 
28709
 
28480
  def __repr__(self):
28710
  def __repr__(self):
28481
    L = ['%s=%r' % (key, value)
28711
    L = ['%s=%r' % (key, value)