Subversion Repositories SmartDukaan

Rev

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

Rev 19686 Rev 19691
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):
-
 
1395
    """
-
 
1396
    Parameters:
-
 
1397
     - itemId
-
 
1398
     - itemCondition
-
 
1399
    """
-
 
1400
    pass
-
 
1401
 
1394
 
1402
 
1395
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1403
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1396
  def __init__(self, iprot, oprot=None):
1404
  def __init__(self, iprot, oprot=None):
1397
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1405
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1398
 
1406
 
Line 7415... Line 7423...
7415
    self._iprot.readMessageEnd()
7423
    self._iprot.readMessageEnd()
7416
    if result.cex is not None:
7424
    if result.cex is not None:
7417
      raise result.cex
7425
      raise result.cex
7418
    return
7426
    return
7419
 
7427
 
-
 
7428
  def getWarrantyInfoForItem(self, itemId, itemCondition):
-
 
7429
    """
-
 
7430
    Parameters:
-
 
7431
     - itemId
-
 
7432
     - itemCondition
-
 
7433
    """
-
 
7434
    self.send_getWarrantyInfoForItem(itemId, itemCondition)
-
 
7435
    return self.recv_getWarrantyInfoForItem()
-
 
7436
 
-
 
7437
  def send_getWarrantyInfoForItem(self, itemId, itemCondition):
-
 
7438
    self._oprot.writeMessageBegin('getWarrantyInfoForItem', TMessageType.CALL, self._seqid)
-
 
7439
    args = getWarrantyInfoForItem_args()
-
 
7440
    args.itemId = itemId
-
 
7441
    args.itemCondition = itemCondition
-
 
7442
    args.write(self._oprot)
-
 
7443
    self._oprot.writeMessageEnd()
-
 
7444
    self._oprot.trans.flush()
-
 
7445
 
-
 
7446
  def recv_getWarrantyInfoForItem(self, ):
-
 
7447
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
7448
    if mtype == TMessageType.EXCEPTION:
-
 
7449
      x = TApplicationException()
-
 
7450
      x.read(self._iprot)
-
 
7451
      self._iprot.readMessageEnd()
-
 
7452
      raise x
-
 
7453
    result = getWarrantyInfoForItem_result()
-
 
7454
    result.read(self._iprot)
-
 
7455
    self._iprot.readMessageEnd()
-
 
7456
    if result.success is not None:
-
 
7457
      return result.success
-
 
7458
    if result.cex is not None:
-
 
7459
      raise result.cex
-
 
7460
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getWarrantyInfoForItem failed: unknown result");
-
 
7461
 
7420
 
7462
 
7421
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
7463
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
7422
  def __init__(self, handler):
7464
  def __init__(self, handler):
7423
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
7465
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
7424
    self._processMap["addItem"] = Processor.process_addItem
7466
    self._processMap["addItem"] = Processor.process_addItem
Line 7617... Line 7659...
7617
    self._processMap["getBulkPricingByItemId"] = Processor.process_getBulkPricingByItemId
7659
    self._processMap["getBulkPricingByItemId"] = Processor.process_getBulkPricingByItemId
7618
    self._processMap["updateBulkPricesOnProduction"] = Processor.process_updateBulkPricesOnProduction
7660
    self._processMap["updateBulkPricesOnProduction"] = Processor.process_updateBulkPricesOnProduction
7619
    self._processMap["getCartByValue"] = Processor.process_getCartByValue
7661
    self._processMap["getCartByValue"] = Processor.process_getCartByValue
7620
    self._processMap["updateItemPricing"] = Processor.process_updateItemPricing
7662
    self._processMap["updateItemPricing"] = Processor.process_updateItemPricing
7621
    self._processMap["bulkUpdateCatalog"] = Processor.process_bulkUpdateCatalog
7663
    self._processMap["bulkUpdateCatalog"] = Processor.process_bulkUpdateCatalog
-
 
7664
    self._processMap["getWarrantyInfoForItem"] = Processor.process_getWarrantyInfoForItem
7622
 
7665
 
7623
  def process(self, iprot, oprot):
7666
  def process(self, iprot, oprot):
7624
    (name, type, seqid) = iprot.readMessageBegin()
7667
    (name, type, seqid) = iprot.readMessageBegin()
7625
    if name not in self._processMap:
7668
    if name not in self._processMap:
7626
      iprot.skip(TType.STRUCT)
7669
      iprot.skip(TType.STRUCT)
Line 9958... Line 10001...
9958
    oprot.writeMessageBegin("bulkUpdateCatalog", TMessageType.REPLY, seqid)
10001
    oprot.writeMessageBegin("bulkUpdateCatalog", TMessageType.REPLY, seqid)
9959
    result.write(oprot)
10002
    result.write(oprot)
9960
    oprot.writeMessageEnd()
10003
    oprot.writeMessageEnd()
9961
    oprot.trans.flush()
10004
    oprot.trans.flush()
9962
 
10005
 
-
 
10006
  def process_getWarrantyInfoForItem(self, seqid, iprot, oprot):
-
 
10007
    args = getWarrantyInfoForItem_args()
-
 
10008
    args.read(iprot)
-
 
10009
    iprot.readMessageEnd()
-
 
10010
    result = getWarrantyInfoForItem_result()
-
 
10011
    try:
-
 
10012
      result.success = self._handler.getWarrantyInfoForItem(args.itemId, args.itemCondition)
-
 
10013
    except CatalogServiceException, cex:
-
 
10014
      result.cex = cex
-
 
10015
    oprot.writeMessageBegin("getWarrantyInfoForItem", TMessageType.REPLY, seqid)
-
 
10016
    result.write(oprot)
-
 
10017
    oprot.writeMessageEnd()
-
 
10018
    oprot.trans.flush()
-
 
10019
 
9963
 
10020
 
9964
# HELPER FUNCTIONS AND STRUCTURES
10021
# HELPER FUNCTIONS AND STRUCTURES
9965
 
10022
 
9966
class addItem_args:
10023
class addItem_args:
9967
  """
10024
  """
Line 35141... Line 35198...
35141
    if self.cex is not None:
35198
    if self.cex is not None:
35142
      oprot.writeFieldBegin('cex', TType.STRUCT, 1)
35199
      oprot.writeFieldBegin('cex', TType.STRUCT, 1)
35143
      self.cex.write(oprot)
35200
      self.cex.write(oprot)
35144
      oprot.writeFieldEnd()
35201
      oprot.writeFieldEnd()
35145
    oprot.writeFieldStop()
35202
    oprot.writeFieldStop()
-
 
35203
    oprot.writeStructEnd()
-
 
35204
 
-
 
35205
  def validate(self):
-
 
35206
    return
-
 
35207
 
-
 
35208
 
-
 
35209
  def __repr__(self):
-
 
35210
    L = ['%s=%r' % (key, value)
-
 
35211
      for key, value in self.__dict__.iteritems()]
-
 
35212
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
35213
 
-
 
35214
  def __eq__(self, other):
-
 
35215
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
35216
 
-
 
35217
  def __ne__(self, other):
-
 
35218
    return not (self == other)
-
 
35219
 
-
 
35220
class getWarrantyInfoForItem_args:
-
 
35221
  """
-
 
35222
  Attributes:
-
 
35223
   - itemId
-
 
35224
   - itemCondition
-
 
35225
  """
-
 
35226
 
-
 
35227
  thrift_spec = (
-
 
35228
    None, # 0
-
 
35229
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
35230
    (2, TType.I32, 'itemCondition', None, None, ), # 2
-
 
35231
  )
-
 
35232
 
-
 
35233
  def __init__(self, itemId=None, itemCondition=None,):
-
 
35234
    self.itemId = itemId
-
 
35235
    self.itemCondition = itemCondition
-
 
35236
 
-
 
35237
  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:
-
 
35239
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
35240
      return
-
 
35241
    iprot.readStructBegin()
-
 
35242
    while True:
-
 
35243
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
35244
      if ftype == TType.STOP:
-
 
35245
        break
-
 
35246
      if fid == 1:
-
 
35247
        if ftype == TType.I64:
-
 
35248
          self.itemId = iprot.readI64();
-
 
35249
        else:
-
 
35250
          iprot.skip(ftype)
-
 
35251
      elif fid == 2:
-
 
35252
        if ftype == TType.I32:
-
 
35253
          self.itemCondition = iprot.readI32();
-
 
35254
        else:
-
 
35255
          iprot.skip(ftype)
-
 
35256
      else:
-
 
35257
        iprot.skip(ftype)
-
 
35258
      iprot.readFieldEnd()
-
 
35259
    iprot.readStructEnd()
-
 
35260
 
-
 
35261
  def write(self, oprot):
-
 
35262
    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)))
-
 
35264
      return
-
 
35265
    oprot.writeStructBegin('getWarrantyInfoForItem_args')
-
 
35266
    if self.itemId is not None:
-
 
35267
      oprot.writeFieldBegin('itemId', TType.I64, 1)
-
 
35268
      oprot.writeI64(self.itemId)
-
 
35269
      oprot.writeFieldEnd()
-
 
35270
    if self.itemCondition is not None:
-
 
35271
      oprot.writeFieldBegin('itemCondition', TType.I32, 2)
-
 
35272
      oprot.writeI32(self.itemCondition)
-
 
35273
      oprot.writeFieldEnd()
-
 
35274
    oprot.writeFieldStop()
-
 
35275
    oprot.writeStructEnd()
-
 
35276
 
-
 
35277
  def validate(self):
-
 
35278
    return
-
 
35279
 
-
 
35280
 
-
 
35281
  def __repr__(self):
-
 
35282
    L = ['%s=%r' % (key, value)
-
 
35283
      for key, value in self.__dict__.iteritems()]
-
 
35284
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
35285
 
-
 
35286
  def __eq__(self, other):
-
 
35287
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
35288
 
-
 
35289
  def __ne__(self, other):
-
 
35290
    return not (self == other)
-
 
35291
 
-
 
35292
class getWarrantyInfoForItem_result:
-
 
35293
  """
-
 
35294
  Attributes:
-
 
35295
   - success
-
 
35296
   - cex
-
 
35297
  """
-
 
35298
 
-
 
35299
  thrift_spec = (
-
 
35300
    (0, TType.MAP, 'success', (TType.STRING,None,TType.I64,None), None, ), # 0
-
 
35301
    (1, TType.STRUCT, 'cex', (CatalogServiceException, CatalogServiceException.thrift_spec), None, ), # 1
-
 
35302
  )
-
 
35303
 
-
 
35304
  def __init__(self, success=None, cex=None,):
-
 
35305
    self.success = success
-
 
35306
    self.cex = cex
-
 
35307
 
-
 
35308
  def read(self, iprot):
-
 
35309
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
35310
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
35311
      return
-
 
35312
    iprot.readStructBegin()
-
 
35313
    while True:
-
 
35314
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
35315
      if ftype == TType.STOP:
-
 
35316
        break
-
 
35317
      if fid == 0:
-
 
35318
        if ftype == TType.MAP:
-
 
35319
          self.success = {}
-
 
35320
          (_ktype941, _vtype942, _size940 ) = iprot.readMapBegin() 
-
 
35321
          for _i944 in xrange(_size940):
-
 
35322
            _key945 = iprot.readString();
-
 
35323
            _val946 = iprot.readI64();
-
 
35324
            self.success[_key945] = _val946
-
 
35325
          iprot.readMapEnd()
-
 
35326
        else:
-
 
35327
          iprot.skip(ftype)
-
 
35328
      elif fid == 1:
-
 
35329
        if ftype == TType.STRUCT:
-
 
35330
          self.cex = CatalogServiceException()
-
 
35331
          self.cex.read(iprot)
-
 
35332
        else:
-
 
35333
          iprot.skip(ftype)
-
 
35334
      else:
-
 
35335
        iprot.skip(ftype)
-
 
35336
      iprot.readFieldEnd()
-
 
35337
    iprot.readStructEnd()
-
 
35338
 
-
 
35339
  def write(self, oprot):
-
 
35340
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
35341
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
35342
      return
-
 
35343
    oprot.writeStructBegin('getWarrantyInfoForItem_result')
-
 
35344
    if self.success is not None:
-
 
35345
      oprot.writeFieldBegin('success', TType.MAP, 0)
-
 
35346
      oprot.writeMapBegin(TType.STRING, TType.I64, len(self.success))
-
 
35347
      for kiter947,viter948 in self.success.items():
-
 
35348
        oprot.writeString(kiter947)
-
 
35349
        oprot.writeI64(viter948)
-
 
35350
      oprot.writeMapEnd()
-
 
35351
      oprot.writeFieldEnd()
-
 
35352
    if self.cex is not None:
-
 
35353
      oprot.writeFieldBegin('cex', TType.STRUCT, 1)
-
 
35354
      self.cex.write(oprot)
-
 
35355
      oprot.writeFieldEnd()
-
 
35356
    oprot.writeFieldStop()
35146
    oprot.writeStructEnd()
35357
    oprot.writeStructEnd()
35147
 
35358
 
35148
  def validate(self):
35359
  def validate(self):
35149
    return
35360
    return
35150
 
35361