Subversion Repositories SmartDukaan

Rev

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

Rev 4391 Rev 4630
Line 30... Line 30...
30
    """
30
    """
31
    Returns a list containing all the providers.
31
    Returns a list containing all the providers.
32
    """
32
    """
33
    pass
33
    pass
34
 
34
 
35
  def getLogisticsEstimation(self, itemId, destination_pin):
35
  def getLogisticsEstimation(self, itemId, destination_pin, type):
36
    """
36
    """
37
    Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
37
    Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
38
    Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
38
    Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
39
    is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
39
    is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
40
 
40
 
41
    Parameters:
41
    Parameters:
42
     - itemId
42
     - itemId
43
     - destination_pin
43
     - destination_pin
-
 
44
     - type
44
    """
45
    """
45
    pass
46
    pass
46
 
47
 
47
  def getLogisticsInfo(self, destination_pincode, item_id, type):
48
  def getLogisticsInfo(self, destination_pincode, item_id, type):
48
    """
49
    """
Line 184... Line 185...
184
      return result.success
185
      return result.success
185
    if result.lse is not None:
186
    if result.lse is not None:
186
      raise result.lse
187
      raise result.lse
187
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllProviders failed: unknown result");
188
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllProviders failed: unknown result");
188
 
189
 
189
  def getLogisticsEstimation(self, itemId, destination_pin):
190
  def getLogisticsEstimation(self, itemId, destination_pin, type):
190
    """
191
    """
191
    Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
192
    Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
192
    Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
193
    Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
193
    is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
194
    is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
194
 
195
 
195
    Parameters:
196
    Parameters:
196
     - itemId
197
     - itemId
197
     - destination_pin
198
     - destination_pin
-
 
199
     - type
198
    """
200
    """
199
    self.send_getLogisticsEstimation(itemId, destination_pin)
201
    self.send_getLogisticsEstimation(itemId, destination_pin, type)
200
    return self.recv_getLogisticsEstimation()
202
    return self.recv_getLogisticsEstimation()
201
 
203
 
202
  def send_getLogisticsEstimation(self, itemId, destination_pin):
204
  def send_getLogisticsEstimation(self, itemId, destination_pin, type):
203
    self._oprot.writeMessageBegin('getLogisticsEstimation', TMessageType.CALL, self._seqid)
205
    self._oprot.writeMessageBegin('getLogisticsEstimation', TMessageType.CALL, self._seqid)
204
    args = getLogisticsEstimation_args()
206
    args = getLogisticsEstimation_args()
205
    args.itemId = itemId
207
    args.itemId = itemId
206
    args.destination_pin = destination_pin
208
    args.destination_pin = destination_pin
-
 
209
    args.type = type
207
    args.write(self._oprot)
210
    args.write(self._oprot)
208
    self._oprot.writeMessageEnd()
211
    self._oprot.writeMessageEnd()
209
    self._oprot.trans.flush()
212
    self._oprot.trans.flush()
210
 
213
 
211
  def recv_getLogisticsEstimation(self, ):
214
  def recv_getLogisticsEstimation(self, ):
Line 534... Line 537...
534
    args = getLogisticsEstimation_args()
537
    args = getLogisticsEstimation_args()
535
    args.read(iprot)
538
    args.read(iprot)
536
    iprot.readMessageEnd()
539
    iprot.readMessageEnd()
537
    result = getLogisticsEstimation_result()
540
    result = getLogisticsEstimation_result()
538
    try:
541
    try:
539
      result.success = self._handler.getLogisticsEstimation(args.itemId, args.destination_pin)
542
      result.success = self._handler.getLogisticsEstimation(args.itemId, args.destination_pin, args.type)
540
    except LogisticsServiceException, se:
543
    except LogisticsServiceException, se:
541
      result.se = se
544
      result.se = se
542
    oprot.writeMessageBegin("getLogisticsEstimation", TMessageType.REPLY, seqid)
545
    oprot.writeMessageBegin("getLogisticsEstimation", TMessageType.REPLY, seqid)
543
    result.write(oprot)
546
    result.write(oprot)
544
    oprot.writeMessageEnd()
547
    oprot.writeMessageEnd()
Line 895... Line 898...
895
class getLogisticsEstimation_args:
898
class getLogisticsEstimation_args:
896
  """
899
  """
897
  Attributes:
900
  Attributes:
898
   - itemId
901
   - itemId
899
   - destination_pin
902
   - destination_pin
-
 
903
   - type
900
  """
904
  """
901
 
905
 
902
  thrift_spec = (
906
  thrift_spec = (
903
    None, # 0
907
    None, # 0
904
    (1, TType.I64, 'itemId', None, None, ), # 1
908
    (1, TType.I64, 'itemId', None, None, ), # 1
905
    (2, TType.STRING, 'destination_pin', None, None, ), # 2
909
    (2, TType.STRING, 'destination_pin', None, None, ), # 2
-
 
910
    (3, TType.I32, 'type', None, None, ), # 3
906
  )
911
  )
907
 
912
 
908
  def __init__(self, itemId=None, destination_pin=None,):
913
  def __init__(self, itemId=None, destination_pin=None, type=None,):
909
    self.itemId = itemId
914
    self.itemId = itemId
910
    self.destination_pin = destination_pin
915
    self.destination_pin = destination_pin
-
 
916
    self.type = type
911
 
917
 
912
  def read(self, iprot):
918
  def read(self, iprot):
913
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
919
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
914
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
920
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
915
      return
921
      return
Line 926... Line 932...
926
      elif fid == 2:
932
      elif fid == 2:
927
        if ftype == TType.STRING:
933
        if ftype == TType.STRING:
928
          self.destination_pin = iprot.readString();
934
          self.destination_pin = iprot.readString();
929
        else:
935
        else:
930
          iprot.skip(ftype)
936
          iprot.skip(ftype)
-
 
937
      elif fid == 3:
-
 
938
        if ftype == TType.I32:
-
 
939
          self.type = iprot.readI32();
-
 
940
        else:
-
 
941
          iprot.skip(ftype)
931
      else:
942
      else:
932
        iprot.skip(ftype)
943
        iprot.skip(ftype)
933
      iprot.readFieldEnd()
944
      iprot.readFieldEnd()
934
    iprot.readStructEnd()
945
    iprot.readStructEnd()
935
 
946
 
Line 944... Line 955...
944
      oprot.writeFieldEnd()
955
      oprot.writeFieldEnd()
945
    if self.destination_pin is not None:
956
    if self.destination_pin is not None:
946
      oprot.writeFieldBegin('destination_pin', TType.STRING, 2)
957
      oprot.writeFieldBegin('destination_pin', TType.STRING, 2)
947
      oprot.writeString(self.destination_pin)
958
      oprot.writeString(self.destination_pin)
948
      oprot.writeFieldEnd()
959
      oprot.writeFieldEnd()
-
 
960
    if self.type is not None:
-
 
961
      oprot.writeFieldBegin('type', TType.I32, 3)
-
 
962
      oprot.writeI32(self.type)
-
 
963
      oprot.writeFieldEnd()
949
    oprot.writeFieldStop()
964
    oprot.writeFieldStop()
950
    oprot.writeStructEnd()
965
    oprot.writeStructEnd()
951
 
966
 
952
  def validate(self):
967
  def validate(self):
953
    return
968
    return