Subversion Repositories SmartDukaan

Rev

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

Rev 504 Rev 513
Line 98... Line 98...
98
     - timestamp
98
     - timestamp
99
     - userId
99
     - userId
100
    """
100
    """
101
    pass
101
    pass
102
 
102
 
103
  def addAddressForUser(self, address, userid, timestamp):
103
  def addAddressForUser(self, address, userid, timestamp, setDefault):
104
    """
104
    """
105
    Parameters:
105
    Parameters:
106
     - address
106
     - address
107
     - userid
107
     - userid
108
     - timestamp
108
     - timestamp
-
 
109
     - setDefault
109
    """
110
    """
110
    pass
111
    pass
111
 
112
 
112
  def removeAddressForUser(self, userid, addressId):
113
  def removeAddressForUser(self, userid, addressId):
113
    """
114
    """
Line 560... Line 561...
560
      return result.success
561
      return result.success
561
    if result.ucx != None:
562
    if result.ucx != None:
562
      raise result.ucx
563
      raise result.ucx
563
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addIpAdressForUser failed: unknown result");
564
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addIpAdressForUser failed: unknown result");
564
 
565
 
565
  def addAddressForUser(self, address, userid, timestamp):
566
  def addAddressForUser(self, address, userid, timestamp, setDefault):
566
    """
567
    """
567
    Parameters:
568
    Parameters:
568
     - address
569
     - address
569
     - userid
570
     - userid
570
     - timestamp
571
     - timestamp
-
 
572
     - setDefault
571
    """
573
    """
572
    self.send_addAddressForUser(address, userid, timestamp)
574
    self.send_addAddressForUser(address, userid, timestamp, setDefault)
573
    return self.recv_addAddressForUser()
575
    return self.recv_addAddressForUser()
574
 
576
 
575
  def send_addAddressForUser(self, address, userid, timestamp):
577
  def send_addAddressForUser(self, address, userid, timestamp, setDefault):
576
    self._oprot.writeMessageBegin('addAddressForUser', TMessageType.CALL, self._seqid)
578
    self._oprot.writeMessageBegin('addAddressForUser', TMessageType.CALL, self._seqid)
577
    args = addAddressForUser_args()
579
    args = addAddressForUser_args()
578
    args.address = address
580
    args.address = address
579
    args.userid = userid
581
    args.userid = userid
580
    args.timestamp = timestamp
582
    args.timestamp = timestamp
-
 
583
    args.setDefault = setDefault
581
    args.write(self._oprot)
584
    args.write(self._oprot)
582
    self._oprot.writeMessageEnd()
585
    self._oprot.writeMessageEnd()
583
    self._oprot.trans.flush()
586
    self._oprot.trans.flush()
584
 
587
 
585
  def recv_addAddressForUser(self, ):
588
  def recv_addAddressForUser(self, ):
Line 1221... Line 1224...
1221
    args = addAddressForUser_args()
1224
    args = addAddressForUser_args()
1222
    args.read(iprot)
1225
    args.read(iprot)
1223
    iprot.readMessageEnd()
1226
    iprot.readMessageEnd()
1224
    result = addAddressForUser_result()
1227
    result = addAddressForUser_result()
1225
    try:
1228
    try:
1226
      result.success = self._handler.addAddressForUser(args.address, args.userid, args.timestamp)
1229
      result.success = self._handler.addAddressForUser(args.address, args.userid, args.timestamp, args.setDefault)
1227
    except UserContextException, ucx:
1230
    except UserContextException, ucx:
1228
      result.ucx = ucx
1231
      result.ucx = ucx
1229
    oprot.writeMessageBegin("addAddressForUser", TMessageType.REPLY, seqid)
1232
    oprot.writeMessageBegin("addAddressForUser", TMessageType.REPLY, seqid)
1230
    result.write(oprot)
1233
    result.write(oprot)
1231
    oprot.writeMessageEnd()
1234
    oprot.writeMessageEnd()
Line 2800... Line 2803...
2800
  """
2803
  """
2801
  Attributes:
2804
  Attributes:
2802
   - address
2805
   - address
2803
   - userid
2806
   - userid
2804
   - timestamp
2807
   - timestamp
-
 
2808
   - setDefault
2805
  """
2809
  """
2806
 
2810
 
2807
  thrift_spec = (
2811
  thrift_spec = (
2808
    None, # 0
2812
    None, # 0
2809
    (1, TType.STRUCT, 'address', (Address, Address.thrift_spec), None, ), # 1
2813
    (1, TType.STRUCT, 'address', (Address, Address.thrift_spec), None, ), # 1
2810
    (2, TType.I64, 'userid', None, None, ), # 2
2814
    (2, TType.I64, 'userid', None, None, ), # 2
2811
    (3, TType.I64, 'timestamp', None, None, ), # 3
2815
    (3, TType.I64, 'timestamp', None, None, ), # 3
-
 
2816
    (4, TType.BOOL, 'setDefault', None, None, ), # 4
2812
  )
2817
  )
2813
 
2818
 
2814
  def __init__(self, address=None, userid=None, timestamp=None,):
2819
  def __init__(self, address=None, userid=None, timestamp=None, setDefault=None,):
2815
    self.address = address
2820
    self.address = address
2816
    self.userid = userid
2821
    self.userid = userid
2817
    self.timestamp = timestamp
2822
    self.timestamp = timestamp
-
 
2823
    self.setDefault = setDefault
2818
 
2824
 
2819
  def read(self, iprot):
2825
  def read(self, iprot):
2820
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2826
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2821
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2827
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2822
      return
2828
      return
Line 2839... Line 2845...
2839
      elif fid == 3:
2845
      elif fid == 3:
2840
        if ftype == TType.I64:
2846
        if ftype == TType.I64:
2841
          self.timestamp = iprot.readI64();
2847
          self.timestamp = iprot.readI64();
2842
        else:
2848
        else:
2843
          iprot.skip(ftype)
2849
          iprot.skip(ftype)
-
 
2850
      elif fid == 4:
-
 
2851
        if ftype == TType.BOOL:
-
 
2852
          self.setDefault = iprot.readBool();
-
 
2853
        else:
-
 
2854
          iprot.skip(ftype)
2844
      else:
2855
      else:
2845
        iprot.skip(ftype)
2856
        iprot.skip(ftype)
2846
      iprot.readFieldEnd()
2857
      iprot.readFieldEnd()
2847
    iprot.readStructEnd()
2858
    iprot.readStructEnd()
2848
 
2859
 
Line 2861... Line 2872...
2861
      oprot.writeFieldEnd()
2872
      oprot.writeFieldEnd()
2862
    if self.timestamp != None:
2873
    if self.timestamp != None:
2863
      oprot.writeFieldBegin('timestamp', TType.I64, 3)
2874
      oprot.writeFieldBegin('timestamp', TType.I64, 3)
2864
      oprot.writeI64(self.timestamp)
2875
      oprot.writeI64(self.timestamp)
2865
      oprot.writeFieldEnd()
2876
      oprot.writeFieldEnd()
-
 
2877
    if self.setDefault != None:
-
 
2878
      oprot.writeFieldBegin('setDefault', TType.BOOL, 4)
-
 
2879
      oprot.writeBool(self.setDefault)
-
 
2880
      oprot.writeFieldEnd()
2866
    oprot.writeFieldStop()
2881
    oprot.writeFieldStop()
2867
    oprot.writeStructEnd()
2882
    oprot.writeStructEnd()
2868
 
2883
 
2869
  def __repr__(self):
2884
  def __repr__(self):
2870
    L = ['%s=%r' % (key, value)
2885
    L = ['%s=%r' % (key, value)