Subversion Repositories SmartDukaan

Rev

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

Rev 559 Rev 567
Line 74... Line 74...
74
    Parameters:
74
    Parameters:
75
     - email
75
     - email
76
    """
76
    """
77
    pass
77
    pass
78
 
78
 
79
  def addAddressForUser(self, userId, address, timestamp, setDefault):
79
  def addAddressForUser(self, userId, address, setDefault):
80
    """
80
    """
81
    Parameters:
81
    Parameters:
82
     - userId
82
     - userId
83
     - address
83
     - address
84
     - timestamp
-
 
85
     - setDefault
84
     - setDefault
86
    """
85
    """
87
    pass
86
    pass
88
 
87
 
89
  def removeAddressForUser(self, userid, addressId):
88
  def removeAddressForUser(self, userid, addressId):
Line 617... Line 616...
617
      return result.success
616
      return result.success
618
    if result.ucx != None:
617
    if result.ucx != None:
619
      raise result.ucx
618
      raise result.ucx
620
    raise TApplicationException(TApplicationException.MISSING_RESULT, "userExists failed: unknown result");
619
    raise TApplicationException(TApplicationException.MISSING_RESULT, "userExists failed: unknown result");
621
 
620
 
622
  def addAddressForUser(self, userId, address, timestamp, setDefault):
621
  def addAddressForUser(self, userId, address, setDefault):
623
    """
622
    """
624
    Parameters:
623
    Parameters:
625
     - userId
624
     - userId
626
     - address
625
     - address
627
     - timestamp
-
 
628
     - setDefault
626
     - setDefault
629
    """
627
    """
630
    self.send_addAddressForUser(userId, address, timestamp, setDefault)
628
    self.send_addAddressForUser(userId, address, setDefault)
631
    return self.recv_addAddressForUser()
629
    return self.recv_addAddressForUser()
632
 
630
 
633
  def send_addAddressForUser(self, userId, address, timestamp, setDefault):
631
  def send_addAddressForUser(self, userId, address, setDefault):
634
    self._oprot.writeMessageBegin('addAddressForUser', TMessageType.CALL, self._seqid)
632
    self._oprot.writeMessageBegin('addAddressForUser', TMessageType.CALL, self._seqid)
635
    args = addAddressForUser_args()
633
    args = addAddressForUser_args()
636
    args.userId = userId
634
    args.userId = userId
637
    args.address = address
635
    args.address = address
638
    args.timestamp = timestamp
-
 
639
    args.setDefault = setDefault
636
    args.setDefault = setDefault
640
    args.write(self._oprot)
637
    args.write(self._oprot)
641
    self._oprot.writeMessageEnd()
638
    self._oprot.writeMessageEnd()
642
    self._oprot.trans.flush()
639
    self._oprot.trans.flush()
643
 
640
 
Line 1918... Line 1915...
1918
    args = addAddressForUser_args()
1915
    args = addAddressForUser_args()
1919
    args.read(iprot)
1916
    args.read(iprot)
1920
    iprot.readMessageEnd()
1917
    iprot.readMessageEnd()
1921
    result = addAddressForUser_result()
1918
    result = addAddressForUser_result()
1922
    try:
1919
    try:
1923
      result.success = self._handler.addAddressForUser(args.userId, args.address, args.timestamp, args.setDefault)
1920
      result.success = self._handler.addAddressForUser(args.userId, args.address, args.setDefault)
1924
    except UserContextException, ucx:
1921
    except UserContextException, ucx:
1925
      result.ucx = ucx
1922
      result.ucx = ucx
1926
    oprot.writeMessageBegin("addAddressForUser", TMessageType.REPLY, seqid)
1923
    oprot.writeMessageBegin("addAddressForUser", TMessageType.REPLY, seqid)
1927
    result.write(oprot)
1924
    result.write(oprot)
1928
    oprot.writeMessageEnd()
1925
    oprot.writeMessageEnd()
Line 3393... Line 3390...
3393
class addAddressForUser_args:
3390
class addAddressForUser_args:
3394
  """
3391
  """
3395
  Attributes:
3392
  Attributes:
3396
   - userId
3393
   - userId
3397
   - address
3394
   - address
3398
   - timestamp
-
 
3399
   - setDefault
3395
   - setDefault
3400
  """
3396
  """
3401
 
3397
 
3402
  thrift_spec = (
3398
  thrift_spec = (
3403
    None, # 0
3399
    None, # 0
3404
    (1, TType.I64, 'userId', None, None, ), # 1
3400
    (1, TType.I64, 'userId', None, None, ), # 1
3405
    (2, TType.STRUCT, 'address', (Address, Address.thrift_spec), None, ), # 2
3401
    (2, TType.STRUCT, 'address', (Address, Address.thrift_spec), None, ), # 2
3406
    (3, TType.I64, 'timestamp', None, None, ), # 3
-
 
3407
    (4, TType.BOOL, 'setDefault', None, None, ), # 4
3402
    (3, TType.BOOL, 'setDefault', None, None, ), # 3
3408
  )
3403
  )
3409
 
3404
 
3410
  def __init__(self, userId=None, address=None, timestamp=None, setDefault=None,):
3405
  def __init__(self, userId=None, address=None, setDefault=None,):
3411
    self.userId = userId
3406
    self.userId = userId
3412
    self.address = address
3407
    self.address = address
3413
    self.timestamp = timestamp
-
 
3414
    self.setDefault = setDefault
3408
    self.setDefault = setDefault
3415
 
3409
 
3416
  def read(self, iprot):
3410
  def read(self, iprot):
3417
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3411
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3418
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3412
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
Line 3432... Line 3426...
3432
          self.address = Address()
3426
          self.address = Address()
3433
          self.address.read(iprot)
3427
          self.address.read(iprot)
3434
        else:
3428
        else:
3435
          iprot.skip(ftype)
3429
          iprot.skip(ftype)
3436
      elif fid == 3:
3430
      elif fid == 3:
3437
        if ftype == TType.I64:
-
 
3438
          self.timestamp = iprot.readI64();
-
 
3439
        else:
-
 
3440
          iprot.skip(ftype)
-
 
3441
      elif fid == 4:
-
 
3442
        if ftype == TType.BOOL:
3431
        if ftype == TType.BOOL:
3443
          self.setDefault = iprot.readBool();
3432
          self.setDefault = iprot.readBool();
3444
        else:
3433
        else:
3445
          iprot.skip(ftype)
3434
          iprot.skip(ftype)
3446
      else:
3435
      else:
Line 3459... Line 3448...
3459
      oprot.writeFieldEnd()
3448
      oprot.writeFieldEnd()
3460
    if self.address != None:
3449
    if self.address != None:
3461
      oprot.writeFieldBegin('address', TType.STRUCT, 2)
3450
      oprot.writeFieldBegin('address', TType.STRUCT, 2)
3462
      self.address.write(oprot)
3451
      self.address.write(oprot)
3463
      oprot.writeFieldEnd()
3452
      oprot.writeFieldEnd()
3464
    if self.timestamp != None:
-
 
3465
      oprot.writeFieldBegin('timestamp', TType.I64, 3)
-
 
3466
      oprot.writeI64(self.timestamp)
-
 
3467
      oprot.writeFieldEnd()
-
 
3468
    if self.setDefault != None:
3453
    if self.setDefault != None:
3469
      oprot.writeFieldBegin('setDefault', TType.BOOL, 4)
3454
      oprot.writeFieldBegin('setDefault', TType.BOOL, 3)
3470
      oprot.writeBool(self.setDefault)
3455
      oprot.writeBool(self.setDefault)
3471
      oprot.writeFieldEnd()
3456
      oprot.writeFieldEnd()
3472
    oprot.writeFieldStop()
3457
    oprot.writeFieldStop()
3473
    oprot.writeStructEnd()
3458
    oprot.writeStructEnd()
3474
 
3459
 
Line 3489... Line 3474...
3489
   - success
3474
   - success
3490
   - ucx
3475
   - ucx
3491
  """
3476
  """
3492
 
3477
 
3493
  thrift_spec = (
3478
  thrift_spec = (
3494
    (0, TType.BOOL, 'success', None, None, ), # 0
3479
    (0, TType.I64, 'success', None, None, ), # 0
3495
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
3480
    (1, TType.STRUCT, 'ucx', (UserContextException, UserContextException.thrift_spec), None, ), # 1
3496
  )
3481
  )
3497
 
3482
 
3498
  def __init__(self, success=None, ucx=None,):
3483
  def __init__(self, success=None, ucx=None,):
3499
    self.success = success
3484
    self.success = success
Line 3507... Line 3492...
3507
    while True:
3492
    while True:
3508
      (fname, ftype, fid) = iprot.readFieldBegin()
3493
      (fname, ftype, fid) = iprot.readFieldBegin()
3509
      if ftype == TType.STOP:
3494
      if ftype == TType.STOP:
3510
        break
3495
        break
3511
      if fid == 0:
3496
      if fid == 0:
3512
        if ftype == TType.BOOL:
3497
        if ftype == TType.I64:
3513
          self.success = iprot.readBool();
3498
          self.success = iprot.readI64();
3514
        else:
3499
        else:
3515
          iprot.skip(ftype)
3500
          iprot.skip(ftype)
3516
      elif fid == 1:
3501
      elif fid == 1:
3517
        if ftype == TType.STRUCT:
3502
        if ftype == TType.STRUCT:
3518
          self.ucx = UserContextException()
3503
          self.ucx = UserContextException()
Line 3528... Line 3513...
3528
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3513
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3529
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3514
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3530
      return
3515
      return
3531
    oprot.writeStructBegin('addAddressForUser_result')
3516
    oprot.writeStructBegin('addAddressForUser_result')
3532
    if self.success != None:
3517
    if self.success != None:
3533
      oprot.writeFieldBegin('success', TType.BOOL, 0)
3518
      oprot.writeFieldBegin('success', TType.I64, 0)
3534
      oprot.writeBool(self.success)
3519
      oprot.writeI64(self.success)
3535
      oprot.writeFieldEnd()
3520
      oprot.writeFieldEnd()
3536
    if self.ucx != None:
3521
    if self.ucx != None:
3537
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
3522
      oprot.writeFieldBegin('ucx', TType.STRUCT, 1)
3538
      self.ucx.write(oprot)
3523
      self.ucx.write(oprot)
3539
      oprot.writeFieldEnd()
3524
      oprot.writeFieldEnd()
Line 4699... Line 4684...
4699
      if ftype == TType.STOP:
4684
      if ftype == TType.STOP:
4700
        break
4685
        break
4701
      if fid == 0:
4686
      if fid == 0:
4702
        if ftype == TType.LIST:
4687
        if ftype == TType.LIST:
4703
          self.success = []
4688
          self.success = []
4704
          (_etype47, _size44) = iprot.readListBegin()
4689
          (_etype40, _size37) = iprot.readListBegin()
4705
          for _i48 in xrange(_size44):
4690
          for _i41 in xrange(_size37):
4706
            _elem49 = Cart()
4691
            _elem42 = Cart()
4707
            _elem49.read(iprot)
4692
            _elem42.read(iprot)
4708
            self.success.append(_elem49)
4693
            self.success.append(_elem42)
4709
          iprot.readListEnd()
4694
          iprot.readListEnd()
4710
        else:
4695
        else:
4711
          iprot.skip(ftype)
4696
          iprot.skip(ftype)
4712
      elif fid == 1:
4697
      elif fid == 1:
4713
        if ftype == TType.STRUCT:
4698
        if ftype == TType.STRUCT:
Line 4726... Line 4711...
4726
      return
4711
      return
4727
    oprot.writeStructBegin('getCartsForUser_result')
4712
    oprot.writeStructBegin('getCartsForUser_result')
4728
    if self.success != None:
4713
    if self.success != None:
4729
      oprot.writeFieldBegin('success', TType.LIST, 0)
4714
      oprot.writeFieldBegin('success', TType.LIST, 0)
4730
      oprot.writeListBegin(TType.STRUCT, len(self.success))
4715
      oprot.writeListBegin(TType.STRUCT, len(self.success))
4731
      for iter50 in self.success:
4716
      for iter43 in self.success:
4732
        iter50.write(oprot)
4717
        iter43.write(oprot)
4733
      oprot.writeListEnd()
4718
      oprot.writeListEnd()
4734
      oprot.writeFieldEnd()
4719
      oprot.writeFieldEnd()
4735
    if self.scx != None:
4720
    if self.scx != None:
4736
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
4721
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
4737
      self.scx.write(oprot)
4722
      self.scx.write(oprot)
Line 4832... Line 4817...
4832
      if ftype == TType.STOP:
4817
      if ftype == TType.STOP:
4833
        break
4818
        break
4834
      if fid == 0:
4819
      if fid == 0:
4835
        if ftype == TType.LIST:
4820
        if ftype == TType.LIST:
4836
          self.success = []
4821
          self.success = []
4837
          (_etype54, _size51) = iprot.readListBegin()
4822
          (_etype47, _size44) = iprot.readListBegin()
4838
          for _i55 in xrange(_size51):
4823
          for _i48 in xrange(_size44):
4839
            _elem56 = Cart()
4824
            _elem49 = Cart()
4840
            _elem56.read(iprot)
4825
            _elem49.read(iprot)
4841
            self.success.append(_elem56)
4826
            self.success.append(_elem49)
4842
          iprot.readListEnd()
4827
          iprot.readListEnd()
4843
        else:
4828
        else:
4844
          iprot.skip(ftype)
4829
          iprot.skip(ftype)
4845
      elif fid == 1:
4830
      elif fid == 1:
4846
        if ftype == TType.STRUCT:
4831
        if ftype == TType.STRUCT:
Line 4859... Line 4844...
4859
      return
4844
      return
4860
    oprot.writeStructBegin('getCartsByStatus_result')
4845
    oprot.writeStructBegin('getCartsByStatus_result')
4861
    if self.success != None:
4846
    if self.success != None:
4862
      oprot.writeFieldBegin('success', TType.LIST, 0)
4847
      oprot.writeFieldBegin('success', TType.LIST, 0)
4863
      oprot.writeListBegin(TType.STRUCT, len(self.success))
4848
      oprot.writeListBegin(TType.STRUCT, len(self.success))
4864
      for iter57 in self.success:
4849
      for iter50 in self.success:
4865
        iter57.write(oprot)
4850
        iter50.write(oprot)
4866
      oprot.writeListEnd()
4851
      oprot.writeListEnd()
4867
      oprot.writeFieldEnd()
4852
      oprot.writeFieldEnd()
4868
    if self.scx != None:
4853
    if self.scx != None:
4869
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
4854
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
4870
      self.scx.write(oprot)
4855
      self.scx.write(oprot)
Line 4989... Line 4974...
4989
      if ftype == TType.STOP:
4974
      if ftype == TType.STOP:
4990
        break
4975
        break
4991
      if fid == 0:
4976
      if fid == 0:
4992
        if ftype == TType.LIST:
4977
        if ftype == TType.LIST:
4993
          self.success = []
4978
          self.success = []
4994
          (_etype61, _size58) = iprot.readListBegin()
4979
          (_etype54, _size51) = iprot.readListBegin()
4995
          for _i62 in xrange(_size58):
4980
          for _i55 in xrange(_size51):
4996
            _elem63 = Cart()
4981
            _elem56 = Cart()
4997
            _elem63.read(iprot)
4982
            _elem56.read(iprot)
4998
            self.success.append(_elem63)
4983
            self.success.append(_elem56)
4999
          iprot.readListEnd()
4984
          iprot.readListEnd()
5000
        else:
4985
        else:
5001
          iprot.skip(ftype)
4986
          iprot.skip(ftype)
5002
      elif fid == 1:
4987
      elif fid == 1:
5003
        if ftype == TType.STRUCT:
4988
        if ftype == TType.STRUCT:
Line 5016... Line 5001...
5016
      return
5001
      return
5017
    oprot.writeStructBegin('getCartsByTime_result')
5002
    oprot.writeStructBegin('getCartsByTime_result')
5018
    if self.success != None:
5003
    if self.success != None:
5019
      oprot.writeFieldBegin('success', TType.LIST, 0)
5004
      oprot.writeFieldBegin('success', TType.LIST, 0)
5020
      oprot.writeListBegin(TType.STRUCT, len(self.success))
5005
      oprot.writeListBegin(TType.STRUCT, len(self.success))
5021
      for iter64 in self.success:
5006
      for iter57 in self.success:
5022
        iter64.write(oprot)
5007
        iter57.write(oprot)
5023
      oprot.writeListEnd()
5008
      oprot.writeListEnd()
5024
      oprot.writeFieldEnd()
5009
      oprot.writeFieldEnd()
5025
    if self.scx != None:
5010
    if self.scx != None:
5026
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
5011
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
5027
      self.scx.write(oprot)
5012
      self.scx.write(oprot)
Line 6294... Line 6279...
6294
        else:
6279
        else:
6295
          iprot.skip(ftype)
6280
          iprot.skip(ftype)
6296
      elif fid == 2:
6281
      elif fid == 2:
6297
        if ftype == TType.LIST:
6282
        if ftype == TType.LIST:
6298
          self.items = []
6283
          self.items = []
6299
          (_etype68, _size65) = iprot.readListBegin()
6284
          (_etype61, _size58) = iprot.readListBegin()
6300
          for _i69 in xrange(_size65):
6285
          for _i62 in xrange(_size58):
6301
            _elem70 = iprot.readI64();
6286
            _elem63 = iprot.readI64();
6302
            self.items.append(_elem70)
6287
            self.items.append(_elem63)
6303
          iprot.readListEnd()
6288
          iprot.readListEnd()
6304
        else:
6289
        else:
6305
          iprot.skip(ftype)
6290
          iprot.skip(ftype)
6306
      else:
6291
      else:
6307
        iprot.skip(ftype)
6292
        iprot.skip(ftype)
Line 6318... Line 6303...
6318
      oprot.writeI64(self.widget_id)
6303
      oprot.writeI64(self.widget_id)
6319
      oprot.writeFieldEnd()
6304
      oprot.writeFieldEnd()
6320
    if self.items != None:
6305
    if self.items != None:
6321
      oprot.writeFieldBegin('items', TType.LIST, 2)
6306
      oprot.writeFieldBegin('items', TType.LIST, 2)
6322
      oprot.writeListBegin(TType.I64, len(self.items))
6307
      oprot.writeListBegin(TType.I64, len(self.items))
6323
      for iter71 in self.items:
6308
      for iter64 in self.items:
6324
        oprot.writeI64(iter71)
6309
        oprot.writeI64(iter64)
6325
      oprot.writeListEnd()
6310
      oprot.writeListEnd()
6326
      oprot.writeFieldEnd()
6311
      oprot.writeFieldEnd()
6327
    oprot.writeFieldStop()
6312
    oprot.writeFieldStop()
6328
    oprot.writeStructEnd()
6313
    oprot.writeStructEnd()
6329
 
6314