Subversion Repositories SmartDukaan

Rev

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

Rev 11592 Rev 11819
Line 49... Line 49...
49
    Parameters:
49
    Parameters:
50
     - couponCode
50
     - couponCode
51
    """
51
    """
52
    pass
52
    pass
53
 
53
 
54
  def isCodApplicable(self, couponCode):
54
  def isCodApplicable(self, cart):
55
    """
55
    """
56
    Parameters:
56
    Parameters:
57
     - couponCode
57
     - cart
58
    """
58
    """
59
    pass
59
    pass
60
 
60
 
61
  def getAllPromotions(self, ):
61
  def getAllPromotions(self, ):
62
    pass
62
    pass
Line 353... Line 353...
353
      return result.success
353
      return result.success
354
    if result.pex is not None:
354
    if result.pex is not None:
355
      raise result.pex
355
      raise result.pex
356
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
356
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
357
 
357
 
358
  def isCodApplicable(self, couponCode):
358
  def isCodApplicable(self, cart):
359
    """
359
    """
360
    Parameters:
360
    Parameters:
361
     - couponCode
361
     - cart
362
    """
362
    """
363
    self.send_isCodApplicable(couponCode)
363
    self.send_isCodApplicable(cart)
364
    return self.recv_isCodApplicable()
364
    return self.recv_isCodApplicable()
365
 
365
 
366
  def send_isCodApplicable(self, couponCode):
366
  def send_isCodApplicable(self, cart):
367
    self._oprot.writeMessageBegin('isCodApplicable', TMessageType.CALL, self._seqid)
367
    self._oprot.writeMessageBegin('isCodApplicable', TMessageType.CALL, self._seqid)
368
    args = isCodApplicable_args()
368
    args = isCodApplicable_args()
369
    args.couponCode = couponCode
369
    args.cart = cart
370
    args.write(self._oprot)
370
    args.write(self._oprot)
371
    self._oprot.writeMessageEnd()
371
    self._oprot.writeMessageEnd()
372
    self._oprot.trans.flush()
372
    self._oprot.trans.flush()
373
 
373
 
374
  def recv_isCodApplicable(self, ):
374
  def recv_isCodApplicable(self, ):
Line 1145... Line 1145...
1145
    args = isCodApplicable_args()
1145
    args = isCodApplicable_args()
1146
    args.read(iprot)
1146
    args.read(iprot)
1147
    iprot.readMessageEnd()
1147
    iprot.readMessageEnd()
1148
    result = isCodApplicable_result()
1148
    result = isCodApplicable_result()
1149
    try:
1149
    try:
1150
      result.success = self._handler.isCodApplicable(args.couponCode)
1150
      result.success = self._handler.isCodApplicable(args.cart)
1151
    except PromotionException, pex:
1151
    except PromotionException, pex:
1152
      result.pex = pex
1152
      result.pex = pex
1153
    oprot.writeMessageBegin("isCodApplicable", TMessageType.REPLY, seqid)
1153
    oprot.writeMessageBegin("isCodApplicable", TMessageType.REPLY, seqid)
1154
    result.write(oprot)
1154
    result.write(oprot)
1155
    oprot.writeMessageEnd()
1155
    oprot.writeMessageEnd()
Line 1978... Line 1978...
1978
    return not (self == other)
1978
    return not (self == other)
1979
 
1979
 
1980
class isCodApplicable_args:
1980
class isCodApplicable_args:
1981
  """
1981
  """
1982
  Attributes:
1982
  Attributes:
1983
   - couponCode
1983
   - cart
1984
  """
1984
  """
1985
 
1985
 
1986
  thrift_spec = (
1986
  thrift_spec = (
1987
    None, # 0
1987
    None, # 0
1988
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1988
    (1, TType.STRUCT, 'cart', (Cart, Cart.thrift_spec), None, ), # 1
1989
  )
1989
  )
1990
 
1990
 
1991
  def __init__(self, couponCode=None,):
1991
  def __init__(self, cart=None,):
1992
    self.couponCode = couponCode
1992
    self.cart = cart
1993
 
1993
 
1994
  def read(self, iprot):
1994
  def read(self, iprot):
1995
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1995
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1996
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1996
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1997
      return
1997
      return
Line 1999... Line 1999...
1999
    while True:
1999
    while True:
2000
      (fname, ftype, fid) = iprot.readFieldBegin()
2000
      (fname, ftype, fid) = iprot.readFieldBegin()
2001
      if ftype == TType.STOP:
2001
      if ftype == TType.STOP:
2002
        break
2002
        break
2003
      if fid == 1:
2003
      if fid == 1:
2004
        if ftype == TType.STRING:
2004
        if ftype == TType.STRUCT:
-
 
2005
          self.cart = Cart()
2005
          self.couponCode = iprot.readString();
2006
          self.cart.read(iprot)
2006
        else:
2007
        else:
2007
          iprot.skip(ftype)
2008
          iprot.skip(ftype)
2008
      else:
2009
      else:
2009
        iprot.skip(ftype)
2010
        iprot.skip(ftype)
2010
      iprot.readFieldEnd()
2011
      iprot.readFieldEnd()
Line 2013... Line 2014...
2013
  def write(self, oprot):
2014
  def write(self, oprot):
2014
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2015
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2015
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2016
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2016
      return
2017
      return
2017
    oprot.writeStructBegin('isCodApplicable_args')
2018
    oprot.writeStructBegin('isCodApplicable_args')
2018
    if self.couponCode is not None:
2019
    if self.cart is not None:
2019
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
2020
      oprot.writeFieldBegin('cart', TType.STRUCT, 1)
2020
      oprot.writeString(self.couponCode)
2021
      self.cart.write(oprot)
2021
      oprot.writeFieldEnd()
2022
      oprot.writeFieldEnd()
2022
    oprot.writeFieldStop()
2023
    oprot.writeFieldStop()
2023
    oprot.writeStructEnd()
2024
    oprot.writeStructEnd()
2024
 
2025
 
2025
  def validate(self):
2026
  def validate(self):