Subversion Repositories SmartDukaan

Rev

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

Rev 21454 Rev 22358
Line 99... Line 99...
99
     - userid
99
     - userid
100
     - addressId
100
     - addressId
101
    """
101
    """
102
    pass
102
    pass
103
 
103
 
-
 
104
  def updateAddress(self, address):
-
 
105
    """
-
 
106
    Parameters:
-
 
107
     - address
-
 
108
    """
-
 
109
    pass
-
 
110
 
104
  def setUserAsLoggedIn(self, userId, timestamp):
111
  def setUserAsLoggedIn(self, userId, timestamp):
105
    """
112
    """
106
    Parameters:
113
    Parameters:
107
     - userId
114
     - userId
108
     - timestamp
115
     - timestamp
Line 1181... Line 1188...
1181
      return result.success
1188
      return result.success
1182
    if result.ucx is not None:
1189
    if result.ucx is not None:
1183
      raise result.ucx
1190
      raise result.ucx
1184
    raise TApplicationException(TApplicationException.MISSING_RESULT, "removeAddressForUser failed: unknown result");
1191
    raise TApplicationException(TApplicationException.MISSING_RESULT, "removeAddressForUser failed: unknown result");
1185
 
1192
 
-
 
1193
  def updateAddress(self, address):
-
 
1194
    """
-
 
1195
    Parameters:
-
 
1196
     - address
-
 
1197
    """
-
 
1198
    self.send_updateAddress(address)
-
 
1199
    return self.recv_updateAddress()
-
 
1200
 
-
 
1201
  def send_updateAddress(self, address):
-
 
1202
    self._oprot.writeMessageBegin('updateAddress', TMessageType.CALL, self._seqid)
-
 
1203
    args = updateAddress_args()
-
 
1204
    args.address = address
-
 
1205
    args.write(self._oprot)
-
 
1206
    self._oprot.writeMessageEnd()
-
 
1207
    self._oprot.trans.flush()
-
 
1208
 
-
 
1209
  def recv_updateAddress(self, ):
-
 
1210
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1211
    if mtype == TMessageType.EXCEPTION:
-
 
1212
      x = TApplicationException()
-
 
1213
      x.read(self._iprot)
-
 
1214
      self._iprot.readMessageEnd()
-
 
1215
      raise x
-
 
1216
    result = updateAddress_result()
-
 
1217
    result.read(self._iprot)
-
 
1218
    self._iprot.readMessageEnd()
-
 
1219
    if result.success is not None:
-
 
1220
      return result.success
-
 
1221
    if result.ucx is not None:
-
 
1222
      raise result.ucx
-
 
1223
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updateAddress failed: unknown result");
-
 
1224
 
1186
  def setUserAsLoggedIn(self, userId, timestamp):
1225
  def setUserAsLoggedIn(self, userId, timestamp):
1187
    """
1226
    """
1188
    Parameters:
1227
    Parameters:
1189
     - userId
1228
     - userId
1190
     - timestamp
1229
     - timestamp
Line 3951... Line 3990...
3951
    self._processMap["updateUser"] = Processor.process_updateUser
3990
    self._processMap["updateUser"] = Processor.process_updateUser
3952
    self._processMap["authenticateUser"] = Processor.process_authenticateUser
3991
    self._processMap["authenticateUser"] = Processor.process_authenticateUser
3953
    self._processMap["userExists"] = Processor.process_userExists
3992
    self._processMap["userExists"] = Processor.process_userExists
3954
    self._processMap["addAddressForUser"] = Processor.process_addAddressForUser
3993
    self._processMap["addAddressForUser"] = Processor.process_addAddressForUser
3955
    self._processMap["removeAddressForUser"] = Processor.process_removeAddressForUser
3994
    self._processMap["removeAddressForUser"] = Processor.process_removeAddressForUser
-
 
3995
    self._processMap["updateAddress"] = Processor.process_updateAddress
3956
    self._processMap["setUserAsLoggedIn"] = Processor.process_setUserAsLoggedIn
3996
    self._processMap["setUserAsLoggedIn"] = Processor.process_setUserAsLoggedIn
3957
    self._processMap["setUserAsLoggedOut"] = Processor.process_setUserAsLoggedOut
3997
    self._processMap["setUserAsLoggedOut"] = Processor.process_setUserAsLoggedOut
3958
    self._processMap["setDefaultAddress"] = Processor.process_setDefaultAddress
3998
    self._processMap["setDefaultAddress"] = Processor.process_setDefaultAddress
3959
    self._processMap["updatePassword"] = Processor.process_updatePassword
3999
    self._processMap["updatePassword"] = Processor.process_updatePassword
3960
    self._processMap["forgotPassword"] = Processor.process_forgotPassword
4000
    self._processMap["forgotPassword"] = Processor.process_forgotPassword
Line 4204... Line 4244...
4204
    oprot.writeMessageBegin("removeAddressForUser", TMessageType.REPLY, seqid)
4244
    oprot.writeMessageBegin("removeAddressForUser", TMessageType.REPLY, seqid)
4205
    result.write(oprot)
4245
    result.write(oprot)
4206
    oprot.writeMessageEnd()
4246
    oprot.writeMessageEnd()
4207
    oprot.trans.flush()
4247
    oprot.trans.flush()
4208
 
4248
 
-
 
4249
  def process_updateAddress(self, seqid, iprot, oprot):
-
 
4250
    args = updateAddress_args()
-
 
4251
    args.read(iprot)
-
 
4252
    iprot.readMessageEnd()
-
 
4253
    result = updateAddress_result()
-
 
4254
    try:
-
 
4255
      result.success = self._handler.updateAddress(args.address)
-
 
4256
    except UserContextException, ucx:
-
 
4257
      result.ucx = ucx
-
 
4258
    oprot.writeMessageBegin("updateAddress", TMessageType.REPLY, seqid)
-
 
4259
    result.write(oprot)
-
 
4260
    oprot.writeMessageEnd()
-
 
4261
    oprot.trans.flush()
-
 
4262
 
4209
  def process_setUserAsLoggedIn(self, seqid, iprot, oprot):
4263
  def process_setUserAsLoggedIn(self, seqid, iprot, oprot):
4210
    args = setUserAsLoggedIn_args()
4264
    args = setUserAsLoggedIn_args()
4211
    args.read(iprot)
4265
    args.read(iprot)
4212
    iprot.readMessageEnd()
4266
    iprot.readMessageEnd()
4213
    result = setUserAsLoggedIn_result()
4267
    result = setUserAsLoggedIn_result()
Line 6753... Line 6807...
6753
    if self.success is not None:
6807
    if self.success is not None:
6754
      oprot.writeFieldBegin('success', TType.BOOL, 0)
6808
      oprot.writeFieldBegin('success', TType.BOOL, 0)
6755
      oprot.writeBool(self.success)
6809
      oprot.writeBool(self.success)
6756
      oprot.writeFieldEnd()
6810
      oprot.writeFieldEnd()
6757
    if self.ucx is not None:
6811
    if self.ucx is not None:
-
 
6812
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
-
 
6813
      self.ucx.write(oprot)
-
 
6814
      oprot.writeFieldEnd()
-
 
6815
    oprot.writeFieldStop()
-
 
6816
    oprot.writeStructEnd()
-
 
6817
 
-
 
6818
  def validate(self):
-
 
6819
    return
-
 
6820
 
-
 
6821
 
-
 
6822
  def __repr__(self):
-
 
6823
    L = ['%s=%r' % (key, value)
-
 
6824
      for key, value in self.__dict__.iteritems()]
-
 
6825
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
6826
 
-
 
6827
  def __eq__(self, other):
-
 
6828
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
6829
 
-
 
6830
  def __ne__(self, other):
-
 
6831
    return not (self == other)
-
 
6832
 
-
 
6833
class updateAddress_args:
-
 
6834
  """
-
 
6835
  Attributes:
-
 
6836
   - address
-
 
6837
  """
-
 
6838
 
-
 
6839
  thrift_spec = (
-
 
6840
    None, # 0
-
 
6841
    (1, TType.STRUCT, 'address', (Address, Address.thrift_spec), None, ), # 1
-
 
6842
  )
-
 
6843
 
-
 
6844
  def __init__(self, address=None,):
-
 
6845
    self.address = address
-
 
6846
 
-
 
6847
  def read(self, iprot):
-
 
6848
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
6849
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
6850
      return
-
 
6851
    iprot.readStructBegin()
-
 
6852
    while True:
-
 
6853
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
6854
      if ftype == TType.STOP:
-
 
6855
        break
-
 
6856
      if fid == 1:
-
 
6857
        if ftype == TType.STRUCT:
-
 
6858
          self.address = Address()
-
 
6859
          self.address.read(iprot)
-
 
6860
        else:
-
 
6861
          iprot.skip(ftype)
-
 
6862
      else:
-
 
6863
        iprot.skip(ftype)
-
 
6864
      iprot.readFieldEnd()
-
 
6865
    iprot.readStructEnd()
-
 
6866
 
-
 
6867
  def write(self, oprot):
-
 
6868
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
6869
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
6870
      return
-
 
6871
    oprot.writeStructBegin('updateAddress_args')
-
 
6872
    if self.address is not None:
-
 
6873
      oprot.writeFieldBegin('address', TType.STRUCT, 1)
-
 
6874
      self.address.write(oprot)
-
 
6875
      oprot.writeFieldEnd()
-
 
6876
    oprot.writeFieldStop()
-
 
6877
    oprot.writeStructEnd()
-
 
6878
 
-
 
6879
  def validate(self):
-
 
6880
    return
-
 
6881
 
-
 
6882
 
-
 
6883
  def __repr__(self):
-
 
6884
    L = ['%s=%r' % (key, value)
-
 
6885
      for key, value in self.__dict__.iteritems()]
-
 
6886
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
6887
 
-
 
6888
  def __eq__(self, other):
-
 
6889
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
6890
 
-
 
6891
  def __ne__(self, other):
-
 
6892
    return not (self == other)
-
 
6893
 
-
 
6894
class updateAddress_result:
-
 
6895
  """
-
 
6896
  Attributes:
-
 
6897
   - success
-
 
6898
   - ucx
-
 
6899
  """
-
 
6900
 
-
 
6901
  thrift_spec = (
-
 
6902
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
6903
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
-
 
6904
  )
-
 
6905
 
-
 
6906
  def __init__(self, success=None, ucx=None,):
-
 
6907
    self.success = success
-
 
6908
    self.ucx = ucx
-
 
6909
 
-
 
6910
  def read(self, iprot):
-
 
6911
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
6912
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
6913
      return
-
 
6914
    iprot.readStructBegin()
-
 
6915
    while True:
-
 
6916
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
6917
      if ftype == TType.STOP:
-
 
6918
        break
-
 
6919
      if fid == 0:
-
 
6920
        if ftype == TType.BOOL:
-
 
6921
          self.success = iprot.readBool();
-
 
6922
        else:
-
 
6923
          iprot.skip(ftype)
-
 
6924
      elif fid == 1:
-
 
6925
        if ftype == TType.STRUCT:
-
 
6926
          self.ucx = UserContextException()
-
 
6927
          self.ucx.read(iprot)
-
 
6928
        else:
-
 
6929
          iprot.skip(ftype)
-
 
6930
      else:
-
 
6931
        iprot.skip(ftype)
-
 
6932
      iprot.readFieldEnd()
-
 
6933
    iprot.readStructEnd()
-
 
6934
 
-
 
6935
  def write(self, oprot):
-
 
6936
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
6937
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
6938
      return
-
 
6939
    oprot.writeStructBegin('updateAddress_result')
-
 
6940
    if self.success is not None:
-
 
6941
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
6942
      oprot.writeBool(self.success)
-
 
6943
      oprot.writeFieldEnd()
-
 
6944
    if self.ucx is not None:
6758
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
6945
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
6759
      self.ucx.write(oprot)
6946
      self.ucx.write(oprot)
6760
      oprot.writeFieldEnd()
6947
      oprot.writeFieldEnd()
6761
    oprot.writeFieldStop()
6948
    oprot.writeFieldStop()
6762
    oprot.writeStructEnd()
6949
    oprot.writeStructEnd()