Subversion Repositories SmartDukaan

Rev

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

Rev 1996 Rev 2035
Line 2085... Line 2085...
2085
     - cartId
2085
     - cartId
2086
     - itemId
2086
     - itemId
2087
     - quantity
2087
     - quantity
2088
    """
2088
    """
2089
    self.send_addItemToCart(cartId, itemId, quantity)
2089
    self.send_addItemToCart(cartId, itemId, quantity)
2090
    self.recv_addItemToCart()
2090
    return self.recv_addItemToCart()
2091
 
2091
 
2092
  def send_addItemToCart(self, cartId, itemId, quantity):
2092
  def send_addItemToCart(self, cartId, itemId, quantity):
2093
    self._oprot.writeMessageBegin('addItemToCart', TMessageType.CALL, self._seqid)
2093
    self._oprot.writeMessageBegin('addItemToCart', TMessageType.CALL, self._seqid)
2094
    args = addItemToCart_args()
2094
    args = addItemToCart_args()
2095
    args.cartId = cartId
2095
    args.cartId = cartId
Line 2107... Line 2107...
2107
      self._iprot.readMessageEnd()
2107
      self._iprot.readMessageEnd()
2108
      raise x
2108
      raise x
2109
    result = addItemToCart_result()
2109
    result = addItemToCart_result()
2110
    result.read(self._iprot)
2110
    result.read(self._iprot)
2111
    self._iprot.readMessageEnd()
2111
    self._iprot.readMessageEnd()
-
 
2112
    if result.success != None:
-
 
2113
      return result.success
2112
    if result.scx != None:
2114
    if result.scx != None:
2113
      raise result.scx
2115
      raise result.scx
2114
    return
-
 
-
 
2116
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addItemToCart failed: unknown result");
2115
 
2117
 
2116
  def deleteItemFromCart(self, cartId, itemId):
2118
  def deleteItemFromCart(self, cartId, itemId):
2117
    """
2119
    """
2118
    Parameters:
2120
    Parameters:
2119
     - cartId
2121
     - cartId
Line 3484... Line 3486...
3484
    args = addItemToCart_args()
3486
    args = addItemToCart_args()
3485
    args.read(iprot)
3487
    args.read(iprot)
3486
    iprot.readMessageEnd()
3488
    iprot.readMessageEnd()
3487
    result = addItemToCart_result()
3489
    result = addItemToCart_result()
3488
    try:
3490
    try:
3489
      self._handler.addItemToCart(args.cartId, args.itemId, args.quantity)
3491
      result.success = self._handler.addItemToCart(args.cartId, args.itemId, args.quantity)
3490
    except ShoppingCartException, scx:
3492
    except ShoppingCartException, scx:
3491
      result.scx = scx
3493
      result.scx = scx
3492
    oprot.writeMessageBegin("addItemToCart", TMessageType.REPLY, seqid)
3494
    oprot.writeMessageBegin("addItemToCart", TMessageType.REPLY, seqid)
3493
    result.write(oprot)
3495
    result.write(oprot)
3494
    oprot.writeMessageEnd()
3496
    oprot.writeMessageEnd()
Line 9943... Line 9945...
9943
    return not (self == other)
9945
    return not (self == other)
9944
 
9946
 
9945
class addItemToCart_result:
9947
class addItemToCart_result:
9946
  """
9948
  """
9947
  Attributes:
9949
  Attributes:
-
 
9950
   - success
9948
   - scx
9951
   - scx
9949
  """
9952
  """
9950
 
9953
 
9951
  thrift_spec = (
9954
  thrift_spec = (
9952
    None, # 0
9955
    (0, TType.STRING, 'success', None, None, ), # 0
9953
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
9956
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
9954
  )
9957
  )
9955
 
9958
 
9956
  def __init__(self, scx=None,):
9959
  def __init__(self, success=None, scx=None,):
-
 
9960
    self.success = success
9957
    self.scx = scx
9961
    self.scx = scx
9958
 
9962
 
9959
  def read(self, iprot):
9963
  def read(self, iprot):
9960
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
9964
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
9961
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
9965
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
Line 9963... Line 9967...
9963
    iprot.readStructBegin()
9967
    iprot.readStructBegin()
9964
    while True:
9968
    while True:
9965
      (fname, ftype, fid) = iprot.readFieldBegin()
9969
      (fname, ftype, fid) = iprot.readFieldBegin()
9966
      if ftype == TType.STOP:
9970
      if ftype == TType.STOP:
9967
        break
9971
        break
9968
      if fid == 1:
9972
      if fid == 0:
-
 
9973
        if ftype == TType.STRING:
-
 
9974
          self.success = iprot.readString();
-
 
9975
        else:
-
 
9976
          iprot.skip(ftype)
-
 
9977
      elif fid == 1:
9969
        if ftype == TType.STRUCT:
9978
        if ftype == TType.STRUCT:
9970
          self.scx = ShoppingCartException()
9979
          self.scx = ShoppingCartException()
9971
          self.scx.read(iprot)
9980
          self.scx.read(iprot)
9972
        else:
9981
        else:
9973
          iprot.skip(ftype)
9982
          iprot.skip(ftype)
Line 9979... Line 9988...
9979
  def write(self, oprot):
9988
  def write(self, oprot):
9980
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
9989
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
9981
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
9990
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
9982
      return
9991
      return
9983
    oprot.writeStructBegin('addItemToCart_result')
9992
    oprot.writeStructBegin('addItemToCart_result')
-
 
9993
    if self.success != None:
-
 
9994
      oprot.writeFieldBegin('success', TType.STRING, 0)
-
 
9995
      oprot.writeString(self.success)
-
 
9996
      oprot.writeFieldEnd()
9984
    if self.scx != None:
9997
    if self.scx != None:
9985
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
9998
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
9986
      self.scx.write(oprot)
9999
      self.scx.write(oprot)
9987
      oprot.writeFieldEnd()
10000
      oprot.writeFieldEnd()
9988
    oprot.writeFieldStop()
10001
    oprot.writeFieldStop()