Subversion Repositories SmartDukaan

Rev

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

Rev 19413 Rev 19474
Line 251... Line 251...
251
     - destPincode
251
     - destPincode
252
     - price
252
     - price
253
    """
253
    """
254
    pass
254
    pass
255
 
255
 
-
 
256
  def getCostingAndDeliveryEstimateForPincode(self, pincode, transactionAmount, isCod, weight, billingWarehouseId, isCompleteTxn):
-
 
257
    """
-
 
258
    Parameters:
-
 
259
     - pincode
-
 
260
     - transactionAmount
-
 
261
     - isCod
-
 
262
     - weight
-
 
263
     - billingWarehouseId
-
 
264
     - isCompleteTxn
-
 
265
    """
-
 
266
    pass
-
 
267
 
256
 
268
 
257
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
269
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
258
  def __init__(self, iprot, oprot=None):
270
  def __init__(self, iprot, oprot=None):
259
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
271
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
260
 
272
 
Line 1115... Line 1127...
1115
    self._iprot.readMessageEnd()
1127
    self._iprot.readMessageEnd()
1116
    if result.success is not None:
1128
    if result.success is not None:
1117
      return result.success
1129
      return result.success
1118
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getLocationInfoMap failed: unknown result");
1130
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getLocationInfoMap failed: unknown result");
1119
 
1131
 
-
 
1132
  def getCostingAndDeliveryEstimateForPincode(self, pincode, transactionAmount, isCod, weight, billingWarehouseId, isCompleteTxn):
-
 
1133
    """
-
 
1134
    Parameters:
-
 
1135
     - pincode
-
 
1136
     - transactionAmount
-
 
1137
     - isCod
-
 
1138
     - weight
-
 
1139
     - billingWarehouseId
-
 
1140
     - isCompleteTxn
-
 
1141
    """
-
 
1142
    self.send_getCostingAndDeliveryEstimateForPincode(pincode, transactionAmount, isCod, weight, billingWarehouseId, isCompleteTxn)
-
 
1143
    return self.recv_getCostingAndDeliveryEstimateForPincode()
-
 
1144
 
-
 
1145
  def send_getCostingAndDeliveryEstimateForPincode(self, pincode, transactionAmount, isCod, weight, billingWarehouseId, isCompleteTxn):
-
 
1146
    self._oprot.writeMessageBegin('getCostingAndDeliveryEstimateForPincode', TMessageType.CALL, self._seqid)
-
 
1147
    args = getCostingAndDeliveryEstimateForPincode_args()
-
 
1148
    args.pincode = pincode
-
 
1149
    args.transactionAmount = transactionAmount
-
 
1150
    args.isCod = isCod
-
 
1151
    args.weight = weight
-
 
1152
    args.billingWarehouseId = billingWarehouseId
-
 
1153
    args.isCompleteTxn = isCompleteTxn
-
 
1154
    args.write(self._oprot)
-
 
1155
    self._oprot.writeMessageEnd()
-
 
1156
    self._oprot.trans.flush()
-
 
1157
 
-
 
1158
  def recv_getCostingAndDeliveryEstimateForPincode(self, ):
-
 
1159
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1160
    if mtype == TMessageType.EXCEPTION:
-
 
1161
      x = TApplicationException()
-
 
1162
      x.read(self._iprot)
-
 
1163
      self._iprot.readMessageEnd()
-
 
1164
      raise x
-
 
1165
    result = getCostingAndDeliveryEstimateForPincode_result()
-
 
1166
    result.read(self._iprot)
-
 
1167
    self._iprot.readMessageEnd()
-
 
1168
    if result.success is not None:
-
 
1169
      return result.success
-
 
1170
    if result.se is not None:
-
 
1171
      raise result.se
-
 
1172
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCostingAndDeliveryEstimateForPincode failed: unknown result");
-
 
1173
 
1120
 
1174
 
1121
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1175
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1122
  def __init__(self, handler):
1176
  def __init__(self, handler):
1123
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1177
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1124
    self._processMap["getProvider"] = Processor.process_getProvider
1178
    self._processMap["getProvider"] = Processor.process_getProvider
Line 1144... Line 1198...
1144
    self._processMap["adjustDeliveryDays"] = Processor.process_adjustDeliveryDays
1198
    self._processMap["adjustDeliveryDays"] = Processor.process_adjustDeliveryDays
1145
    self._processMap["getFirstDeliveryEstimateForWhLocation"] = Processor.process_getFirstDeliveryEstimateForWhLocation
1199
    self._processMap["getFirstDeliveryEstimateForWhLocation"] = Processor.process_getFirstDeliveryEstimateForWhLocation
1146
    self._processMap["getNewEmptyAwb"] = Processor.process_getNewEmptyAwb
1200
    self._processMap["getNewEmptyAwb"] = Processor.process_getNewEmptyAwb
1147
    self._processMap["getProviderLimitDetailsForPincode"] = Processor.process_getProviderLimitDetailsForPincode
1201
    self._processMap["getProviderLimitDetailsForPincode"] = Processor.process_getProviderLimitDetailsForPincode
1148
    self._processMap["getLocationInfoMap"] = Processor.process_getLocationInfoMap
1202
    self._processMap["getLocationInfoMap"] = Processor.process_getLocationInfoMap
-
 
1203
    self._processMap["getCostingAndDeliveryEstimateForPincode"] = Processor.process_getCostingAndDeliveryEstimateForPincode
1149
 
1204
 
1150
  def process(self, iprot, oprot):
1205
  def process(self, iprot, oprot):
1151
    (name, type, seqid) = iprot.readMessageBegin()
1206
    (name, type, seqid) = iprot.readMessageBegin()
1152
    if name not in self._processMap:
1207
    if name not in self._processMap:
1153
      iprot.skip(TType.STRUCT)
1208
      iprot.skip(TType.STRUCT)
Line 1471... Line 1526...
1471
    oprot.writeMessageBegin("getLocationInfoMap", TMessageType.REPLY, seqid)
1526
    oprot.writeMessageBegin("getLocationInfoMap", TMessageType.REPLY, seqid)
1472
    result.write(oprot)
1527
    result.write(oprot)
1473
    oprot.writeMessageEnd()
1528
    oprot.writeMessageEnd()
1474
    oprot.trans.flush()
1529
    oprot.trans.flush()
1475
 
1530
 
-
 
1531
  def process_getCostingAndDeliveryEstimateForPincode(self, seqid, iprot, oprot):
-
 
1532
    args = getCostingAndDeliveryEstimateForPincode_args()
-
 
1533
    args.read(iprot)
-
 
1534
    iprot.readMessageEnd()
-
 
1535
    result = getCostingAndDeliveryEstimateForPincode_result()
-
 
1536
    try:
-
 
1537
      result.success = self._handler.getCostingAndDeliveryEstimateForPincode(args.pincode, args.transactionAmount, args.isCod, args.weight, args.billingWarehouseId, args.isCompleteTxn)
-
 
1538
    except LogisticsServiceException, se:
-
 
1539
      result.se = se
-
 
1540
    oprot.writeMessageBegin("getCostingAndDeliveryEstimateForPincode", TMessageType.REPLY, seqid)
-
 
1541
    result.write(oprot)
-
 
1542
    oprot.writeMessageEnd()
-
 
1543
    oprot.trans.flush()
-
 
1544
 
1476
 
1545
 
1477
# HELPER FUNCTIONS AND STRUCTURES
1546
# HELPER FUNCTIONS AND STRUCTURES
1478
 
1547
 
1479
class getProvider_args:
1548
class getProvider_args:
1480
  """
1549
  """
Line 5003... Line 5072...
5003
      oprot.writeFieldEnd()
5072
      oprot.writeFieldEnd()
5004
    oprot.writeFieldStop()
5073
    oprot.writeFieldStop()
5005
    oprot.writeStructEnd()
5074
    oprot.writeStructEnd()
5006
 
5075
 
5007
  def validate(self):
5076
  def validate(self):
-
 
5077
    return
-
 
5078
 
-
 
5079
 
-
 
5080
  def __repr__(self):
-
 
5081
    L = ['%s=%r' % (key, value)
-
 
5082
      for key, value in self.__dict__.iteritems()]
-
 
5083
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
5084
 
-
 
5085
  def __eq__(self, other):
-
 
5086
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
5087
 
-
 
5088
  def __ne__(self, other):
-
 
5089
    return not (self == other)
-
 
5090
 
-
 
5091
class getCostingAndDeliveryEstimateForPincode_args:
-
 
5092
  """
-
 
5093
  Attributes:
-
 
5094
   - pincode
-
 
5095
   - transactionAmount
-
 
5096
   - isCod
-
 
5097
   - weight
-
 
5098
   - billingWarehouseId
-
 
5099
   - isCompleteTxn
-
 
5100
  """
-
 
5101
 
-
 
5102
  thrift_spec = (
-
 
5103
    None, # 0
-
 
5104
    (1, TType.STRING, 'pincode', None, None, ), # 1
-
 
5105
    (2, TType.DOUBLE, 'transactionAmount', None, None, ), # 2
-
 
5106
    (3, TType.BOOL, 'isCod', None, None, ), # 3
-
 
5107
    (4, TType.DOUBLE, 'weight', None, None, ), # 4
-
 
5108
    (5, TType.I64, 'billingWarehouseId', None, None, ), # 5
-
 
5109
    (6, TType.BOOL, 'isCompleteTxn', None, None, ), # 6
-
 
5110
  )
-
 
5111
 
-
 
5112
  def __init__(self, pincode=None, transactionAmount=None, isCod=None, weight=None, billingWarehouseId=None, isCompleteTxn=None,):
-
 
5113
    self.pincode = pincode
-
 
5114
    self.transactionAmount = transactionAmount
-
 
5115
    self.isCod = isCod
-
 
5116
    self.weight = weight
-
 
5117
    self.billingWarehouseId = billingWarehouseId
-
 
5118
    self.isCompleteTxn = isCompleteTxn
-
 
5119
 
-
 
5120
  def read(self, iprot):
-
 
5121
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
5122
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
5123
      return
-
 
5124
    iprot.readStructBegin()
-
 
5125
    while True:
-
 
5126
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
5127
      if ftype == TType.STOP:
-
 
5128
        break
-
 
5129
      if fid == 1:
-
 
5130
        if ftype == TType.STRING:
-
 
5131
          self.pincode = iprot.readString();
-
 
5132
        else:
-
 
5133
          iprot.skip(ftype)
-
 
5134
      elif fid == 2:
-
 
5135
        if ftype == TType.DOUBLE:
-
 
5136
          self.transactionAmount = iprot.readDouble();
-
 
5137
        else:
-
 
5138
          iprot.skip(ftype)
-
 
5139
      elif fid == 3:
-
 
5140
        if ftype == TType.BOOL:
-
 
5141
          self.isCod = iprot.readBool();
-
 
5142
        else:
-
 
5143
          iprot.skip(ftype)
-
 
5144
      elif fid == 4:
-
 
5145
        if ftype == TType.DOUBLE:
-
 
5146
          self.weight = iprot.readDouble();
-
 
5147
        else:
-
 
5148
          iprot.skip(ftype)
-
 
5149
      elif fid == 5:
-
 
5150
        if ftype == TType.I64:
-
 
5151
          self.billingWarehouseId = iprot.readI64();
-
 
5152
        else:
-
 
5153
          iprot.skip(ftype)
-
 
5154
      elif fid == 6:
-
 
5155
        if ftype == TType.BOOL:
-
 
5156
          self.isCompleteTxn = iprot.readBool();
-
 
5157
        else:
-
 
5158
          iprot.skip(ftype)
-
 
5159
      else:
-
 
5160
        iprot.skip(ftype)
-
 
5161
      iprot.readFieldEnd()
-
 
5162
    iprot.readStructEnd()
-
 
5163
 
-
 
5164
  def write(self, oprot):
-
 
5165
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
5166
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
5167
      return
-
 
5168
    oprot.writeStructBegin('getCostingAndDeliveryEstimateForPincode_args')
-
 
5169
    if self.pincode is not None:
-
 
5170
      oprot.writeFieldBegin('pincode', TType.STRING, 1)
-
 
5171
      oprot.writeString(self.pincode)
-
 
5172
      oprot.writeFieldEnd()
-
 
5173
    if self.transactionAmount is not None:
-
 
5174
      oprot.writeFieldBegin('transactionAmount', TType.DOUBLE, 2)
-
 
5175
      oprot.writeDouble(self.transactionAmount)
-
 
5176
      oprot.writeFieldEnd()
-
 
5177
    if self.isCod is not None:
-
 
5178
      oprot.writeFieldBegin('isCod', TType.BOOL, 3)
-
 
5179
      oprot.writeBool(self.isCod)
-
 
5180
      oprot.writeFieldEnd()
-
 
5181
    if self.weight is not None:
-
 
5182
      oprot.writeFieldBegin('weight', TType.DOUBLE, 4)
-
 
5183
      oprot.writeDouble(self.weight)
-
 
5184
      oprot.writeFieldEnd()
-
 
5185
    if self.billingWarehouseId is not None:
-
 
5186
      oprot.writeFieldBegin('billingWarehouseId', TType.I64, 5)
-
 
5187
      oprot.writeI64(self.billingWarehouseId)
-
 
5188
      oprot.writeFieldEnd()
-
 
5189
    if self.isCompleteTxn is not None:
-
 
5190
      oprot.writeFieldBegin('isCompleteTxn', TType.BOOL, 6)
-
 
5191
      oprot.writeBool(self.isCompleteTxn)
-
 
5192
      oprot.writeFieldEnd()
-
 
5193
    oprot.writeFieldStop()
-
 
5194
    oprot.writeStructEnd()
-
 
5195
 
-
 
5196
  def validate(self):
-
 
5197
    return
-
 
5198
 
-
 
5199
 
-
 
5200
  def __repr__(self):
-
 
5201
    L = ['%s=%r' % (key, value)
-
 
5202
      for key, value in self.__dict__.iteritems()]
-
 
5203
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
5204
 
-
 
5205
  def __eq__(self, other):
-
 
5206
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
5207
 
-
 
5208
  def __ne__(self, other):
-
 
5209
    return not (self == other)
-
 
5210
 
-
 
5211
class getCostingAndDeliveryEstimateForPincode_result:
-
 
5212
  """
-
 
5213
  Attributes:
-
 
5214
   - success
-
 
5215
   - se
-
 
5216
  """
-
 
5217
 
-
 
5218
  thrift_spec = (
-
 
5219
    (0, TType.STRUCT, 'success', (DeliveryEstimateAndCosting, DeliveryEstimateAndCosting.thrift_spec), None, ), # 0
-
 
5220
    (1, TType.STRUCT, 'se', (LogisticsServiceException, LogisticsServiceException.thrift_spec), None, ), # 1
-
 
5221
  )
-
 
5222
 
-
 
5223
  def __init__(self, success=None, se=None,):
-
 
5224
    self.success = success
-
 
5225
    self.se = se
-
 
5226
 
-
 
5227
  def read(self, iprot):
-
 
5228
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
5229
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
5230
      return
-
 
5231
    iprot.readStructBegin()
-
 
5232
    while True:
-
 
5233
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
5234
      if ftype == TType.STOP:
-
 
5235
        break
-
 
5236
      if fid == 0:
-
 
5237
        if ftype == TType.STRUCT:
-
 
5238
          self.success = DeliveryEstimateAndCosting()
-
 
5239
          self.success.read(iprot)
-
 
5240
        else:
-
 
5241
          iprot.skip(ftype)
-
 
5242
      elif fid == 1:
-
 
5243
        if ftype == TType.STRUCT:
-
 
5244
          self.se = LogisticsServiceException()
-
 
5245
          self.se.read(iprot)
-
 
5246
        else:
-
 
5247
          iprot.skip(ftype)
-
 
5248
      else:
-
 
5249
        iprot.skip(ftype)
-
 
5250
      iprot.readFieldEnd()
-
 
5251
    iprot.readStructEnd()
-
 
5252
 
-
 
5253
  def write(self, oprot):
-
 
5254
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
5255
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
5256
      return
-
 
5257
    oprot.writeStructBegin('getCostingAndDeliveryEstimateForPincode_result')
-
 
5258
    if self.success is not None:
-
 
5259
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
5260
      self.success.write(oprot)
-
 
5261
      oprot.writeFieldEnd()
-
 
5262
    if self.se is not None:
-
 
5263
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
-
 
5264
      self.se.write(oprot)
-
 
5265
      oprot.writeFieldEnd()
-
 
5266
    oprot.writeFieldStop()
-
 
5267
    oprot.writeStructEnd()
-
 
5268
 
-
 
5269
  def validate(self):
5008
    return
5270
    return
5009
 
5271
 
5010
 
5272
 
5011
  def __repr__(self):
5273
  def __repr__(self):
5012
    L = ['%s=%r' % (key, value)
5274
    L = ['%s=%r' % (key, value)