Subversion Repositories SmartDukaan

Rev

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

Rev 19691 Rev 19714
Line 1389... Line 1389...
1389
    Parameters:
1389
    Parameters:
1390
     - bulkUploadCatalog
1390
     - bulkUploadCatalog
1391
    """
1391
    """
1392
    pass
1392
    pass
1393
 
1393
 
1394
  def getWarrantyInfoForItem(self, itemId, itemCondition):
1394
  def getWarrantyInfoForItem(self, catalogItemId, itemCondition):
1395
    """
1395
    """
1396
    Parameters:
1396
    Parameters:
-
 
1397
     - catalogItemId
1397
     - itemId
1398
     - itemCondition
-
 
1399
    """
-
 
1400
    pass
-
 
1401
 
-
 
1402
  def getWarrantyInfoForItemList(self, catalogItemIds, itemCondition):
-
 
1403
    """
-
 
1404
    Parameters:
-
 
1405
     - catalogItemIds
1398
     - itemCondition
1406
     - itemCondition
1399
    """
1407
    """
1400
    pass
1408
    pass
1401
 
1409
 
1402
 
1410
 
Line 7423... Line 7431...
7423
    self._iprot.readMessageEnd()
7431
    self._iprot.readMessageEnd()
7424
    if result.cex is not None:
7432
    if result.cex is not None:
7425
      raise result.cex
7433
      raise result.cex
7426
    return
7434
    return
7427
 
7435
 
7428
  def getWarrantyInfoForItem(self, itemId, itemCondition):
7436
  def getWarrantyInfoForItem(self, catalogItemId, itemCondition):
7429
    """
7437
    """
7430
    Parameters:
7438
    Parameters:
7431
     - itemId
7439
     - catalogItemId
7432
     - itemCondition
7440
     - itemCondition
7433
    """
7441
    """
7434
    self.send_getWarrantyInfoForItem(itemId, itemCondition)
7442
    self.send_getWarrantyInfoForItem(catalogItemId, itemCondition)
7435
    return self.recv_getWarrantyInfoForItem()
7443
    return self.recv_getWarrantyInfoForItem()
7436
 
7444
 
7437
  def send_getWarrantyInfoForItem(self, itemId, itemCondition):
7445
  def send_getWarrantyInfoForItem(self, catalogItemId, itemCondition):
7438
    self._oprot.writeMessageBegin('getWarrantyInfoForItem', TMessageType.CALL, self._seqid)
7446
    self._oprot.writeMessageBegin('getWarrantyInfoForItem', TMessageType.CALL, self._seqid)
7439
    args = getWarrantyInfoForItem_args()
7447
    args = getWarrantyInfoForItem_args()
7440
    args.itemId = itemId
7448
    args.catalogItemId = catalogItemId
7441
    args.itemCondition = itemCondition
7449
    args.itemCondition = itemCondition
7442
    args.write(self._oprot)
7450
    args.write(self._oprot)
7443
    self._oprot.writeMessageEnd()
7451
    self._oprot.writeMessageEnd()
7444
    self._oprot.trans.flush()
7452
    self._oprot.trans.flush()
7445
 
7453
 
Line 7457... Line 7465...
7457
      return result.success
7465
      return result.success
7458
    if result.cex is not None:
7466
    if result.cex is not None:
7459
      raise result.cex
7467
      raise result.cex
7460
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getWarrantyInfoForItem failed: unknown result");
7468
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getWarrantyInfoForItem failed: unknown result");
7461
 
7469
 
-
 
7470
  def getWarrantyInfoForItemList(self, catalogItemIds, itemCondition):
-
 
7471
    """
-
 
7472
    Parameters:
-
 
7473
     - catalogItemIds
-
 
7474
     - itemCondition
-
 
7475
    """
-
 
7476
    self.send_getWarrantyInfoForItemList(catalogItemIds, itemCondition)
-
 
7477
    return self.recv_getWarrantyInfoForItemList()
-
 
7478
 
-
 
7479
  def send_getWarrantyInfoForItemList(self, catalogItemIds, itemCondition):
-
 
7480
    self._oprot.writeMessageBegin('getWarrantyInfoForItemList', TMessageType.CALL, self._seqid)
-
 
7481
    args = getWarrantyInfoForItemList_args()
-
 
7482
    args.catalogItemIds = catalogItemIds
-
 
7483
    args.itemCondition = itemCondition
-
 
7484
    args.write(self._oprot)
-
 
7485
    self._oprot.writeMessageEnd()
-
 
7486
    self._oprot.trans.flush()
-
 
7487
 
-
 
7488
  def recv_getWarrantyInfoForItemList(self, ):
-
 
7489
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
7490
    if mtype == TMessageType.EXCEPTION:
-
 
7491
      x = TApplicationException()
-
 
7492
      x.read(self._iprot)
-
 
7493
      self._iprot.readMessageEnd()
-
 
7494
      raise x
-
 
7495
    result = getWarrantyInfoForItemList_result()
-
 
7496
    result.read(self._iprot)
-
 
7497
    self._iprot.readMessageEnd()
-
 
7498
    if result.success is not None:
-
 
7499
      return result.success
-
 
7500
    if result.cex is not None:
-
 
7501
      raise result.cex
-
 
7502
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getWarrantyInfoForItemList failed: unknown result");
-
 
7503
 
7462
 
7504
 
7463
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
7505
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
7464
  def __init__(self, handler):
7506
  def __init__(self, handler):
7465
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
7507
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
7466
    self._processMap["addItem"] = Processor.process_addItem
7508
    self._processMap["addItem"] = Processor.process_addItem
Line 7660... Line 7702...
7660
    self._processMap["updateBulkPricesOnProduction"] = Processor.process_updateBulkPricesOnProduction
7702
    self._processMap["updateBulkPricesOnProduction"] = Processor.process_updateBulkPricesOnProduction
7661
    self._processMap["getCartByValue"] = Processor.process_getCartByValue
7703
    self._processMap["getCartByValue"] = Processor.process_getCartByValue
7662
    self._processMap["updateItemPricing"] = Processor.process_updateItemPricing
7704
    self._processMap["updateItemPricing"] = Processor.process_updateItemPricing
7663
    self._processMap["bulkUpdateCatalog"] = Processor.process_bulkUpdateCatalog
7705
    self._processMap["bulkUpdateCatalog"] = Processor.process_bulkUpdateCatalog
7664
    self._processMap["getWarrantyInfoForItem"] = Processor.process_getWarrantyInfoForItem
7706
    self._processMap["getWarrantyInfoForItem"] = Processor.process_getWarrantyInfoForItem
-
 
7707
    self._processMap["getWarrantyInfoForItemList"] = Processor.process_getWarrantyInfoForItemList
7665
 
7708
 
7666
  def process(self, iprot, oprot):
7709
  def process(self, iprot, oprot):
7667
    (name, type, seqid) = iprot.readMessageBegin()
7710
    (name, type, seqid) = iprot.readMessageBegin()
7668
    if name not in self._processMap:
7711
    if name not in self._processMap:
7669
      iprot.skip(TType.STRUCT)
7712
      iprot.skip(TType.STRUCT)
Line 10007... Line 10050...
10007
    args = getWarrantyInfoForItem_args()
10050
    args = getWarrantyInfoForItem_args()
10008
    args.read(iprot)
10051
    args.read(iprot)
10009
    iprot.readMessageEnd()
10052
    iprot.readMessageEnd()
10010
    result = getWarrantyInfoForItem_result()
10053
    result = getWarrantyInfoForItem_result()
10011
    try:
10054
    try:
10012
      result.success = self._handler.getWarrantyInfoForItem(args.itemId, args.itemCondition)
10055
      result.success = self._handler.getWarrantyInfoForItem(args.catalogItemId, args.itemCondition)
10013
    except CatalogServiceException, cex:
10056
    except CatalogServiceException, cex:
10014
      result.cex = cex
10057
      result.cex = cex
10015
    oprot.writeMessageBegin("getWarrantyInfoForItem", TMessageType.REPLY, seqid)
10058
    oprot.writeMessageBegin("getWarrantyInfoForItem", TMessageType.REPLY, seqid)
10016
    result.write(oprot)
10059
    result.write(oprot)
10017
    oprot.writeMessageEnd()
10060
    oprot.writeMessageEnd()
10018
    oprot.trans.flush()
10061
    oprot.trans.flush()
10019
 
10062
 
-
 
10063
  def process_getWarrantyInfoForItemList(self, seqid, iprot, oprot):
-
 
10064
    args = getWarrantyInfoForItemList_args()
-
 
10065
    args.read(iprot)
-
 
10066
    iprot.readMessageEnd()
-
 
10067
    result = getWarrantyInfoForItemList_result()
-
 
10068
    try:
-
 
10069
      result.success = self._handler.getWarrantyInfoForItemList(args.catalogItemIds, args.itemCondition)
-
 
10070
    except CatalogServiceException, cex:
-
 
10071
      result.cex = cex
-
 
10072
    oprot.writeMessageBegin("getWarrantyInfoForItemList", TMessageType.REPLY, seqid)
-
 
10073
    result.write(oprot)
-
 
10074
    oprot.writeMessageEnd()
-
 
10075
    oprot.trans.flush()
-
 
10076
 
10020
 
10077
 
10021
# HELPER FUNCTIONS AND STRUCTURES
10078
# HELPER FUNCTIONS AND STRUCTURES
10022
 
10079
 
10023
class addItem_args:
10080
class addItem_args:
10024
  """
10081
  """
Line 35218... Line 35275...
35218
    return not (self == other)
35275
    return not (self == other)
35219
 
35276
 
35220
class getWarrantyInfoForItem_args:
35277
class getWarrantyInfoForItem_args:
35221
  """
35278
  """
35222
  Attributes:
35279
  Attributes:
35223
   - itemId
35280
   - catalogItemId
35224
   - itemCondition
35281
   - itemCondition
35225
  """
35282
  """
35226
 
35283
 
35227
  thrift_spec = (
35284
  thrift_spec = (
35228
    None, # 0
35285
    None, # 0
35229
    (1, TType.I64, 'itemId', None, None, ), # 1
35286
    (1, TType.I64, 'catalogItemId', None, None, ), # 1
35230
    (2, TType.I32, 'itemCondition', None, None, ), # 2
35287
    (2, TType.I32, 'itemCondition', None, None, ), # 2
35231
  )
35288
  )
35232
 
35289
 
35233
  def __init__(self, itemId=None, itemCondition=None,):
35290
  def __init__(self, catalogItemId=None, itemCondition=None,):
35234
    self.itemId = itemId
35291
    self.catalogItemId = catalogItemId
35235
    self.itemCondition = itemCondition
35292
    self.itemCondition = itemCondition
35236
 
35293
 
35237
  def read(self, iprot):
35294
  def read(self, iprot):
35238
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
35295
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
35239
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
35296
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
Line 35243... Line 35300...
35243
      (fname, ftype, fid) = iprot.readFieldBegin()
35300
      (fname, ftype, fid) = iprot.readFieldBegin()
35244
      if ftype == TType.STOP:
35301
      if ftype == TType.STOP:
35245
        break
35302
        break
35246
      if fid == 1:
35303
      if fid == 1:
35247
        if ftype == TType.I64:
35304
        if ftype == TType.I64:
35248
          self.itemId = iprot.readI64();
35305
          self.catalogItemId = iprot.readI64();
35249
        else:
35306
        else:
35250
          iprot.skip(ftype)
35307
          iprot.skip(ftype)
35251
      elif fid == 2:
35308
      elif fid == 2:
35252
        if ftype == TType.I32:
35309
        if ftype == TType.I32:
35253
          self.itemCondition = iprot.readI32();
35310
          self.itemCondition = iprot.readI32();
Line 35261... Line 35318...
35261
  def write(self, oprot):
35318
  def write(self, oprot):
35262
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
35319
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
35263
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
35320
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
35264
      return
35321
      return
35265
    oprot.writeStructBegin('getWarrantyInfoForItem_args')
35322
    oprot.writeStructBegin('getWarrantyInfoForItem_args')
35266
    if self.itemId is not None:
35323
    if self.catalogItemId is not None:
35267
      oprot.writeFieldBegin('itemId', TType.I64, 1)
35324
      oprot.writeFieldBegin('catalogItemId', TType.I64, 1)
35268
      oprot.writeI64(self.itemId)
35325
      oprot.writeI64(self.catalogItemId)
35269
      oprot.writeFieldEnd()
35326
      oprot.writeFieldEnd()
35270
    if self.itemCondition is not None:
35327
    if self.itemCondition is not None:
35271
      oprot.writeFieldBegin('itemCondition', TType.I32, 2)
35328
      oprot.writeFieldBegin('itemCondition', TType.I32, 2)
35272
      oprot.writeI32(self.itemCondition)
35329
      oprot.writeI32(self.itemCondition)
35273
      oprot.writeFieldEnd()
35330
      oprot.writeFieldEnd()
Line 35350... Line 35407...
35350
      oprot.writeMapEnd()
35407
      oprot.writeMapEnd()
35351
      oprot.writeFieldEnd()
35408
      oprot.writeFieldEnd()
35352
    if self.cex is not None:
35409
    if self.cex is not None:
35353
      oprot.writeFieldBegin('cex', TType.STRUCT, 1)
35410
      oprot.writeFieldBegin('cex', TType.STRUCT, 1)
35354
      self.cex.write(oprot)
35411
      self.cex.write(oprot)
-
 
35412
      oprot.writeFieldEnd()
-
 
35413
    oprot.writeFieldStop()
-
 
35414
    oprot.writeStructEnd()
-
 
35415
 
-
 
35416
  def validate(self):
-
 
35417
    return
-
 
35418
 
-
 
35419
 
-
 
35420
  def __repr__(self):
-
 
35421
    L = ['%s=%r' % (key, value)
-
 
35422
      for key, value in self.__dict__.iteritems()]
-
 
35423
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
35424
 
-
 
35425
  def __eq__(self, other):
-
 
35426
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
35427
 
-
 
35428
  def __ne__(self, other):
-
 
35429
    return not (self == other)
-
 
35430
 
-
 
35431
class getWarrantyInfoForItemList_args:
-
 
35432
  """
-
 
35433
  Attributes:
-
 
35434
   - catalogItemIds
-
 
35435
   - itemCondition
-
 
35436
  """
-
 
35437
 
-
 
35438
  thrift_spec = (
-
 
35439
    None, # 0
-
 
35440
    (1, TType.LIST, 'catalogItemIds', (TType.I64,None), None, ), # 1
-
 
35441
    (2, TType.I32, 'itemCondition', None, None, ), # 2
-
 
35442
  )
-
 
35443
 
-
 
35444
  def __init__(self, catalogItemIds=None, itemCondition=None,):
-
 
35445
    self.catalogItemIds = catalogItemIds
-
 
35446
    self.itemCondition = itemCondition
-
 
35447
 
-
 
35448
  def read(self, iprot):
-
 
35449
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
35450
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
35451
      return
-
 
35452
    iprot.readStructBegin()
-
 
35453
    while True:
-
 
35454
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
35455
      if ftype == TType.STOP:
-
 
35456
        break
-
 
35457
      if fid == 1:
-
 
35458
        if ftype == TType.LIST:
-
 
35459
          self.catalogItemIds = []
-
 
35460
          (_etype952, _size949) = iprot.readListBegin()
-
 
35461
          for _i953 in xrange(_size949):
-
 
35462
            _elem954 = iprot.readI64();
-
 
35463
            self.catalogItemIds.append(_elem954)
-
 
35464
          iprot.readListEnd()
-
 
35465
        else:
-
 
35466
          iprot.skip(ftype)
-
 
35467
      elif fid == 2:
-
 
35468
        if ftype == TType.I32:
-
 
35469
          self.itemCondition = iprot.readI32();
-
 
35470
        else:
-
 
35471
          iprot.skip(ftype)
-
 
35472
      else:
-
 
35473
        iprot.skip(ftype)
-
 
35474
      iprot.readFieldEnd()
-
 
35475
    iprot.readStructEnd()
-
 
35476
 
-
 
35477
  def write(self, oprot):
-
 
35478
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
35479
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
35480
      return
-
 
35481
    oprot.writeStructBegin('getWarrantyInfoForItemList_args')
-
 
35482
    if self.catalogItemIds is not None:
-
 
35483
      oprot.writeFieldBegin('catalogItemIds', TType.LIST, 1)
-
 
35484
      oprot.writeListBegin(TType.I64, len(self.catalogItemIds))
-
 
35485
      for iter955 in self.catalogItemIds:
-
 
35486
        oprot.writeI64(iter955)
-
 
35487
      oprot.writeListEnd()
-
 
35488
      oprot.writeFieldEnd()
-
 
35489
    if self.itemCondition is not None:
-
 
35490
      oprot.writeFieldBegin('itemCondition', TType.I32, 2)
-
 
35491
      oprot.writeI32(self.itemCondition)
-
 
35492
      oprot.writeFieldEnd()
-
 
35493
    oprot.writeFieldStop()
-
 
35494
    oprot.writeStructEnd()
-
 
35495
 
-
 
35496
  def validate(self):
-
 
35497
    return
-
 
35498
 
-
 
35499
 
-
 
35500
  def __repr__(self):
-
 
35501
    L = ['%s=%r' % (key, value)
-
 
35502
      for key, value in self.__dict__.iteritems()]
-
 
35503
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
35504
 
-
 
35505
  def __eq__(self, other):
-
 
35506
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
35507
 
-
 
35508
  def __ne__(self, other):
-
 
35509
    return not (self == other)
-
 
35510
 
-
 
35511
class getWarrantyInfoForItemList_result:
-
 
35512
  """
-
 
35513
  Attributes:
-
 
35514
   - success
-
 
35515
   - cex
-
 
35516
  """
-
 
35517
 
-
 
35518
  thrift_spec = (
-
 
35519
    (0, TType.MAP, 'success', (TType.I64,None,TType.MAP,(TType.STRING,None,TType.I64,None)), None, ), # 0
-
 
35520
    (1, TType.STRUCT, 'cex', (CatalogServiceException, CatalogServiceException.thrift_spec), None, ), # 1
-
 
35521
  )
-
 
35522
 
-
 
35523
  def __init__(self, success=None, cex=None,):
-
 
35524
    self.success = success
-
 
35525
    self.cex = cex
-
 
35526
 
-
 
35527
  def read(self, iprot):
-
 
35528
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
35529
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
35530
      return
-
 
35531
    iprot.readStructBegin()
-
 
35532
    while True:
-
 
35533
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
35534
      if ftype == TType.STOP:
-
 
35535
        break
-
 
35536
      if fid == 0:
-
 
35537
        if ftype == TType.MAP:
-
 
35538
          self.success = {}
-
 
35539
          (_ktype957, _vtype958, _size956 ) = iprot.readMapBegin() 
-
 
35540
          for _i960 in xrange(_size956):
-
 
35541
            _key961 = iprot.readI64();
-
 
35542
            _val962 = {}
-
 
35543
            (_ktype964, _vtype965, _size963 ) = iprot.readMapBegin() 
-
 
35544
            for _i967 in xrange(_size963):
-
 
35545
              _key968 = iprot.readString();
-
 
35546
              _val969 = iprot.readI64();
-
 
35547
              _val962[_key968] = _val969
-
 
35548
            iprot.readMapEnd()
-
 
35549
            self.success[_key961] = _val962
-
 
35550
          iprot.readMapEnd()
-
 
35551
        else:
-
 
35552
          iprot.skip(ftype)
-
 
35553
      elif fid == 1:
-
 
35554
        if ftype == TType.STRUCT:
-
 
35555
          self.cex = CatalogServiceException()
-
 
35556
          self.cex.read(iprot)
-
 
35557
        else:
-
 
35558
          iprot.skip(ftype)
-
 
35559
      else:
-
 
35560
        iprot.skip(ftype)
-
 
35561
      iprot.readFieldEnd()
-
 
35562
    iprot.readStructEnd()
-
 
35563
 
-
 
35564
  def write(self, oprot):
-
 
35565
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
35566
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
35567
      return
-
 
35568
    oprot.writeStructBegin('getWarrantyInfoForItemList_result')
-
 
35569
    if self.success is not None:
-
 
35570
      oprot.writeFieldBegin('success', TType.MAP, 0)
-
 
35571
      oprot.writeMapBegin(TType.I64, TType.MAP, len(self.success))
-
 
35572
      for kiter970,viter971 in self.success.items():
-
 
35573
        oprot.writeI64(kiter970)
-
 
35574
        oprot.writeMapBegin(TType.STRING, TType.I64, len(viter971))
-
 
35575
        for kiter972,viter973 in viter971.items():
-
 
35576
          oprot.writeString(kiter972)
-
 
35577
          oprot.writeI64(viter973)
-
 
35578
        oprot.writeMapEnd()
-
 
35579
      oprot.writeMapEnd()
-
 
35580
      oprot.writeFieldEnd()
-
 
35581
    if self.cex is not None:
-
 
35582
      oprot.writeFieldBegin('cex', TType.STRUCT, 1)
-
 
35583
      self.cex.write(oprot)
35355
      oprot.writeFieldEnd()
35584
      oprot.writeFieldEnd()
35356
    oprot.writeFieldStop()
35585
    oprot.writeFieldStop()
35357
    oprot.writeStructEnd()
35586
    oprot.writeStructEnd()
35358
 
35587
 
35359
  def validate(self):
35588
  def validate(self):