Subversion Repositories SmartDukaan

Rev

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

Rev 22358 Rev 22364
Line 106... Line 106...
106
    Parameters:
106
    Parameters:
107
     - address
107
     - address
108
    """
108
    """
109
    pass
109
    pass
110
 
110
 
-
 
111
  def updateCounter(self, counter):
-
 
112
    """
-
 
113
    Parameters:
-
 
114
     - counter
-
 
115
    """
-
 
116
    pass
-
 
117
 
111
  def setUserAsLoggedIn(self, userId, timestamp):
118
  def setUserAsLoggedIn(self, userId, timestamp):
112
    """
119
    """
113
    Parameters:
120
    Parameters:
114
     - userId
121
     - userId
115
     - timestamp
122
     - timestamp
Line 1220... Line 1227...
1220
      return result.success
1227
      return result.success
1221
    if result.ucx is not None:
1228
    if result.ucx is not None:
1222
      raise result.ucx
1229
      raise result.ucx
1223
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updateAddress failed: unknown result");
1230
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updateAddress failed: unknown result");
1224
 
1231
 
-
 
1232
  def updateCounter(self, counter):
-
 
1233
    """
-
 
1234
    Parameters:
-
 
1235
     - counter
-
 
1236
    """
-
 
1237
    self.send_updateCounter(counter)
-
 
1238
    return self.recv_updateCounter()
-
 
1239
 
-
 
1240
  def send_updateCounter(self, counter):
-
 
1241
    self._oprot.writeMessageBegin('updateCounter', TMessageType.CALL, self._seqid)
-
 
1242
    args = updateCounter_args()
-
 
1243
    args.counter = counter
-
 
1244
    args.write(self._oprot)
-
 
1245
    self._oprot.writeMessageEnd()
-
 
1246
    self._oprot.trans.flush()
-
 
1247
 
-
 
1248
  def recv_updateCounter(self, ):
-
 
1249
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1250
    if mtype == TMessageType.EXCEPTION:
-
 
1251
      x = TApplicationException()
-
 
1252
      x.read(self._iprot)
-
 
1253
      self._iprot.readMessageEnd()
-
 
1254
      raise x
-
 
1255
    result = updateCounter_result()
-
 
1256
    result.read(self._iprot)
-
 
1257
    self._iprot.readMessageEnd()
-
 
1258
    if result.success is not None:
-
 
1259
      return result.success
-
 
1260
    if result.ucx is not None:
-
 
1261
      raise result.ucx
-
 
1262
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updateCounter failed: unknown result");
-
 
1263
 
1225
  def setUserAsLoggedIn(self, userId, timestamp):
1264
  def setUserAsLoggedIn(self, userId, timestamp):
1226
    """
1265
    """
1227
    Parameters:
1266
    Parameters:
1228
     - userId
1267
     - userId
1229
     - timestamp
1268
     - timestamp
Line 3991... Line 4030...
3991
    self._processMap["authenticateUser"] = Processor.process_authenticateUser
4030
    self._processMap["authenticateUser"] = Processor.process_authenticateUser
3992
    self._processMap["userExists"] = Processor.process_userExists
4031
    self._processMap["userExists"] = Processor.process_userExists
3993
    self._processMap["addAddressForUser"] = Processor.process_addAddressForUser
4032
    self._processMap["addAddressForUser"] = Processor.process_addAddressForUser
3994
    self._processMap["removeAddressForUser"] = Processor.process_removeAddressForUser
4033
    self._processMap["removeAddressForUser"] = Processor.process_removeAddressForUser
3995
    self._processMap["updateAddress"] = Processor.process_updateAddress
4034
    self._processMap["updateAddress"] = Processor.process_updateAddress
-
 
4035
    self._processMap["updateCounter"] = Processor.process_updateCounter
3996
    self._processMap["setUserAsLoggedIn"] = Processor.process_setUserAsLoggedIn
4036
    self._processMap["setUserAsLoggedIn"] = Processor.process_setUserAsLoggedIn
3997
    self._processMap["setUserAsLoggedOut"] = Processor.process_setUserAsLoggedOut
4037
    self._processMap["setUserAsLoggedOut"] = Processor.process_setUserAsLoggedOut
3998
    self._processMap["setDefaultAddress"] = Processor.process_setDefaultAddress
4038
    self._processMap["setDefaultAddress"] = Processor.process_setDefaultAddress
3999
    self._processMap["updatePassword"] = Processor.process_updatePassword
4039
    self._processMap["updatePassword"] = Processor.process_updatePassword
4000
    self._processMap["forgotPassword"] = Processor.process_forgotPassword
4040
    self._processMap["forgotPassword"] = Processor.process_forgotPassword
Line 4258... Line 4298...
4258
    oprot.writeMessageBegin("updateAddress", TMessageType.REPLY, seqid)
4298
    oprot.writeMessageBegin("updateAddress", TMessageType.REPLY, seqid)
4259
    result.write(oprot)
4299
    result.write(oprot)
4260
    oprot.writeMessageEnd()
4300
    oprot.writeMessageEnd()
4261
    oprot.trans.flush()
4301
    oprot.trans.flush()
4262
 
4302
 
-
 
4303
  def process_updateCounter(self, seqid, iprot, oprot):
-
 
4304
    args = updateCounter_args()
-
 
4305
    args.read(iprot)
-
 
4306
    iprot.readMessageEnd()
-
 
4307
    result = updateCounter_result()
-
 
4308
    try:
-
 
4309
      result.success = self._handler.updateCounter(args.counter)
-
 
4310
    except UserContextException, ucx:
-
 
4311
      result.ucx = ucx
-
 
4312
    oprot.writeMessageBegin("updateCounter", TMessageType.REPLY, seqid)
-
 
4313
    result.write(oprot)
-
 
4314
    oprot.writeMessageEnd()
-
 
4315
    oprot.trans.flush()
-
 
4316
 
4263
  def process_setUserAsLoggedIn(self, seqid, iprot, oprot):
4317
  def process_setUserAsLoggedIn(self, seqid, iprot, oprot):
4264
    args = setUserAsLoggedIn_args()
4318
    args = setUserAsLoggedIn_args()
4265
    args.read(iprot)
4319
    args.read(iprot)
4266
    iprot.readMessageEnd()
4320
    iprot.readMessageEnd()
4267
    result = setUserAsLoggedIn_result()
4321
    result = setUserAsLoggedIn_result()
Line 6940... Line 6994...
6940
    if self.success is not None:
6994
    if self.success is not None:
6941
      oprot.writeFieldBegin('success', TType.BOOL, 0)
6995
      oprot.writeFieldBegin('success', TType.BOOL, 0)
6942
      oprot.writeBool(self.success)
6996
      oprot.writeBool(self.success)
6943
      oprot.writeFieldEnd()
6997
      oprot.writeFieldEnd()
6944
    if self.ucx is not None:
6998
    if self.ucx is not None:
-
 
6999
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
-
 
7000
      self.ucx.write(oprot)
-
 
7001
      oprot.writeFieldEnd()
-
 
7002
    oprot.writeFieldStop()
-
 
7003
    oprot.writeStructEnd()
-
 
7004
 
-
 
7005
  def validate(self):
-
 
7006
    return
-
 
7007
 
-
 
7008
 
-
 
7009
  def __repr__(self):
-
 
7010
    L = ['%s=%r' % (key, value)
-
 
7011
      for key, value in self.__dict__.iteritems()]
-
 
7012
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
7013
 
-
 
7014
  def __eq__(self, other):
-
 
7015
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
7016
 
-
 
7017
  def __ne__(self, other):
-
 
7018
    return not (self == other)
-
 
7019
 
-
 
7020
class updateCounter_args:
-
 
7021
  """
-
 
7022
  Attributes:
-
 
7023
   - counter
-
 
7024
  """
-
 
7025
 
-
 
7026
  thrift_spec = (
-
 
7027
    None, # 0
-
 
7028
    (1, TType.STRUCT, 'counter', (Counter, Counter.thrift_spec), None, ), # 1
-
 
7029
  )
-
 
7030
 
-
 
7031
  def __init__(self, counter=None,):
-
 
7032
    self.counter = counter
-
 
7033
 
-
 
7034
  def read(self, iprot):
-
 
7035
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
7036
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
7037
      return
-
 
7038
    iprot.readStructBegin()
-
 
7039
    while True:
-
 
7040
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
7041
      if ftype == TType.STOP:
-
 
7042
        break
-
 
7043
      if fid == 1:
-
 
7044
        if ftype == TType.STRUCT:
-
 
7045
          self.counter = Counter()
-
 
7046
          self.counter.read(iprot)
-
 
7047
        else:
-
 
7048
          iprot.skip(ftype)
-
 
7049
      else:
-
 
7050
        iprot.skip(ftype)
-
 
7051
      iprot.readFieldEnd()
-
 
7052
    iprot.readStructEnd()
-
 
7053
 
-
 
7054
  def write(self, oprot):
-
 
7055
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
7056
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
7057
      return
-
 
7058
    oprot.writeStructBegin('updateCounter_args')
-
 
7059
    if self.counter is not None:
-
 
7060
      oprot.writeFieldBegin('counter', TType.STRUCT, 1)
-
 
7061
      self.counter.write(oprot)
-
 
7062
      oprot.writeFieldEnd()
-
 
7063
    oprot.writeFieldStop()
-
 
7064
    oprot.writeStructEnd()
-
 
7065
 
-
 
7066
  def validate(self):
-
 
7067
    return
-
 
7068
 
-
 
7069
 
-
 
7070
  def __repr__(self):
-
 
7071
    L = ['%s=%r' % (key, value)
-
 
7072
      for key, value in self.__dict__.iteritems()]
-
 
7073
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
7074
 
-
 
7075
  def __eq__(self, other):
-
 
7076
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
7077
 
-
 
7078
  def __ne__(self, other):
-
 
7079
    return not (self == other)
-
 
7080
 
-
 
7081
class updateCounter_result:
-
 
7082
  """
-
 
7083
  Attributes:
-
 
7084
   - success
-
 
7085
   - ucx
-
 
7086
  """
-
 
7087
 
-
 
7088
  thrift_spec = (
-
 
7089
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
7090
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
-
 
7091
  )
-
 
7092
 
-
 
7093
  def __init__(self, success=None, ucx=None,):
-
 
7094
    self.success = success
-
 
7095
    self.ucx = ucx
-
 
7096
 
-
 
7097
  def read(self, iprot):
-
 
7098
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
7099
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
7100
      return
-
 
7101
    iprot.readStructBegin()
-
 
7102
    while True:
-
 
7103
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
7104
      if ftype == TType.STOP:
-
 
7105
        break
-
 
7106
      if fid == 0:
-
 
7107
        if ftype == TType.BOOL:
-
 
7108
          self.success = iprot.readBool();
-
 
7109
        else:
-
 
7110
          iprot.skip(ftype)
-
 
7111
      elif fid == 1:
-
 
7112
        if ftype == TType.STRUCT:
-
 
7113
          self.ucx = UserContextException()
-
 
7114
          self.ucx.read(iprot)
-
 
7115
        else:
-
 
7116
          iprot.skip(ftype)
-
 
7117
      else:
-
 
7118
        iprot.skip(ftype)
-
 
7119
      iprot.readFieldEnd()
-
 
7120
    iprot.readStructEnd()
-
 
7121
 
-
 
7122
  def write(self, oprot):
-
 
7123
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
7124
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
7125
      return
-
 
7126
    oprot.writeStructBegin('updateCounter_result')
-
 
7127
    if self.success is not None:
-
 
7128
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
7129
      oprot.writeBool(self.success)
-
 
7130
      oprot.writeFieldEnd()
-
 
7131
    if self.ucx is not None:
6945
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
7132
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
6946
      self.ucx.write(oprot)
7133
      self.ucx.write(oprot)
6947
      oprot.writeFieldEnd()
7134
      oprot.writeFieldEnd()
6948
    oprot.writeFieldStop()
7135
    oprot.writeFieldStop()
6949
    oprot.writeStructEnd()
7136
    oprot.writeStructEnd()