Subversion Repositories SmartDukaan

Rev

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

Rev 6467 Rev 6484
Line 370... Line 370...
370
    Parameters:
370
    Parameters:
371
     - vendorId
371
     - vendorId
372
    """
372
    """
373
    pass
373
    pass
374
 
374
 
-
 
375
  def getItemAvailabilitiesAtOurWarehouses(self, item_ids):
-
 
376
    """
-
 
377
    Parameters:
-
 
378
     - item_ids
-
 
379
    """
-
 
380
    pass
-
 
381
 
375
 
382
 
376
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
383
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
377
  def __init__(self, iprot, oprot=None):
384
  def __init__(self, iprot, oprot=None):
378
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
385
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
379
 
386
 
Line 1628... Line 1635...
1628
    self._iprot.readMessageEnd()
1635
    self._iprot.readMessageEnd()
1629
    if result.success is not None:
1636
    if result.success is not None:
1630
      return result.success
1637
      return result.success
1631
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getOurWarehouseIdForVendor failed: unknown result");
1638
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getOurWarehouseIdForVendor failed: unknown result");
1632
 
1639
 
-
 
1640
  def getItemAvailabilitiesAtOurWarehouses(self, item_ids):
-
 
1641
    """
-
 
1642
    Parameters:
-
 
1643
     - item_ids
-
 
1644
    """
-
 
1645
    self.send_getItemAvailabilitiesAtOurWarehouses(item_ids)
-
 
1646
    return self.recv_getItemAvailabilitiesAtOurWarehouses()
-
 
1647
 
-
 
1648
  def send_getItemAvailabilitiesAtOurWarehouses(self, item_ids):
-
 
1649
    self._oprot.writeMessageBegin('getItemAvailabilitiesAtOurWarehouses', TMessageType.CALL, self._seqid)
-
 
1650
    args = getItemAvailabilitiesAtOurWarehouses_args()
-
 
1651
    args.item_ids = item_ids
-
 
1652
    args.write(self._oprot)
-
 
1653
    self._oprot.writeMessageEnd()
-
 
1654
    self._oprot.trans.flush()
-
 
1655
 
-
 
1656
  def recv_getItemAvailabilitiesAtOurWarehouses(self, ):
-
 
1657
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1658
    if mtype == TMessageType.EXCEPTION:
-
 
1659
      x = TApplicationException()
-
 
1660
      x.read(self._iprot)
-
 
1661
      self._iprot.readMessageEnd()
-
 
1662
      raise x
-
 
1663
    result = getItemAvailabilitiesAtOurWarehouses_result()
-
 
1664
    result.read(self._iprot)
-
 
1665
    self._iprot.readMessageEnd()
-
 
1666
    if result.success is not None:
-
 
1667
      return result.success
-
 
1668
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemAvailabilitiesAtOurWarehouses failed: unknown result");
-
 
1669
 
1633
 
1670
 
1634
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1671
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1635
  def __init__(self, handler):
1672
  def __init__(self, handler):
1636
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1673
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1637
    self._processMap["addWarehouse"] = Processor.process_addWarehouse
1674
    self._processMap["addWarehouse"] = Processor.process_addWarehouse
Line 1669... Line 1706...
1669
    self._processMap["getInventorySnapshot"] = Processor.process_getInventorySnapshot
1706
    self._processMap["getInventorySnapshot"] = Processor.process_getInventorySnapshot
1670
    self._processMap["clearItemAvailabilityCache"] = Processor.process_clearItemAvailabilityCache
1707
    self._processMap["clearItemAvailabilityCache"] = Processor.process_clearItemAvailabilityCache
1671
    self._processMap["updateVendorString"] = Processor.process_updateVendorString
1708
    self._processMap["updateVendorString"] = Processor.process_updateVendorString
1672
    self._processMap["clearItemAvailabilityCacheForItem"] = Processor.process_clearItemAvailabilityCacheForItem
1709
    self._processMap["clearItemAvailabilityCacheForItem"] = Processor.process_clearItemAvailabilityCacheForItem
1673
    self._processMap["getOurWarehouseIdForVendor"] = Processor.process_getOurWarehouseIdForVendor
1710
    self._processMap["getOurWarehouseIdForVendor"] = Processor.process_getOurWarehouseIdForVendor
-
 
1711
    self._processMap["getItemAvailabilitiesAtOurWarehouses"] = Processor.process_getItemAvailabilitiesAtOurWarehouses
1674
 
1712
 
1675
  def process(self, iprot, oprot):
1713
  def process(self, iprot, oprot):
1676
    (name, type, seqid) = iprot.readMessageBegin()
1714
    (name, type, seqid) = iprot.readMessageBegin()
1677
    if name not in self._processMap:
1715
    if name not in self._processMap:
1678
      iprot.skip(TType.STRUCT)
1716
      iprot.skip(TType.STRUCT)
Line 2158... Line 2196...
2158
    oprot.writeMessageBegin("getOurWarehouseIdForVendor", TMessageType.REPLY, seqid)
2196
    oprot.writeMessageBegin("getOurWarehouseIdForVendor", TMessageType.REPLY, seqid)
2159
    result.write(oprot)
2197
    result.write(oprot)
2160
    oprot.writeMessageEnd()
2198
    oprot.writeMessageEnd()
2161
    oprot.trans.flush()
2199
    oprot.trans.flush()
2162
 
2200
 
-
 
2201
  def process_getItemAvailabilitiesAtOurWarehouses(self, seqid, iprot, oprot):
-
 
2202
    args = getItemAvailabilitiesAtOurWarehouses_args()
-
 
2203
    args.read(iprot)
-
 
2204
    iprot.readMessageEnd()
-
 
2205
    result = getItemAvailabilitiesAtOurWarehouses_result()
-
 
2206
    result.success = self._handler.getItemAvailabilitiesAtOurWarehouses(args.item_ids)
-
 
2207
    oprot.writeMessageBegin("getItemAvailabilitiesAtOurWarehouses", TMessageType.REPLY, seqid)
-
 
2208
    result.write(oprot)
-
 
2209
    oprot.writeMessageEnd()
-
 
2210
    oprot.trans.flush()
-
 
2211
 
2163
 
2212
 
2164
# HELPER FUNCTIONS AND STRUCTURES
2213
# HELPER FUNCTIONS AND STRUCTURES
2165
 
2214
 
2166
class addWarehouse_args:
2215
class addWarehouse_args:
2167
  """
2216
  """
Line 7142... Line 7191...
7142
      oprot.writeFieldEnd()
7191
      oprot.writeFieldEnd()
7143
    oprot.writeFieldStop()
7192
    oprot.writeFieldStop()
7144
    oprot.writeStructEnd()
7193
    oprot.writeStructEnd()
7145
 
7194
 
7146
  def validate(self):
7195
  def validate(self):
-
 
7196
    return
-
 
7197
 
-
 
7198
 
-
 
7199
  def __repr__(self):
-
 
7200
    L = ['%s=%r' % (key, value)
-
 
7201
      for key, value in self.__dict__.iteritems()]
-
 
7202
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
7203
 
-
 
7204
  def __eq__(self, other):
-
 
7205
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
7206
 
-
 
7207
  def __ne__(self, other):
-
 
7208
    return not (self == other)
-
 
7209
 
-
 
7210
class getItemAvailabilitiesAtOurWarehouses_args:
-
 
7211
  """
-
 
7212
  Attributes:
-
 
7213
   - item_ids
-
 
7214
  """
-
 
7215
 
-
 
7216
  thrift_spec = (
-
 
7217
    None, # 0
-
 
7218
    (1, TType.LIST, 'item_ids', (TType.I64,None), None, ), # 1
-
 
7219
  )
-
 
7220
 
-
 
7221
  def __init__(self, item_ids=None,):
-
 
7222
    self.item_ids = item_ids
-
 
7223
 
-
 
7224
  def read(self, iprot):
-
 
7225
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
7226
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
7227
      return
-
 
7228
    iprot.readStructBegin()
-
 
7229
    while True:
-
 
7230
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
7231
      if ftype == TType.STOP:
-
 
7232
        break
-
 
7233
      if fid == 1:
-
 
7234
        if ftype == TType.LIST:
-
 
7235
          self.item_ids = []
-
 
7236
          (_etype143, _size140) = iprot.readListBegin()
-
 
7237
          for _i144 in xrange(_size140):
-
 
7238
            _elem145 = iprot.readI64();
-
 
7239
            self.item_ids.append(_elem145)
-
 
7240
          iprot.readListEnd()
-
 
7241
        else:
-
 
7242
          iprot.skip(ftype)
-
 
7243
      else:
-
 
7244
        iprot.skip(ftype)
-
 
7245
      iprot.readFieldEnd()
-
 
7246
    iprot.readStructEnd()
-
 
7247
 
-
 
7248
  def write(self, oprot):
-
 
7249
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
7250
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
7251
      return
-
 
7252
    oprot.writeStructBegin('getItemAvailabilitiesAtOurWarehouses_args')
-
 
7253
    if self.item_ids is not None:
-
 
7254
      oprot.writeFieldBegin('item_ids', TType.LIST, 1)
-
 
7255
      oprot.writeListBegin(TType.I64, len(self.item_ids))
-
 
7256
      for iter146 in self.item_ids:
-
 
7257
        oprot.writeI64(iter146)
-
 
7258
      oprot.writeListEnd()
-
 
7259
      oprot.writeFieldEnd()
-
 
7260
    oprot.writeFieldStop()
-
 
7261
    oprot.writeStructEnd()
-
 
7262
 
-
 
7263
  def validate(self):
-
 
7264
    return
-
 
7265
 
-
 
7266
 
-
 
7267
  def __repr__(self):
-
 
7268
    L = ['%s=%r' % (key, value)
-
 
7269
      for key, value in self.__dict__.iteritems()]
-
 
7270
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
7271
 
-
 
7272
  def __eq__(self, other):
-
 
7273
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
7274
 
-
 
7275
  def __ne__(self, other):
-
 
7276
    return not (self == other)
-
 
7277
 
-
 
7278
class getItemAvailabilitiesAtOurWarehouses_result:
-
 
7279
  """
-
 
7280
  Attributes:
-
 
7281
   - success
-
 
7282
  """
-
 
7283
 
-
 
7284
  thrift_spec = (
-
 
7285
    (0, TType.MAP, 'success', (TType.I64,None,TType.I64,None), None, ), # 0
-
 
7286
  )
-
 
7287
 
-
 
7288
  def __init__(self, success=None,):
-
 
7289
    self.success = success
-
 
7290
 
-
 
7291
  def read(self, iprot):
-
 
7292
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
7293
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
7294
      return
-
 
7295
    iprot.readStructBegin()
-
 
7296
    while True:
-
 
7297
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
7298
      if ftype == TType.STOP:
-
 
7299
        break
-
 
7300
      if fid == 0:
-
 
7301
        if ftype == TType.MAP:
-
 
7302
          self.success = {}
-
 
7303
          (_ktype148, _vtype149, _size147 ) = iprot.readMapBegin() 
-
 
7304
          for _i151 in xrange(_size147):
-
 
7305
            _key152 = iprot.readI64();
-
 
7306
            _val153 = iprot.readI64();
-
 
7307
            self.success[_key152] = _val153
-
 
7308
          iprot.readMapEnd()
-
 
7309
        else:
-
 
7310
          iprot.skip(ftype)
-
 
7311
      else:
-
 
7312
        iprot.skip(ftype)
-
 
7313
      iprot.readFieldEnd()
-
 
7314
    iprot.readStructEnd()
-
 
7315
 
-
 
7316
  def write(self, oprot):
-
 
7317
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
7318
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
7319
      return
-
 
7320
    oprot.writeStructBegin('getItemAvailabilitiesAtOurWarehouses_result')
-
 
7321
    if self.success is not None:
-
 
7322
      oprot.writeFieldBegin('success', TType.MAP, 0)
-
 
7323
      oprot.writeMapBegin(TType.I64, TType.I64, len(self.success))
-
 
7324
      for kiter154,viter155 in self.success.items():
-
 
7325
        oprot.writeI64(kiter154)
-
 
7326
        oprot.writeI64(viter155)
-
 
7327
      oprot.writeMapEnd()
-
 
7328
      oprot.writeFieldEnd()
-
 
7329
    oprot.writeFieldStop()
-
 
7330
    oprot.writeStructEnd()
-
 
7331
 
-
 
7332
  def validate(self):
7147
    return
7333
    return
7148
 
7334
 
7149
 
7335
 
7150
  def __repr__(self):
7336
  def __repr__(self):
7151
    L = ['%s=%r' % (key, value)
7337
    L = ['%s=%r' % (key, value)