Subversion Repositories SmartDukaan

Rev

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

Rev 13146 Rev 19413
Line 241... Line 241...
241
     - providerId
241
     - providerId
242
     - pincode
242
     - pincode
243
    """
243
    """
244
    pass
244
    pass
245
 
245
 
-
 
246
  def getLocationInfoMap(self, destPincode, price):
-
 
247
    """
-
 
248
    This returns map for locations and providers corresponding their serviceability and delay
-
 
249
 
-
 
250
    Parameters:
-
 
251
     - destPincode
-
 
252
     - price
-
 
253
    """
-
 
254
    pass
-
 
255
 
246
 
256
 
247
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
257
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
248
  def __init__(self, iprot, oprot=None):
258
  def __init__(self, iprot, oprot=None):
249
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
259
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
250
 
260
 
Line 1071... Line 1081...
1071
      return result.success
1081
      return result.success
1072
    if result.se is not None:
1082
    if result.se is not None:
1073
      raise result.se
1083
      raise result.se
1074
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getProviderLimitDetailsForPincode failed: unknown result");
1084
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getProviderLimitDetailsForPincode failed: unknown result");
1075
 
1085
 
-
 
1086
  def getLocationInfoMap(self, destPincode, price):
-
 
1087
    """
-
 
1088
    This returns map for locations and providers corresponding their serviceability and delay
-
 
1089
 
-
 
1090
    Parameters:
-
 
1091
     - destPincode
-
 
1092
     - price
-
 
1093
    """
-
 
1094
    self.send_getLocationInfoMap(destPincode, price)
-
 
1095
    return self.recv_getLocationInfoMap()
-
 
1096
 
-
 
1097
  def send_getLocationInfoMap(self, destPincode, price):
-
 
1098
    self._oprot.writeMessageBegin('getLocationInfoMap', TMessageType.CALL, self._seqid)
-
 
1099
    args = getLocationInfoMap_args()
-
 
1100
    args.destPincode = destPincode
-
 
1101
    args.price = price
-
 
1102
    args.write(self._oprot)
-
 
1103
    self._oprot.writeMessageEnd()
-
 
1104
    self._oprot.trans.flush()
-
 
1105
 
-
 
1106
  def recv_getLocationInfoMap(self, ):
-
 
1107
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1108
    if mtype == TMessageType.EXCEPTION:
-
 
1109
      x = TApplicationException()
-
 
1110
      x.read(self._iprot)
-
 
1111
      self._iprot.readMessageEnd()
-
 
1112
      raise x
-
 
1113
    result = getLocationInfoMap_result()
-
 
1114
    result.read(self._iprot)
-
 
1115
    self._iprot.readMessageEnd()
-
 
1116
    if result.success is not None:
-
 
1117
      return result.success
-
 
1118
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getLocationInfoMap failed: unknown result");
-
 
1119
 
1076
 
1120
 
1077
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1121
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1078
  def __init__(self, handler):
1122
  def __init__(self, handler):
1079
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1123
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1080
    self._processMap["getProvider"] = Processor.process_getProvider
1124
    self._processMap["getProvider"] = Processor.process_getProvider
Line 1099... Line 1143...
1099
    self._processMap["runLogisticsLocationInfoUpdate"] = Processor.process_runLogisticsLocationInfoUpdate
1143
    self._processMap["runLogisticsLocationInfoUpdate"] = Processor.process_runLogisticsLocationInfoUpdate
1100
    self._processMap["adjustDeliveryDays"] = Processor.process_adjustDeliveryDays
1144
    self._processMap["adjustDeliveryDays"] = Processor.process_adjustDeliveryDays
1101
    self._processMap["getFirstDeliveryEstimateForWhLocation"] = Processor.process_getFirstDeliveryEstimateForWhLocation
1145
    self._processMap["getFirstDeliveryEstimateForWhLocation"] = Processor.process_getFirstDeliveryEstimateForWhLocation
1102
    self._processMap["getNewEmptyAwb"] = Processor.process_getNewEmptyAwb
1146
    self._processMap["getNewEmptyAwb"] = Processor.process_getNewEmptyAwb
1103
    self._processMap["getProviderLimitDetailsForPincode"] = Processor.process_getProviderLimitDetailsForPincode
1147
    self._processMap["getProviderLimitDetailsForPincode"] = Processor.process_getProviderLimitDetailsForPincode
-
 
1148
    self._processMap["getLocationInfoMap"] = Processor.process_getLocationInfoMap
1104
 
1149
 
1105
  def process(self, iprot, oprot):
1150
  def process(self, iprot, oprot):
1106
    (name, type, seqid) = iprot.readMessageBegin()
1151
    (name, type, seqid) = iprot.readMessageBegin()
1107
    if name not in self._processMap:
1152
    if name not in self._processMap:
1108
      iprot.skip(TType.STRUCT)
1153
      iprot.skip(TType.STRUCT)
Line 1415... Line 1460...
1415
    oprot.writeMessageBegin("getProviderLimitDetailsForPincode", TMessageType.REPLY, seqid)
1460
    oprot.writeMessageBegin("getProviderLimitDetailsForPincode", TMessageType.REPLY, seqid)
1416
    result.write(oprot)
1461
    result.write(oprot)
1417
    oprot.writeMessageEnd()
1462
    oprot.writeMessageEnd()
1418
    oprot.trans.flush()
1463
    oprot.trans.flush()
1419
 
1464
 
-
 
1465
  def process_getLocationInfoMap(self, seqid, iprot, oprot):
-
 
1466
    args = getLocationInfoMap_args()
-
 
1467
    args.read(iprot)
-
 
1468
    iprot.readMessageEnd()
-
 
1469
    result = getLocationInfoMap_result()
-
 
1470
    result.success = self._handler.getLocationInfoMap(args.destPincode, args.price)
-
 
1471
    oprot.writeMessageBegin("getLocationInfoMap", TMessageType.REPLY, seqid)
-
 
1472
    result.write(oprot)
-
 
1473
    oprot.writeMessageEnd()
-
 
1474
    oprot.trans.flush()
-
 
1475
 
1420
 
1476
 
1421
# HELPER FUNCTIONS AND STRUCTURES
1477
# HELPER FUNCTIONS AND STRUCTURES
1422
 
1478
 
1423
class getProvider_args:
1479
class getProvider_args:
1424
  """
1480
  """
Line 4787... Line 4843...
4787
      oprot.writeFieldEnd()
4843
      oprot.writeFieldEnd()
4788
    oprot.writeFieldStop()
4844
    oprot.writeFieldStop()
4789
    oprot.writeStructEnd()
4845
    oprot.writeStructEnd()
4790
 
4846
 
4791
  def validate(self):
4847
  def validate(self):
-
 
4848
    return
-
 
4849
 
-
 
4850
 
-
 
4851
  def __repr__(self):
-
 
4852
    L = ['%s=%r' % (key, value)
-
 
4853
      for key, value in self.__dict__.iteritems()]
-
 
4854
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
4855
 
-
 
4856
  def __eq__(self, other):
-
 
4857
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
4858
 
-
 
4859
  def __ne__(self, other):
-
 
4860
    return not (self == other)
-
 
4861
 
-
 
4862
class getLocationInfoMap_args:
-
 
4863
  """
-
 
4864
  Attributes:
-
 
4865
   - destPincode
-
 
4866
   - price
-
 
4867
  """
-
 
4868
 
-
 
4869
  thrift_spec = (
-
 
4870
    None, # 0
-
 
4871
    (1, TType.STRING, 'destPincode', None, None, ), # 1
-
 
4872
    (2, TType.LIST, 'price', (TType.I64,None), None, ), # 2
-
 
4873
  )
-
 
4874
 
-
 
4875
  def __init__(self, destPincode=None, price=None,):
-
 
4876
    self.destPincode = destPincode
-
 
4877
    self.price = price
-
 
4878
 
-
 
4879
  def read(self, iprot):
-
 
4880
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
4881
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
4882
      return
-
 
4883
    iprot.readStructBegin()
-
 
4884
    while True:
-
 
4885
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
4886
      if ftype == TType.STOP:
-
 
4887
        break
-
 
4888
      if fid == 1:
-
 
4889
        if ftype == TType.STRING:
-
 
4890
          self.destPincode = iprot.readString();
-
 
4891
        else:
-
 
4892
          iprot.skip(ftype)
-
 
4893
      elif fid == 2:
-
 
4894
        if ftype == TType.LIST:
-
 
4895
          self.price = []
-
 
4896
          (_etype68, _size65) = iprot.readListBegin()
-
 
4897
          for _i69 in xrange(_size65):
-
 
4898
            _elem70 = iprot.readI64();
-
 
4899
            self.price.append(_elem70)
-
 
4900
          iprot.readListEnd()
-
 
4901
        else:
-
 
4902
          iprot.skip(ftype)
-
 
4903
      else:
-
 
4904
        iprot.skip(ftype)
-
 
4905
      iprot.readFieldEnd()
-
 
4906
    iprot.readStructEnd()
-
 
4907
 
-
 
4908
  def write(self, oprot):
-
 
4909
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
4910
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
4911
      return
-
 
4912
    oprot.writeStructBegin('getLocationInfoMap_args')
-
 
4913
    if self.destPincode is not None:
-
 
4914
      oprot.writeFieldBegin('destPincode', TType.STRING, 1)
-
 
4915
      oprot.writeString(self.destPincode)
-
 
4916
      oprot.writeFieldEnd()
-
 
4917
    if self.price is not None:
-
 
4918
      oprot.writeFieldBegin('price', TType.LIST, 2)
-
 
4919
      oprot.writeListBegin(TType.I64, len(self.price))
-
 
4920
      for iter71 in self.price:
-
 
4921
        oprot.writeI64(iter71)
-
 
4922
      oprot.writeListEnd()
-
 
4923
      oprot.writeFieldEnd()
-
 
4924
    oprot.writeFieldStop()
-
 
4925
    oprot.writeStructEnd()
-
 
4926
 
-
 
4927
  def validate(self):
-
 
4928
    return
-
 
4929
 
-
 
4930
 
-
 
4931
  def __repr__(self):
-
 
4932
    L = ['%s=%r' % (key, value)
-
 
4933
      for key, value in self.__dict__.iteritems()]
-
 
4934
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
4935
 
-
 
4936
  def __eq__(self, other):
-
 
4937
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
4938
 
-
 
4939
  def __ne__(self, other):
-
 
4940
    return not (self == other)
-
 
4941
 
-
 
4942
class getLocationInfoMap_result:
-
 
4943
  """
-
 
4944
  Attributes:
-
 
4945
   - success
-
 
4946
  """
-
 
4947
 
-
 
4948
  thrift_spec = (
-
 
4949
    (0, TType.MAP, 'success', (TType.I64,None,TType.MAP,(TType.I64,None,TType.STRUCT,(LocationInfo, LocationInfo.thrift_spec))), None, ), # 0
-
 
4950
  )
-
 
4951
 
-
 
4952
  def __init__(self, success=None,):
-
 
4953
    self.success = success
-
 
4954
 
-
 
4955
  def read(self, iprot):
-
 
4956
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
4957
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
4958
      return
-
 
4959
    iprot.readStructBegin()
-
 
4960
    while True:
-
 
4961
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
4962
      if ftype == TType.STOP:
-
 
4963
        break
-
 
4964
      if fid == 0:
-
 
4965
        if ftype == TType.MAP:
-
 
4966
          self.success = {}
-
 
4967
          (_ktype73, _vtype74, _size72 ) = iprot.readMapBegin() 
-
 
4968
          for _i76 in xrange(_size72):
-
 
4969
            _key77 = iprot.readI64();
-
 
4970
            _val78 = {}
-
 
4971
            (_ktype80, _vtype81, _size79 ) = iprot.readMapBegin() 
-
 
4972
            for _i83 in xrange(_size79):
-
 
4973
              _key84 = iprot.readI64();
-
 
4974
              _val85 = LocationInfo()
-
 
4975
              _val85.read(iprot)
-
 
4976
              _val78[_key84] = _val85
-
 
4977
            iprot.readMapEnd()
-
 
4978
            self.success[_key77] = _val78
-
 
4979
          iprot.readMapEnd()
-
 
4980
        else:
-
 
4981
          iprot.skip(ftype)
-
 
4982
      else:
-
 
4983
        iprot.skip(ftype)
-
 
4984
      iprot.readFieldEnd()
-
 
4985
    iprot.readStructEnd()
-
 
4986
 
-
 
4987
  def write(self, oprot):
-
 
4988
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
4989
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
4990
      return
-
 
4991
    oprot.writeStructBegin('getLocationInfoMap_result')
-
 
4992
    if self.success is not None:
-
 
4993
      oprot.writeFieldBegin('success', TType.MAP, 0)
-
 
4994
      oprot.writeMapBegin(TType.I64, TType.MAP, len(self.success))
-
 
4995
      for kiter86,viter87 in self.success.items():
-
 
4996
        oprot.writeI64(kiter86)
-
 
4997
        oprot.writeMapBegin(TType.I64, TType.STRUCT, len(viter87))
-
 
4998
        for kiter88,viter89 in viter87.items():
-
 
4999
          oprot.writeI64(kiter88)
-
 
5000
          viter89.write(oprot)
-
 
5001
        oprot.writeMapEnd()
-
 
5002
      oprot.writeMapEnd()
-
 
5003
      oprot.writeFieldEnd()
-
 
5004
    oprot.writeFieldStop()
-
 
5005
    oprot.writeStructEnd()
-
 
5006
 
-
 
5007
  def validate(self):
4792
    return
5008
    return
4793
 
5009
 
4794
 
5010
 
4795
  def __repr__(self):
5011
  def __repr__(self):
4796
    L = ['%s=%r' % (key, value)
5012
    L = ['%s=%r' % (key, value)