Subversion Repositories SmartDukaan

Rev

Rev 581 | Rev 690 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#

from thrift.Thrift import *
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None


class Iface:
  """
  service
  """
  def createAnonymousUser(self, jsessionId):
    """
    Parameters:
     - jsessionId
    """
    pass

  def getUserById(self, userId):
    """
    Parameters:
     - userId
    """
    pass

  def createUser(self, user):
    """
    Parameters:
     - user
    """
    pass

  def updateUser(self, user):
    """
    Parameters:
     - user
    """
    pass

  def deleteUser(self, userId):
    """
    Parameters:
     - userId
    """
    pass

  def getUserState(self, userId):
    """
    Parameters:
     - userId
    """
    pass

  def authenticateUser(self, email, password):
    """
    Parameters:
     - email
     - password
    """
    pass

  def userExists(self, email):
    """
    Parameters:
     - email
    """
    pass

  def addAddressForUser(self, userId, address, setDefault):
    """
    Parameters:
     - userId
     - address
     - setDefault
    """
    pass

  def removeAddressForUser(self, userid, addressId):
    """
    Parameters:
     - userid
     - addressId
    """
    pass

  def setUserAsLoggedIn(self, userId, timestamp):
    """
    Parameters:
     - userId
     - timestamp
    """
    pass

  def setUserAsLoggedOut(self, userid, timestamp):
    """
    Parameters:
     - userid
     - timestamp
    """
    pass

  def setDefaultAddress(self, userid, addressId):
    """
    Parameters:
     - userid
     - addressId
    """
    pass

  def updatePassword(self, userid, oldPassword, newPassword):
    """
    Parameters:
     - userid
     - oldPassword
     - newPassword
    """
    pass

  def forgotPassword(self, email):
    """
    Parameters:
     - email
    """
    pass

  def getAllAddressesForUser(self, userId):
    """
    Parameters:
     - userId
    """
    pass

  def getDefaultAddressId(self, userId):
    """
    Parameters:
     - userId
    """
    pass

  def createCart(self, userId):
    """
    Parameters:
     - userId
    """
    pass

  def getCurrentCart(self, userId):
    """
    Parameters:
     - userId
    """
    pass

  def getCart(self, cartId):
    """
    Parameters:
     - cartId
    """
    pass

  def getCartsForUser(self, userId, status):
    """
    Parameters:
     - userId
     - status
    """
    pass

  def getCartsByStatus(self, status):
    """
    Parameters:
     - status
    """
    pass

  def getCartsByTime(self, from_time, to_time, status):
    """
    Parameters:
     - from_time
     - to_time
     - status
    """
    pass

  def changeCartStatus(self, cartId, status):
    """
    Parameters:
     - cartId
     - status
    """
    pass

  def addItemToCart(self, cartId, itemId, quantity):
    """
    Parameters:
     - cartId
     - itemId
     - quantity
    """
    pass

  def deleteItemFromCart(self, cartId, itemId):
    """
    Parameters:
     - cartId
     - itemId
    """
    pass

  def changeQuantity(self, cartId, itemId, quantity):
    """
    Parameters:
     - cartId
     - itemId
     - quantity
    """
    pass

  def changeItemStatus(self, cartId, itemId, status):
    """
    Parameters:
     - cartId
     - itemId
     - status
    """
    pass

  def addAddressToCart(self, cartId, addressId):
    """
    Parameters:
     - cartId
     - addressId
    """
    pass

  def commitCart(self, cartId):
    """
    Parameters:
     - cartId
    """
    pass

  def validateCart(self, cartId):
    """
    Parameters:
     - cartId
    """
    pass

  def refreshCart(self, cartId):
    """
    Parameters:
     - cartId
    """
    pass

  def mergeCart(self, fromCartId, toCartId):
    """
    Parameters:
     - fromCartId
     - toCartId
    """
    pass

  def addWidget(self, widget):
    """
    Parameters:
     - widget
    """
    pass

  def addItemToWidget(self, widget_id, items):
    """
    Parameters:
     - widget_id
     - items
    """
    pass

  def deleteItemFromWidget(self, widget_id, item_id):
    """
    Parameters:
     - widget_id
     - item_id
    """
    pass

  def updateWidget(self, widgetId, enable):
    """
    Parameters:
     - widgetId
     - enable
    """
    pass

  def updateWidgetItem(self, widgetId, enable):
    """
    Parameters:
     - widgetId
     - enable
    """
    pass

  def getWidget(self, type, userId, onlyEnabled):
    """
    Parameters:
     - type
     - userId
     - onlyEnabled
    """
    pass

  def getMyResearch(self, user_id):
    """
    Parameters:
     - user_id
    """
    pass

  def updateMyResearch(self, user_id, item_id):
    """
    Parameters:
     - user_id
     - item_id
    """
    pass

  def deleteItemFromMyResearch(self, user_id, item_id):
    """
    Parameters:
     - user_id
     - item_id
    """
    pass

  def updateRatings(self, item_id, type, rating, user_id):
    """
    Parameters:
     - item_id
     - type
     - rating
     - user_id
    """
    pass

  def getRatings(self, item_id, user_id):
    """
    Parameters:
     - item_id
     - user_id
    """
    pass

  def updateBrowseHistory(self, user_id, item_id, isSessionId):
    """
    Parameters:
     - user_id
     - item_id
     - isSessionId
    """
    pass

  def getBrowseHistory(self, userId, isSessionId):
    """
    Parameters:
     - userId
     - isSessionId
    """
    pass


class Client(Iface):
  """
  service
  """
  def __init__(self, iprot, oprot=None):
    self._iprot = self._oprot = iprot
    if oprot != None:
      self._oprot = oprot
    self._seqid = 0

  def createAnonymousUser(self, jsessionId):
    """
    Parameters:
     - jsessionId
    """
    self.send_createAnonymousUser(jsessionId)
    return self.recv_createAnonymousUser()

  def send_createAnonymousUser(self, jsessionId):
    self._oprot.writeMessageBegin('createAnonymousUser', TMessageType.CALL, self._seqid)
    args = createAnonymousUser_args()
    args.jsessionId = jsessionId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_createAnonymousUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = createAnonymousUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucex != None:
      raise result.ucex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createAnonymousUser failed: unknown result");

  def getUserById(self, userId):
    """
    Parameters:
     - userId
    """
    self.send_getUserById(userId)
    return self.recv_getUserById()

  def send_getUserById(self, userId):
    self._oprot.writeMessageBegin('getUserById', TMessageType.CALL, self._seqid)
    args = getUserById_args()
    args.userId = userId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getUserById(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getUserById_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucex != None:
      raise result.ucex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserById failed: unknown result");

  def createUser(self, user):
    """
    Parameters:
     - user
    """
    self.send_createUser(user)
    return self.recv_createUser()

  def send_createUser(self, user):
    self._oprot.writeMessageBegin('createUser', TMessageType.CALL, self._seqid)
    args = createUser_args()
    args.user = user
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_createUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = createUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucex != None:
      raise result.ucex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createUser failed: unknown result");

  def updateUser(self, user):
    """
    Parameters:
     - user
    """
    self.send_updateUser(user)
    return self.recv_updateUser()

  def send_updateUser(self, user):
    self._oprot.writeMessageBegin('updateUser', TMessageType.CALL, self._seqid)
    args = updateUser_args()
    args.user = user
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_updateUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = updateUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucex != None:
      raise result.ucex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updateUser failed: unknown result");

  def deleteUser(self, userId):
    """
    Parameters:
     - userId
    """
    self.send_deleteUser(userId)
    return self.recv_deleteUser()

  def send_deleteUser(self, userId):
    self._oprot.writeMessageBegin('deleteUser', TMessageType.CALL, self._seqid)
    args = deleteUser_args()
    args.userId = userId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_deleteUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = deleteUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucex != None:
      raise result.ucex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteUser failed: unknown result");

  def getUserState(self, userId):
    """
    Parameters:
     - userId
    """
    self.send_getUserState(userId)
    return self.recv_getUserState()

  def send_getUserState(self, userId):
    self._oprot.writeMessageBegin('getUserState', TMessageType.CALL, self._seqid)
    args = getUserState_args()
    args.userId = userId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getUserState(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getUserState_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucex != None:
      raise result.ucex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserState failed: unknown result");

  def authenticateUser(self, email, password):
    """
    Parameters:
     - email
     - password
    """
    self.send_authenticateUser(email, password)
    return self.recv_authenticateUser()

  def send_authenticateUser(self, email, password):
    self._oprot.writeMessageBegin('authenticateUser', TMessageType.CALL, self._seqid)
    args = authenticateUser_args()
    args.email = email
    args.password = password
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_authenticateUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = authenticateUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.auex != None:
      raise result.auex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "authenticateUser failed: unknown result");

  def userExists(self, email):
    """
    Parameters:
     - email
    """
    self.send_userExists(email)
    return self.recv_userExists()

  def send_userExists(self, email):
    self._oprot.writeMessageBegin('userExists', TMessageType.CALL, self._seqid)
    args = userExists_args()
    args.email = email
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_userExists(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = userExists_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "userExists failed: unknown result");

  def addAddressForUser(self, userId, address, setDefault):
    """
    Parameters:
     - userId
     - address
     - setDefault
    """
    self.send_addAddressForUser(userId, address, setDefault)
    return self.recv_addAddressForUser()

  def send_addAddressForUser(self, userId, address, setDefault):
    self._oprot.writeMessageBegin('addAddressForUser', TMessageType.CALL, self._seqid)
    args = addAddressForUser_args()
    args.userId = userId
    args.address = address
    args.setDefault = setDefault
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_addAddressForUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = addAddressForUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addAddressForUser failed: unknown result");

  def removeAddressForUser(self, userid, addressId):
    """
    Parameters:
     - userid
     - addressId
    """
    self.send_removeAddressForUser(userid, addressId)
    return self.recv_removeAddressForUser()

  def send_removeAddressForUser(self, userid, addressId):
    self._oprot.writeMessageBegin('removeAddressForUser', TMessageType.CALL, self._seqid)
    args = removeAddressForUser_args()
    args.userid = userid
    args.addressId = addressId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_removeAddressForUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = removeAddressForUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "removeAddressForUser failed: unknown result");

  def setUserAsLoggedIn(self, userId, timestamp):
    """
    Parameters:
     - userId
     - timestamp
    """
    self.send_setUserAsLoggedIn(userId, timestamp)
    return self.recv_setUserAsLoggedIn()

  def send_setUserAsLoggedIn(self, userId, timestamp):
    self._oprot.writeMessageBegin('setUserAsLoggedIn', TMessageType.CALL, self._seqid)
    args = setUserAsLoggedIn_args()
    args.userId = userId
    args.timestamp = timestamp
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_setUserAsLoggedIn(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = setUserAsLoggedIn_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "setUserAsLoggedIn failed: unknown result");

  def setUserAsLoggedOut(self, userid, timestamp):
    """
    Parameters:
     - userid
     - timestamp
    """
    self.send_setUserAsLoggedOut(userid, timestamp)
    return self.recv_setUserAsLoggedOut()

  def send_setUserAsLoggedOut(self, userid, timestamp):
    self._oprot.writeMessageBegin('setUserAsLoggedOut', TMessageType.CALL, self._seqid)
    args = setUserAsLoggedOut_args()
    args.userid = userid
    args.timestamp = timestamp
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_setUserAsLoggedOut(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = setUserAsLoggedOut_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "setUserAsLoggedOut failed: unknown result");

  def setDefaultAddress(self, userid, addressId):
    """
    Parameters:
     - userid
     - addressId
    """
    self.send_setDefaultAddress(userid, addressId)
    return self.recv_setDefaultAddress()

  def send_setDefaultAddress(self, userid, addressId):
    self._oprot.writeMessageBegin('setDefaultAddress', TMessageType.CALL, self._seqid)
    args = setDefaultAddress_args()
    args.userid = userid
    args.addressId = addressId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_setDefaultAddress(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = setDefaultAddress_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "setDefaultAddress failed: unknown result");

  def updatePassword(self, userid, oldPassword, newPassword):
    """
    Parameters:
     - userid
     - oldPassword
     - newPassword
    """
    self.send_updatePassword(userid, oldPassword, newPassword)
    return self.recv_updatePassword()

  def send_updatePassword(self, userid, oldPassword, newPassword):
    self._oprot.writeMessageBegin('updatePassword', TMessageType.CALL, self._seqid)
    args = updatePassword_args()
    args.userid = userid
    args.oldPassword = oldPassword
    args.newPassword = newPassword
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_updatePassword(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = updatePassword_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updatePassword failed: unknown result");

  def forgotPassword(self, email):
    """
    Parameters:
     - email
    """
    self.send_forgotPassword(email)
    return self.recv_forgotPassword()

  def send_forgotPassword(self, email):
    self._oprot.writeMessageBegin('forgotPassword', TMessageType.CALL, self._seqid)
    args = forgotPassword_args()
    args.email = email
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_forgotPassword(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = forgotPassword_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "forgotPassword failed: unknown result");

  def getAllAddressesForUser(self, userId):
    """
    Parameters:
     - userId
    """
    self.send_getAllAddressesForUser(userId)
    return self.recv_getAllAddressesForUser()

  def send_getAllAddressesForUser(self, userId):
    self._oprot.writeMessageBegin('getAllAddressesForUser', TMessageType.CALL, self._seqid)
    args = getAllAddressesForUser_args()
    args.userId = userId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getAllAddressesForUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getAllAddressesForUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllAddressesForUser failed: unknown result");

  def getDefaultAddressId(self, userId):
    """
    Parameters:
     - userId
    """
    self.send_getDefaultAddressId(userId)
    return self.recv_getDefaultAddressId()

  def send_getDefaultAddressId(self, userId):
    self._oprot.writeMessageBegin('getDefaultAddressId', TMessageType.CALL, self._seqid)
    args = getDefaultAddressId_args()
    args.userId = userId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getDefaultAddressId(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getDefaultAddressId_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.ucx != None:
      raise result.ucx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getDefaultAddressId failed: unknown result");

  def createCart(self, userId):
    """
    Parameters:
     - userId
    """
    self.send_createCart(userId)
    return self.recv_createCart()

  def send_createCart(self, userId):
    self._oprot.writeMessageBegin('createCart', TMessageType.CALL, self._seqid)
    args = createCart_args()
    args.userId = userId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_createCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = createCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createCart failed: unknown result");

  def getCurrentCart(self, userId):
    """
    Parameters:
     - userId
    """
    self.send_getCurrentCart(userId)
    return self.recv_getCurrentCart()

  def send_getCurrentCart(self, userId):
    self._oprot.writeMessageBegin('getCurrentCart', TMessageType.CALL, self._seqid)
    args = getCurrentCart_args()
    args.userId = userId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getCurrentCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getCurrentCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCurrentCart failed: unknown result");

  def getCart(self, cartId):
    """
    Parameters:
     - cartId
    """
    self.send_getCart(cartId)
    return self.recv_getCart()

  def send_getCart(self, cartId):
    self._oprot.writeMessageBegin('getCart', TMessageType.CALL, self._seqid)
    args = getCart_args()
    args.cartId = cartId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCart failed: unknown result");

  def getCartsForUser(self, userId, status):
    """
    Parameters:
     - userId
     - status
    """
    self.send_getCartsForUser(userId, status)
    return self.recv_getCartsForUser()

  def send_getCartsForUser(self, userId, status):
    self._oprot.writeMessageBegin('getCartsForUser', TMessageType.CALL, self._seqid)
    args = getCartsForUser_args()
    args.userId = userId
    args.status = status
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getCartsForUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getCartsForUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCartsForUser failed: unknown result");

  def getCartsByStatus(self, status):
    """
    Parameters:
     - status
    """
    self.send_getCartsByStatus(status)
    return self.recv_getCartsByStatus()

  def send_getCartsByStatus(self, status):
    self._oprot.writeMessageBegin('getCartsByStatus', TMessageType.CALL, self._seqid)
    args = getCartsByStatus_args()
    args.status = status
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getCartsByStatus(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getCartsByStatus_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCartsByStatus failed: unknown result");

  def getCartsByTime(self, from_time, to_time, status):
    """
    Parameters:
     - from_time
     - to_time
     - status
    """
    self.send_getCartsByTime(from_time, to_time, status)
    return self.recv_getCartsByTime()

  def send_getCartsByTime(self, from_time, to_time, status):
    self._oprot.writeMessageBegin('getCartsByTime', TMessageType.CALL, self._seqid)
    args = getCartsByTime_args()
    args.from_time = from_time
    args.to_time = to_time
    args.status = status
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getCartsByTime(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getCartsByTime_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCartsByTime failed: unknown result");

  def changeCartStatus(self, cartId, status):
    """
    Parameters:
     - cartId
     - status
    """
    self.send_changeCartStatus(cartId, status)
    self.recv_changeCartStatus()

  def send_changeCartStatus(self, cartId, status):
    self._oprot.writeMessageBegin('changeCartStatus', TMessageType.CALL, self._seqid)
    args = changeCartStatus_args()
    args.cartId = cartId
    args.status = status
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_changeCartStatus(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = changeCartStatus_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def addItemToCart(self, cartId, itemId, quantity):
    """
    Parameters:
     - cartId
     - itemId
     - quantity
    """
    self.send_addItemToCart(cartId, itemId, quantity)
    self.recv_addItemToCart()

  def send_addItemToCart(self, cartId, itemId, quantity):
    self._oprot.writeMessageBegin('addItemToCart', TMessageType.CALL, self._seqid)
    args = addItemToCart_args()
    args.cartId = cartId
    args.itemId = itemId
    args.quantity = quantity
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_addItemToCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = addItemToCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def deleteItemFromCart(self, cartId, itemId):
    """
    Parameters:
     - cartId
     - itemId
    """
    self.send_deleteItemFromCart(cartId, itemId)
    self.recv_deleteItemFromCart()

  def send_deleteItemFromCart(self, cartId, itemId):
    self._oprot.writeMessageBegin('deleteItemFromCart', TMessageType.CALL, self._seqid)
    args = deleteItemFromCart_args()
    args.cartId = cartId
    args.itemId = itemId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_deleteItemFromCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = deleteItemFromCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def changeQuantity(self, cartId, itemId, quantity):
    """
    Parameters:
     - cartId
     - itemId
     - quantity
    """
    self.send_changeQuantity(cartId, itemId, quantity)
    self.recv_changeQuantity()

  def send_changeQuantity(self, cartId, itemId, quantity):
    self._oprot.writeMessageBegin('changeQuantity', TMessageType.CALL, self._seqid)
    args = changeQuantity_args()
    args.cartId = cartId
    args.itemId = itemId
    args.quantity = quantity
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_changeQuantity(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = changeQuantity_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def changeItemStatus(self, cartId, itemId, status):
    """
    Parameters:
     - cartId
     - itemId
     - status
    """
    self.send_changeItemStatus(cartId, itemId, status)
    self.recv_changeItemStatus()

  def send_changeItemStatus(self, cartId, itemId, status):
    self._oprot.writeMessageBegin('changeItemStatus', TMessageType.CALL, self._seqid)
    args = changeItemStatus_args()
    args.cartId = cartId
    args.itemId = itemId
    args.status = status
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_changeItemStatus(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = changeItemStatus_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def addAddressToCart(self, cartId, addressId):
    """
    Parameters:
     - cartId
     - addressId
    """
    self.send_addAddressToCart(cartId, addressId)
    self.recv_addAddressToCart()

  def send_addAddressToCart(self, cartId, addressId):
    self._oprot.writeMessageBegin('addAddressToCart', TMessageType.CALL, self._seqid)
    args = addAddressToCart_args()
    args.cartId = cartId
    args.addressId = addressId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_addAddressToCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = addAddressToCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def commitCart(self, cartId):
    """
    Parameters:
     - cartId
    """
    self.send_commitCart(cartId)
    return self.recv_commitCart()

  def send_commitCart(self, cartId):
    self._oprot.writeMessageBegin('commitCart', TMessageType.CALL, self._seqid)
    args = commitCart_args()
    args.cartId = cartId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_commitCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = commitCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "commitCart failed: unknown result");

  def validateCart(self, cartId):
    """
    Parameters:
     - cartId
    """
    self.send_validateCart(cartId)
    return self.recv_validateCart()

  def send_validateCart(self, cartId):
    self._oprot.writeMessageBegin('validateCart', TMessageType.CALL, self._seqid)
    args = validateCart_args()
    args.cartId = cartId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_validateCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = validateCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scex != None:
      raise result.scex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "validateCart failed: unknown result");

  def refreshCart(self, cartId):
    """
    Parameters:
     - cartId
    """
    self.send_refreshCart(cartId)
    return self.recv_refreshCart()

  def send_refreshCart(self, cartId):
    self._oprot.writeMessageBegin('refreshCart', TMessageType.CALL, self._seqid)
    args = refreshCart_args()
    args.cartId = cartId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_refreshCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = refreshCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scex != None:
      raise result.scex
    raise TApplicationException(TApplicationException.MISSING_RESULT, "refreshCart failed: unknown result");

  def mergeCart(self, fromCartId, toCartId):
    """
    Parameters:
     - fromCartId
     - toCartId
    """
    self.send_mergeCart(fromCartId, toCartId)
    self.recv_mergeCart()

  def send_mergeCart(self, fromCartId, toCartId):
    self._oprot.writeMessageBegin('mergeCart', TMessageType.CALL, self._seqid)
    args = mergeCart_args()
    args.fromCartId = fromCartId
    args.toCartId = toCartId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_mergeCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = mergeCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    return

  def addWidget(self, widget):
    """
    Parameters:
     - widget
    """
    self.send_addWidget(widget)
    self.recv_addWidget()

  def send_addWidget(self, widget):
    self._oprot.writeMessageBegin('addWidget', TMessageType.CALL, self._seqid)
    args = addWidget_args()
    args.widget = widget
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_addWidget(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = addWidget_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def addItemToWidget(self, widget_id, items):
    """
    Parameters:
     - widget_id
     - items
    """
    self.send_addItemToWidget(widget_id, items)
    self.recv_addItemToWidget()

  def send_addItemToWidget(self, widget_id, items):
    self._oprot.writeMessageBegin('addItemToWidget', TMessageType.CALL, self._seqid)
    args = addItemToWidget_args()
    args.widget_id = widget_id
    args.items = items
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_addItemToWidget(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = addItemToWidget_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def deleteItemFromWidget(self, widget_id, item_id):
    """
    Parameters:
     - widget_id
     - item_id
    """
    self.send_deleteItemFromWidget(widget_id, item_id)
    self.recv_deleteItemFromWidget()

  def send_deleteItemFromWidget(self, widget_id, item_id):
    self._oprot.writeMessageBegin('deleteItemFromWidget', TMessageType.CALL, self._seqid)
    args = deleteItemFromWidget_args()
    args.widget_id = widget_id
    args.item_id = item_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_deleteItemFromWidget(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = deleteItemFromWidget_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def updateWidget(self, widgetId, enable):
    """
    Parameters:
     - widgetId
     - enable
    """
    self.send_updateWidget(widgetId, enable)
    self.recv_updateWidget()

  def send_updateWidget(self, widgetId, enable):
    self._oprot.writeMessageBegin('updateWidget', TMessageType.CALL, self._seqid)
    args = updateWidget_args()
    args.widgetId = widgetId
    args.enable = enable
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_updateWidget(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = updateWidget_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def updateWidgetItem(self, widgetId, enable):
    """
    Parameters:
     - widgetId
     - enable
    """
    self.send_updateWidgetItem(widgetId, enable)
    self.recv_updateWidgetItem()

  def send_updateWidgetItem(self, widgetId, enable):
    self._oprot.writeMessageBegin('updateWidgetItem', TMessageType.CALL, self._seqid)
    args = updateWidgetItem_args()
    args.widgetId = widgetId
    args.enable = enable
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_updateWidgetItem(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = updateWidgetItem_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def getWidget(self, type, userId, onlyEnabled):
    """
    Parameters:
     - type
     - userId
     - onlyEnabled
    """
    self.send_getWidget(type, userId, onlyEnabled)
    return self.recv_getWidget()

  def send_getWidget(self, type, userId, onlyEnabled):
    self._oprot.writeMessageBegin('getWidget', TMessageType.CALL, self._seqid)
    args = getWidget_args()
    args.type = type
    args.userId = userId
    args.onlyEnabled = onlyEnabled
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getWidget(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getWidget_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getWidget failed: unknown result");

  def getMyResearch(self, user_id):
    """
    Parameters:
     - user_id
    """
    self.send_getMyResearch(user_id)
    return self.recv_getMyResearch()

  def send_getMyResearch(self, user_id):
    self._oprot.writeMessageBegin('getMyResearch', TMessageType.CALL, self._seqid)
    args = getMyResearch_args()
    args.user_id = user_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getMyResearch(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getMyResearch_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getMyResearch failed: unknown result");

  def updateMyResearch(self, user_id, item_id):
    """
    Parameters:
     - user_id
     - item_id
    """
    self.send_updateMyResearch(user_id, item_id)
    return self.recv_updateMyResearch()

  def send_updateMyResearch(self, user_id, item_id):
    self._oprot.writeMessageBegin('updateMyResearch', TMessageType.CALL, self._seqid)
    args = updateMyResearch_args()
    args.user_id = user_id
    args.item_id = item_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_updateMyResearch(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = updateMyResearch_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updateMyResearch failed: unknown result");

  def deleteItemFromMyResearch(self, user_id, item_id):
    """
    Parameters:
     - user_id
     - item_id
    """
    self.send_deleteItemFromMyResearch(user_id, item_id)
    self.recv_deleteItemFromMyResearch()

  def send_deleteItemFromMyResearch(self, user_id, item_id):
    self._oprot.writeMessageBegin('deleteItemFromMyResearch', TMessageType.CALL, self._seqid)
    args = deleteItemFromMyResearch_args()
    args.user_id = user_id
    args.item_id = item_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_deleteItemFromMyResearch(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = deleteItemFromMyResearch_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.scx != None:
      raise result.scx
    return

  def updateRatings(self, item_id, type, rating, user_id):
    """
    Parameters:
     - item_id
     - type
     - rating
     - user_id
    """
    self.send_updateRatings(item_id, type, rating, user_id)
    self.recv_updateRatings()

  def send_updateRatings(self, item_id, type, rating, user_id):
    self._oprot.writeMessageBegin('updateRatings', TMessageType.CALL, self._seqid)
    args = updateRatings_args()
    args.item_id = item_id
    args.type = type
    args.rating = rating
    args.user_id = user_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_updateRatings(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = updateRatings_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    return

  def getRatings(self, item_id, user_id):
    """
    Parameters:
     - item_id
     - user_id
    """
    self.send_getRatings(item_id, user_id)
    return self.recv_getRatings()

  def send_getRatings(self, item_id, user_id):
    self._oprot.writeMessageBegin('getRatings', TMessageType.CALL, self._seqid)
    args = getRatings_args()
    args.item_id = item_id
    args.user_id = user_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getRatings(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getRatings_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getRatings failed: unknown result");

  def updateBrowseHistory(self, user_id, item_id, isSessionId):
    """
    Parameters:
     - user_id
     - item_id
     - isSessionId
    """
    self.send_updateBrowseHistory(user_id, item_id, isSessionId)
    self.recv_updateBrowseHistory()

  def send_updateBrowseHistory(self, user_id, item_id, isSessionId):
    self._oprot.writeMessageBegin('updateBrowseHistory', TMessageType.CALL, self._seqid)
    args = updateBrowseHistory_args()
    args.user_id = user_id
    args.item_id = item_id
    args.isSessionId = isSessionId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_updateBrowseHistory(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = updateBrowseHistory_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    return

  def getBrowseHistory(self, userId, isSessionId):
    """
    Parameters:
     - userId
     - isSessionId
    """
    self.send_getBrowseHistory(userId, isSessionId)
    return self.recv_getBrowseHistory()

  def send_getBrowseHistory(self, userId, isSessionId):
    self._oprot.writeMessageBegin('getBrowseHistory', TMessageType.CALL, self._seqid)
    args = getBrowseHistory_args()
    args.userId = userId
    args.isSessionId = isSessionId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getBrowseHistory(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getBrowseHistory_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.scx != None:
      raise result.scx
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getBrowseHistory failed: unknown result");


class Processor(Iface, TProcessor):
  def __init__(self, handler):
    self._handler = handler
    self._processMap = {}
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
    self._processMap["getUserById"] = Processor.process_getUserById
    self._processMap["createUser"] = Processor.process_createUser
    self._processMap["updateUser"] = Processor.process_updateUser
    self._processMap["deleteUser"] = Processor.process_deleteUser
    self._processMap["getUserState"] = Processor.process_getUserState
    self._processMap["authenticateUser"] = Processor.process_authenticateUser
    self._processMap["userExists"] = Processor.process_userExists
    self._processMap["addAddressForUser"] = Processor.process_addAddressForUser
    self._processMap["removeAddressForUser"] = Processor.process_removeAddressForUser
    self._processMap["setUserAsLoggedIn"] = Processor.process_setUserAsLoggedIn
    self._processMap["setUserAsLoggedOut"] = Processor.process_setUserAsLoggedOut
    self._processMap["setDefaultAddress"] = Processor.process_setDefaultAddress
    self._processMap["updatePassword"] = Processor.process_updatePassword
    self._processMap["forgotPassword"] = Processor.process_forgotPassword
    self._processMap["getAllAddressesForUser"] = Processor.process_getAllAddressesForUser
    self._processMap["getDefaultAddressId"] = Processor.process_getDefaultAddressId
    self._processMap["createCart"] = Processor.process_createCart
    self._processMap["getCurrentCart"] = Processor.process_getCurrentCart
    self._processMap["getCart"] = Processor.process_getCart
    self._processMap["getCartsForUser"] = Processor.process_getCartsForUser
    self._processMap["getCartsByStatus"] = Processor.process_getCartsByStatus
    self._processMap["getCartsByTime"] = Processor.process_getCartsByTime
    self._processMap["changeCartStatus"] = Processor.process_changeCartStatus
    self._processMap["addItemToCart"] = Processor.process_addItemToCart
    self._processMap["deleteItemFromCart"] = Processor.process_deleteItemFromCart
    self._processMap["changeQuantity"] = Processor.process_changeQuantity
    self._processMap["changeItemStatus"] = Processor.process_changeItemStatus
    self._processMap["addAddressToCart"] = Processor.process_addAddressToCart
    self._processMap["commitCart"] = Processor.process_commitCart
    self._processMap["validateCart"] = Processor.process_validateCart
    self._processMap["refreshCart"] = Processor.process_refreshCart
    self._processMap["mergeCart"] = Processor.process_mergeCart
    self._processMap["addWidget"] = Processor.process_addWidget
    self._processMap["addItemToWidget"] = Processor.process_addItemToWidget
    self._processMap["deleteItemFromWidget"] = Processor.process_deleteItemFromWidget
    self._processMap["updateWidget"] = Processor.process_updateWidget
    self._processMap["updateWidgetItem"] = Processor.process_updateWidgetItem
    self._processMap["getWidget"] = Processor.process_getWidget
    self._processMap["getMyResearch"] = Processor.process_getMyResearch
    self._processMap["updateMyResearch"] = Processor.process_updateMyResearch
    self._processMap["deleteItemFromMyResearch"] = Processor.process_deleteItemFromMyResearch
    self._processMap["updateRatings"] = Processor.process_updateRatings
    self._processMap["getRatings"] = Processor.process_getRatings
    self._processMap["updateBrowseHistory"] = Processor.process_updateBrowseHistory
    self._processMap["getBrowseHistory"] = Processor.process_getBrowseHistory

  def process(self, iprot, oprot):
    (name, type, seqid) = iprot.readMessageBegin()
    if name not in self._processMap:
      iprot.skip(TType.STRUCT)
      iprot.readMessageEnd()
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
      x.write(oprot)
      oprot.writeMessageEnd()
      oprot.trans.flush()
      return
    else:
      self._processMap[name](self, seqid, iprot, oprot)
    return True

  def process_createAnonymousUser(self, seqid, iprot, oprot):
    args = createAnonymousUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = createAnonymousUser_result()
    try:
      result.success = self._handler.createAnonymousUser(args.jsessionId)
    except UserContextException, ucex:
      result.ucex = ucex
    oprot.writeMessageBegin("createAnonymousUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getUserById(self, seqid, iprot, oprot):
    args = getUserById_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getUserById_result()
    try:
      result.success = self._handler.getUserById(args.userId)
    except UserContextException, ucex:
      result.ucex = ucex
    oprot.writeMessageBegin("getUserById", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_createUser(self, seqid, iprot, oprot):
    args = createUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = createUser_result()
    try:
      result.success = self._handler.createUser(args.user)
    except UserContextException, ucex:
      result.ucex = ucex
    oprot.writeMessageBegin("createUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_updateUser(self, seqid, iprot, oprot):
    args = updateUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = updateUser_result()
    try:
      result.success = self._handler.updateUser(args.user)
    except UserContextException, ucex:
      result.ucex = ucex
    oprot.writeMessageBegin("updateUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_deleteUser(self, seqid, iprot, oprot):
    args = deleteUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = deleteUser_result()
    try:
      result.success = self._handler.deleteUser(args.userId)
    except UserContextException, ucex:
      result.ucex = ucex
    oprot.writeMessageBegin("deleteUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getUserState(self, seqid, iprot, oprot):
    args = getUserState_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getUserState_result()
    try:
      result.success = self._handler.getUserState(args.userId)
    except UserContextException, ucex:
      result.ucex = ucex
    oprot.writeMessageBegin("getUserState", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_authenticateUser(self, seqid, iprot, oprot):
    args = authenticateUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = authenticateUser_result()
    try:
      result.success = self._handler.authenticateUser(args.email, args.password)
    except AuthenticationException, auex:
      result.auex = auex
    oprot.writeMessageBegin("authenticateUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_userExists(self, seqid, iprot, oprot):
    args = userExists_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = userExists_result()
    try:
      result.success = self._handler.userExists(args.email)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("userExists", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_addAddressForUser(self, seqid, iprot, oprot):
    args = addAddressForUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = addAddressForUser_result()
    try:
      result.success = self._handler.addAddressForUser(args.userId, args.address, args.setDefault)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("addAddressForUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_removeAddressForUser(self, seqid, iprot, oprot):
    args = removeAddressForUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = removeAddressForUser_result()
    try:
      result.success = self._handler.removeAddressForUser(args.userid, args.addressId)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("removeAddressForUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_setUserAsLoggedIn(self, seqid, iprot, oprot):
    args = setUserAsLoggedIn_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = setUserAsLoggedIn_result()
    try:
      result.success = self._handler.setUserAsLoggedIn(args.userId, args.timestamp)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("setUserAsLoggedIn", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_setUserAsLoggedOut(self, seqid, iprot, oprot):
    args = setUserAsLoggedOut_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = setUserAsLoggedOut_result()
    try:
      result.success = self._handler.setUserAsLoggedOut(args.userid, args.timestamp)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("setUserAsLoggedOut", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_setDefaultAddress(self, seqid, iprot, oprot):
    args = setDefaultAddress_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = setDefaultAddress_result()
    try:
      result.success = self._handler.setDefaultAddress(args.userid, args.addressId)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("setDefaultAddress", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_updatePassword(self, seqid, iprot, oprot):
    args = updatePassword_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = updatePassword_result()
    try:
      result.success = self._handler.updatePassword(args.userid, args.oldPassword, args.newPassword)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("updatePassword", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_forgotPassword(self, seqid, iprot, oprot):
    args = forgotPassword_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = forgotPassword_result()
    try:
      result.success = self._handler.forgotPassword(args.email)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("forgotPassword", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getAllAddressesForUser(self, seqid, iprot, oprot):
    args = getAllAddressesForUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getAllAddressesForUser_result()
    try:
      result.success = self._handler.getAllAddressesForUser(args.userId)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("getAllAddressesForUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getDefaultAddressId(self, seqid, iprot, oprot):
    args = getDefaultAddressId_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getDefaultAddressId_result()
    try:
      result.success = self._handler.getDefaultAddressId(args.userId)
    except UserContextException, ucx:
      result.ucx = ucx
    oprot.writeMessageBegin("getDefaultAddressId", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_createCart(self, seqid, iprot, oprot):
    args = createCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = createCart_result()
    try:
      result.success = self._handler.createCart(args.userId)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("createCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getCurrentCart(self, seqid, iprot, oprot):
    args = getCurrentCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getCurrentCart_result()
    try:
      result.success = self._handler.getCurrentCart(args.userId)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("getCurrentCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getCart(self, seqid, iprot, oprot):
    args = getCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getCart_result()
    try:
      result.success = self._handler.getCart(args.cartId)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("getCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getCartsForUser(self, seqid, iprot, oprot):
    args = getCartsForUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getCartsForUser_result()
    try:
      result.success = self._handler.getCartsForUser(args.userId, args.status)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("getCartsForUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getCartsByStatus(self, seqid, iprot, oprot):
    args = getCartsByStatus_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getCartsByStatus_result()
    try:
      result.success = self._handler.getCartsByStatus(args.status)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("getCartsByStatus", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getCartsByTime(self, seqid, iprot, oprot):
    args = getCartsByTime_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getCartsByTime_result()
    try:
      result.success = self._handler.getCartsByTime(args.from_time, args.to_time, args.status)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("getCartsByTime", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_changeCartStatus(self, seqid, iprot, oprot):
    args = changeCartStatus_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = changeCartStatus_result()
    try:
      self._handler.changeCartStatus(args.cartId, args.status)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("changeCartStatus", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_addItemToCart(self, seqid, iprot, oprot):
    args = addItemToCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = addItemToCart_result()
    try:
      self._handler.addItemToCart(args.cartId, args.itemId, args.quantity)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("addItemToCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_deleteItemFromCart(self, seqid, iprot, oprot):
    args = deleteItemFromCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = deleteItemFromCart_result()
    try:
      self._handler.deleteItemFromCart(args.cartId, args.itemId)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("deleteItemFromCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_changeQuantity(self, seqid, iprot, oprot):
    args = changeQuantity_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = changeQuantity_result()
    try:
      self._handler.changeQuantity(args.cartId, args.itemId, args.quantity)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("changeQuantity", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_changeItemStatus(self, seqid, iprot, oprot):
    args = changeItemStatus_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = changeItemStatus_result()
    try:
      self._handler.changeItemStatus(args.cartId, args.itemId, args.status)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("changeItemStatus", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_addAddressToCart(self, seqid, iprot, oprot):
    args = addAddressToCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = addAddressToCart_result()
    try:
      self._handler.addAddressToCart(args.cartId, args.addressId)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("addAddressToCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_commitCart(self, seqid, iprot, oprot):
    args = commitCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = commitCart_result()
    try:
      result.success = self._handler.commitCart(args.cartId)
    except ShoppingCartException, scx:
      result.scx = scx
    oprot.writeMessageBegin("commitCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_validateCart(self, seqid, iprot, oprot):
    args = validateCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = validateCart_result()
    try:
      result.success = self._handler.validateCart(args.cartId)
    except ShoppingCartException, scex:
      result.scex = scex
    oprot.writeMessageBegin("validateCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_refreshCart(self, seqid, iprot, oprot):
    args = refreshCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = refreshCart_result()
    try:
      result.success = self._handler.refreshCart(args.cartId)
    except ShoppingCartException, scex:
      result.scex = scex
    oprot.writeMessageBegin("refreshCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_mergeCart(self, seqid, iprot, oprot):
    args = mergeCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = mergeCart_result()
    self._handler.mergeCart(args.fromCartId, args.toCartId)
    oprot.writeMessageBegin("mergeCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_addWidget(self, seqid, iprot, oprot):
    args = addWidget_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = addWidget_result()
    try:
      self._handler.addWidget(args.widget)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("addWidget", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_addItemToWidget(self, seqid, iprot, oprot):
    args = addItemToWidget_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = addItemToWidget_result()
    try:
      self._handler.addItemToWidget(args.widget_id, args.items)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("addItemToWidget", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_deleteItemFromWidget(self, seqid, iprot, oprot):
    args = deleteItemFromWidget_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = deleteItemFromWidget_result()
    try:
      self._handler.deleteItemFromWidget(args.widget_id, args.item_id)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("deleteItemFromWidget", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_updateWidget(self, seqid, iprot, oprot):
    args = updateWidget_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = updateWidget_result()
    try:
      self._handler.updateWidget(args.widgetId, args.enable)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("updateWidget", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_updateWidgetItem(self, seqid, iprot, oprot):
    args = updateWidgetItem_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = updateWidgetItem_result()
    try:
      self._handler.updateWidgetItem(args.widgetId, args.enable)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("updateWidgetItem", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getWidget(self, seqid, iprot, oprot):
    args = getWidget_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getWidget_result()
    try:
      result.success = self._handler.getWidget(args.type, args.userId, args.onlyEnabled)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("getWidget", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getMyResearch(self, seqid, iprot, oprot):
    args = getMyResearch_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getMyResearch_result()
    try:
      result.success = self._handler.getMyResearch(args.user_id)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("getMyResearch", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_updateMyResearch(self, seqid, iprot, oprot):
    args = updateMyResearch_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = updateMyResearch_result()
    try:
      result.success = self._handler.updateMyResearch(args.user_id, args.item_id)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("updateMyResearch", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_deleteItemFromMyResearch(self, seqid, iprot, oprot):
    args = deleteItemFromMyResearch_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = deleteItemFromMyResearch_result()
    try:
      self._handler.deleteItemFromMyResearch(args.user_id, args.item_id)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("deleteItemFromMyResearch", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_updateRatings(self, seqid, iprot, oprot):
    args = updateRatings_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = updateRatings_result()
    self._handler.updateRatings(args.item_id, args.type, args.rating, args.user_id)
    oprot.writeMessageBegin("updateRatings", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getRatings(self, seqid, iprot, oprot):
    args = getRatings_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getRatings_result()
    try:
      result.success = self._handler.getRatings(args.item_id, args.user_id)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("getRatings", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_updateBrowseHistory(self, seqid, iprot, oprot):
    args = updateBrowseHistory_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = updateBrowseHistory_result()
    self._handler.updateBrowseHistory(args.user_id, args.item_id, args.isSessionId)
    oprot.writeMessageBegin("updateBrowseHistory", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getBrowseHistory(self, seqid, iprot, oprot):
    args = getBrowseHistory_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getBrowseHistory_result()
    try:
      result.success = self._handler.getBrowseHistory(args.userId, args.isSessionId)
    except WidgetException, scx:
      result.scx = scx
    oprot.writeMessageBegin("getBrowseHistory", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES

class createAnonymousUser_args:
  """
  Attributes:
   - jsessionId
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'jsessionId', None, None, ), # 1
  )

  def __init__(self, jsessionId=None,):
    self.jsessionId = jsessionId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.jsessionId = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createAnonymousUser_args')
    if self.jsessionId != None:
      oprot.writeFieldBegin('jsessionId', TType.STRING, 1)
      oprot.writeString(self.jsessionId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class createAnonymousUser_result:
  """
  Attributes:
   - success
   - ucex
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (User, User.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ucex', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucex=None,):
    self.success = success
    self.ucex = ucex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = User()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucex = UserContextException()
          self.ucex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createAnonymousUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ucex != None:
      oprot.writeFieldBegin('ucex', TType.STRUCT, 1)
      self.ucex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getUserById_args:
  """
  Attributes:
   - userId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
  )

  def __init__(self, userId=None,):
    self.userId = userId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getUserById_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getUserById_result:
  """
  Attributes:
   - success
   - ucex
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (User, User.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ucex', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucex=None,):
    self.success = success
    self.ucex = ucex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = User()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucex = UserContextException()
          self.ucex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getUserById_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ucex != None:
      oprot.writeFieldBegin('ucex', TType.STRUCT, 1)
      self.ucex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class createUser_args:
  """
  Attributes:
   - user
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'user', (User, User.thrift_spec), None, ), # 1
  )

  def __init__(self, user=None,):
    self.user = user

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.user = User()
          self.user.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createUser_args')
    if self.user != None:
      oprot.writeFieldBegin('user', TType.STRUCT, 1)
      self.user.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class createUser_result:
  """
  Attributes:
   - success
   - ucex
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (User, User.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ucex', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucex=None,):
    self.success = success
    self.ucex = ucex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = User()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucex = UserContextException()
          self.ucex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ucex != None:
      oprot.writeFieldBegin('ucex', TType.STRUCT, 1)
      self.ucex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateUser_args:
  """
  Attributes:
   - user
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'user', (User, User.thrift_spec), None, ), # 1
  )

  def __init__(self, user=None,):
    self.user = user

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.user = User()
          self.user.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateUser_args')
    if self.user != None:
      oprot.writeFieldBegin('user', TType.STRUCT, 1)
      self.user.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateUser_result:
  """
  Attributes:
   - success
   - ucex
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (User, User.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ucex', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucex=None,):
    self.success = success
    self.ucex = ucex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = User()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucex = UserContextException()
          self.ucex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ucex != None:
      oprot.writeFieldBegin('ucex', TType.STRUCT, 1)
      self.ucex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class deleteUser_args:
  """
  Attributes:
   - userId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
  )

  def __init__(self, userId=None,):
    self.userId = userId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('deleteUser_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class deleteUser_result:
  """
  Attributes:
   - success
   - ucex
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucex', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucex=None,):
    self.success = success
    self.ucex = ucex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucex = UserContextException()
          self.ucex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('deleteUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.ucex != None:
      oprot.writeFieldBegin('ucex', TType.STRUCT, 1)
      self.ucex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getUserState_args:
  """
  Attributes:
   - userId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
  )

  def __init__(self, userId=None,):
    self.userId = userId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getUserState_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getUserState_result:
  """
  Attributes:
   - success
   - ucex
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (UserState, UserState.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ucex', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucex=None,):
    self.success = success
    self.ucex = ucex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = UserState()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucex = UserContextException()
          self.ucex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getUserState_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ucex != None:
      oprot.writeFieldBegin('ucex', TType.STRUCT, 1)
      self.ucex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class authenticateUser_args:
  """
  Attributes:
   - email
   - password
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'email', None, None, ), # 1
    (2, TType.STRING, 'password', None, None, ), # 2
  )

  def __init__(self, email=None, password=None,):
    self.email = email
    self.password = password

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.email = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.password = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('authenticateUser_args')
    if self.email != None:
      oprot.writeFieldBegin('email', TType.STRING, 1)
      oprot.writeString(self.email)
      oprot.writeFieldEnd()
    if self.password != None:
      oprot.writeFieldBegin('password', TType.STRING, 2)
      oprot.writeString(self.password)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class authenticateUser_result:
  """
  Attributes:
   - success
   - auex
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (User, User.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'auex', (AuthenticationException, AuthenticationException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, auex=None,):
    self.success = success
    self.auex = auex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = User()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.auex = AuthenticationException()
          self.auex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('authenticateUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.auex != None:
      oprot.writeFieldBegin('auex', TType.STRUCT, 1)
      self.auex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class userExists_args:
  """
  Attributes:
   - email
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'email', None, None, ), # 1
  )

  def __init__(self, email=None,):
    self.email = email

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.email = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('userExists_args')
    if self.email != None:
      oprot.writeFieldBegin('email', TType.STRING, 1)
      oprot.writeString(self.email)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class userExists_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('userExists_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addAddressForUser_args:
  """
  Attributes:
   - userId
   - address
   - setDefault
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
    (2, TType.STRUCT, 'address', (Address, Address.thrift_spec), None, ), # 2
    (3, TType.BOOL, 'setDefault', None, None, ), # 3
  )

  def __init__(self, userId=None, address=None, setDefault=None,):
    self.userId = userId
    self.address = address
    self.setDefault = setDefault

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.address = Address()
          self.address.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.BOOL:
          self.setDefault = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addAddressForUser_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    if self.address != None:
      oprot.writeFieldBegin('address', TType.STRUCT, 2)
      self.address.write(oprot)
      oprot.writeFieldEnd()
    if self.setDefault != None:
      oprot.writeFieldBegin('setDefault', TType.BOOL, 3)
      oprot.writeBool(self.setDefault)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addAddressForUser_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.I64:
          self.success = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addAddressForUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.I64, 0)
      oprot.writeI64(self.success)
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class removeAddressForUser_args:
  """
  Attributes:
   - userid
   - addressId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userid', None, None, ), # 1
    (2, TType.I64, 'addressId', None, None, ), # 2
  )

  def __init__(self, userid=None, addressId=None,):
    self.userid = userid
    self.addressId = addressId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userid = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.addressId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('removeAddressForUser_args')
    if self.userid != None:
      oprot.writeFieldBegin('userid', TType.I64, 1)
      oprot.writeI64(self.userid)
      oprot.writeFieldEnd()
    if self.addressId != None:
      oprot.writeFieldBegin('addressId', TType.I64, 2)
      oprot.writeI64(self.addressId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class removeAddressForUser_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('removeAddressForUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class setUserAsLoggedIn_args:
  """
  Attributes:
   - userId
   - timestamp
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
    (2, TType.I64, 'timestamp', None, None, ), # 2
  )

  def __init__(self, userId=None, timestamp=None,):
    self.userId = userId
    self.timestamp = timestamp

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.timestamp = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('setUserAsLoggedIn_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    if self.timestamp != None:
      oprot.writeFieldBegin('timestamp', TType.I64, 2)
      oprot.writeI64(self.timestamp)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class setUserAsLoggedIn_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('setUserAsLoggedIn_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class setUserAsLoggedOut_args:
  """
  Attributes:
   - userid
   - timestamp
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userid', None, None, ), # 1
    (2, TType.I64, 'timestamp', None, None, ), # 2
  )

  def __init__(self, userid=None, timestamp=None,):
    self.userid = userid
    self.timestamp = timestamp

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userid = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.timestamp = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('setUserAsLoggedOut_args')
    if self.userid != None:
      oprot.writeFieldBegin('userid', TType.I64, 1)
      oprot.writeI64(self.userid)
      oprot.writeFieldEnd()
    if self.timestamp != None:
      oprot.writeFieldBegin('timestamp', TType.I64, 2)
      oprot.writeI64(self.timestamp)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class setUserAsLoggedOut_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('setUserAsLoggedOut_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class setDefaultAddress_args:
  """
  Attributes:
   - userid
   - addressId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userid', None, None, ), # 1
    (2, TType.I64, 'addressId', None, None, ), # 2
  )

  def __init__(self, userid=None, addressId=None,):
    self.userid = userid
    self.addressId = addressId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userid = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.addressId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('setDefaultAddress_args')
    if self.userid != None:
      oprot.writeFieldBegin('userid', TType.I64, 1)
      oprot.writeI64(self.userid)
      oprot.writeFieldEnd()
    if self.addressId != None:
      oprot.writeFieldBegin('addressId', TType.I64, 2)
      oprot.writeI64(self.addressId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class setDefaultAddress_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('setDefaultAddress_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updatePassword_args:
  """
  Attributes:
   - userid
   - oldPassword
   - newPassword
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userid', None, None, ), # 1
    (2, TType.STRING, 'oldPassword', None, None, ), # 2
    (3, TType.STRING, 'newPassword', None, None, ), # 3
  )

  def __init__(self, userid=None, oldPassword=None, newPassword=None,):
    self.userid = userid
    self.oldPassword = oldPassword
    self.newPassword = newPassword

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userid = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.oldPassword = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.newPassword = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updatePassword_args')
    if self.userid != None:
      oprot.writeFieldBegin('userid', TType.I64, 1)
      oprot.writeI64(self.userid)
      oprot.writeFieldEnd()
    if self.oldPassword != None:
      oprot.writeFieldBegin('oldPassword', TType.STRING, 2)
      oprot.writeString(self.oldPassword)
      oprot.writeFieldEnd()
    if self.newPassword != None:
      oprot.writeFieldBegin('newPassword', TType.STRING, 3)
      oprot.writeString(self.newPassword)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updatePassword_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updatePassword_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class forgotPassword_args:
  """
  Attributes:
   - email
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'email', None, None, ), # 1
  )

  def __init__(self, email=None,):
    self.email = email

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.email = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('forgotPassword_args')
    if self.email != None:
      oprot.writeFieldBegin('email', TType.STRING, 1)
      oprot.writeString(self.email)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class forgotPassword_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('forgotPassword_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getAllAddressesForUser_args:
  """
  Attributes:
   - userId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
  )

  def __init__(self, userId=None,):
    self.userId = userId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getAllAddressesForUser_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getAllAddressesForUser_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(Address, Address.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype40, _size37) = iprot.readListBegin()
          for _i41 in xrange(_size37):
            _elem42 = Address()
            _elem42.read(iprot)
            self.success.append(_elem42)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getAllAddressesForUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter43 in self.success:
        iter43.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getDefaultAddressId_args:
  """
  Attributes:
   - userId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
  )

  def __init__(self, userId=None,):
    self.userId = userId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getDefaultAddressId_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getDefaultAddressId_result:
  """
  Attributes:
   - success
   - ucx
  """

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, ucx=None,):
    self.success = success
    self.ucx = ucx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.I64:
          self.success = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ucx = UserContextException()
          self.ucx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getDefaultAddressId_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.I64, 0)
      oprot.writeI64(self.success)
      oprot.writeFieldEnd()
    if self.ucx != None:
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
      self.ucx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class createCart_args:
  """
  Attributes:
   - userId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
  )

  def __init__(self, userId=None,):
    self.userId = userId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createCart_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class createCart_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.I64:
          self.success = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createCart_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.I64, 0)
      oprot.writeI64(self.success)
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCurrentCart_args:
  """
  Attributes:
   - userId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
  )

  def __init__(self, userId=None,):
    self.userId = userId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCurrentCart_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCurrentCart_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Cart, Cart.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = Cart()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCurrentCart_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCart_args:
  """
  Attributes:
   - cartId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
  )

  def __init__(self, cartId=None,):
    self.cartId = cartId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCart_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCart_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Cart, Cart.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = Cart()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCart_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCartsForUser_args:
  """
  Attributes:
   - userId
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
    (2, TType.I32, 'status', None, None, ), # 2
  )

  def __init__(self, userId=None, status=None,):
    self.userId = userId
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCartsForUser_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 2)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCartsForUser_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(Cart, Cart.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype47, _size44) = iprot.readListBegin()
          for _i48 in xrange(_size44):
            _elem49 = Cart()
            _elem49.read(iprot)
            self.success.append(_elem49)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCartsForUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter50 in self.success:
        iter50.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCartsByStatus_args:
  """
  Attributes:
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'status', None, None, ), # 1
  )

  def __init__(self, status=None,):
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCartsByStatus_args')
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 1)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCartsByStatus_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(Cart, Cart.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype54, _size51) = iprot.readListBegin()
          for _i55 in xrange(_size51):
            _elem56 = Cart()
            _elem56.read(iprot)
            self.success.append(_elem56)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCartsByStatus_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter57 in self.success:
        iter57.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCartsByTime_args:
  """
  Attributes:
   - from_time
   - to_time
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'from_time', None, None, ), # 1
    (2, TType.I64, 'to_time', None, None, ), # 2
    (3, TType.I32, 'status', None, None, ), # 3
  )

  def __init__(self, from_time=None, to_time=None, status=None,):
    self.from_time = from_time
    self.to_time = to_time
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.from_time = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.to_time = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCartsByTime_args')
    if self.from_time != None:
      oprot.writeFieldBegin('from_time', TType.I64, 1)
      oprot.writeI64(self.from_time)
      oprot.writeFieldEnd()
    if self.to_time != None:
      oprot.writeFieldBegin('to_time', TType.I64, 2)
      oprot.writeI64(self.to_time)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 3)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCartsByTime_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(Cart, Cart.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype61, _size58) = iprot.readListBegin()
          for _i62 in xrange(_size58):
            _elem63 = Cart()
            _elem63.read(iprot)
            self.success.append(_elem63)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCartsByTime_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter64 in self.success:
        iter64.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changeCartStatus_args:
  """
  Attributes:
   - cartId
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
    (2, TType.I32, 'status', None, None, ), # 2
  )

  def __init__(self, cartId=None, status=None,):
    self.cartId = cartId
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changeCartStatus_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 2)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changeCartStatus_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changeCartStatus_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addItemToCart_args:
  """
  Attributes:
   - cartId
   - itemId
   - quantity
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
    (2, TType.I64, 'itemId', None, None, ), # 2
    (3, TType.I64, 'quantity', None, None, ), # 3
  )

  def __init__(self, cartId=None, itemId=None, quantity=None,):
    self.cartId = cartId
    self.itemId = itemId
    self.quantity = quantity

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.itemId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.quantity = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addItemToCart_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    if self.itemId != None:
      oprot.writeFieldBegin('itemId', TType.I64, 2)
      oprot.writeI64(self.itemId)
      oprot.writeFieldEnd()
    if self.quantity != None:
      oprot.writeFieldBegin('quantity', TType.I64, 3)
      oprot.writeI64(self.quantity)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addItemToCart_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addItemToCart_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class deleteItemFromCart_args:
  """
  Attributes:
   - cartId
   - itemId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
    (2, TType.I64, 'itemId', None, None, ), # 2
  )

  def __init__(self, cartId=None, itemId=None,):
    self.cartId = cartId
    self.itemId = itemId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.itemId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('deleteItemFromCart_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    if self.itemId != None:
      oprot.writeFieldBegin('itemId', TType.I64, 2)
      oprot.writeI64(self.itemId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class deleteItemFromCart_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('deleteItemFromCart_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changeQuantity_args:
  """
  Attributes:
   - cartId
   - itemId
   - quantity
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
    (2, TType.I64, 'itemId', None, None, ), # 2
    (3, TType.I64, 'quantity', None, None, ), # 3
  )

  def __init__(self, cartId=None, itemId=None, quantity=None,):
    self.cartId = cartId
    self.itemId = itemId
    self.quantity = quantity

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.itemId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.quantity = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changeQuantity_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    if self.itemId != None:
      oprot.writeFieldBegin('itemId', TType.I64, 2)
      oprot.writeI64(self.itemId)
      oprot.writeFieldEnd()
    if self.quantity != None:
      oprot.writeFieldBegin('quantity', TType.I64, 3)
      oprot.writeI64(self.quantity)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changeQuantity_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changeQuantity_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changeItemStatus_args:
  """
  Attributes:
   - cartId
   - itemId
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
    (2, TType.I64, 'itemId', None, None, ), # 2
    (3, TType.I32, 'status', None, None, ), # 3
  )

  def __init__(self, cartId=None, itemId=None, status=None,):
    self.cartId = cartId
    self.itemId = itemId
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.itemId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changeItemStatus_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    if self.itemId != None:
      oprot.writeFieldBegin('itemId', TType.I64, 2)
      oprot.writeI64(self.itemId)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 3)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changeItemStatus_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changeItemStatus_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addAddressToCart_args:
  """
  Attributes:
   - cartId
   - addressId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
    (2, TType.I64, 'addressId', None, None, ), # 2
  )

  def __init__(self, cartId=None, addressId=None,):
    self.cartId = cartId
    self.addressId = addressId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.addressId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addAddressToCart_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    if self.addressId != None:
      oprot.writeFieldBegin('addressId', TType.I64, 2)
      oprot.writeI64(self.addressId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addAddressToCart_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addAddressToCart_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class commitCart_args:
  """
  Attributes:
   - cartId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
  )

  def __init__(self, cartId=None,):
    self.cartId = cartId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('commitCart_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class commitCart_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.I64:
          self.success = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = ShoppingCartException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('commitCart_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.I64, 0)
      oprot.writeI64(self.success)
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class validateCart_args:
  """
  Attributes:
   - cartId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
  )

  def __init__(self, cartId=None,):
    self.cartId = cartId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('validateCart_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class validateCart_result:
  """
  Attributes:
   - success
   - scex
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'scex', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scex=None,):
    self.success = success
    self.scex = scex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scex = ShoppingCartException()
          self.scex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('validateCart_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.scex != None:
      oprot.writeFieldBegin('scex', TType.STRUCT, 1)
      self.scex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class refreshCart_args:
  """
  Attributes:
   - cartId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
  )

  def __init__(self, cartId=None,):
    self.cartId = cartId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('refreshCart_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class refreshCart_result:
  """
  Attributes:
   - success
   - scex
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'scex', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scex=None,):
    self.success = success
    self.scex = scex

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scex = ShoppingCartException()
          self.scex.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('refreshCart_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.scex != None:
      oprot.writeFieldBegin('scex', TType.STRUCT, 1)
      self.scex.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class mergeCart_args:
  """
  Attributes:
   - fromCartId
   - toCartId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'fromCartId', None, None, ), # 1
    (2, TType.I64, 'toCartId', None, None, ), # 2
  )

  def __init__(self, fromCartId=None, toCartId=None,):
    self.fromCartId = fromCartId
    self.toCartId = toCartId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.fromCartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.toCartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('mergeCart_args')
    if self.fromCartId != None:
      oprot.writeFieldBegin('fromCartId', TType.I64, 1)
      oprot.writeI64(self.fromCartId)
      oprot.writeFieldEnd()
    if self.toCartId != None:
      oprot.writeFieldBegin('toCartId', TType.I64, 2)
      oprot.writeI64(self.toCartId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class mergeCart_result:

  thrift_spec = (
  )

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('mergeCart_result')
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addWidget_args:
  """
  Attributes:
   - widget
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'widget', (Widget, Widget.thrift_spec), None, ), # 1
  )

  def __init__(self, widget=None,):
    self.widget = widget

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.widget = Widget()
          self.widget.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addWidget_args')
    if self.widget != None:
      oprot.writeFieldBegin('widget', TType.STRUCT, 1)
      self.widget.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addWidget_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addWidget_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addItemToWidget_args:
  """
  Attributes:
   - widget_id
   - items
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'widget_id', None, None, ), # 1
    (2, TType.LIST, 'items', (TType.I64,None), None, ), # 2
  )

  def __init__(self, widget_id=None, items=None,):
    self.widget_id = widget_id
    self.items = items

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.widget_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.LIST:
          self.items = []
          (_etype68, _size65) = iprot.readListBegin()
          for _i69 in xrange(_size65):
            _elem70 = iprot.readI64();
            self.items.append(_elem70)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addItemToWidget_args')
    if self.widget_id != None:
      oprot.writeFieldBegin('widget_id', TType.I64, 1)
      oprot.writeI64(self.widget_id)
      oprot.writeFieldEnd()
    if self.items != None:
      oprot.writeFieldBegin('items', TType.LIST, 2)
      oprot.writeListBegin(TType.I64, len(self.items))
      for iter71 in self.items:
        oprot.writeI64(iter71)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addItemToWidget_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addItemToWidget_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class deleteItemFromWidget_args:
  """
  Attributes:
   - widget_id
   - item_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'widget_id', None, None, ), # 1
    (2, TType.I64, 'item_id', None, None, ), # 2
  )

  def __init__(self, widget_id=None, item_id=None,):
    self.widget_id = widget_id
    self.item_id = item_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.widget_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.item_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('deleteItemFromWidget_args')
    if self.widget_id != None:
      oprot.writeFieldBegin('widget_id', TType.I64, 1)
      oprot.writeI64(self.widget_id)
      oprot.writeFieldEnd()
    if self.item_id != None:
      oprot.writeFieldBegin('item_id', TType.I64, 2)
      oprot.writeI64(self.item_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class deleteItemFromWidget_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('deleteItemFromWidget_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateWidget_args:
  """
  Attributes:
   - widgetId
   - enable
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'widgetId', None, None, ), # 1
    (2, TType.BOOL, 'enable', None, None, ), # 2
  )

  def __init__(self, widgetId=None, enable=None,):
    self.widgetId = widgetId
    self.enable = enable

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.widgetId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.BOOL:
          self.enable = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateWidget_args')
    if self.widgetId != None:
      oprot.writeFieldBegin('widgetId', TType.I64, 1)
      oprot.writeI64(self.widgetId)
      oprot.writeFieldEnd()
    if self.enable != None:
      oprot.writeFieldBegin('enable', TType.BOOL, 2)
      oprot.writeBool(self.enable)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateWidget_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateWidget_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateWidgetItem_args:
  """
  Attributes:
   - widgetId
   - enable
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'widgetId', None, None, ), # 1
    (2, TType.BOOL, 'enable', None, None, ), # 2
  )

  def __init__(self, widgetId=None, enable=None,):
    self.widgetId = widgetId
    self.enable = enable

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.widgetId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.BOOL:
          self.enable = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateWidgetItem_args')
    if self.widgetId != None:
      oprot.writeFieldBegin('widgetId', TType.I64, 1)
      oprot.writeI64(self.widgetId)
      oprot.writeFieldEnd()
    if self.enable != None:
      oprot.writeFieldBegin('enable', TType.BOOL, 2)
      oprot.writeBool(self.enable)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateWidgetItem_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateWidgetItem_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getWidget_args:
  """
  Attributes:
   - type
   - userId
   - onlyEnabled
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'type', None, None, ), # 1
    (2, TType.I64, 'userId', None, None, ), # 2
    (3, TType.BOOL, 'onlyEnabled', None, None, ), # 3
  )

  def __init__(self, type=None, userId=None, onlyEnabled=None,):
    self.type = type
    self.userId = userId
    self.onlyEnabled = onlyEnabled

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.BOOL:
          self.onlyEnabled = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getWidget_args')
    if self.type != None:
      oprot.writeFieldBegin('type', TType.I32, 1)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 2)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    if self.onlyEnabled != None:
      oprot.writeFieldBegin('onlyEnabled', TType.BOOL, 3)
      oprot.writeBool(self.onlyEnabled)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getWidget_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Widget, Widget.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = Widget()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getWidget_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getMyResearch_args:
  """
  Attributes:
   - user_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'user_id', None, None, ), # 1
  )

  def __init__(self, user_id=None,):
    self.user_id = user_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.user_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getMyResearch_args')
    if self.user_id != None:
      oprot.writeFieldBegin('user_id', TType.I64, 1)
      oprot.writeI64(self.user_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getMyResearch_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Widget, Widget.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = Widget()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getMyResearch_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateMyResearch_args:
  """
  Attributes:
   - user_id
   - item_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'user_id', None, None, ), # 1
    (2, TType.I64, 'item_id', None, None, ), # 2
  )

  def __init__(self, user_id=None, item_id=None,):
    self.user_id = user_id
    self.item_id = item_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.user_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.item_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateMyResearch_args')
    if self.user_id != None:
      oprot.writeFieldBegin('user_id', TType.I64, 1)
      oprot.writeI64(self.user_id)
      oprot.writeFieldEnd()
    if self.item_id != None:
      oprot.writeFieldBegin('item_id', TType.I64, 2)
      oprot.writeI64(self.item_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateMyResearch_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.BOOL:
          self.success = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateMyResearch_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.BOOL, 0)
      oprot.writeBool(self.success)
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class deleteItemFromMyResearch_args:
  """
  Attributes:
   - user_id
   - item_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'user_id', None, None, ), # 1
    (2, TType.I64, 'item_id', None, None, ), # 2
  )

  def __init__(self, user_id=None, item_id=None,):
    self.user_id = user_id
    self.item_id = item_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.user_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.item_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('deleteItemFromMyResearch_args')
    if self.user_id != None:
      oprot.writeFieldBegin('user_id', TType.I64, 1)
      oprot.writeI64(self.user_id)
      oprot.writeFieldEnd()
    if self.item_id != None:
      oprot.writeFieldBegin('item_id', TType.I64, 2)
      oprot.writeI64(self.item_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class deleteItemFromMyResearch_result:
  """
  Attributes:
   - scx
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, scx=None,):
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('deleteItemFromMyResearch_result')
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateRatings_args:
  """
  Attributes:
   - item_id
   - type
   - rating
   - user_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'item_id', None, None, ), # 1
    (2, TType.I32, 'type', None, None, ), # 2
    (3, TType.DOUBLE, 'rating', None, None, ), # 3
    (4, TType.I64, 'user_id', None, None, ), # 4
  )

  def __init__(self, item_id=None, type=None, rating=None, user_id=None,):
    self.item_id = item_id
    self.type = type
    self.rating = rating
    self.user_id = user_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.item_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.rating = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.user_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateRatings_args')
    if self.item_id != None:
      oprot.writeFieldBegin('item_id', TType.I64, 1)
      oprot.writeI64(self.item_id)
      oprot.writeFieldEnd()
    if self.type != None:
      oprot.writeFieldBegin('type', TType.I32, 2)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    if self.rating != None:
      oprot.writeFieldBegin('rating', TType.DOUBLE, 3)
      oprot.writeDouble(self.rating)
      oprot.writeFieldEnd()
    if self.user_id != None:
      oprot.writeFieldBegin('user_id', TType.I64, 4)
      oprot.writeI64(self.user_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateRatings_result:

  thrift_spec = (
  )

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateRatings_result')
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getRatings_args:
  """
  Attributes:
   - item_id
   - user_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'item_id', None, None, ), # 1
    (2, TType.I64, 'user_id', None, None, ), # 2
  )

  def __init__(self, item_id=None, user_id=None,):
    self.item_id = item_id
    self.user_id = user_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.item_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.user_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getRatings_args')
    if self.item_id != None:
      oprot.writeFieldBegin('item_id', TType.I64, 1)
      oprot.writeI64(self.item_id)
      oprot.writeFieldEnd()
    if self.user_id != None:
      oprot.writeFieldBegin('user_id', TType.I64, 2)
      oprot.writeI64(self.user_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getRatings_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (RatingsWidget, RatingsWidget.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = RatingsWidget()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getRatings_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateBrowseHistory_args:
  """
  Attributes:
   - user_id
   - item_id
   - isSessionId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'user_id', None, None, ), # 1
    (2, TType.I64, 'item_id', None, None, ), # 2
    (3, TType.BOOL, 'isSessionId', None, None, ), # 3
  )

  def __init__(self, user_id=None, item_id=None, isSessionId=None,):
    self.user_id = user_id
    self.item_id = item_id
    self.isSessionId = isSessionId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.user_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.item_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.BOOL:
          self.isSessionId = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateBrowseHistory_args')
    if self.user_id != None:
      oprot.writeFieldBegin('user_id', TType.I64, 1)
      oprot.writeI64(self.user_id)
      oprot.writeFieldEnd()
    if self.item_id != None:
      oprot.writeFieldBegin('item_id', TType.I64, 2)
      oprot.writeI64(self.item_id)
      oprot.writeFieldEnd()
    if self.isSessionId != None:
      oprot.writeFieldBegin('isSessionId', TType.BOOL, 3)
      oprot.writeBool(self.isSessionId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class updateBrowseHistory_result:

  thrift_spec = (
  )

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('updateBrowseHistory_result')
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getBrowseHistory_args:
  """
  Attributes:
   - userId
   - isSessionId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
    (2, TType.BOOL, 'isSessionId', None, None, ), # 2
  )

  def __init__(self, userId=None, isSessionId=None,):
    self.userId = userId
    self.isSessionId = isSessionId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.BOOL:
          self.isSessionId = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getBrowseHistory_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    if self.isSessionId != None:
      oprot.writeFieldBegin('isSessionId', TType.BOOL, 2)
      oprot.writeBool(self.isSessionId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getBrowseHistory_result:
  """
  Attributes:
   - success
   - scx
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Widget, Widget.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'scx', (WidgetException, WidgetException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, scx=None,):
    self.success = success
    self.scx = scx

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = Widget()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.scx = WidgetException()
          self.scx.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getBrowseHistory_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.scx != None:
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
      self.scx.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)