Subversion Repositories SmartDukaan

Rev

Rev 3376 | Rev 3431 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1976 varun.gupt 1
#
2
# Autogenerated by Thrift
3
#
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
#
6
 
7
from thrift.Thrift import *
3376 rajveer 8
import shop2020.thriftpy.generic.GenericService
1976 varun.gupt 9
from ttypes import *
10
from thrift.Thrift import TProcessor
11
from thrift.transport import TTransport
12
from thrift.protocol import TBinaryProtocol
13
try:
14
  from thrift.protocol import fastbinary
15
except:
16
  fastbinary = None
17
 
18
 
3376 rajveer 19
class Iface(shop2020.thriftpy.generic.GenericService.Iface):
1976 varun.gupt 20
  """
21
  Promotion Service
22
  """
23
  def closeSession(self, ):
24
    """
25
    For closing the open session in sqlalchemy
26
    """
27
    pass
28
 
29
  def createPromotion(self, name, ruleExecutionSrc, startOn, endOn):
30
    """
31
    Parameters:
32
     - name
33
     - ruleExecutionSrc
34
     - startOn
35
     - endOn
36
    """
37
    pass
38
 
39
  def getAllPromotions(self, ):
40
    pass
41
 
42
  def getPromotionById(self, promotionId):
43
    """
44
    Parameters:
45
     - promotionId
46
    """
47
    pass
48
 
49
  def generateCouponsForPromotion(self, promotionId, couponCode):
50
    """
51
    Parameters:
52
     - promotionId
53
     - couponCode
54
    """
55
    pass
56
 
57
  def applyCoupon(self, couponCode, cartId):
58
    """
59
    Parameters:
60
     - couponCode
61
     - cartId
62
    """
63
    pass
64
 
65
  def trackCouponUsage(self, couponCode, transactionId, userId):
66
    """
67
    Parameters:
68
     - couponCode
69
     - transactionId
70
     - userId
71
    """
72
    pass
73
 
74
  def getCouponUsageCountByUser(self, couponCode, userId):
75
    """
76
    Parameters:
77
     - couponCode
78
     - userId
79
    """
80
    pass
81
 
3385 varun.gupt 82
  def getActiveCoupons(self, ):
83
    """
84
    Returns a list of active coupons
85
    """
86
    pass
1976 varun.gupt 87
 
3385 varun.gupt 88
  def getSuccessfulPaymentCountForCoupon(self, couponCode):
89
    """
90
    Returns the count of successful payments done using a given coupon
91
 
92
    Parameters:
93
     - couponCode
94
    """
95
    pass
96
 
97
  def getRuleDocString(self, ruleName):
98
    """
99
    Returns the doc string of the rule module
100
 
101
    Parameters:
102
     - ruleName
103
    """
104
    pass
105
 
106
 
3376 rajveer 107
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1976 varun.gupt 108
  """
109
  Promotion Service
110
  """
111
  def __init__(self, iprot, oprot=None):
3376 rajveer 112
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1976 varun.gupt 113
 
114
  def closeSession(self, ):
115
    """
116
    For closing the open session in sqlalchemy
117
    """
118
    self.send_closeSession()
119
    self.recv_closeSession()
120
 
121
  def send_closeSession(self, ):
122
    self._oprot.writeMessageBegin('closeSession', TMessageType.CALL, self._seqid)
123
    args = closeSession_args()
124
    args.write(self._oprot)
125
    self._oprot.writeMessageEnd()
126
    self._oprot.trans.flush()
127
 
128
  def recv_closeSession(self, ):
129
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
130
    if mtype == TMessageType.EXCEPTION:
131
      x = TApplicationException()
132
      x.read(self._iprot)
133
      self._iprot.readMessageEnd()
134
      raise x
135
    result = closeSession_result()
136
    result.read(self._iprot)
137
    self._iprot.readMessageEnd()
138
    return
139
 
140
  def createPromotion(self, name, ruleExecutionSrc, startOn, endOn):
141
    """
142
    Parameters:
143
     - name
144
     - ruleExecutionSrc
145
     - startOn
146
     - endOn
147
    """
148
    self.send_createPromotion(name, ruleExecutionSrc, startOn, endOn)
149
    self.recv_createPromotion()
150
 
151
  def send_createPromotion(self, name, ruleExecutionSrc, startOn, endOn):
152
    self._oprot.writeMessageBegin('createPromotion', TMessageType.CALL, self._seqid)
153
    args = createPromotion_args()
154
    args.name = name
155
    args.ruleExecutionSrc = ruleExecutionSrc
156
    args.startOn = startOn
157
    args.endOn = endOn
158
    args.write(self._oprot)
159
    self._oprot.writeMessageEnd()
160
    self._oprot.trans.flush()
161
 
162
  def recv_createPromotion(self, ):
163
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
164
    if mtype == TMessageType.EXCEPTION:
165
      x = TApplicationException()
166
      x.read(self._iprot)
167
      self._iprot.readMessageEnd()
168
      raise x
169
    result = createPromotion_result()
170
    result.read(self._iprot)
171
    self._iprot.readMessageEnd()
172
    if result.pex != None:
173
      raise result.pex
174
    return
175
 
176
  def getAllPromotions(self, ):
177
    self.send_getAllPromotions()
178
    return self.recv_getAllPromotions()
179
 
180
  def send_getAllPromotions(self, ):
181
    self._oprot.writeMessageBegin('getAllPromotions', TMessageType.CALL, self._seqid)
182
    args = getAllPromotions_args()
183
    args.write(self._oprot)
184
    self._oprot.writeMessageEnd()
185
    self._oprot.trans.flush()
186
 
187
  def recv_getAllPromotions(self, ):
188
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
189
    if mtype == TMessageType.EXCEPTION:
190
      x = TApplicationException()
191
      x.read(self._iprot)
192
      self._iprot.readMessageEnd()
193
      raise x
194
    result = getAllPromotions_result()
195
    result.read(self._iprot)
196
    self._iprot.readMessageEnd()
197
    if result.success != None:
198
      return result.success
199
    if result.pex != None:
200
      raise result.pex
201
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
202
 
203
  def getPromotionById(self, promotionId):
204
    """
205
    Parameters:
206
     - promotionId
207
    """
208
    self.send_getPromotionById(promotionId)
209
    return self.recv_getPromotionById()
210
 
211
  def send_getPromotionById(self, promotionId):
212
    self._oprot.writeMessageBegin('getPromotionById', TMessageType.CALL, self._seqid)
213
    args = getPromotionById_args()
214
    args.promotionId = promotionId
215
    args.write(self._oprot)
216
    self._oprot.writeMessageEnd()
217
    self._oprot.trans.flush()
218
 
219
  def recv_getPromotionById(self, ):
220
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
221
    if mtype == TMessageType.EXCEPTION:
222
      x = TApplicationException()
223
      x.read(self._iprot)
224
      self._iprot.readMessageEnd()
225
      raise x
226
    result = getPromotionById_result()
227
    result.read(self._iprot)
228
    self._iprot.readMessageEnd()
229
    if result.success != None:
230
      return result.success
231
    if result.pex != None:
232
      raise result.pex
233
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
234
 
235
  def generateCouponsForPromotion(self, promotionId, couponCode):
236
    """
237
    Parameters:
238
     - promotionId
239
     - couponCode
240
    """
241
    self.send_generateCouponsForPromotion(promotionId, couponCode)
242
    self.recv_generateCouponsForPromotion()
243
 
244
  def send_generateCouponsForPromotion(self, promotionId, couponCode):
245
    self._oprot.writeMessageBegin('generateCouponsForPromotion', TMessageType.CALL, self._seqid)
246
    args = generateCouponsForPromotion_args()
247
    args.promotionId = promotionId
248
    args.couponCode = couponCode
249
    args.write(self._oprot)
250
    self._oprot.writeMessageEnd()
251
    self._oprot.trans.flush()
252
 
253
  def recv_generateCouponsForPromotion(self, ):
254
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
255
    if mtype == TMessageType.EXCEPTION:
256
      x = TApplicationException()
257
      x.read(self._iprot)
258
      self._iprot.readMessageEnd()
259
      raise x
260
    result = generateCouponsForPromotion_result()
261
    result.read(self._iprot)
262
    self._iprot.readMessageEnd()
263
    if result.pex != None:
264
      raise result.pex
265
    return
266
 
267
  def applyCoupon(self, couponCode, cartId):
268
    """
269
    Parameters:
270
     - couponCode
271
     - cartId
272
    """
273
    self.send_applyCoupon(couponCode, cartId)
274
    return self.recv_applyCoupon()
275
 
276
  def send_applyCoupon(self, couponCode, cartId):
277
    self._oprot.writeMessageBegin('applyCoupon', TMessageType.CALL, self._seqid)
278
    args = applyCoupon_args()
279
    args.couponCode = couponCode
280
    args.cartId = cartId
281
    args.write(self._oprot)
282
    self._oprot.writeMessageEnd()
283
    self._oprot.trans.flush()
284
 
285
  def recv_applyCoupon(self, ):
286
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
287
    if mtype == TMessageType.EXCEPTION:
288
      x = TApplicationException()
289
      x.read(self._iprot)
290
      self._iprot.readMessageEnd()
291
      raise x
292
    result = applyCoupon_result()
293
    result.read(self._iprot)
294
    self._iprot.readMessageEnd()
295
    if result.success != None:
296
      return result.success
297
    if result.pex != None:
298
      raise result.pex
299
    raise TApplicationException(TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
300
 
301
  def trackCouponUsage(self, couponCode, transactionId, userId):
302
    """
303
    Parameters:
304
     - couponCode
305
     - transactionId
306
     - userId
307
    """
308
    self.send_trackCouponUsage(couponCode, transactionId, userId)
309
    self.recv_trackCouponUsage()
310
 
311
  def send_trackCouponUsage(self, couponCode, transactionId, userId):
312
    self._oprot.writeMessageBegin('trackCouponUsage', TMessageType.CALL, self._seqid)
313
    args = trackCouponUsage_args()
314
    args.couponCode = couponCode
315
    args.transactionId = transactionId
316
    args.userId = userId
317
    args.write(self._oprot)
318
    self._oprot.writeMessageEnd()
319
    self._oprot.trans.flush()
320
 
321
  def recv_trackCouponUsage(self, ):
322
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
323
    if mtype == TMessageType.EXCEPTION:
324
      x = TApplicationException()
325
      x.read(self._iprot)
326
      self._iprot.readMessageEnd()
327
      raise x
328
    result = trackCouponUsage_result()
329
    result.read(self._iprot)
330
    self._iprot.readMessageEnd()
331
    if result.pex != None:
332
      raise result.pex
333
    return
334
 
335
  def getCouponUsageCountByUser(self, couponCode, userId):
336
    """
337
    Parameters:
338
     - couponCode
339
     - userId
340
    """
341
    self.send_getCouponUsageCountByUser(couponCode, userId)
342
    return self.recv_getCouponUsageCountByUser()
343
 
344
  def send_getCouponUsageCountByUser(self, couponCode, userId):
345
    self._oprot.writeMessageBegin('getCouponUsageCountByUser', TMessageType.CALL, self._seqid)
346
    args = getCouponUsageCountByUser_args()
347
    args.couponCode = couponCode
348
    args.userId = userId
349
    args.write(self._oprot)
350
    self._oprot.writeMessageEnd()
351
    self._oprot.trans.flush()
352
 
353
  def recv_getCouponUsageCountByUser(self, ):
354
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
355
    if mtype == TMessageType.EXCEPTION:
356
      x = TApplicationException()
357
      x.read(self._iprot)
358
      self._iprot.readMessageEnd()
359
      raise x
360
    result = getCouponUsageCountByUser_result()
361
    result.read(self._iprot)
362
    self._iprot.readMessageEnd()
363
    if result.success != None:
364
      return result.success
365
    if result.pex != None:
366
      raise result.pex
367
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
368
 
3385 varun.gupt 369
  def getActiveCoupons(self, ):
370
    """
371
    Returns a list of active coupons
372
    """
373
    self.send_getActiveCoupons()
374
    return self.recv_getActiveCoupons()
1976 varun.gupt 375
 
3385 varun.gupt 376
  def send_getActiveCoupons(self, ):
377
    self._oprot.writeMessageBegin('getActiveCoupons', TMessageType.CALL, self._seqid)
378
    args = getActiveCoupons_args()
379
    args.write(self._oprot)
380
    self._oprot.writeMessageEnd()
381
    self._oprot.trans.flush()
382
 
383
  def recv_getActiveCoupons(self, ):
384
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
385
    if mtype == TMessageType.EXCEPTION:
386
      x = TApplicationException()
387
      x.read(self._iprot)
388
      self._iprot.readMessageEnd()
389
      raise x
390
    result = getActiveCoupons_result()
391
    result.read(self._iprot)
392
    self._iprot.readMessageEnd()
393
    if result.success != None:
394
      return result.success
395
    if result.pex != None:
396
      raise result.pex
397
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
398
 
399
  def getSuccessfulPaymentCountForCoupon(self, couponCode):
400
    """
401
    Returns the count of successful payments done using a given coupon
402
 
403
    Parameters:
404
     - couponCode
405
    """
406
    self.send_getSuccessfulPaymentCountForCoupon(couponCode)
407
    return self.recv_getSuccessfulPaymentCountForCoupon()
408
 
409
  def send_getSuccessfulPaymentCountForCoupon(self, couponCode):
410
    self._oprot.writeMessageBegin('getSuccessfulPaymentCountForCoupon', TMessageType.CALL, self._seqid)
411
    args = getSuccessfulPaymentCountForCoupon_args()
412
    args.couponCode = couponCode
413
    args.write(self._oprot)
414
    self._oprot.writeMessageEnd()
415
    self._oprot.trans.flush()
416
 
417
  def recv_getSuccessfulPaymentCountForCoupon(self, ):
418
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
419
    if mtype == TMessageType.EXCEPTION:
420
      x = TApplicationException()
421
      x.read(self._iprot)
422
      self._iprot.readMessageEnd()
423
      raise x
424
    result = getSuccessfulPaymentCountForCoupon_result()
425
    result.read(self._iprot)
426
    self._iprot.readMessageEnd()
427
    if result.success != None:
428
      return result.success
429
    if result.pex != None:
430
      raise result.pex
431
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
432
 
433
  def getRuleDocString(self, ruleName):
434
    """
435
    Returns the doc string of the rule module
436
 
437
    Parameters:
438
     - ruleName
439
    """
440
    self.send_getRuleDocString(ruleName)
441
    return self.recv_getRuleDocString()
442
 
443
  def send_getRuleDocString(self, ruleName):
444
    self._oprot.writeMessageBegin('getRuleDocString', TMessageType.CALL, self._seqid)
445
    args = getRuleDocString_args()
446
    args.ruleName = ruleName
447
    args.write(self._oprot)
448
    self._oprot.writeMessageEnd()
449
    self._oprot.trans.flush()
450
 
451
  def recv_getRuleDocString(self, ):
452
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
453
    if mtype == TMessageType.EXCEPTION:
454
      x = TApplicationException()
455
      x.read(self._iprot)
456
      self._iprot.readMessageEnd()
457
      raise x
458
    result = getRuleDocString_result()
459
    result.read(self._iprot)
460
    self._iprot.readMessageEnd()
461
    if result.success != None:
462
      return result.success
463
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
464
 
465
 
3376 rajveer 466
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1976 varun.gupt 467
  def __init__(self, handler):
3376 rajveer 468
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1976 varun.gupt 469
    self._processMap["closeSession"] = Processor.process_closeSession
470
    self._processMap["createPromotion"] = Processor.process_createPromotion
471
    self._processMap["getAllPromotions"] = Processor.process_getAllPromotions
472
    self._processMap["getPromotionById"] = Processor.process_getPromotionById
473
    self._processMap["generateCouponsForPromotion"] = Processor.process_generateCouponsForPromotion
474
    self._processMap["applyCoupon"] = Processor.process_applyCoupon
475
    self._processMap["trackCouponUsage"] = Processor.process_trackCouponUsage
476
    self._processMap["getCouponUsageCountByUser"] = Processor.process_getCouponUsageCountByUser
3385 varun.gupt 477
    self._processMap["getActiveCoupons"] = Processor.process_getActiveCoupons
478
    self._processMap["getSuccessfulPaymentCountForCoupon"] = Processor.process_getSuccessfulPaymentCountForCoupon
479
    self._processMap["getRuleDocString"] = Processor.process_getRuleDocString
1976 varun.gupt 480
 
481
  def process(self, iprot, oprot):
482
    (name, type, seqid) = iprot.readMessageBegin()
483
    if name not in self._processMap:
484
      iprot.skip(TType.STRUCT)
485
      iprot.readMessageEnd()
486
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
487
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
488
      x.write(oprot)
489
      oprot.writeMessageEnd()
490
      oprot.trans.flush()
491
      return
492
    else:
493
      self._processMap[name](self, seqid, iprot, oprot)
494
    return True
495
 
496
  def process_closeSession(self, seqid, iprot, oprot):
497
    args = closeSession_args()
498
    args.read(iprot)
499
    iprot.readMessageEnd()
500
    result = closeSession_result()
501
    self._handler.closeSession()
502
    oprot.writeMessageBegin("closeSession", TMessageType.REPLY, seqid)
503
    result.write(oprot)
504
    oprot.writeMessageEnd()
505
    oprot.trans.flush()
506
 
507
  def process_createPromotion(self, seqid, iprot, oprot):
508
    args = createPromotion_args()
509
    args.read(iprot)
510
    iprot.readMessageEnd()
511
    result = createPromotion_result()
512
    try:
513
      self._handler.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn)
514
    except PromotionException, pex:
515
      result.pex = pex
516
    oprot.writeMessageBegin("createPromotion", TMessageType.REPLY, seqid)
517
    result.write(oprot)
518
    oprot.writeMessageEnd()
519
    oprot.trans.flush()
520
 
521
  def process_getAllPromotions(self, seqid, iprot, oprot):
522
    args = getAllPromotions_args()
523
    args.read(iprot)
524
    iprot.readMessageEnd()
525
    result = getAllPromotions_result()
526
    try:
527
      result.success = self._handler.getAllPromotions()
528
    except PromotionException, pex:
529
      result.pex = pex
530
    oprot.writeMessageBegin("getAllPromotions", TMessageType.REPLY, seqid)
531
    result.write(oprot)
532
    oprot.writeMessageEnd()
533
    oprot.trans.flush()
534
 
535
  def process_getPromotionById(self, seqid, iprot, oprot):
536
    args = getPromotionById_args()
537
    args.read(iprot)
538
    iprot.readMessageEnd()
539
    result = getPromotionById_result()
540
    try:
541
      result.success = self._handler.getPromotionById(args.promotionId)
542
    except PromotionException, pex:
543
      result.pex = pex
544
    oprot.writeMessageBegin("getPromotionById", TMessageType.REPLY, seqid)
545
    result.write(oprot)
546
    oprot.writeMessageEnd()
547
    oprot.trans.flush()
548
 
549
  def process_generateCouponsForPromotion(self, seqid, iprot, oprot):
550
    args = generateCouponsForPromotion_args()
551
    args.read(iprot)
552
    iprot.readMessageEnd()
553
    result = generateCouponsForPromotion_result()
554
    try:
555
      self._handler.generateCouponsForPromotion(args.promotionId, args.couponCode)
556
    except PromotionException, pex:
557
      result.pex = pex
558
    oprot.writeMessageBegin("generateCouponsForPromotion", TMessageType.REPLY, seqid)
559
    result.write(oprot)
560
    oprot.writeMessageEnd()
561
    oprot.trans.flush()
562
 
563
  def process_applyCoupon(self, seqid, iprot, oprot):
564
    args = applyCoupon_args()
565
    args.read(iprot)
566
    iprot.readMessageEnd()
567
    result = applyCoupon_result()
568
    try:
569
      result.success = self._handler.applyCoupon(args.couponCode, args.cartId)
570
    except PromotionException, pex:
571
      result.pex = pex
572
    oprot.writeMessageBegin("applyCoupon", TMessageType.REPLY, seqid)
573
    result.write(oprot)
574
    oprot.writeMessageEnd()
575
    oprot.trans.flush()
576
 
577
  def process_trackCouponUsage(self, seqid, iprot, oprot):
578
    args = trackCouponUsage_args()
579
    args.read(iprot)
580
    iprot.readMessageEnd()
581
    result = trackCouponUsage_result()
582
    try:
583
      self._handler.trackCouponUsage(args.couponCode, args.transactionId, args.userId)
584
    except PromotionException, pex:
585
      result.pex = pex
586
    oprot.writeMessageBegin("trackCouponUsage", TMessageType.REPLY, seqid)
587
    result.write(oprot)
588
    oprot.writeMessageEnd()
589
    oprot.trans.flush()
590
 
591
  def process_getCouponUsageCountByUser(self, seqid, iprot, oprot):
592
    args = getCouponUsageCountByUser_args()
593
    args.read(iprot)
594
    iprot.readMessageEnd()
595
    result = getCouponUsageCountByUser_result()
596
    try:
597
      result.success = self._handler.getCouponUsageCountByUser(args.couponCode, args.userId)
598
    except PromotionException, pex:
599
      result.pex = pex
600
    oprot.writeMessageBegin("getCouponUsageCountByUser", TMessageType.REPLY, seqid)
601
    result.write(oprot)
602
    oprot.writeMessageEnd()
603
    oprot.trans.flush()
604
 
3385 varun.gupt 605
  def process_getActiveCoupons(self, seqid, iprot, oprot):
606
    args = getActiveCoupons_args()
607
    args.read(iprot)
608
    iprot.readMessageEnd()
609
    result = getActiveCoupons_result()
610
    try:
611
      result.success = self._handler.getActiveCoupons()
612
    except PromotionException, pex:
613
      result.pex = pex
614
    oprot.writeMessageBegin("getActiveCoupons", TMessageType.REPLY, seqid)
615
    result.write(oprot)
616
    oprot.writeMessageEnd()
617
    oprot.trans.flush()
1976 varun.gupt 618
 
3385 varun.gupt 619
  def process_getSuccessfulPaymentCountForCoupon(self, seqid, iprot, oprot):
620
    args = getSuccessfulPaymentCountForCoupon_args()
621
    args.read(iprot)
622
    iprot.readMessageEnd()
623
    result = getSuccessfulPaymentCountForCoupon_result()
624
    try:
625
      result.success = self._handler.getSuccessfulPaymentCountForCoupon(args.couponCode)
626
    except PromotionException, pex:
627
      result.pex = pex
628
    oprot.writeMessageBegin("getSuccessfulPaymentCountForCoupon", TMessageType.REPLY, seqid)
629
    result.write(oprot)
630
    oprot.writeMessageEnd()
631
    oprot.trans.flush()
632
 
633
  def process_getRuleDocString(self, seqid, iprot, oprot):
634
    args = getRuleDocString_args()
635
    args.read(iprot)
636
    iprot.readMessageEnd()
637
    result = getRuleDocString_result()
638
    result.success = self._handler.getRuleDocString(args.ruleName)
639
    oprot.writeMessageBegin("getRuleDocString", TMessageType.REPLY, seqid)
640
    result.write(oprot)
641
    oprot.writeMessageEnd()
642
    oprot.trans.flush()
643
 
644
 
1976 varun.gupt 645
# HELPER FUNCTIONS AND STRUCTURES
646
 
647
class closeSession_args:
648
 
649
  thrift_spec = (
650
  )
651
 
652
  def read(self, iprot):
653
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
654
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
655
      return
656
    iprot.readStructBegin()
657
    while True:
658
      (fname, ftype, fid) = iprot.readFieldBegin()
659
      if ftype == TType.STOP:
660
        break
661
      else:
662
        iprot.skip(ftype)
663
      iprot.readFieldEnd()
664
    iprot.readStructEnd()
665
 
666
  def write(self, oprot):
667
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
668
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
669
      return
670
    oprot.writeStructBegin('closeSession_args')
671
    oprot.writeFieldStop()
672
    oprot.writeStructEnd()
673
 
674
  def __repr__(self):
675
    L = ['%s=%r' % (key, value)
676
      for key, value in self.__dict__.iteritems()]
677
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
678
 
679
  def __eq__(self, other):
680
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
681
 
682
  def __ne__(self, other):
683
    return not (self == other)
684
 
685
class closeSession_result:
686
 
687
  thrift_spec = (
688
  )
689
 
690
  def read(self, iprot):
691
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
692
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
693
      return
694
    iprot.readStructBegin()
695
    while True:
696
      (fname, ftype, fid) = iprot.readFieldBegin()
697
      if ftype == TType.STOP:
698
        break
699
      else:
700
        iprot.skip(ftype)
701
      iprot.readFieldEnd()
702
    iprot.readStructEnd()
703
 
704
  def write(self, oprot):
705
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
706
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
707
      return
708
    oprot.writeStructBegin('closeSession_result')
709
    oprot.writeFieldStop()
710
    oprot.writeStructEnd()
711
 
712
  def __repr__(self):
713
    L = ['%s=%r' % (key, value)
714
      for key, value in self.__dict__.iteritems()]
715
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
716
 
717
  def __eq__(self, other):
718
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
719
 
720
  def __ne__(self, other):
721
    return not (self == other)
722
 
723
class createPromotion_args:
724
  """
725
  Attributes:
726
   - name
727
   - ruleExecutionSrc
728
   - startOn
729
   - endOn
730
  """
731
 
732
  thrift_spec = (
733
    None, # 0
734
    (1, TType.STRING, 'name', None, None, ), # 1
735
    (2, TType.STRING, 'ruleExecutionSrc', None, None, ), # 2
736
    (3, TType.I64, 'startOn', None, None, ), # 3
737
    (4, TType.I64, 'endOn', None, None, ), # 4
738
  )
739
 
740
  def __init__(self, name=None, ruleExecutionSrc=None, startOn=None, endOn=None,):
741
    self.name = name
742
    self.ruleExecutionSrc = ruleExecutionSrc
743
    self.startOn = startOn
744
    self.endOn = endOn
745
 
746
  def read(self, iprot):
747
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
748
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
749
      return
750
    iprot.readStructBegin()
751
    while True:
752
      (fname, ftype, fid) = iprot.readFieldBegin()
753
      if ftype == TType.STOP:
754
        break
755
      if fid == 1:
756
        if ftype == TType.STRING:
757
          self.name = iprot.readString();
758
        else:
759
          iprot.skip(ftype)
760
      elif fid == 2:
761
        if ftype == TType.STRING:
762
          self.ruleExecutionSrc = iprot.readString();
763
        else:
764
          iprot.skip(ftype)
765
      elif fid == 3:
766
        if ftype == TType.I64:
767
          self.startOn = iprot.readI64();
768
        else:
769
          iprot.skip(ftype)
770
      elif fid == 4:
771
        if ftype == TType.I64:
772
          self.endOn = iprot.readI64();
773
        else:
774
          iprot.skip(ftype)
775
      else:
776
        iprot.skip(ftype)
777
      iprot.readFieldEnd()
778
    iprot.readStructEnd()
779
 
780
  def write(self, oprot):
781
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
782
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
783
      return
784
    oprot.writeStructBegin('createPromotion_args')
785
    if self.name != None:
786
      oprot.writeFieldBegin('name', TType.STRING, 1)
787
      oprot.writeString(self.name)
788
      oprot.writeFieldEnd()
789
    if self.ruleExecutionSrc != None:
790
      oprot.writeFieldBegin('ruleExecutionSrc', TType.STRING, 2)
791
      oprot.writeString(self.ruleExecutionSrc)
792
      oprot.writeFieldEnd()
793
    if self.startOn != None:
794
      oprot.writeFieldBegin('startOn', TType.I64, 3)
795
      oprot.writeI64(self.startOn)
796
      oprot.writeFieldEnd()
797
    if self.endOn != None:
798
      oprot.writeFieldBegin('endOn', TType.I64, 4)
799
      oprot.writeI64(self.endOn)
800
      oprot.writeFieldEnd()
801
    oprot.writeFieldStop()
802
    oprot.writeStructEnd()
803
 
804
  def __repr__(self):
805
    L = ['%s=%r' % (key, value)
806
      for key, value in self.__dict__.iteritems()]
807
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
808
 
809
  def __eq__(self, other):
810
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
811
 
812
  def __ne__(self, other):
813
    return not (self == other)
814
 
815
class createPromotion_result:
816
  """
817
  Attributes:
818
   - pex
819
  """
820
 
821
  thrift_spec = (
822
    None, # 0
823
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
824
  )
825
 
826
  def __init__(self, pex=None,):
827
    self.pex = pex
828
 
829
  def read(self, iprot):
830
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
831
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
832
      return
833
    iprot.readStructBegin()
834
    while True:
835
      (fname, ftype, fid) = iprot.readFieldBegin()
836
      if ftype == TType.STOP:
837
        break
838
      if fid == 1:
839
        if ftype == TType.STRUCT:
840
          self.pex = PromotionException()
841
          self.pex.read(iprot)
842
        else:
843
          iprot.skip(ftype)
844
      else:
845
        iprot.skip(ftype)
846
      iprot.readFieldEnd()
847
    iprot.readStructEnd()
848
 
849
  def write(self, oprot):
850
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
851
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
852
      return
853
    oprot.writeStructBegin('createPromotion_result')
854
    if self.pex != None:
855
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
856
      self.pex.write(oprot)
857
      oprot.writeFieldEnd()
858
    oprot.writeFieldStop()
859
    oprot.writeStructEnd()
860
 
861
  def __repr__(self):
862
    L = ['%s=%r' % (key, value)
863
      for key, value in self.__dict__.iteritems()]
864
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
865
 
866
  def __eq__(self, other):
867
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
868
 
869
  def __ne__(self, other):
870
    return not (self == other)
871
 
872
class getAllPromotions_args:
873
 
874
  thrift_spec = (
875
  )
876
 
877
  def read(self, iprot):
878
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
879
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
880
      return
881
    iprot.readStructBegin()
882
    while True:
883
      (fname, ftype, fid) = iprot.readFieldBegin()
884
      if ftype == TType.STOP:
885
        break
886
      else:
887
        iprot.skip(ftype)
888
      iprot.readFieldEnd()
889
    iprot.readStructEnd()
890
 
891
  def write(self, oprot):
892
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
893
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
894
      return
895
    oprot.writeStructBegin('getAllPromotions_args')
896
    oprot.writeFieldStop()
897
    oprot.writeStructEnd()
898
 
899
  def __repr__(self):
900
    L = ['%s=%r' % (key, value)
901
      for key, value in self.__dict__.iteritems()]
902
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
903
 
904
  def __eq__(self, other):
905
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
906
 
907
  def __ne__(self, other):
908
    return not (self == other)
909
 
910
class getAllPromotions_result:
911
  """
912
  Attributes:
913
   - success
914
   - pex
915
  """
916
 
917
  thrift_spec = (
918
    (0, TType.LIST, 'success', (TType.STRUCT,(Promotion, Promotion.thrift_spec)), None, ), # 0
919
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
920
  )
921
 
922
  def __init__(self, success=None, pex=None,):
923
    self.success = success
924
    self.pex = pex
925
 
926
  def read(self, iprot):
927
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
928
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
929
      return
930
    iprot.readStructBegin()
931
    while True:
932
      (fname, ftype, fid) = iprot.readFieldBegin()
933
      if ftype == TType.STOP:
934
        break
935
      if fid == 0:
936
        if ftype == TType.LIST:
937
          self.success = []
2981 rajveer 938
          (_etype24, _size21) = iprot.readListBegin()
939
          for _i25 in xrange(_size21):
940
            _elem26 = Promotion()
941
            _elem26.read(iprot)
942
            self.success.append(_elem26)
1976 varun.gupt 943
          iprot.readListEnd()
944
        else:
945
          iprot.skip(ftype)
946
      elif fid == 1:
947
        if ftype == TType.STRUCT:
948
          self.pex = PromotionException()
949
          self.pex.read(iprot)
950
        else:
951
          iprot.skip(ftype)
952
      else:
953
        iprot.skip(ftype)
954
      iprot.readFieldEnd()
955
    iprot.readStructEnd()
956
 
957
  def write(self, oprot):
958
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
959
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
960
      return
961
    oprot.writeStructBegin('getAllPromotions_result')
962
    if self.success != None:
963
      oprot.writeFieldBegin('success', TType.LIST, 0)
964
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2981 rajveer 965
      for iter27 in self.success:
966
        iter27.write(oprot)
1976 varun.gupt 967
      oprot.writeListEnd()
968
      oprot.writeFieldEnd()
969
    if self.pex != None:
970
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
971
      self.pex.write(oprot)
972
      oprot.writeFieldEnd()
973
    oprot.writeFieldStop()
974
    oprot.writeStructEnd()
975
 
976
  def __repr__(self):
977
    L = ['%s=%r' % (key, value)
978
      for key, value in self.__dict__.iteritems()]
979
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
980
 
981
  def __eq__(self, other):
982
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
983
 
984
  def __ne__(self, other):
985
    return not (self == other)
986
 
987
class getPromotionById_args:
988
  """
989
  Attributes:
990
   - promotionId
991
  """
992
 
993
  thrift_spec = (
994
    None, # 0
995
    (1, TType.I64, 'promotionId', None, None, ), # 1
996
  )
997
 
998
  def __init__(self, promotionId=None,):
999
    self.promotionId = promotionId
1000
 
1001
  def read(self, iprot):
1002
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1003
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1004
      return
1005
    iprot.readStructBegin()
1006
    while True:
1007
      (fname, ftype, fid) = iprot.readFieldBegin()
1008
      if ftype == TType.STOP:
1009
        break
1010
      if fid == 1:
1011
        if ftype == TType.I64:
1012
          self.promotionId = iprot.readI64();
1013
        else:
1014
          iprot.skip(ftype)
1015
      else:
1016
        iprot.skip(ftype)
1017
      iprot.readFieldEnd()
1018
    iprot.readStructEnd()
1019
 
1020
  def write(self, oprot):
1021
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1022
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1023
      return
1024
    oprot.writeStructBegin('getPromotionById_args')
1025
    if self.promotionId != None:
1026
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
1027
      oprot.writeI64(self.promotionId)
1028
      oprot.writeFieldEnd()
1029
    oprot.writeFieldStop()
1030
    oprot.writeStructEnd()
1031
 
1032
  def __repr__(self):
1033
    L = ['%s=%r' % (key, value)
1034
      for key, value in self.__dict__.iteritems()]
1035
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1036
 
1037
  def __eq__(self, other):
1038
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1039
 
1040
  def __ne__(self, other):
1041
    return not (self == other)
1042
 
1043
class getPromotionById_result:
1044
  """
1045
  Attributes:
1046
   - success
1047
   - pex
1048
  """
1049
 
1050
  thrift_spec = (
1051
    (0, TType.STRUCT, 'success', (Promotion, Promotion.thrift_spec), None, ), # 0
1052
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1053
  )
1054
 
1055
  def __init__(self, success=None, pex=None,):
1056
    self.success = success
1057
    self.pex = pex
1058
 
1059
  def read(self, iprot):
1060
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1061
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1062
      return
1063
    iprot.readStructBegin()
1064
    while True:
1065
      (fname, ftype, fid) = iprot.readFieldBegin()
1066
      if ftype == TType.STOP:
1067
        break
1068
      if fid == 0:
1069
        if ftype == TType.STRUCT:
1070
          self.success = Promotion()
1071
          self.success.read(iprot)
1072
        else:
1073
          iprot.skip(ftype)
1074
      elif fid == 1:
1075
        if ftype == TType.STRUCT:
1076
          self.pex = PromotionException()
1077
          self.pex.read(iprot)
1078
        else:
1079
          iprot.skip(ftype)
1080
      else:
1081
        iprot.skip(ftype)
1082
      iprot.readFieldEnd()
1083
    iprot.readStructEnd()
1084
 
1085
  def write(self, oprot):
1086
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1087
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1088
      return
1089
    oprot.writeStructBegin('getPromotionById_result')
1090
    if self.success != None:
1091
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1092
      self.success.write(oprot)
1093
      oprot.writeFieldEnd()
1094
    if self.pex != None:
1095
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1096
      self.pex.write(oprot)
1097
      oprot.writeFieldEnd()
1098
    oprot.writeFieldStop()
1099
    oprot.writeStructEnd()
1100
 
1101
  def __repr__(self):
1102
    L = ['%s=%r' % (key, value)
1103
      for key, value in self.__dict__.iteritems()]
1104
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1105
 
1106
  def __eq__(self, other):
1107
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1108
 
1109
  def __ne__(self, other):
1110
    return not (self == other)
1111
 
1112
class generateCouponsForPromotion_args:
1113
  """
1114
  Attributes:
1115
   - promotionId
1116
   - couponCode
1117
  """
1118
 
1119
  thrift_spec = (
1120
    None, # 0
1121
    (1, TType.I64, 'promotionId', None, None, ), # 1
1122
    (2, TType.STRING, 'couponCode', None, None, ), # 2
1123
  )
1124
 
1125
  def __init__(self, promotionId=None, couponCode=None,):
1126
    self.promotionId = promotionId
1127
    self.couponCode = couponCode
1128
 
1129
  def read(self, iprot):
1130
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1131
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1132
      return
1133
    iprot.readStructBegin()
1134
    while True:
1135
      (fname, ftype, fid) = iprot.readFieldBegin()
1136
      if ftype == TType.STOP:
1137
        break
1138
      if fid == 1:
1139
        if ftype == TType.I64:
1140
          self.promotionId = iprot.readI64();
1141
        else:
1142
          iprot.skip(ftype)
1143
      elif fid == 2:
1144
        if ftype == TType.STRING:
1145
          self.couponCode = iprot.readString();
1146
        else:
1147
          iprot.skip(ftype)
1148
      else:
1149
        iprot.skip(ftype)
1150
      iprot.readFieldEnd()
1151
    iprot.readStructEnd()
1152
 
1153
  def write(self, oprot):
1154
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1155
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1156
      return
1157
    oprot.writeStructBegin('generateCouponsForPromotion_args')
1158
    if self.promotionId != None:
1159
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
1160
      oprot.writeI64(self.promotionId)
1161
      oprot.writeFieldEnd()
1162
    if self.couponCode != None:
1163
      oprot.writeFieldBegin('couponCode', TType.STRING, 2)
1164
      oprot.writeString(self.couponCode)
1165
      oprot.writeFieldEnd()
1166
    oprot.writeFieldStop()
1167
    oprot.writeStructEnd()
1168
 
1169
  def __repr__(self):
1170
    L = ['%s=%r' % (key, value)
1171
      for key, value in self.__dict__.iteritems()]
1172
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1173
 
1174
  def __eq__(self, other):
1175
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1176
 
1177
  def __ne__(self, other):
1178
    return not (self == other)
1179
 
1180
class generateCouponsForPromotion_result:
1181
  """
1182
  Attributes:
1183
   - pex
1184
  """
1185
 
1186
  thrift_spec = (
1187
    None, # 0
1188
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1189
  )
1190
 
1191
  def __init__(self, pex=None,):
1192
    self.pex = pex
1193
 
1194
  def read(self, iprot):
1195
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1196
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1197
      return
1198
    iprot.readStructBegin()
1199
    while True:
1200
      (fname, ftype, fid) = iprot.readFieldBegin()
1201
      if ftype == TType.STOP:
1202
        break
1203
      if fid == 1:
1204
        if ftype == TType.STRUCT:
1205
          self.pex = PromotionException()
1206
          self.pex.read(iprot)
1207
        else:
1208
          iprot.skip(ftype)
1209
      else:
1210
        iprot.skip(ftype)
1211
      iprot.readFieldEnd()
1212
    iprot.readStructEnd()
1213
 
1214
  def write(self, oprot):
1215
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1216
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1217
      return
1218
    oprot.writeStructBegin('generateCouponsForPromotion_result')
1219
    if self.pex != None:
1220
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1221
      self.pex.write(oprot)
1222
      oprot.writeFieldEnd()
1223
    oprot.writeFieldStop()
1224
    oprot.writeStructEnd()
1225
 
1226
  def __repr__(self):
1227
    L = ['%s=%r' % (key, value)
1228
      for key, value in self.__dict__.iteritems()]
1229
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1230
 
1231
  def __eq__(self, other):
1232
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1233
 
1234
  def __ne__(self, other):
1235
    return not (self == other)
1236
 
1237
class applyCoupon_args:
1238
  """
1239
  Attributes:
1240
   - couponCode
1241
   - cartId
1242
  """
1243
 
1244
  thrift_spec = (
1245
    None, # 0
1246
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1247
    (2, TType.I64, 'cartId', None, None, ), # 2
1248
  )
1249
 
1250
  def __init__(self, couponCode=None, cartId=None,):
1251
    self.couponCode = couponCode
1252
    self.cartId = cartId
1253
 
1254
  def read(self, iprot):
1255
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1256
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1257
      return
1258
    iprot.readStructBegin()
1259
    while True:
1260
      (fname, ftype, fid) = iprot.readFieldBegin()
1261
      if ftype == TType.STOP:
1262
        break
1263
      if fid == 1:
1264
        if ftype == TType.STRING:
1265
          self.couponCode = iprot.readString();
1266
        else:
1267
          iprot.skip(ftype)
1268
      elif fid == 2:
1269
        if ftype == TType.I64:
1270
          self.cartId = iprot.readI64();
1271
        else:
1272
          iprot.skip(ftype)
1273
      else:
1274
        iprot.skip(ftype)
1275
      iprot.readFieldEnd()
1276
    iprot.readStructEnd()
1277
 
1278
  def write(self, oprot):
1279
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1280
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1281
      return
1282
    oprot.writeStructBegin('applyCoupon_args')
1283
    if self.couponCode != None:
1284
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1285
      oprot.writeString(self.couponCode)
1286
      oprot.writeFieldEnd()
1287
    if self.cartId != None:
1288
      oprot.writeFieldBegin('cartId', TType.I64, 2)
1289
      oprot.writeI64(self.cartId)
1290
      oprot.writeFieldEnd()
1291
    oprot.writeFieldStop()
1292
    oprot.writeStructEnd()
1293
 
1294
  def __repr__(self):
1295
    L = ['%s=%r' % (key, value)
1296
      for key, value in self.__dict__.iteritems()]
1297
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1298
 
1299
  def __eq__(self, other):
1300
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1301
 
1302
  def __ne__(self, other):
1303
    return not (self == other)
1304
 
1305
class applyCoupon_result:
1306
  """
1307
  Attributes:
1308
   - success
1309
   - pex
1310
  """
1311
 
1312
  thrift_spec = (
1313
    (0, TType.STRUCT, 'success', (Cart, Cart.thrift_spec), None, ), # 0
1314
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1315
  )
1316
 
1317
  def __init__(self, success=None, pex=None,):
1318
    self.success = success
1319
    self.pex = pex
1320
 
1321
  def read(self, iprot):
1322
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1323
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1324
      return
1325
    iprot.readStructBegin()
1326
    while True:
1327
      (fname, ftype, fid) = iprot.readFieldBegin()
1328
      if ftype == TType.STOP:
1329
        break
1330
      if fid == 0:
1331
        if ftype == TType.STRUCT:
1332
          self.success = Cart()
1333
          self.success.read(iprot)
1334
        else:
1335
          iprot.skip(ftype)
1336
      elif fid == 1:
1337
        if ftype == TType.STRUCT:
1338
          self.pex = PromotionException()
1339
          self.pex.read(iprot)
1340
        else:
1341
          iprot.skip(ftype)
1342
      else:
1343
        iprot.skip(ftype)
1344
      iprot.readFieldEnd()
1345
    iprot.readStructEnd()
1346
 
1347
  def write(self, oprot):
1348
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1349
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1350
      return
1351
    oprot.writeStructBegin('applyCoupon_result')
1352
    if self.success != None:
1353
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1354
      self.success.write(oprot)
1355
      oprot.writeFieldEnd()
1356
    if self.pex != None:
1357
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1358
      self.pex.write(oprot)
1359
      oprot.writeFieldEnd()
1360
    oprot.writeFieldStop()
1361
    oprot.writeStructEnd()
1362
 
1363
  def __repr__(self):
1364
    L = ['%s=%r' % (key, value)
1365
      for key, value in self.__dict__.iteritems()]
1366
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1367
 
1368
  def __eq__(self, other):
1369
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1370
 
1371
  def __ne__(self, other):
1372
    return not (self == other)
1373
 
1374
class trackCouponUsage_args:
1375
  """
1376
  Attributes:
1377
   - couponCode
1378
   - transactionId
1379
   - userId
1380
  """
1381
 
1382
  thrift_spec = (
1383
    None, # 0
1384
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1385
    (2, TType.I64, 'transactionId', None, None, ), # 2
1386
    (3, TType.I64, 'userId', None, None, ), # 3
1387
  )
1388
 
1389
  def __init__(self, couponCode=None, transactionId=None, userId=None,):
1390
    self.couponCode = couponCode
1391
    self.transactionId = transactionId
1392
    self.userId = userId
1393
 
1394
  def read(self, iprot):
1395
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1396
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1397
      return
1398
    iprot.readStructBegin()
1399
    while True:
1400
      (fname, ftype, fid) = iprot.readFieldBegin()
1401
      if ftype == TType.STOP:
1402
        break
1403
      if fid == 1:
1404
        if ftype == TType.STRING:
1405
          self.couponCode = iprot.readString();
1406
        else:
1407
          iprot.skip(ftype)
1408
      elif fid == 2:
1409
        if ftype == TType.I64:
1410
          self.transactionId = iprot.readI64();
1411
        else:
1412
          iprot.skip(ftype)
1413
      elif fid == 3:
1414
        if ftype == TType.I64:
1415
          self.userId = iprot.readI64();
1416
        else:
1417
          iprot.skip(ftype)
1418
      else:
1419
        iprot.skip(ftype)
1420
      iprot.readFieldEnd()
1421
    iprot.readStructEnd()
1422
 
1423
  def write(self, oprot):
1424
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1425
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1426
      return
1427
    oprot.writeStructBegin('trackCouponUsage_args')
1428
    if self.couponCode != None:
1429
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1430
      oprot.writeString(self.couponCode)
1431
      oprot.writeFieldEnd()
1432
    if self.transactionId != None:
1433
      oprot.writeFieldBegin('transactionId', TType.I64, 2)
1434
      oprot.writeI64(self.transactionId)
1435
      oprot.writeFieldEnd()
1436
    if self.userId != None:
1437
      oprot.writeFieldBegin('userId', TType.I64, 3)
1438
      oprot.writeI64(self.userId)
1439
      oprot.writeFieldEnd()
1440
    oprot.writeFieldStop()
1441
    oprot.writeStructEnd()
1442
 
1443
  def __repr__(self):
1444
    L = ['%s=%r' % (key, value)
1445
      for key, value in self.__dict__.iteritems()]
1446
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1447
 
1448
  def __eq__(self, other):
1449
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1450
 
1451
  def __ne__(self, other):
1452
    return not (self == other)
1453
 
1454
class trackCouponUsage_result:
1455
  """
1456
  Attributes:
1457
   - pex
1458
  """
1459
 
1460
  thrift_spec = (
1461
    None, # 0
1462
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1463
  )
1464
 
1465
  def __init__(self, pex=None,):
1466
    self.pex = pex
1467
 
1468
  def read(self, iprot):
1469
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1470
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1471
      return
1472
    iprot.readStructBegin()
1473
    while True:
1474
      (fname, ftype, fid) = iprot.readFieldBegin()
1475
      if ftype == TType.STOP:
1476
        break
1477
      if fid == 1:
1478
        if ftype == TType.STRUCT:
1479
          self.pex = PromotionException()
1480
          self.pex.read(iprot)
1481
        else:
1482
          iprot.skip(ftype)
1483
      else:
1484
        iprot.skip(ftype)
1485
      iprot.readFieldEnd()
1486
    iprot.readStructEnd()
1487
 
1488
  def write(self, oprot):
1489
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1490
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1491
      return
1492
    oprot.writeStructBegin('trackCouponUsage_result')
1493
    if self.pex != None:
1494
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1495
      self.pex.write(oprot)
1496
      oprot.writeFieldEnd()
1497
    oprot.writeFieldStop()
1498
    oprot.writeStructEnd()
1499
 
1500
  def __repr__(self):
1501
    L = ['%s=%r' % (key, value)
1502
      for key, value in self.__dict__.iteritems()]
1503
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1504
 
1505
  def __eq__(self, other):
1506
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1507
 
1508
  def __ne__(self, other):
1509
    return not (self == other)
1510
 
1511
class getCouponUsageCountByUser_args:
1512
  """
1513
  Attributes:
1514
   - couponCode
1515
   - userId
1516
  """
1517
 
1518
  thrift_spec = (
1519
    None, # 0
1520
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1521
    (2, TType.I64, 'userId', None, None, ), # 2
1522
  )
1523
 
1524
  def __init__(self, couponCode=None, userId=None,):
1525
    self.couponCode = couponCode
1526
    self.userId = userId
1527
 
1528
  def read(self, iprot):
1529
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1530
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1531
      return
1532
    iprot.readStructBegin()
1533
    while True:
1534
      (fname, ftype, fid) = iprot.readFieldBegin()
1535
      if ftype == TType.STOP:
1536
        break
1537
      if fid == 1:
1538
        if ftype == TType.STRING:
1539
          self.couponCode = iprot.readString();
1540
        else:
1541
          iprot.skip(ftype)
1542
      elif fid == 2:
1543
        if ftype == TType.I64:
1544
          self.userId = iprot.readI64();
1545
        else:
1546
          iprot.skip(ftype)
1547
      else:
1548
        iprot.skip(ftype)
1549
      iprot.readFieldEnd()
1550
    iprot.readStructEnd()
1551
 
1552
  def write(self, oprot):
1553
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1554
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1555
      return
1556
    oprot.writeStructBegin('getCouponUsageCountByUser_args')
1557
    if self.couponCode != None:
1558
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1559
      oprot.writeString(self.couponCode)
1560
      oprot.writeFieldEnd()
1561
    if self.userId != None:
1562
      oprot.writeFieldBegin('userId', TType.I64, 2)
1563
      oprot.writeI64(self.userId)
1564
      oprot.writeFieldEnd()
1565
    oprot.writeFieldStop()
1566
    oprot.writeStructEnd()
1567
 
1568
  def __repr__(self):
1569
    L = ['%s=%r' % (key, value)
1570
      for key, value in self.__dict__.iteritems()]
1571
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1572
 
1573
  def __eq__(self, other):
1574
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1575
 
1576
  def __ne__(self, other):
1577
    return not (self == other)
1578
 
1579
class getCouponUsageCountByUser_result:
1580
  """
1581
  Attributes:
1582
   - success
1583
   - pex
1584
  """
1585
 
1586
  thrift_spec = (
1587
    (0, TType.I64, 'success', None, None, ), # 0
1588
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1589
  )
1590
 
1591
  def __init__(self, success=None, pex=None,):
1592
    self.success = success
1593
    self.pex = pex
1594
 
1595
  def read(self, iprot):
1596
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1597
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1598
      return
1599
    iprot.readStructBegin()
1600
    while True:
1601
      (fname, ftype, fid) = iprot.readFieldBegin()
1602
      if ftype == TType.STOP:
1603
        break
1604
      if fid == 0:
1605
        if ftype == TType.I64:
1606
          self.success = iprot.readI64();
1607
        else:
1608
          iprot.skip(ftype)
1609
      elif fid == 1:
1610
        if ftype == TType.STRUCT:
1611
          self.pex = PromotionException()
1612
          self.pex.read(iprot)
1613
        else:
1614
          iprot.skip(ftype)
1615
      else:
1616
        iprot.skip(ftype)
1617
      iprot.readFieldEnd()
1618
    iprot.readStructEnd()
1619
 
1620
  def write(self, oprot):
1621
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1622
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1623
      return
1624
    oprot.writeStructBegin('getCouponUsageCountByUser_result')
1625
    if self.success != None:
1626
      oprot.writeFieldBegin('success', TType.I64, 0)
1627
      oprot.writeI64(self.success)
1628
      oprot.writeFieldEnd()
1629
    if self.pex != None:
1630
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1631
      self.pex.write(oprot)
1632
      oprot.writeFieldEnd()
1633
    oprot.writeFieldStop()
1634
    oprot.writeStructEnd()
1635
 
1636
  def __repr__(self):
1637
    L = ['%s=%r' % (key, value)
1638
      for key, value in self.__dict__.iteritems()]
1639
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1640
 
1641
  def __eq__(self, other):
1642
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1643
 
1644
  def __ne__(self, other):
1645
    return not (self == other)
1646
 
3385 varun.gupt 1647
class getActiveCoupons_args:
1976 varun.gupt 1648
 
3385 varun.gupt 1649
  thrift_spec = (
1650
  )
1651
 
1652
  def read(self, iprot):
1653
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1654
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1655
      return
1656
    iprot.readStructBegin()
1657
    while True:
1658
      (fname, ftype, fid) = iprot.readFieldBegin()
1659
      if ftype == TType.STOP:
1660
        break
1661
      else:
1662
        iprot.skip(ftype)
1663
      iprot.readFieldEnd()
1664
    iprot.readStructEnd()
1665
 
1666
  def write(self, oprot):
1667
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1668
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1669
      return
1670
    oprot.writeStructBegin('getActiveCoupons_args')
1671
    oprot.writeFieldStop()
1672
    oprot.writeStructEnd()
1673
 
1674
  def __repr__(self):
1675
    L = ['%s=%r' % (key, value)
1676
      for key, value in self.__dict__.iteritems()]
1677
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1678
 
1679
  def __eq__(self, other):
1680
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1681
 
1682
  def __ne__(self, other):
1683
    return not (self == other)
1684
 
1685
class getActiveCoupons_result:
1686
  """
1687
  Attributes:
1688
   - success
1689
   - pex
1690
  """
1691
 
1692
  thrift_spec = (
1693
    (0, TType.LIST, 'success', (TType.STRUCT,(Coupon, Coupon.thrift_spec)), None, ), # 0
1694
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1695
  )
1696
 
1697
  def __init__(self, success=None, pex=None,):
1698
    self.success = success
1699
    self.pex = pex
1700
 
1701
  def read(self, iprot):
1702
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1703
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1704
      return
1705
    iprot.readStructBegin()
1706
    while True:
1707
      (fname, ftype, fid) = iprot.readFieldBegin()
1708
      if ftype == TType.STOP:
1709
        break
1710
      if fid == 0:
1711
        if ftype == TType.LIST:
1712
          self.success = []
1713
          (_etype31, _size28) = iprot.readListBegin()
1714
          for _i32 in xrange(_size28):
1715
            _elem33 = Coupon()
1716
            _elem33.read(iprot)
1717
            self.success.append(_elem33)
1718
          iprot.readListEnd()
1719
        else:
1720
          iprot.skip(ftype)
1721
      elif fid == 1:
1722
        if ftype == TType.STRUCT:
1723
          self.pex = PromotionException()
1724
          self.pex.read(iprot)
1725
        else:
1726
          iprot.skip(ftype)
1727
      else:
1728
        iprot.skip(ftype)
1729
      iprot.readFieldEnd()
1730
    iprot.readStructEnd()
1731
 
1732
  def write(self, oprot):
1733
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1734
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1735
      return
1736
    oprot.writeStructBegin('getActiveCoupons_result')
1737
    if self.success != None:
1738
      oprot.writeFieldBegin('success', TType.LIST, 0)
1739
      oprot.writeListBegin(TType.STRUCT, len(self.success))
1740
      for iter34 in self.success:
1741
        iter34.write(oprot)
1742
      oprot.writeListEnd()
1743
      oprot.writeFieldEnd()
1744
    if self.pex != None:
1745
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1746
      self.pex.write(oprot)
1747
      oprot.writeFieldEnd()
1748
    oprot.writeFieldStop()
1749
    oprot.writeStructEnd()
1750
 
1751
  def __repr__(self):
1752
    L = ['%s=%r' % (key, value)
1753
      for key, value in self.__dict__.iteritems()]
1754
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1755
 
1756
  def __eq__(self, other):
1757
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1758
 
1759
  def __ne__(self, other):
1760
    return not (self == other)
1761
 
1762
class getSuccessfulPaymentCountForCoupon_args:
1763
  """
1764
  Attributes:
1765
   - couponCode
1766
  """
1767
 
1768
  thrift_spec = (
1769
    None, # 0
1770
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1771
  )
1772
 
1773
  def __init__(self, couponCode=None,):
1774
    self.couponCode = couponCode
1775
 
1776
  def read(self, iprot):
1777
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1778
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1779
      return
1780
    iprot.readStructBegin()
1781
    while True:
1782
      (fname, ftype, fid) = iprot.readFieldBegin()
1783
      if ftype == TType.STOP:
1784
        break
1785
      if fid == 1:
1786
        if ftype == TType.STRING:
1787
          self.couponCode = iprot.readString();
1788
        else:
1789
          iprot.skip(ftype)
1790
      else:
1791
        iprot.skip(ftype)
1792
      iprot.readFieldEnd()
1793
    iprot.readStructEnd()
1794
 
1795
  def write(self, oprot):
1796
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1797
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1798
      return
1799
    oprot.writeStructBegin('getSuccessfulPaymentCountForCoupon_args')
1800
    if self.couponCode != None:
1801
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1802
      oprot.writeString(self.couponCode)
1803
      oprot.writeFieldEnd()
1804
    oprot.writeFieldStop()
1805
    oprot.writeStructEnd()
1806
 
1807
  def __repr__(self):
1808
    L = ['%s=%r' % (key, value)
1809
      for key, value in self.__dict__.iteritems()]
1810
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1811
 
1812
  def __eq__(self, other):
1813
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1814
 
1815
  def __ne__(self, other):
1816
    return not (self == other)
1817
 
1818
class getSuccessfulPaymentCountForCoupon_result:
1819
  """
1820
  Attributes:
1821
   - success
1822
   - pex
1823
  """
1824
 
1825
  thrift_spec = (
1826
    (0, TType.I64, 'success', None, None, ), # 0
1827
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1828
  )
1829
 
1830
  def __init__(self, success=None, pex=None,):
1831
    self.success = success
1832
    self.pex = pex
1833
 
1834
  def read(self, iprot):
1835
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1836
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1837
      return
1838
    iprot.readStructBegin()
1839
    while True:
1840
      (fname, ftype, fid) = iprot.readFieldBegin()
1841
      if ftype == TType.STOP:
1842
        break
1843
      if fid == 0:
1844
        if ftype == TType.I64:
1845
          self.success = iprot.readI64();
1846
        else:
1847
          iprot.skip(ftype)
1848
      elif fid == 1:
1849
        if ftype == TType.STRUCT:
1850
          self.pex = PromotionException()
1851
          self.pex.read(iprot)
1852
        else:
1853
          iprot.skip(ftype)
1854
      else:
1855
        iprot.skip(ftype)
1856
      iprot.readFieldEnd()
1857
    iprot.readStructEnd()
1858
 
1859
  def write(self, oprot):
1860
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1861
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1862
      return
1863
    oprot.writeStructBegin('getSuccessfulPaymentCountForCoupon_result')
1864
    if self.success != None:
1865
      oprot.writeFieldBegin('success', TType.I64, 0)
1866
      oprot.writeI64(self.success)
1867
      oprot.writeFieldEnd()
1868
    if self.pex != None:
1869
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1870
      self.pex.write(oprot)
1871
      oprot.writeFieldEnd()
1872
    oprot.writeFieldStop()
1873
    oprot.writeStructEnd()
1874
 
1875
  def __repr__(self):
1876
    L = ['%s=%r' % (key, value)
1877
      for key, value in self.__dict__.iteritems()]
1878
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1879
 
1880
  def __eq__(self, other):
1881
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1882
 
1883
  def __ne__(self, other):
1884
    return not (self == other)
1885
 
1886
class getRuleDocString_args:
1887
  """
1888
  Attributes:
1889
   - ruleName
1890
  """
1891
 
1892
  thrift_spec = (
1893
    None, # 0
1894
    (1, TType.STRING, 'ruleName', None, None, ), # 1
1895
  )
1896
 
1897
  def __init__(self, ruleName=None,):
1898
    self.ruleName = ruleName
1899
 
1900
  def read(self, iprot):
1901
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1902
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1903
      return
1904
    iprot.readStructBegin()
1905
    while True:
1906
      (fname, ftype, fid) = iprot.readFieldBegin()
1907
      if ftype == TType.STOP:
1908
        break
1909
      if fid == 1:
1910
        if ftype == TType.STRING:
1911
          self.ruleName = iprot.readString();
1912
        else:
1913
          iprot.skip(ftype)
1914
      else:
1915
        iprot.skip(ftype)
1916
      iprot.readFieldEnd()
1917
    iprot.readStructEnd()
1918
 
1919
  def write(self, oprot):
1920
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1921
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1922
      return
1923
    oprot.writeStructBegin('getRuleDocString_args')
1924
    if self.ruleName != None:
1925
      oprot.writeFieldBegin('ruleName', TType.STRING, 1)
1926
      oprot.writeString(self.ruleName)
1927
      oprot.writeFieldEnd()
1928
    oprot.writeFieldStop()
1929
    oprot.writeStructEnd()
1930
 
1931
  def __repr__(self):
1932
    L = ['%s=%r' % (key, value)
1933
      for key, value in self.__dict__.iteritems()]
1934
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1935
 
1936
  def __eq__(self, other):
1937
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1938
 
1939
  def __ne__(self, other):
1940
    return not (self == other)
1941
 
1942
class getRuleDocString_result:
1943
  """
1944
  Attributes:
1945
   - success
1946
  """
1947
 
1948
  thrift_spec = (
1949
    (0, TType.STRING, 'success', None, None, ), # 0
1950
  )
1951
 
1952
  def __init__(self, success=None,):
1953
    self.success = success
1954
 
1955
  def read(self, iprot):
1956
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1957
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1958
      return
1959
    iprot.readStructBegin()
1960
    while True:
1961
      (fname, ftype, fid) = iprot.readFieldBegin()
1962
      if ftype == TType.STOP:
1963
        break
1964
      if fid == 0:
1965
        if ftype == TType.STRING:
1966
          self.success = iprot.readString();
1967
        else:
1968
          iprot.skip(ftype)
1969
      else:
1970
        iprot.skip(ftype)
1971
      iprot.readFieldEnd()
1972
    iprot.readStructEnd()
1973
 
1974
  def write(self, oprot):
1975
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1976
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1977
      return
1978
    oprot.writeStructBegin('getRuleDocString_result')
1979
    if self.success != None:
1980
      oprot.writeFieldBegin('success', TType.STRING, 0)
1981
      oprot.writeString(self.success)
1982
      oprot.writeFieldEnd()
1983
    oprot.writeFieldStop()
1984
    oprot.writeStructEnd()
1985
 
1986
  def __repr__(self):
1987
    L = ['%s=%r' % (key, value)
1988
      for key, value in self.__dict__.iteritems()]
1989
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1990
 
1991
  def __eq__(self, other):
1992
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1993
 
1994
  def __ne__(self, other):
1995
    return not (self == other)
1996
 
1997