Subversion Repositories SmartDukaan

Rev

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

Rev 1395 Rev 1422
Line 32... Line 32...
32
     - source
32
     - source
33
     - emailType
33
     - emailType
34
    """
34
    """
35
    pass
35
    pass
36
 
36
 
-
 
37
  def getEmailsToBeSent(self, emailType):
-
 
38
    """
-
 
39
    Parameters:
-
 
40
     - emailType
-
 
41
    """
-
 
42
    pass
-
 
43
 
-
 
44
  def markEmailAsSent(self, emailId):
-
 
45
    """
-
 
46
    Parameters:
-
 
47
     - emailId
-
 
48
    """
-
 
49
    pass
-
 
50
 
37
  def sendMail(self, mail):
51
  def sendMail(self, mail):
38
    """
52
    """
39
    Parameters:
53
    Parameters:
40
     - mail
54
     - mail
41
    """
55
    """
Line 198... Line 212...
198
    self._iprot.readMessageEnd()
212
    self._iprot.readMessageEnd()
199
    if result.se != None:
213
    if result.se != None:
200
      raise result.se
214
      raise result.se
201
    return
215
    return
202
 
216
 
-
 
217
  def getEmailsToBeSent(self, emailType):
-
 
218
    """
-
 
219
    Parameters:
-
 
220
     - emailType
-
 
221
    """
-
 
222
    self.send_getEmailsToBeSent(emailType)
-
 
223
    return self.recv_getEmailsToBeSent()
-
 
224
 
-
 
225
  def send_getEmailsToBeSent(self, emailType):
-
 
226
    self._oprot.writeMessageBegin('getEmailsToBeSent', TMessageType.CALL, self._seqid)
-
 
227
    args = getEmailsToBeSent_args()
-
 
228
    args.emailType = emailType
-
 
229
    args.write(self._oprot)
-
 
230
    self._oprot.writeMessageEnd()
-
 
231
    self._oprot.trans.flush()
-
 
232
 
-
 
233
  def recv_getEmailsToBeSent(self, ):
-
 
234
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
235
    if mtype == TMessageType.EXCEPTION:
-
 
236
      x = TApplicationException()
-
 
237
      x.read(self._iprot)
-
 
238
      self._iprot.readMessageEnd()
-
 
239
      raise x
-
 
240
    result = getEmailsToBeSent_result()
-
 
241
    result.read(self._iprot)
-
 
242
    self._iprot.readMessageEnd()
-
 
243
    if result.success != None:
-
 
244
      return result.success
-
 
245
    if result.se != None:
-
 
246
      raise result.se
-
 
247
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getEmailsToBeSent failed: unknown result");
-
 
248
 
-
 
249
  def markEmailAsSent(self, emailId):
-
 
250
    """
-
 
251
    Parameters:
-
 
252
     - emailId
-
 
253
    """
-
 
254
    self.send_markEmailAsSent(emailId)
-
 
255
    self.recv_markEmailAsSent()
-
 
256
 
-
 
257
  def send_markEmailAsSent(self, emailId):
-
 
258
    self._oprot.writeMessageBegin('markEmailAsSent', TMessageType.CALL, self._seqid)
-
 
259
    args = markEmailAsSent_args()
-
 
260
    args.emailId = emailId
-
 
261
    args.write(self._oprot)
-
 
262
    self._oprot.writeMessageEnd()
-
 
263
    self._oprot.trans.flush()
-
 
264
 
-
 
265
  def recv_markEmailAsSent(self, ):
-
 
266
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
267
    if mtype == TMessageType.EXCEPTION:
-
 
268
      x = TApplicationException()
-
 
269
      x.read(self._iprot)
-
 
270
      self._iprot.readMessageEnd()
-
 
271
      raise x
-
 
272
    result = markEmailAsSent_result()
-
 
273
    result.read(self._iprot)
-
 
274
    self._iprot.readMessageEnd()
-
 
275
    if result.se != None:
-
 
276
      raise result.se
-
 
277
    return
-
 
278
 
203
  def sendMail(self, mail):
279
  def sendMail(self, mail):
204
    """
280
    """
205
    Parameters:
281
    Parameters:
206
     - mail
282
     - mail
207
    """
283
    """
Line 572... Line 648...
572
  def __init__(self, handler):
648
  def __init__(self, handler):
573
    self._handler = handler
649
    self._handler = handler
574
    self._processMap = {}
650
    self._processMap = {}
575
    self._processMap["closeSession"] = Processor.process_closeSession
651
    self._processMap["closeSession"] = Processor.process_closeSession
576
    self._processMap["saveUserEmailForSending"] = Processor.process_saveUserEmailForSending
652
    self._processMap["saveUserEmailForSending"] = Processor.process_saveUserEmailForSending
-
 
653
    self._processMap["getEmailsToBeSent"] = Processor.process_getEmailsToBeSent
-
 
654
    self._processMap["markEmailAsSent"] = Processor.process_markEmailAsSent
577
    self._processMap["sendMail"] = Processor.process_sendMail
655
    self._processMap["sendMail"] = Processor.process_sendMail
578
    self._processMap["sendText"] = Processor.process_sendText
656
    self._processMap["sendText"] = Processor.process_sendText
579
    self._processMap["addMessage"] = Processor.process_addMessage
657
    self._processMap["addMessage"] = Processor.process_addMessage
580
    self._processMap["updateMessage"] = Processor.process_updateMessage
658
    self._processMap["updateMessage"] = Processor.process_updateMessage
581
    self._processMap["getMessage"] = Processor.process_getMessage
659
    self._processMap["getMessage"] = Processor.process_getMessage
Line 624... Line 702...
624
    oprot.writeMessageBegin("saveUserEmailForSending", TMessageType.REPLY, seqid)
702
    oprot.writeMessageBegin("saveUserEmailForSending", TMessageType.REPLY, seqid)
625
    result.write(oprot)
703
    result.write(oprot)
626
    oprot.writeMessageEnd()
704
    oprot.writeMessageEnd()
627
    oprot.trans.flush()
705
    oprot.trans.flush()
628
 
706
 
-
 
707
  def process_getEmailsToBeSent(self, seqid, iprot, oprot):
-
 
708
    args = getEmailsToBeSent_args()
-
 
709
    args.read(iprot)
-
 
710
    iprot.readMessageEnd()
-
 
711
    result = getEmailsToBeSent_result()
-
 
712
    try:
-
 
713
      result.success = self._handler.getEmailsToBeSent(args.emailType)
-
 
714
    except HelperServiceException, se:
-
 
715
      result.se = se
-
 
716
    oprot.writeMessageBegin("getEmailsToBeSent", TMessageType.REPLY, seqid)
-
 
717
    result.write(oprot)
-
 
718
    oprot.writeMessageEnd()
-
 
719
    oprot.trans.flush()
-
 
720
 
-
 
721
  def process_markEmailAsSent(self, seqid, iprot, oprot):
-
 
722
    args = markEmailAsSent_args()
-
 
723
    args.read(iprot)
-
 
724
    iprot.readMessageEnd()
-
 
725
    result = markEmailAsSent_result()
-
 
726
    try:
-
 
727
      self._handler.markEmailAsSent(args.emailId)
-
 
728
    except HelperServiceException, se:
-
 
729
      result.se = se
-
 
730
    oprot.writeMessageBegin("markEmailAsSent", TMessageType.REPLY, seqid)
-
 
731
    result.write(oprot)
-
 
732
    oprot.writeMessageEnd()
-
 
733
    oprot.trans.flush()
-
 
734
 
629
  def process_sendMail(self, seqid, iprot, oprot):
735
  def process_sendMail(self, seqid, iprot, oprot):
630
    args = sendMail_args()
736
    args = sendMail_args()
631
    args.read(iprot)
737
    args.read(iprot)
632
    iprot.readMessageEnd()
738
    iprot.readMessageEnd()
633
    result = sendMail_result()
739
    result = sendMail_result()
Line 1030... Line 1136...
1030
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1136
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1031
 
1137
 
1032
  def __ne__(self, other):
1138
  def __ne__(self, other):
1033
    return not (self == other)
1139
    return not (self == other)
1034
 
1140
 
-
 
1141
class getEmailsToBeSent_args:
-
 
1142
  """
-
 
1143
  Attributes:
-
 
1144
   - emailType
-
 
1145
  """
-
 
1146
 
-
 
1147
  thrift_spec = (
-
 
1148
    None, # 0
-
 
1149
    (1, TType.STRING, 'emailType', None, None, ), # 1
-
 
1150
  )
-
 
1151
 
-
 
1152
  def __init__(self, emailType=None,):
-
 
1153
    self.emailType = emailType
-
 
1154
 
-
 
1155
  def read(self, iprot):
-
 
1156
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1157
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1158
      return
-
 
1159
    iprot.readStructBegin()
-
 
1160
    while True:
-
 
1161
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1162
      if ftype == TType.STOP:
-
 
1163
        break
-
 
1164
      if fid == 1:
-
 
1165
        if ftype == TType.STRING:
-
 
1166
          self.emailType = iprot.readString();
-
 
1167
        else:
-
 
1168
          iprot.skip(ftype)
-
 
1169
      else:
-
 
1170
        iprot.skip(ftype)
-
 
1171
      iprot.readFieldEnd()
-
 
1172
    iprot.readStructEnd()
-
 
1173
 
-
 
1174
  def write(self, oprot):
-
 
1175
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1176
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1177
      return
-
 
1178
    oprot.writeStructBegin('getEmailsToBeSent_args')
-
 
1179
    if self.emailType != None:
-
 
1180
      oprot.writeFieldBegin('emailType', TType.STRING, 1)
-
 
1181
      oprot.writeString(self.emailType)
-
 
1182
      oprot.writeFieldEnd()
-
 
1183
    oprot.writeFieldStop()
-
 
1184
    oprot.writeStructEnd()
-
 
1185
 
-
 
1186
  def __repr__(self):
-
 
1187
    L = ['%s=%r' % (key, value)
-
 
1188
      for key, value in self.__dict__.iteritems()]
-
 
1189
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1190
 
-
 
1191
  def __eq__(self, other):
-
 
1192
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1193
 
-
 
1194
  def __ne__(self, other):
-
 
1195
    return not (self == other)
-
 
1196
 
-
 
1197
class getEmailsToBeSent_result:
-
 
1198
  """
-
 
1199
  Attributes:
-
 
1200
   - success
-
 
1201
   - se
-
 
1202
  """
-
 
1203
 
-
 
1204
  thrift_spec = (
-
 
1205
    (0, TType.LIST, 'success', (TType.STRUCT,(UserEmail, UserEmail.thrift_spec)), None, ), # 0
-
 
1206
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
-
 
1207
  )
-
 
1208
 
-
 
1209
  def __init__(self, success=None, se=None,):
-
 
1210
    self.success = success
-
 
1211
    self.se = se
-
 
1212
 
-
 
1213
  def read(self, iprot):
-
 
1214
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1215
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1216
      return
-
 
1217
    iprot.readStructBegin()
-
 
1218
    while True:
-
 
1219
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1220
      if ftype == TType.STOP:
-
 
1221
        break
-
 
1222
      if fid == 0:
-
 
1223
        if ftype == TType.LIST:
-
 
1224
          self.success = []
-
 
1225
          (_etype17, _size14) = iprot.readListBegin()
-
 
1226
          for _i18 in xrange(_size14):
-
 
1227
            _elem19 = UserEmail()
-
 
1228
            _elem19.read(iprot)
-
 
1229
            self.success.append(_elem19)
-
 
1230
          iprot.readListEnd()
-
 
1231
        else:
-
 
1232
          iprot.skip(ftype)
-
 
1233
      elif fid == 1:
-
 
1234
        if ftype == TType.STRUCT:
-
 
1235
          self.se = HelperServiceException()
-
 
1236
          self.se.read(iprot)
-
 
1237
        else:
-
 
1238
          iprot.skip(ftype)
-
 
1239
      else:
-
 
1240
        iprot.skip(ftype)
-
 
1241
      iprot.readFieldEnd()
-
 
1242
    iprot.readStructEnd()
-
 
1243
 
-
 
1244
  def write(self, oprot):
-
 
1245
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1246
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1247
      return
-
 
1248
    oprot.writeStructBegin('getEmailsToBeSent_result')
-
 
1249
    if self.success != None:
-
 
1250
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
1251
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
1252
      for iter20 in self.success:
-
 
1253
        iter20.write(oprot)
-
 
1254
      oprot.writeListEnd()
-
 
1255
      oprot.writeFieldEnd()
-
 
1256
    if self.se != None:
-
 
1257
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
-
 
1258
      self.se.write(oprot)
-
 
1259
      oprot.writeFieldEnd()
-
 
1260
    oprot.writeFieldStop()
-
 
1261
    oprot.writeStructEnd()
-
 
1262
 
-
 
1263
  def __repr__(self):
-
 
1264
    L = ['%s=%r' % (key, value)
-
 
1265
      for key, value in self.__dict__.iteritems()]
-
 
1266
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1267
 
-
 
1268
  def __eq__(self, other):
-
 
1269
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1270
 
-
 
1271
  def __ne__(self, other):
-
 
1272
    return not (self == other)
-
 
1273
 
-
 
1274
class markEmailAsSent_args:
-
 
1275
  """
-
 
1276
  Attributes:
-
 
1277
   - emailId
-
 
1278
  """
-
 
1279
 
-
 
1280
  thrift_spec = (
-
 
1281
    None, # 0
-
 
1282
    (1, TType.I64, 'emailId', None, None, ), # 1
-
 
1283
  )
-
 
1284
 
-
 
1285
  def __init__(self, emailId=None,):
-
 
1286
    self.emailId = emailId
-
 
1287
 
-
 
1288
  def read(self, iprot):
-
 
1289
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1290
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1291
      return
-
 
1292
    iprot.readStructBegin()
-
 
1293
    while True:
-
 
1294
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1295
      if ftype == TType.STOP:
-
 
1296
        break
-
 
1297
      if fid == 1:
-
 
1298
        if ftype == TType.I64:
-
 
1299
          self.emailId = iprot.readI64();
-
 
1300
        else:
-
 
1301
          iprot.skip(ftype)
-
 
1302
      else:
-
 
1303
        iprot.skip(ftype)
-
 
1304
      iprot.readFieldEnd()
-
 
1305
    iprot.readStructEnd()
-
 
1306
 
-
 
1307
  def write(self, oprot):
-
 
1308
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1309
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1310
      return
-
 
1311
    oprot.writeStructBegin('markEmailAsSent_args')
-
 
1312
    if self.emailId != None:
-
 
1313
      oprot.writeFieldBegin('emailId', TType.I64, 1)
-
 
1314
      oprot.writeI64(self.emailId)
-
 
1315
      oprot.writeFieldEnd()
-
 
1316
    oprot.writeFieldStop()
-
 
1317
    oprot.writeStructEnd()
-
 
1318
 
-
 
1319
  def __repr__(self):
-
 
1320
    L = ['%s=%r' % (key, value)
-
 
1321
      for key, value in self.__dict__.iteritems()]
-
 
1322
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1323
 
-
 
1324
  def __eq__(self, other):
-
 
1325
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1326
 
-
 
1327
  def __ne__(self, other):
-
 
1328
    return not (self == other)
-
 
1329
 
-
 
1330
class markEmailAsSent_result:
-
 
1331
  """
-
 
1332
  Attributes:
-
 
1333
   - se
-
 
1334
  """
-
 
1335
 
-
 
1336
  thrift_spec = (
-
 
1337
    None, # 0
-
 
1338
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
-
 
1339
  )
-
 
1340
 
-
 
1341
  def __init__(self, se=None,):
-
 
1342
    self.se = se
-
 
1343
 
-
 
1344
  def read(self, iprot):
-
 
1345
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1346
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1347
      return
-
 
1348
    iprot.readStructBegin()
-
 
1349
    while True:
-
 
1350
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1351
      if ftype == TType.STOP:
-
 
1352
        break
-
 
1353
      if fid == 1:
-
 
1354
        if ftype == TType.STRUCT:
-
 
1355
          self.se = HelperServiceException()
-
 
1356
          self.se.read(iprot)
-
 
1357
        else:
-
 
1358
          iprot.skip(ftype)
-
 
1359
      else:
-
 
1360
        iprot.skip(ftype)
-
 
1361
      iprot.readFieldEnd()
-
 
1362
    iprot.readStructEnd()
-
 
1363
 
-
 
1364
  def write(self, oprot):
-
 
1365
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1366
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1367
      return
-
 
1368
    oprot.writeStructBegin('markEmailAsSent_result')
-
 
1369
    if self.se != None:
-
 
1370
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
-
 
1371
      self.se.write(oprot)
-
 
1372
      oprot.writeFieldEnd()
-
 
1373
    oprot.writeFieldStop()
-
 
1374
    oprot.writeStructEnd()
-
 
1375
 
-
 
1376
  def __repr__(self):
-
 
1377
    L = ['%s=%r' % (key, value)
-
 
1378
      for key, value in self.__dict__.iteritems()]
-
 
1379
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1380
 
-
 
1381
  def __eq__(self, other):
-
 
1382
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1383
 
-
 
1384
  def __ne__(self, other):
-
 
1385
    return not (self == other)
-
 
1386
 
1035
class sendMail_args:
1387
class sendMail_args:
1036
  """
1388
  """
1037
  Attributes:
1389
  Attributes:
1038
   - mail
1390
   - mail
1039
  """
1391
  """
Line 1656... Line 2008...
1656
        else:
2008
        else:
1657
          iprot.skip(ftype)
2009
          iprot.skip(ftype)
1658
      elif fid == 2:
2010
      elif fid == 2:
1659
        if ftype == TType.MAP:
2011
        if ftype == TType.MAP:
1660
          self.params = {}
2012
          self.params = {}
1661
          (_ktype15, _vtype16, _size14 ) = iprot.readMapBegin() 
2013
          (_ktype22, _vtype23, _size21 ) = iprot.readMapBegin() 
1662
          for _i18 in xrange(_size14):
2014
          for _i25 in xrange(_size21):
1663
            _key19 = iprot.readString();
2015
            _key26 = iprot.readString();
1664
            _val20 = iprot.readString();
2016
            _val27 = iprot.readString();
1665
            self.params[_key19] = _val20
2017
            self.params[_key26] = _val27
1666
          iprot.readMapEnd()
2018
          iprot.readMapEnd()
1667
        else:
2019
        else:
1668
          iprot.skip(ftype)
2020
          iprot.skip(ftype)
1669
      else:
2021
      else:
1670
        iprot.skip(ftype)
2022
        iprot.skip(ftype)
Line 1681... Line 2033...
1681
      oprot.writeI64(self.id)
2033
      oprot.writeI64(self.id)
1682
      oprot.writeFieldEnd()
2034
      oprot.writeFieldEnd()
1683
    if self.params != None:
2035
    if self.params != None:
1684
      oprot.writeFieldBegin('params', TType.MAP, 2)
2036
      oprot.writeFieldBegin('params', TType.MAP, 2)
1685
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.params))
2037
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.params))
1686
      for kiter21,viter22 in self.params.items():
2038
      for kiter28,viter29 in self.params.items():
1687
        oprot.writeString(kiter21)
2039
        oprot.writeString(kiter28)
1688
        oprot.writeString(viter22)
2040
        oprot.writeString(viter29)
1689
      oprot.writeMapEnd()
2041
      oprot.writeMapEnd()
1690
      oprot.writeFieldEnd()
2042
      oprot.writeFieldEnd()
1691
    oprot.writeFieldStop()
2043
    oprot.writeFieldStop()
1692
    oprot.writeStructEnd()
2044
    oprot.writeStructEnd()
1693
 
2045