Subversion Repositories SmartDukaan

Rev

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

Rev 575 Rev 581
Line 123... Line 123...
123
     - userid
123
     - userid
124
     - password
124
     - password
125
    """
125
    """
126
    pass
126
    pass
127
 
127
 
-
 
128
  def forgotPassword(self, email):
-
 
129
    """
-
 
130
    Parameters:
-
 
131
     - email
-
 
132
    """
-
 
133
    pass
-
 
134
 
128
  def createCart(self, userId):
135
  def createCart(self, userId):
129
    """
136
    """
130
    Parameters:
137
    Parameters:
131
     - userId
138
     - userId
132
    """
139
    """
Line 829... Line 836...
829
      return result.success
836
      return result.success
830
    if result.ucx != None:
837
    if result.ucx != None:
831
      raise result.ucx
838
      raise result.ucx
832
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updatePassword failed: unknown result");
839
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updatePassword failed: unknown result");
833
 
840
 
-
 
841
  def forgotPassword(self, email):
-
 
842
    """
-
 
843
    Parameters:
-
 
844
     - email
-
 
845
    """
-
 
846
    self.send_forgotPassword(email)
-
 
847
    return self.recv_forgotPassword()
-
 
848
 
-
 
849
  def send_forgotPassword(self, email):
-
 
850
    self._oprot.writeMessageBegin('forgotPassword', TMessageType.CALL, self._seqid)
-
 
851
    args = forgotPassword_args()
-
 
852
    args.email = email
-
 
853
    args.write(self._oprot)
-
 
854
    self._oprot.writeMessageEnd()
-
 
855
    self._oprot.trans.flush()
-
 
856
 
-
 
857
  def recv_forgotPassword(self, ):
-
 
858
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
859
    if mtype == TMessageType.EXCEPTION:
-
 
860
      x = TApplicationException()
-
 
861
      x.read(self._iprot)
-
 
862
      self._iprot.readMessageEnd()
-
 
863
      raise x
-
 
864
    result = forgotPassword_result()
-
 
865
    result.read(self._iprot)
-
 
866
    self._iprot.readMessageEnd()
-
 
867
    if result.success != None:
-
 
868
      return result.success
-
 
869
    if result.ucx != None:
-
 
870
      raise result.ucx
-
 
871
    raise TApplicationException(TApplicationException.MISSING_RESULT, "forgotPassword failed: unknown result");
-
 
872
 
834
  def createCart(self, userId):
873
  def createCart(self, userId):
835
    """
874
    """
836
    Parameters:
875
    Parameters:
837
     - userId
876
     - userId
838
    """
877
    """
Line 1796... Line 1835...
1796
    self._processMap["removeAddressForUser"] = Processor.process_removeAddressForUser
1835
    self._processMap["removeAddressForUser"] = Processor.process_removeAddressForUser
1797
    self._processMap["setUserAsLoggedIn"] = Processor.process_setUserAsLoggedIn
1836
    self._processMap["setUserAsLoggedIn"] = Processor.process_setUserAsLoggedIn
1798
    self._processMap["setUserAsLoggedOut"] = Processor.process_setUserAsLoggedOut
1837
    self._processMap["setUserAsLoggedOut"] = Processor.process_setUserAsLoggedOut
1799
    self._processMap["setDefaultAddress"] = Processor.process_setDefaultAddress
1838
    self._processMap["setDefaultAddress"] = Processor.process_setDefaultAddress
1800
    self._processMap["updatePassword"] = Processor.process_updatePassword
1839
    self._processMap["updatePassword"] = Processor.process_updatePassword
-
 
1840
    self._processMap["forgotPassword"] = Processor.process_forgotPassword
1801
    self._processMap["createCart"] = Processor.process_createCart
1841
    self._processMap["createCart"] = Processor.process_createCart
1802
    self._processMap["getCurrentCart"] = Processor.process_getCurrentCart
1842
    self._processMap["getCurrentCart"] = Processor.process_getCurrentCart
1803
    self._processMap["getCart"] = Processor.process_getCart
1843
    self._processMap["getCart"] = Processor.process_getCart
1804
    self._processMap["getCartsForUser"] = Processor.process_getCartsForUser
1844
    self._processMap["getCartsForUser"] = Processor.process_getCartsForUser
1805
    self._processMap["getCartsByStatus"] = Processor.process_getCartsByStatus
1845
    self._processMap["getCartsByStatus"] = Processor.process_getCartsByStatus
Line 2037... Line 2077...
2037
    oprot.writeMessageBegin("updatePassword", TMessageType.REPLY, seqid)
2077
    oprot.writeMessageBegin("updatePassword", TMessageType.REPLY, seqid)
2038
    result.write(oprot)
2078
    result.write(oprot)
2039
    oprot.writeMessageEnd()
2079
    oprot.writeMessageEnd()
2040
    oprot.trans.flush()
2080
    oprot.trans.flush()
2041
 
2081
 
-
 
2082
  def process_forgotPassword(self, seqid, iprot, oprot):
-
 
2083
    args = forgotPassword_args()
-
 
2084
    args.read(iprot)
-
 
2085
    iprot.readMessageEnd()
-
 
2086
    result = forgotPassword_result()
-
 
2087
    try:
-
 
2088
      result.success = self._handler.forgotPassword(args.email)
-
 
2089
    except UserContextException, ucx:
-
 
2090
      result.ucx = ucx
-
 
2091
    oprot.writeMessageBegin("forgotPassword", TMessageType.REPLY, seqid)
-
 
2092
    result.write(oprot)
-
 
2093
    oprot.writeMessageEnd()
-
 
2094
    oprot.trans.flush()
-
 
2095
 
2042
  def process_createCart(self, seqid, iprot, oprot):
2096
  def process_createCart(self, seqid, iprot, oprot):
2043
    args = createCart_args()
2097
    args = createCart_args()
2044
    args.read(iprot)
2098
    args.read(iprot)
2045
    iprot.readMessageEnd()
2099
    iprot.readMessageEnd()
2046
    result = createCart_result()
2100
    result = createCart_result()
Line 4261... Line 4315...
4261
    if self.success != None:
4315
    if self.success != None:
4262
      oprot.writeFieldBegin('success', TType.BOOL, 0)
4316
      oprot.writeFieldBegin('success', TType.BOOL, 0)
4263
      oprot.writeBool(self.success)
4317
      oprot.writeBool(self.success)
4264
      oprot.writeFieldEnd()
4318
      oprot.writeFieldEnd()
4265
    if self.ucx != None:
4319
    if self.ucx != None:
-
 
4320
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
-
 
4321
      self.ucx.write(oprot)
-
 
4322
      oprot.writeFieldEnd()
-
 
4323
    oprot.writeFieldStop()
-
 
4324
    oprot.writeStructEnd()
-
 
4325
 
-
 
4326
  def __repr__(self):
-
 
4327
    L = ['%s=%r' % (key, value)
-
 
4328
      for key, value in self.__dict__.iteritems()]
-
 
4329
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
4330
 
-
 
4331
  def __eq__(self, other):
-
 
4332
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
4333
 
-
 
4334
  def __ne__(self, other):
-
 
4335
    return not (self == other)
-
 
4336
 
-
 
4337
class forgotPassword_args:
-
 
4338
  """
-
 
4339
  Attributes:
-
 
4340
   - email
-
 
4341
  """
-
 
4342
 
-
 
4343
  thrift_spec = (
-
 
4344
    None, # 0
-
 
4345
    (1, TType.STRING, 'email', None, None, ), # 1
-
 
4346
  )
-
 
4347
 
-
 
4348
  def __init__(self, email=None,):
-
 
4349
    self.email = email
-
 
4350
 
-
 
4351
  def read(self, iprot):
-
 
4352
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
4353
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
4354
      return
-
 
4355
    iprot.readStructBegin()
-
 
4356
    while True:
-
 
4357
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
4358
      if ftype == TType.STOP:
-
 
4359
        break
-
 
4360
      if fid == 1:
-
 
4361
        if ftype == TType.STRING:
-
 
4362
          self.email = iprot.readString();
-
 
4363
        else:
-
 
4364
          iprot.skip(ftype)
-
 
4365
      else:
-
 
4366
        iprot.skip(ftype)
-
 
4367
      iprot.readFieldEnd()
-
 
4368
    iprot.readStructEnd()
-
 
4369
 
-
 
4370
  def write(self, oprot):
-
 
4371
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
4372
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
4373
      return
-
 
4374
    oprot.writeStructBegin('forgotPassword_args')
-
 
4375
    if self.email != None:
-
 
4376
      oprot.writeFieldBegin('email', TType.STRING, 1)
-
 
4377
      oprot.writeString(self.email)
-
 
4378
      oprot.writeFieldEnd()
-
 
4379
    oprot.writeFieldStop()
-
 
4380
    oprot.writeStructEnd()
-
 
4381
 
-
 
4382
  def __repr__(self):
-
 
4383
    L = ['%s=%r' % (key, value)
-
 
4384
      for key, value in self.__dict__.iteritems()]
-
 
4385
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
4386
 
-
 
4387
  def __eq__(self, other):
-
 
4388
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
4389
 
-
 
4390
  def __ne__(self, other):
-
 
4391
    return not (self == other)
-
 
4392
 
-
 
4393
class forgotPassword_result:
-
 
4394
  """
-
 
4395
  Attributes:
-
 
4396
   - success
-
 
4397
   - ucx
-
 
4398
  """
-
 
4399
 
-
 
4400
  thrift_spec = (
-
 
4401
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
4402
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
-
 
4403
  )
-
 
4404
 
-
 
4405
  def __init__(self, success=None, ucx=None,):
-
 
4406
    self.success = success
-
 
4407
    self.ucx = ucx
-
 
4408
 
-
 
4409
  def read(self, iprot):
-
 
4410
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
4411
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
4412
      return
-
 
4413
    iprot.readStructBegin()
-
 
4414
    while True:
-
 
4415
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
4416
      if ftype == TType.STOP:
-
 
4417
        break
-
 
4418
      if fid == 0:
-
 
4419
        if ftype == TType.BOOL:
-
 
4420
          self.success = iprot.readBool();
-
 
4421
        else:
-
 
4422
          iprot.skip(ftype)
-
 
4423
      elif fid == 1:
-
 
4424
        if ftype == TType.STRUCT:
-
 
4425
          self.ucx = UserContextException()
-
 
4426
          self.ucx.read(iprot)
-
 
4427
        else:
-
 
4428
          iprot.skip(ftype)
-
 
4429
      else:
-
 
4430
        iprot.skip(ftype)
-
 
4431
      iprot.readFieldEnd()
-
 
4432
    iprot.readStructEnd()
-
 
4433
 
-
 
4434
  def write(self, oprot):
-
 
4435
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
4436
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
4437
      return
-
 
4438
    oprot.writeStructBegin('forgotPassword_result')
-
 
4439
    if self.success != None:
-
 
4440
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
4441
      oprot.writeBool(self.success)
-
 
4442
      oprot.writeFieldEnd()
-
 
4443
    if self.ucx != None:
4266
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
4444
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
4267
      self.ucx.write(oprot)
4445
      self.ucx.write(oprot)
4268
      oprot.writeFieldEnd()
4446
      oprot.writeFieldEnd()
4269
    oprot.writeFieldStop()
4447
    oprot.writeFieldStop()
4270
    oprot.writeStructEnd()
4448
    oprot.writeStructEnd()