Subversion Repositories SmartDukaan

Rev

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

Rev 4865 Rev 4934
Line 107... Line 107...
107
     - fromDate
107
     - fromDate
108
     - toDate
108
     - toDate
109
    """
109
    """
110
    pass
110
    pass
111
 
111
 
-
 
112
  def getEntityLogisticsEstimation(self, catalogItemId, destination_pin, type):
-
 
113
    """
-
 
114
    Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
-
 
115
    Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
-
 
116
    is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
-
 
117
 
-
 
118
    Parameters:
-
 
119
     - catalogItemId
-
 
120
     - destination_pin
-
 
121
     - type
-
 
122
    """
-
 
123
    pass
-
 
124
 
112
 
125
 
113
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
126
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
114
  def __init__(self, iprot, oprot=None):
127
  def __init__(self, iprot, oprot=None):
115
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
128
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
116
 
129
 
Line 432... Line 445...
432
    self._iprot.readMessageEnd()
445
    self._iprot.readMessageEnd()
433
    if result.success is not None:
446
    if result.success is not None:
434
      return result.success
447
      return result.success
435
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getHolidays failed: unknown result");
448
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getHolidays failed: unknown result");
436
 
449
 
-
 
450
  def getEntityLogisticsEstimation(self, catalogItemId, destination_pin, type):
-
 
451
    """
-
 
452
    Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
-
 
453
    Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
-
 
454
    is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
-
 
455
 
-
 
456
    Parameters:
-
 
457
     - catalogItemId
-
 
458
     - destination_pin
-
 
459
     - type
-
 
460
    """
-
 
461
    self.send_getEntityLogisticsEstimation(catalogItemId, destination_pin, type)
-
 
462
    return self.recv_getEntityLogisticsEstimation()
-
 
463
 
-
 
464
  def send_getEntityLogisticsEstimation(self, catalogItemId, destination_pin, type):
-
 
465
    self._oprot.writeMessageBegin('getEntityLogisticsEstimation', TMessageType.CALL, self._seqid)
-
 
466
    args = getEntityLogisticsEstimation_args()
-
 
467
    args.catalogItemId = catalogItemId
-
 
468
    args.destination_pin = destination_pin
-
 
469
    args.type = type
-
 
470
    args.write(self._oprot)
-
 
471
    self._oprot.writeMessageEnd()
-
 
472
    self._oprot.trans.flush()
-
 
473
 
-
 
474
  def recv_getEntityLogisticsEstimation(self, ):
-
 
475
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
476
    if mtype == TMessageType.EXCEPTION:
-
 
477
      x = TApplicationException()
-
 
478
      x.read(self._iprot)
-
 
479
      self._iprot.readMessageEnd()
-
 
480
      raise x
-
 
481
    result = getEntityLogisticsEstimation_result()
-
 
482
    result.read(self._iprot)
-
 
483
    self._iprot.readMessageEnd()
-
 
484
    if result.success is not None:
-
 
485
      return result.success
-
 
486
    if result.se is not None:
-
 
487
      raise result.se
-
 
488
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getEntityLogisticsEstimation failed: unknown result");
-
 
489
 
437
 
490
 
438
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
491
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
439
  def __init__(self, handler):
492
  def __init__(self, handler):
440
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
493
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
441
    self._processMap["getProvider"] = Processor.process_getProvider
494
    self._processMap["getProvider"] = Processor.process_getProvider
Line 445... Line 498...
445
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
498
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
446
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
499
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
447
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
500
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
448
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
501
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
449
    self._processMap["getHolidays"] = Processor.process_getHolidays
502
    self._processMap["getHolidays"] = Processor.process_getHolidays
-
 
503
    self._processMap["getEntityLogisticsEstimation"] = Processor.process_getEntityLogisticsEstimation
450
 
504
 
451
  def process(self, iprot, oprot):
505
  def process(self, iprot, oprot):
452
    (name, type, seqid) = iprot.readMessageBegin()
506
    (name, type, seqid) = iprot.readMessageBegin()
453
    if name not in self._processMap:
507
    if name not in self._processMap:
454
      iprot.skip(TType.STRUCT)
508
      iprot.skip(TType.STRUCT)
Line 581... Line 635...
581
    oprot.writeMessageBegin("getHolidays", TMessageType.REPLY, seqid)
635
    oprot.writeMessageBegin("getHolidays", TMessageType.REPLY, seqid)
582
    result.write(oprot)
636
    result.write(oprot)
583
    oprot.writeMessageEnd()
637
    oprot.writeMessageEnd()
584
    oprot.trans.flush()
638
    oprot.trans.flush()
585
 
639
 
-
 
640
  def process_getEntityLogisticsEstimation(self, seqid, iprot, oprot):
-
 
641
    args = getEntityLogisticsEstimation_args()
-
 
642
    args.read(iprot)
-
 
643
    iprot.readMessageEnd()
-
 
644
    result = getEntityLogisticsEstimation_result()
-
 
645
    try:
-
 
646
      result.success = self._handler.getEntityLogisticsEstimation(args.catalogItemId, args.destination_pin, args.type)
-
 
647
    except LogisticsServiceException, se:
-
 
648
      result.se = se
-
 
649
    oprot.writeMessageBegin("getEntityLogisticsEstimation", TMessageType.REPLY, seqid)
-
 
650
    result.write(oprot)
-
 
651
    oprot.writeMessageEnd()
-
 
652
    oprot.trans.flush()
-
 
653
 
586
 
654
 
587
# HELPER FUNCTIONS AND STRUCTURES
655
# HELPER FUNCTIONS AND STRUCTURES
588
 
656
 
589
class getProvider_args:
657
class getProvider_args:
590
  """
658
  """
Line 1839... Line 1907...
1839
      oprot.writeFieldEnd()
1907
      oprot.writeFieldEnd()
1840
    oprot.writeFieldStop()
1908
    oprot.writeFieldStop()
1841
    oprot.writeStructEnd()
1909
    oprot.writeStructEnd()
1842
 
1910
 
1843
  def validate(self):
1911
  def validate(self):
-
 
1912
    return
-
 
1913
 
-
 
1914
 
-
 
1915
  def __repr__(self):
-
 
1916
    L = ['%s=%r' % (key, value)
-
 
1917
      for key, value in self.__dict__.iteritems()]
-
 
1918
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1919
 
-
 
1920
  def __eq__(self, other):
-
 
1921
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1922
 
-
 
1923
  def __ne__(self, other):
-
 
1924
    return not (self == other)
-
 
1925
 
-
 
1926
class getEntityLogisticsEstimation_args:
-
 
1927
  """
-
 
1928
  Attributes:
-
 
1929
   - catalogItemId
-
 
1930
   - destination_pin
-
 
1931
   - type
-
 
1932
  """
-
 
1933
 
-
 
1934
  thrift_spec = (
-
 
1935
    None, # 0
-
 
1936
    (1, TType.I64, 'catalogItemId', None, None, ), # 1
-
 
1937
    (2, TType.STRING, 'destination_pin', None, None, ), # 2
-
 
1938
    (3, TType.I32, 'type', None, None, ), # 3
-
 
1939
  )
-
 
1940
 
-
 
1941
  def __init__(self, catalogItemId=None, destination_pin=None, type=None,):
-
 
1942
    self.catalogItemId = catalogItemId
-
 
1943
    self.destination_pin = destination_pin
-
 
1944
    self.type = type
-
 
1945
 
-
 
1946
  def read(self, iprot):
-
 
1947
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1948
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1949
      return
-
 
1950
    iprot.readStructBegin()
-
 
1951
    while True:
-
 
1952
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1953
      if ftype == TType.STOP:
-
 
1954
        break
-
 
1955
      if fid == 1:
-
 
1956
        if ftype == TType.I64:
-
 
1957
          self.catalogItemId = iprot.readI64();
-
 
1958
        else:
-
 
1959
          iprot.skip(ftype)
-
 
1960
      elif fid == 2:
-
 
1961
        if ftype == TType.STRING:
-
 
1962
          self.destination_pin = iprot.readString();
-
 
1963
        else:
-
 
1964
          iprot.skip(ftype)
-
 
1965
      elif fid == 3:
-
 
1966
        if ftype == TType.I32:
-
 
1967
          self.type = iprot.readI32();
-
 
1968
        else:
-
 
1969
          iprot.skip(ftype)
-
 
1970
      else:
-
 
1971
        iprot.skip(ftype)
-
 
1972
      iprot.readFieldEnd()
-
 
1973
    iprot.readStructEnd()
-
 
1974
 
-
 
1975
  def write(self, oprot):
-
 
1976
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1977
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1978
      return
-
 
1979
    oprot.writeStructBegin('getEntityLogisticsEstimation_args')
-
 
1980
    if self.catalogItemId is not None:
-
 
1981
      oprot.writeFieldBegin('catalogItemId', TType.I64, 1)
-
 
1982
      oprot.writeI64(self.catalogItemId)
-
 
1983
      oprot.writeFieldEnd()
-
 
1984
    if self.destination_pin is not None:
-
 
1985
      oprot.writeFieldBegin('destination_pin', TType.STRING, 2)
-
 
1986
      oprot.writeString(self.destination_pin)
-
 
1987
      oprot.writeFieldEnd()
-
 
1988
    if self.type is not None:
-
 
1989
      oprot.writeFieldBegin('type', TType.I32, 3)
-
 
1990
      oprot.writeI32(self.type)
-
 
1991
      oprot.writeFieldEnd()
-
 
1992
    oprot.writeFieldStop()
-
 
1993
    oprot.writeStructEnd()
-
 
1994
 
-
 
1995
  def validate(self):
-
 
1996
    return
-
 
1997
 
-
 
1998
 
-
 
1999
  def __repr__(self):
-
 
2000
    L = ['%s=%r' % (key, value)
-
 
2001
      for key, value in self.__dict__.iteritems()]
-
 
2002
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
2003
 
-
 
2004
  def __eq__(self, other):
-
 
2005
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
2006
 
-
 
2007
  def __ne__(self, other):
-
 
2008
    return not (self == other)
-
 
2009
 
-
 
2010
class getEntityLogisticsEstimation_result:
-
 
2011
  """
-
 
2012
  Attributes:
-
 
2013
   - success
-
 
2014
   - se
-
 
2015
  """
-
 
2016
 
-
 
2017
  thrift_spec = (
-
 
2018
    (0, TType.LIST, 'success', (TType.I64,None), None, ), # 0
-
 
2019
    (1, TType.STRUCT, 'se', (LogisticsServiceException, LogisticsServiceException.thrift_spec), None, ), # 1
-
 
2020
  )
-
 
2021
 
-
 
2022
  def __init__(self, success=None, se=None,):
-
 
2023
    self.success = success
-
 
2024
    self.se = se
-
 
2025
 
-
 
2026
  def read(self, iprot):
-
 
2027
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
2028
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
2029
      return
-
 
2030
    iprot.readStructBegin()
-
 
2031
    while True:
-
 
2032
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
2033
      if ftype == TType.STOP:
-
 
2034
        break
-
 
2035
      if fid == 0:
-
 
2036
        if ftype == TType.LIST:
-
 
2037
          self.success = []
-
 
2038
          (_etype33, _size30) = iprot.readListBegin()
-
 
2039
          for _i34 in xrange(_size30):
-
 
2040
            _elem35 = iprot.readI64();
-
 
2041
            self.success.append(_elem35)
-
 
2042
          iprot.readListEnd()
-
 
2043
        else:
-
 
2044
          iprot.skip(ftype)
-
 
2045
      elif fid == 1:
-
 
2046
        if ftype == TType.STRUCT:
-
 
2047
          self.se = LogisticsServiceException()
-
 
2048
          self.se.read(iprot)
-
 
2049
        else:
-
 
2050
          iprot.skip(ftype)
-
 
2051
      else:
-
 
2052
        iprot.skip(ftype)
-
 
2053
      iprot.readFieldEnd()
-
 
2054
    iprot.readStructEnd()
-
 
2055
 
-
 
2056
  def write(self, oprot):
-
 
2057
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2058
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2059
      return
-
 
2060
    oprot.writeStructBegin('getEntityLogisticsEstimation_result')
-
 
2061
    if self.success is not None:
-
 
2062
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
2063
      oprot.writeListBegin(TType.I64, len(self.success))
-
 
2064
      for iter36 in self.success:
-
 
2065
        oprot.writeI64(iter36)
-
 
2066
      oprot.writeListEnd()
-
 
2067
      oprot.writeFieldEnd()
-
 
2068
    if self.se is not None:
-
 
2069
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
-
 
2070
      self.se.write(oprot)
-
 
2071
      oprot.writeFieldEnd()
-
 
2072
    oprot.writeFieldStop()
-
 
2073
    oprot.writeStructEnd()
-
 
2074
 
-
 
2075
  def validate(self):
1844
    return
2076
    return
1845
 
2077
 
1846
 
2078
 
1847
  def __repr__(self):
2079
  def __repr__(self):
1848
    L = ['%s=%r' % (key, value)
2080
    L = ['%s=%r' % (key, value)