Subversion Repositories SmartDukaan

Rev

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

Rev 4630 Rev 4865
Line 107... Line 107...
107
     - fromDate
107
     - fromDate
108
     - toDate
108
     - toDate
109
    """
109
    """
110
    pass
110
    pass
111
 
111
 
112
  def isCodAllowed(self, destination_pincode):
-
 
113
    """
-
 
114
    Returns true if COD is allowed for this destination pincode
-
 
115
 
-
 
116
    Parameters:
-
 
117
     - destination_pincode
-
 
118
    """
-
 
119
    pass
-
 
120
 
-
 
121
 
112
 
122
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
113
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
123
  def __init__(self, iprot, oprot=None):
114
  def __init__(self, iprot, oprot=None):
124
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
115
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
125
 
116
 
Line 441... Line 432...
441
    self._iprot.readMessageEnd()
432
    self._iprot.readMessageEnd()
442
    if result.success is not None:
433
    if result.success is not None:
443
      return result.success
434
      return result.success
444
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getHolidays failed: unknown result");
435
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getHolidays failed: unknown result");
445
 
436
 
446
  def isCodAllowed(self, destination_pincode):
-
 
447
    """
-
 
448
    Returns true if COD is allowed for this destination pincode
-
 
449
 
-
 
450
    Parameters:
-
 
451
     - destination_pincode
-
 
452
    """
-
 
453
    self.send_isCodAllowed(destination_pincode)
-
 
454
    return self.recv_isCodAllowed()
-
 
455
 
-
 
456
  def send_isCodAllowed(self, destination_pincode):
-
 
457
    self._oprot.writeMessageBegin('isCodAllowed', TMessageType.CALL, self._seqid)
-
 
458
    args = isCodAllowed_args()
-
 
459
    args.destination_pincode = destination_pincode
-
 
460
    args.write(self._oprot)
-
 
461
    self._oprot.writeMessageEnd()
-
 
462
    self._oprot.trans.flush()
-
 
463
 
-
 
464
  def recv_isCodAllowed(self, ):
-
 
465
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
466
    if mtype == TMessageType.EXCEPTION:
-
 
467
      x = TApplicationException()
-
 
468
      x.read(self._iprot)
-
 
469
      self._iprot.readMessageEnd()
-
 
470
      raise x
-
 
471
    result = isCodAllowed_result()
-
 
472
    result.read(self._iprot)
-
 
473
    self._iprot.readMessageEnd()
-
 
474
    if result.success is not None:
-
 
475
      return result.success
-
 
476
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isCodAllowed failed: unknown result");
-
 
477
 
-
 
478
 
437
 
479
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
438
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
480
  def __init__(self, handler):
439
  def __init__(self, handler):
481
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
440
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
482
    self._processMap["getProvider"] = Processor.process_getProvider
441
    self._processMap["getProvider"] = Processor.process_getProvider
Line 486... Line 445...
486
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
445
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
487
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
446
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
488
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
447
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
489
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
448
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
490
    self._processMap["getHolidays"] = Processor.process_getHolidays
449
    self._processMap["getHolidays"] = Processor.process_getHolidays
491
    self._processMap["isCodAllowed"] = Processor.process_isCodAllowed
-
 
492
 
450
 
493
  def process(self, iprot, oprot):
451
  def process(self, iprot, oprot):
494
    (name, type, seqid) = iprot.readMessageBegin()
452
    (name, type, seqid) = iprot.readMessageBegin()
495
    if name not in self._processMap:
453
    if name not in self._processMap:
496
      iprot.skip(TType.STRUCT)
454
      iprot.skip(TType.STRUCT)
Line 623... Line 581...
623
    oprot.writeMessageBegin("getHolidays", TMessageType.REPLY, seqid)
581
    oprot.writeMessageBegin("getHolidays", TMessageType.REPLY, seqid)
624
    result.write(oprot)
582
    result.write(oprot)
625
    oprot.writeMessageEnd()
583
    oprot.writeMessageEnd()
626
    oprot.trans.flush()
584
    oprot.trans.flush()
627
 
585
 
628
  def process_isCodAllowed(self, seqid, iprot, oprot):
-
 
629
    args = isCodAllowed_args()
-
 
630
    args.read(iprot)
-
 
631
    iprot.readMessageEnd()
-
 
632
    result = isCodAllowed_result()
-
 
633
    result.success = self._handler.isCodAllowed(args.destination_pincode)
-
 
634
    oprot.writeMessageBegin("isCodAllowed", TMessageType.REPLY, seqid)
-
 
635
    result.write(oprot)
-
 
636
    oprot.writeMessageEnd()
-
 
637
    oprot.trans.flush()
-
 
638
 
-
 
639
 
586
 
640
# HELPER FUNCTIONS AND STRUCTURES
587
# HELPER FUNCTIONS AND STRUCTURES
641
 
588
 
642
class getProvider_args:
589
class getProvider_args:
643
  """
590
  """
Line 1892... Line 1839...
1892
      oprot.writeFieldEnd()
1839
      oprot.writeFieldEnd()
1893
    oprot.writeFieldStop()
1840
    oprot.writeFieldStop()
1894
    oprot.writeStructEnd()
1841
    oprot.writeStructEnd()
1895
 
1842
 
1896
  def validate(self):
1843
  def validate(self):
1897
    return
-
 
1898
 
-
 
1899
 
-
 
1900
  def __repr__(self):
-
 
1901
    L = ['%s=%r' % (key, value)
-
 
1902
      for key, value in self.__dict__.iteritems()]
-
 
1903
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1904
 
-
 
1905
  def __eq__(self, other):
-
 
1906
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1907
 
-
 
1908
  def __ne__(self, other):
-
 
1909
    return not (self == other)
-
 
1910
 
-
 
1911
class isCodAllowed_args:
-
 
1912
  """
-
 
1913
  Attributes:
-
 
1914
   - destination_pincode
-
 
1915
  """
-
 
1916
 
-
 
1917
  thrift_spec = (
-
 
1918
    None, # 0
-
 
1919
    (1, TType.STRING, 'destination_pincode', None, None, ), # 1
-
 
1920
  )
-
 
1921
 
-
 
1922
  def __init__(self, destination_pincode=None,):
-
 
1923
    self.destination_pincode = destination_pincode
-
 
1924
 
-
 
1925
  def read(self, iprot):
-
 
1926
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1927
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1928
      return
-
 
1929
    iprot.readStructBegin()
-
 
1930
    while True:
-
 
1931
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1932
      if ftype == TType.STOP:
-
 
1933
        break
-
 
1934
      if fid == 1:
-
 
1935
        if ftype == TType.STRING:
-
 
1936
          self.destination_pincode = iprot.readString();
-
 
1937
        else:
-
 
1938
          iprot.skip(ftype)
-
 
1939
      else:
-
 
1940
        iprot.skip(ftype)
-
 
1941
      iprot.readFieldEnd()
-
 
1942
    iprot.readStructEnd()
-
 
1943
 
-
 
1944
  def write(self, oprot):
-
 
1945
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1946
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1947
      return
-
 
1948
    oprot.writeStructBegin('isCodAllowed_args')
-
 
1949
    if self.destination_pincode is not None:
-
 
1950
      oprot.writeFieldBegin('destination_pincode', TType.STRING, 1)
-
 
1951
      oprot.writeString(self.destination_pincode)
-
 
1952
      oprot.writeFieldEnd()
-
 
1953
    oprot.writeFieldStop()
-
 
1954
    oprot.writeStructEnd()
-
 
1955
 
-
 
1956
  def validate(self):
-
 
1957
    return
-
 
1958
 
-
 
1959
 
-
 
1960
  def __repr__(self):
-
 
1961
    L = ['%s=%r' % (key, value)
-
 
1962
      for key, value in self.__dict__.iteritems()]
-
 
1963
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1964
 
-
 
1965
  def __eq__(self, other):
-
 
1966
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1967
 
-
 
1968
  def __ne__(self, other):
-
 
1969
    return not (self == other)
-
 
1970
 
-
 
1971
class isCodAllowed_result:
-
 
1972
  """
-
 
1973
  Attributes:
-
 
1974
   - success
-
 
1975
  """
-
 
1976
 
-
 
1977
  thrift_spec = (
-
 
1978
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
1979
  )
-
 
1980
 
-
 
1981
  def __init__(self, success=None,):
-
 
1982
    self.success = success
-
 
1983
 
-
 
1984
  def read(self, iprot):
-
 
1985
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1986
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1987
      return
-
 
1988
    iprot.readStructBegin()
-
 
1989
    while True:
-
 
1990
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1991
      if ftype == TType.STOP:
-
 
1992
        break
-
 
1993
      if fid == 0:
-
 
1994
        if ftype == TType.BOOL:
-
 
1995
          self.success = iprot.readBool();
-
 
1996
        else:
-
 
1997
          iprot.skip(ftype)
-
 
1998
      else:
-
 
1999
        iprot.skip(ftype)
-
 
2000
      iprot.readFieldEnd()
-
 
2001
    iprot.readStructEnd()
-
 
2002
 
-
 
2003
  def write(self, oprot):
-
 
2004
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2005
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2006
      return
-
 
2007
    oprot.writeStructBegin('isCodAllowed_result')
-
 
2008
    if self.success is not None:
-
 
2009
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
2010
      oprot.writeBool(self.success)
-
 
2011
      oprot.writeFieldEnd()
-
 
2012
    oprot.writeFieldStop()
-
 
2013
    oprot.writeStructEnd()
-
 
2014
 
-
 
2015
  def validate(self):
-
 
2016
    return
1844
    return
2017
 
1845
 
2018
 
1846
 
2019
  def __repr__(self):
1847
  def __repr__(self):
2020
    L = ['%s=%r' % (key, value)
1848
    L = ['%s=%r' % (key, value)