Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1976 varun.gupt 1
#
3431 rajveer 2
# Autogenerated by Thrift Compiler (0.7.0)
1976 varun.gupt 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
3431 rajveer 12
from thrift.protocol import TBinaryProtocol, TProtocol
1976 varun.gupt 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 createPromotion(self, name, ruleExecutionSrc, startOn, endOn):
24
    """
25
    Parameters:
26
     - name
27
     - ruleExecutionSrc
28
     - startOn
29
     - endOn
30
    """
31
    pass
32
 
6301 amit.gupta 33
  def getCoupon(self, couponCode):
34
    """
35
    Parameters:
36
     - couponCode
37
    """
38
    pass
39
 
40
  def isGiftVoucher(self, couponCode):
41
    """
42
    Parameters:
43
     - couponCode
44
    """
45
    pass
46
 
6356 amit.gupta 47
  def isCodApplicable(self, couponCode):
48
    """
49
    Parameters:
50
     - couponCode
51
    """
52
    pass
53
 
1976 varun.gupt 54
  def getAllPromotions(self, ):
55
    pass
56
 
57
  def getPromotionById(self, promotionId):
58
    """
59
    Parameters:
60
     - promotionId
61
    """
62
    pass
63
 
64
  def generateCouponsForPromotion(self, promotionId, couponCode):
65
    """
66
    Parameters:
67
     - promotionId
68
     - couponCode
69
    """
70
    pass
71
 
72
  def applyCoupon(self, couponCode, cartId):
73
    """
74
    Parameters:
75
     - couponCode
76
     - cartId
77
    """
78
    pass
79
 
6433 anupam.sin 80
  def applyRechargeCoupon(self, couponCode, totalAmount, userId):
81
    """
82
    Parameters:
83
     - couponCode
84
     - totalAmount
85
     - userId
86
    """
87
    pass
88
 
1976 varun.gupt 89
  def trackCouponUsage(self, couponCode, transactionId, userId):
90
    """
91
    Parameters:
92
     - couponCode
93
     - transactionId
94
     - userId
95
    """
96
    pass
97
 
98
  def getCouponUsageCountByUser(self, couponCode, userId):
99
    """
100
    Parameters:
101
     - couponCode
102
     - userId
103
    """
104
    pass
105
 
6497 amit.gupta 106
  def getActiveCodes(self, promotionId):
107
    """
108
    Parameters:
109
     - promotionId
110
    """
111
    pass
112
 
113
  def deleteCoupon(self, couponCode):
114
    """
115
    Parameters:
116
     - couponCode
117
    """
118
    pass
119
 
3385 varun.gupt 120
  def getActiveCoupons(self, ):
121
    """
122
    Returns a list of active coupons
123
    """
124
    pass
1976 varun.gupt 125
 
6356 amit.gupta 126
  def createCoupon(self, promotionId, endOn, email, amount, isCod, usage):
6250 amit.gupta 127
    """
128
    Creates a coupon and returns couponcode if successfully created
129
 
130
    Parameters:
131
     - promotionId
132
     - endOn
133
     - email
134
     - amount
6356 amit.gupta 135
     - isCod
6250 amit.gupta 136
     - usage
137
    """
138
    pass
139
 
3385 varun.gupt 140
  def getSuccessfulPaymentCountForCoupon(self, couponCode):
141
    """
142
    Returns the count of successful payments done using a given coupon
3431 rajveer 143
 
3385 varun.gupt 144
    Parameters:
145
     - couponCode
146
    """
147
    pass
148
 
149
  def getRuleDocString(self, ruleName):
150
    """
151
    Returns the doc string of the rule module
3431 rajveer 152
 
3385 varun.gupt 153
    Parameters:
154
     - ruleName
155
    """
156
    pass
157
 
4189 varun.gupt 158
  def getItemDiscountMap(self, itemIds):
159
    """
160
    Parameters:
161
     - itemIds
162
    """
163
    pass
3385 varun.gupt 164
 
4494 varun.gupt 165
  def getDiscountsForEntity(self, entityId):
166
    """
167
    Parameters:
168
     - entityId
169
    """
170
    pass
4189 varun.gupt 171
 
5469 rajveer 172
  def addVoucher(self, voucher):
173
    """
174
    Parameters:
175
     - voucher
176
    """
177
    pass
4494 varun.gupt 178
 
5469 rajveer 179
  def assignVoucher(self, userId, userEmail, voucherType, amount):
180
    """
181
    Parameters:
182
     - userId
183
     - userEmail
184
     - voucherType
185
     - amount
186
    """
187
    pass
188
 
189
  def markVoucherAsRedeemed(self, voucherCode, redeemedOn):
190
    """
191
    Parameters:
192
     - voucherCode
193
     - redeemedOn
194
    """
195
    pass
196
 
197
 
3376 rajveer 198
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1976 varun.gupt 199
  """
200
  Promotion Service
201
  """
202
  def __init__(self, iprot, oprot=None):
3376 rajveer 203
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1976 varun.gupt 204
 
205
  def createPromotion(self, name, ruleExecutionSrc, startOn, endOn):
206
    """
207
    Parameters:
208
     - name
209
     - ruleExecutionSrc
210
     - startOn
211
     - endOn
212
    """
213
    self.send_createPromotion(name, ruleExecutionSrc, startOn, endOn)
214
    self.recv_createPromotion()
215
 
216
  def send_createPromotion(self, name, ruleExecutionSrc, startOn, endOn):
217
    self._oprot.writeMessageBegin('createPromotion', TMessageType.CALL, self._seqid)
218
    args = createPromotion_args()
219
    args.name = name
220
    args.ruleExecutionSrc = ruleExecutionSrc
221
    args.startOn = startOn
222
    args.endOn = endOn
223
    args.write(self._oprot)
224
    self._oprot.writeMessageEnd()
225
    self._oprot.trans.flush()
226
 
227
  def recv_createPromotion(self, ):
228
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
229
    if mtype == TMessageType.EXCEPTION:
230
      x = TApplicationException()
231
      x.read(self._iprot)
232
      self._iprot.readMessageEnd()
233
      raise x
234
    result = createPromotion_result()
235
    result.read(self._iprot)
236
    self._iprot.readMessageEnd()
3431 rajveer 237
    if result.pex is not None:
1976 varun.gupt 238
      raise result.pex
239
    return
240
 
6301 amit.gupta 241
  def getCoupon(self, couponCode):
242
    """
243
    Parameters:
244
     - couponCode
245
    """
246
    self.send_getCoupon(couponCode)
247
    return self.recv_getCoupon()
248
 
249
  def send_getCoupon(self, couponCode):
250
    self._oprot.writeMessageBegin('getCoupon', TMessageType.CALL, self._seqid)
251
    args = getCoupon_args()
252
    args.couponCode = couponCode
253
    args.write(self._oprot)
254
    self._oprot.writeMessageEnd()
255
    self._oprot.trans.flush()
256
 
257
  def recv_getCoupon(self, ):
258
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
259
    if mtype == TMessageType.EXCEPTION:
260
      x = TApplicationException()
261
      x.read(self._iprot)
262
      self._iprot.readMessageEnd()
263
      raise x
264
    result = getCoupon_result()
265
    result.read(self._iprot)
266
    self._iprot.readMessageEnd()
267
    if result.success is not None:
268
      return result.success
269
    if result.pex is not None:
270
      raise result.pex
271
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
272
 
273
  def isGiftVoucher(self, couponCode):
274
    """
275
    Parameters:
276
     - couponCode
277
    """
278
    self.send_isGiftVoucher(couponCode)
279
    return self.recv_isGiftVoucher()
280
 
281
  def send_isGiftVoucher(self, couponCode):
282
    self._oprot.writeMessageBegin('isGiftVoucher', TMessageType.CALL, self._seqid)
283
    args = isGiftVoucher_args()
284
    args.couponCode = couponCode
285
    args.write(self._oprot)
286
    self._oprot.writeMessageEnd()
287
    self._oprot.trans.flush()
288
 
289
  def recv_isGiftVoucher(self, ):
290
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
291
    if mtype == TMessageType.EXCEPTION:
292
      x = TApplicationException()
293
      x.read(self._iprot)
294
      self._iprot.readMessageEnd()
295
      raise x
296
    result = isGiftVoucher_result()
297
    result.read(self._iprot)
298
    self._iprot.readMessageEnd()
299
    if result.success is not None:
300
      return result.success
301
    if result.pex is not None:
302
      raise result.pex
303
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
304
 
6356 amit.gupta 305
  def isCodApplicable(self, couponCode):
306
    """
307
    Parameters:
308
     - couponCode
309
    """
310
    self.send_isCodApplicable(couponCode)
311
    return self.recv_isCodApplicable()
312
 
313
  def send_isCodApplicable(self, couponCode):
314
    self._oprot.writeMessageBegin('isCodApplicable', TMessageType.CALL, self._seqid)
315
    args = isCodApplicable_args()
316
    args.couponCode = couponCode
317
    args.write(self._oprot)
318
    self._oprot.writeMessageEnd()
319
    self._oprot.trans.flush()
320
 
321
  def recv_isCodApplicable(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 = isCodApplicable_result()
329
    result.read(self._iprot)
330
    self._iprot.readMessageEnd()
331
    if result.success is not None:
332
      return result.success
333
    if result.pex is not None:
334
      raise result.pex
335
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
336
 
1976 varun.gupt 337
  def getAllPromotions(self, ):
338
    self.send_getAllPromotions()
339
    return self.recv_getAllPromotions()
340
 
341
  def send_getAllPromotions(self, ):
342
    self._oprot.writeMessageBegin('getAllPromotions', TMessageType.CALL, self._seqid)
343
    args = getAllPromotions_args()
344
    args.write(self._oprot)
345
    self._oprot.writeMessageEnd()
346
    self._oprot.trans.flush()
347
 
348
  def recv_getAllPromotions(self, ):
349
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
350
    if mtype == TMessageType.EXCEPTION:
351
      x = TApplicationException()
352
      x.read(self._iprot)
353
      self._iprot.readMessageEnd()
354
      raise x
355
    result = getAllPromotions_result()
356
    result.read(self._iprot)
357
    self._iprot.readMessageEnd()
3431 rajveer 358
    if result.success is not None:
1976 varun.gupt 359
      return result.success
3431 rajveer 360
    if result.pex is not None:
1976 varun.gupt 361
      raise result.pex
362
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
363
 
364
  def getPromotionById(self, promotionId):
365
    """
366
    Parameters:
367
     - promotionId
368
    """
369
    self.send_getPromotionById(promotionId)
370
    return self.recv_getPromotionById()
371
 
372
  def send_getPromotionById(self, promotionId):
373
    self._oprot.writeMessageBegin('getPromotionById', TMessageType.CALL, self._seqid)
374
    args = getPromotionById_args()
375
    args.promotionId = promotionId
376
    args.write(self._oprot)
377
    self._oprot.writeMessageEnd()
378
    self._oprot.trans.flush()
379
 
380
  def recv_getPromotionById(self, ):
381
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
382
    if mtype == TMessageType.EXCEPTION:
383
      x = TApplicationException()
384
      x.read(self._iprot)
385
      self._iprot.readMessageEnd()
386
      raise x
387
    result = getPromotionById_result()
388
    result.read(self._iprot)
389
    self._iprot.readMessageEnd()
3431 rajveer 390
    if result.success is not None:
1976 varun.gupt 391
      return result.success
3431 rajveer 392
    if result.pex is not None:
1976 varun.gupt 393
      raise result.pex
394
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
395
 
396
  def generateCouponsForPromotion(self, promotionId, couponCode):
397
    """
398
    Parameters:
399
     - promotionId
400
     - couponCode
401
    """
402
    self.send_generateCouponsForPromotion(promotionId, couponCode)
403
    self.recv_generateCouponsForPromotion()
404
 
405
  def send_generateCouponsForPromotion(self, promotionId, couponCode):
406
    self._oprot.writeMessageBegin('generateCouponsForPromotion', TMessageType.CALL, self._seqid)
407
    args = generateCouponsForPromotion_args()
408
    args.promotionId = promotionId
409
    args.couponCode = couponCode
410
    args.write(self._oprot)
411
    self._oprot.writeMessageEnd()
412
    self._oprot.trans.flush()
413
 
414
  def recv_generateCouponsForPromotion(self, ):
415
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
416
    if mtype == TMessageType.EXCEPTION:
417
      x = TApplicationException()
418
      x.read(self._iprot)
419
      self._iprot.readMessageEnd()
420
      raise x
421
    result = generateCouponsForPromotion_result()
422
    result.read(self._iprot)
423
    self._iprot.readMessageEnd()
3431 rajveer 424
    if result.pex is not None:
1976 varun.gupt 425
      raise result.pex
426
    return
427
 
428
  def applyCoupon(self, couponCode, cartId):
429
    """
430
    Parameters:
431
     - couponCode
432
     - cartId
433
    """
434
    self.send_applyCoupon(couponCode, cartId)
435
    return self.recv_applyCoupon()
436
 
437
  def send_applyCoupon(self, couponCode, cartId):
438
    self._oprot.writeMessageBegin('applyCoupon', TMessageType.CALL, self._seqid)
439
    args = applyCoupon_args()
440
    args.couponCode = couponCode
441
    args.cartId = cartId
442
    args.write(self._oprot)
443
    self._oprot.writeMessageEnd()
444
    self._oprot.trans.flush()
445
 
446
  def recv_applyCoupon(self, ):
447
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
448
    if mtype == TMessageType.EXCEPTION:
449
      x = TApplicationException()
450
      x.read(self._iprot)
451
      self._iprot.readMessageEnd()
452
      raise x
453
    result = applyCoupon_result()
454
    result.read(self._iprot)
455
    self._iprot.readMessageEnd()
3431 rajveer 456
    if result.success is not None:
1976 varun.gupt 457
      return result.success
3431 rajveer 458
    if result.pex is not None:
1976 varun.gupt 459
      raise result.pex
460
    raise TApplicationException(TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
461
 
6433 anupam.sin 462
  def applyRechargeCoupon(self, couponCode, totalAmount, userId):
463
    """
464
    Parameters:
465
     - couponCode
466
     - totalAmount
467
     - userId
468
    """
469
    self.send_applyRechargeCoupon(couponCode, totalAmount, userId)
470
    return self.recv_applyRechargeCoupon()
471
 
472
  def send_applyRechargeCoupon(self, couponCode, totalAmount, userId):
473
    self._oprot.writeMessageBegin('applyRechargeCoupon', TMessageType.CALL, self._seqid)
474
    args = applyRechargeCoupon_args()
475
    args.couponCode = couponCode
476
    args.totalAmount = totalAmount
477
    args.userId = userId
478
    args.write(self._oprot)
479
    self._oprot.writeMessageEnd()
480
    self._oprot.trans.flush()
481
 
482
  def recv_applyRechargeCoupon(self, ):
483
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
484
    if mtype == TMessageType.EXCEPTION:
485
      x = TApplicationException()
486
      x.read(self._iprot)
487
      self._iprot.readMessageEnd()
488
      raise x
489
    result = applyRechargeCoupon_result()
490
    result.read(self._iprot)
491
    self._iprot.readMessageEnd()
492
    if result.success is not None:
493
      return result.success
494
    if result.pex is not None:
495
      raise result.pex
496
    raise TApplicationException(TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
497
 
1976 varun.gupt 498
  def trackCouponUsage(self, couponCode, transactionId, userId):
499
    """
500
    Parameters:
501
     - couponCode
502
     - transactionId
503
     - userId
504
    """
505
    self.send_trackCouponUsage(couponCode, transactionId, userId)
506
    self.recv_trackCouponUsage()
507
 
508
  def send_trackCouponUsage(self, couponCode, transactionId, userId):
509
    self._oprot.writeMessageBegin('trackCouponUsage', TMessageType.CALL, self._seqid)
510
    args = trackCouponUsage_args()
511
    args.couponCode = couponCode
512
    args.transactionId = transactionId
513
    args.userId = userId
514
    args.write(self._oprot)
515
    self._oprot.writeMessageEnd()
516
    self._oprot.trans.flush()
517
 
518
  def recv_trackCouponUsage(self, ):
519
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
520
    if mtype == TMessageType.EXCEPTION:
521
      x = TApplicationException()
522
      x.read(self._iprot)
523
      self._iprot.readMessageEnd()
524
      raise x
525
    result = trackCouponUsage_result()
526
    result.read(self._iprot)
527
    self._iprot.readMessageEnd()
3431 rajveer 528
    if result.pex is not None:
1976 varun.gupt 529
      raise result.pex
530
    return
531
 
532
  def getCouponUsageCountByUser(self, couponCode, userId):
533
    """
534
    Parameters:
535
     - couponCode
536
     - userId
537
    """
538
    self.send_getCouponUsageCountByUser(couponCode, userId)
539
    return self.recv_getCouponUsageCountByUser()
540
 
541
  def send_getCouponUsageCountByUser(self, couponCode, userId):
542
    self._oprot.writeMessageBegin('getCouponUsageCountByUser', TMessageType.CALL, self._seqid)
543
    args = getCouponUsageCountByUser_args()
544
    args.couponCode = couponCode
545
    args.userId = userId
546
    args.write(self._oprot)
547
    self._oprot.writeMessageEnd()
548
    self._oprot.trans.flush()
549
 
550
  def recv_getCouponUsageCountByUser(self, ):
551
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
552
    if mtype == TMessageType.EXCEPTION:
553
      x = TApplicationException()
554
      x.read(self._iprot)
555
      self._iprot.readMessageEnd()
556
      raise x
557
    result = getCouponUsageCountByUser_result()
558
    result.read(self._iprot)
559
    self._iprot.readMessageEnd()
3431 rajveer 560
    if result.success is not None:
1976 varun.gupt 561
      return result.success
3431 rajveer 562
    if result.pex is not None:
1976 varun.gupt 563
      raise result.pex
564
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
565
 
6497 amit.gupta 566
  def getActiveCodes(self, promotionId):
567
    """
568
    Parameters:
569
     - promotionId
570
    """
571
    self.send_getActiveCodes(promotionId)
572
    return self.recv_getActiveCodes()
573
 
574
  def send_getActiveCodes(self, promotionId):
575
    self._oprot.writeMessageBegin('getActiveCodes', TMessageType.CALL, self._seqid)
576
    args = getActiveCodes_args()
577
    args.promotionId = promotionId
578
    args.write(self._oprot)
579
    self._oprot.writeMessageEnd()
580
    self._oprot.trans.flush()
581
 
582
  def recv_getActiveCodes(self, ):
583
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
584
    if mtype == TMessageType.EXCEPTION:
585
      x = TApplicationException()
586
      x.read(self._iprot)
587
      self._iprot.readMessageEnd()
588
      raise x
589
    result = getActiveCodes_result()
590
    result.read(self._iprot)
591
    self._iprot.readMessageEnd()
592
    if result.success is not None:
593
      return result.success
594
    if result.pex is not None:
595
      raise result.pex
596
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
597
 
598
  def deleteCoupon(self, couponCode):
599
    """
600
    Parameters:
601
     - couponCode
602
    """
603
    self.send_deleteCoupon(couponCode)
604
    self.recv_deleteCoupon()
605
 
606
  def send_deleteCoupon(self, couponCode):
607
    self._oprot.writeMessageBegin('deleteCoupon', TMessageType.CALL, self._seqid)
608
    args = deleteCoupon_args()
609
    args.couponCode = couponCode
610
    args.write(self._oprot)
611
    self._oprot.writeMessageEnd()
612
    self._oprot.trans.flush()
613
 
614
  def recv_deleteCoupon(self, ):
615
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
616
    if mtype == TMessageType.EXCEPTION:
617
      x = TApplicationException()
618
      x.read(self._iprot)
619
      self._iprot.readMessageEnd()
620
      raise x
621
    result = deleteCoupon_result()
622
    result.read(self._iprot)
623
    self._iprot.readMessageEnd()
624
    if result.pex is not None:
625
      raise result.pex
626
    return
627
 
3385 varun.gupt 628
  def getActiveCoupons(self, ):
629
    """
630
    Returns a list of active coupons
631
    """
632
    self.send_getActiveCoupons()
633
    return self.recv_getActiveCoupons()
1976 varun.gupt 634
 
3385 varun.gupt 635
  def send_getActiveCoupons(self, ):
636
    self._oprot.writeMessageBegin('getActiveCoupons', TMessageType.CALL, self._seqid)
637
    args = getActiveCoupons_args()
638
    args.write(self._oprot)
639
    self._oprot.writeMessageEnd()
640
    self._oprot.trans.flush()
641
 
642
  def recv_getActiveCoupons(self, ):
643
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
644
    if mtype == TMessageType.EXCEPTION:
645
      x = TApplicationException()
646
      x.read(self._iprot)
647
      self._iprot.readMessageEnd()
648
      raise x
649
    result = getActiveCoupons_result()
650
    result.read(self._iprot)
651
    self._iprot.readMessageEnd()
3431 rajveer 652
    if result.success is not None:
3385 varun.gupt 653
      return result.success
3431 rajveer 654
    if result.pex is not None:
3385 varun.gupt 655
      raise result.pex
656
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
657
 
6356 amit.gupta 658
  def createCoupon(self, promotionId, endOn, email, amount, isCod, usage):
6250 amit.gupta 659
    """
660
    Creates a coupon and returns couponcode if successfully created
661
 
662
    Parameters:
663
     - promotionId
664
     - endOn
665
     - email
666
     - amount
6356 amit.gupta 667
     - isCod
6250 amit.gupta 668
     - usage
669
    """
6356 amit.gupta 670
    self.send_createCoupon(promotionId, endOn, email, amount, isCod, usage)
6250 amit.gupta 671
    return self.recv_createCoupon()
672
 
6356 amit.gupta 673
  def send_createCoupon(self, promotionId, endOn, email, amount, isCod, usage):
6250 amit.gupta 674
    self._oprot.writeMessageBegin('createCoupon', TMessageType.CALL, self._seqid)
675
    args = createCoupon_args()
676
    args.promotionId = promotionId
677
    args.endOn = endOn
678
    args.email = email
679
    args.amount = amount
6356 amit.gupta 680
    args.isCod = isCod
6250 amit.gupta 681
    args.usage = usage
682
    args.write(self._oprot)
683
    self._oprot.writeMessageEnd()
684
    self._oprot.trans.flush()
685
 
686
  def recv_createCoupon(self, ):
687
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
688
    if mtype == TMessageType.EXCEPTION:
689
      x = TApplicationException()
690
      x.read(self._iprot)
691
      self._iprot.readMessageEnd()
692
      raise x
693
    result = createCoupon_result()
694
    result.read(self._iprot)
695
    self._iprot.readMessageEnd()
696
    if result.success is not None:
697
      return result.success
698
    if result.pex is not None:
699
      raise result.pex
700
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
701
 
3385 varun.gupt 702
  def getSuccessfulPaymentCountForCoupon(self, couponCode):
703
    """
704
    Returns the count of successful payments done using a given coupon
3431 rajveer 705
 
3385 varun.gupt 706
    Parameters:
707
     - couponCode
708
    """
709
    self.send_getSuccessfulPaymentCountForCoupon(couponCode)
710
    return self.recv_getSuccessfulPaymentCountForCoupon()
711
 
712
  def send_getSuccessfulPaymentCountForCoupon(self, couponCode):
713
    self._oprot.writeMessageBegin('getSuccessfulPaymentCountForCoupon', TMessageType.CALL, self._seqid)
714
    args = getSuccessfulPaymentCountForCoupon_args()
715
    args.couponCode = couponCode
716
    args.write(self._oprot)
717
    self._oprot.writeMessageEnd()
718
    self._oprot.trans.flush()
719
 
720
  def recv_getSuccessfulPaymentCountForCoupon(self, ):
721
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
722
    if mtype == TMessageType.EXCEPTION:
723
      x = TApplicationException()
724
      x.read(self._iprot)
725
      self._iprot.readMessageEnd()
726
      raise x
727
    result = getSuccessfulPaymentCountForCoupon_result()
728
    result.read(self._iprot)
729
    self._iprot.readMessageEnd()
3431 rajveer 730
    if result.success is not None:
3385 varun.gupt 731
      return result.success
3431 rajveer 732
    if result.pex is not None:
3385 varun.gupt 733
      raise result.pex
734
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
735
 
736
  def getRuleDocString(self, ruleName):
737
    """
738
    Returns the doc string of the rule module
3431 rajveer 739
 
3385 varun.gupt 740
    Parameters:
741
     - ruleName
742
    """
743
    self.send_getRuleDocString(ruleName)
744
    return self.recv_getRuleDocString()
745
 
746
  def send_getRuleDocString(self, ruleName):
747
    self._oprot.writeMessageBegin('getRuleDocString', TMessageType.CALL, self._seqid)
748
    args = getRuleDocString_args()
749
    args.ruleName = ruleName
750
    args.write(self._oprot)
751
    self._oprot.writeMessageEnd()
752
    self._oprot.trans.flush()
753
 
754
  def recv_getRuleDocString(self, ):
755
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
756
    if mtype == TMessageType.EXCEPTION:
757
      x = TApplicationException()
758
      x.read(self._iprot)
759
      self._iprot.readMessageEnd()
760
      raise x
761
    result = getRuleDocString_result()
762
    result.read(self._iprot)
763
    self._iprot.readMessageEnd()
3431 rajveer 764
    if result.success is not None:
3385 varun.gupt 765
      return result.success
766
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
767
 
4189 varun.gupt 768
  def getItemDiscountMap(self, itemIds):
769
    """
770
    Parameters:
771
     - itemIds
772
    """
773
    self.send_getItemDiscountMap(itemIds)
774
    return self.recv_getItemDiscountMap()
3385 varun.gupt 775
 
4189 varun.gupt 776
  def send_getItemDiscountMap(self, itemIds):
777
    self._oprot.writeMessageBegin('getItemDiscountMap', TMessageType.CALL, self._seqid)
778
    args = getItemDiscountMap_args()
779
    args.itemIds = itemIds
780
    args.write(self._oprot)
781
    self._oprot.writeMessageEnd()
782
    self._oprot.trans.flush()
783
 
784
  def recv_getItemDiscountMap(self, ):
785
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
786
    if mtype == TMessageType.EXCEPTION:
787
      x = TApplicationException()
788
      x.read(self._iprot)
789
      self._iprot.readMessageEnd()
790
      raise x
791
    result = getItemDiscountMap_result()
792
    result.read(self._iprot)
793
    self._iprot.readMessageEnd()
794
    if result.success is not None:
795
      return result.success
796
    if result.pex is not None:
797
      raise result.pex
798
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
799
 
4494 varun.gupt 800
  def getDiscountsForEntity(self, entityId):
801
    """
802
    Parameters:
803
     - entityId
804
    """
805
    self.send_getDiscountsForEntity(entityId)
806
    return self.recv_getDiscountsForEntity()
4189 varun.gupt 807
 
4494 varun.gupt 808
  def send_getDiscountsForEntity(self, entityId):
809
    self._oprot.writeMessageBegin('getDiscountsForEntity', TMessageType.CALL, self._seqid)
810
    args = getDiscountsForEntity_args()
811
    args.entityId = entityId
812
    args.write(self._oprot)
813
    self._oprot.writeMessageEnd()
814
    self._oprot.trans.flush()
815
 
816
  def recv_getDiscountsForEntity(self, ):
817
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
818
    if mtype == TMessageType.EXCEPTION:
819
      x = TApplicationException()
820
      x.read(self._iprot)
821
      self._iprot.readMessageEnd()
822
      raise x
823
    result = getDiscountsForEntity_result()
824
    result.read(self._iprot)
825
    self._iprot.readMessageEnd()
826
    if result.success is not None:
827
      return result.success
828
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
829
 
5469 rajveer 830
  def addVoucher(self, voucher):
831
    """
832
    Parameters:
833
     - voucher
834
    """
835
    self.send_addVoucher(voucher)
836
    self.recv_addVoucher()
4494 varun.gupt 837
 
5469 rajveer 838
  def send_addVoucher(self, voucher):
839
    self._oprot.writeMessageBegin('addVoucher', TMessageType.CALL, self._seqid)
840
    args = addVoucher_args()
841
    args.voucher = voucher
842
    args.write(self._oprot)
843
    self._oprot.writeMessageEnd()
844
    self._oprot.trans.flush()
845
 
846
  def recv_addVoucher(self, ):
847
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
848
    if mtype == TMessageType.EXCEPTION:
849
      x = TApplicationException()
850
      x.read(self._iprot)
851
      self._iprot.readMessageEnd()
852
      raise x
853
    result = addVoucher_result()
854
    result.read(self._iprot)
855
    self._iprot.readMessageEnd()
856
    return
857
 
858
  def assignVoucher(self, userId, userEmail, voucherType, amount):
859
    """
860
    Parameters:
861
     - userId
862
     - userEmail
863
     - voucherType
864
     - amount
865
    """
866
    self.send_assignVoucher(userId, userEmail, voucherType, amount)
867
    return self.recv_assignVoucher()
868
 
869
  def send_assignVoucher(self, userId, userEmail, voucherType, amount):
870
    self._oprot.writeMessageBegin('assignVoucher', TMessageType.CALL, self._seqid)
871
    args = assignVoucher_args()
872
    args.userId = userId
873
    args.userEmail = userEmail
874
    args.voucherType = voucherType
875
    args.amount = amount
876
    args.write(self._oprot)
877
    self._oprot.writeMessageEnd()
878
    self._oprot.trans.flush()
879
 
880
  def recv_assignVoucher(self, ):
881
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
882
    if mtype == TMessageType.EXCEPTION:
883
      x = TApplicationException()
884
      x.read(self._iprot)
885
      self._iprot.readMessageEnd()
886
      raise x
887
    result = assignVoucher_result()
888
    result.read(self._iprot)
889
    self._iprot.readMessageEnd()
890
    if result.success is not None:
891
      return result.success
892
    raise TApplicationException(TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
893
 
894
  def markVoucherAsRedeemed(self, voucherCode, redeemedOn):
895
    """
896
    Parameters:
897
     - voucherCode
898
     - redeemedOn
899
    """
900
    self.send_markVoucherAsRedeemed(voucherCode, redeemedOn)
901
    return self.recv_markVoucherAsRedeemed()
902
 
903
  def send_markVoucherAsRedeemed(self, voucherCode, redeemedOn):
904
    self._oprot.writeMessageBegin('markVoucherAsRedeemed', TMessageType.CALL, self._seqid)
905
    args = markVoucherAsRedeemed_args()
906
    args.voucherCode = voucherCode
907
    args.redeemedOn = redeemedOn
908
    args.write(self._oprot)
909
    self._oprot.writeMessageEnd()
910
    self._oprot.trans.flush()
911
 
912
  def recv_markVoucherAsRedeemed(self, ):
913
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
914
    if mtype == TMessageType.EXCEPTION:
915
      x = TApplicationException()
916
      x.read(self._iprot)
917
      self._iprot.readMessageEnd()
918
      raise x
919
    result = markVoucherAsRedeemed_result()
920
    result.read(self._iprot)
921
    self._iprot.readMessageEnd()
922
    if result.success is not None:
923
      return result.success
924
    raise TApplicationException(TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
925
 
926
 
3376 rajveer 927
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1976 varun.gupt 928
  def __init__(self, handler):
3376 rajveer 929
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1976 varun.gupt 930
    self._processMap["createPromotion"] = Processor.process_createPromotion
6301 amit.gupta 931
    self._processMap["getCoupon"] = Processor.process_getCoupon
932
    self._processMap["isGiftVoucher"] = Processor.process_isGiftVoucher
6356 amit.gupta 933
    self._processMap["isCodApplicable"] = Processor.process_isCodApplicable
1976 varun.gupt 934
    self._processMap["getAllPromotions"] = Processor.process_getAllPromotions
935
    self._processMap["getPromotionById"] = Processor.process_getPromotionById
936
    self._processMap["generateCouponsForPromotion"] = Processor.process_generateCouponsForPromotion
937
    self._processMap["applyCoupon"] = Processor.process_applyCoupon
6433 anupam.sin 938
    self._processMap["applyRechargeCoupon"] = Processor.process_applyRechargeCoupon
1976 varun.gupt 939
    self._processMap["trackCouponUsage"] = Processor.process_trackCouponUsage
940
    self._processMap["getCouponUsageCountByUser"] = Processor.process_getCouponUsageCountByUser
6497 amit.gupta 941
    self._processMap["getActiveCodes"] = Processor.process_getActiveCodes
942
    self._processMap["deleteCoupon"] = Processor.process_deleteCoupon
3385 varun.gupt 943
    self._processMap["getActiveCoupons"] = Processor.process_getActiveCoupons
6250 amit.gupta 944
    self._processMap["createCoupon"] = Processor.process_createCoupon
3385 varun.gupt 945
    self._processMap["getSuccessfulPaymentCountForCoupon"] = Processor.process_getSuccessfulPaymentCountForCoupon
946
    self._processMap["getRuleDocString"] = Processor.process_getRuleDocString
4189 varun.gupt 947
    self._processMap["getItemDiscountMap"] = Processor.process_getItemDiscountMap
4494 varun.gupt 948
    self._processMap["getDiscountsForEntity"] = Processor.process_getDiscountsForEntity
5469 rajveer 949
    self._processMap["addVoucher"] = Processor.process_addVoucher
950
    self._processMap["assignVoucher"] = Processor.process_assignVoucher
951
    self._processMap["markVoucherAsRedeemed"] = Processor.process_markVoucherAsRedeemed
1976 varun.gupt 952
 
953
  def process(self, iprot, oprot):
954
    (name, type, seqid) = iprot.readMessageBegin()
955
    if name not in self._processMap:
956
      iprot.skip(TType.STRUCT)
957
      iprot.readMessageEnd()
958
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
959
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
960
      x.write(oprot)
961
      oprot.writeMessageEnd()
962
      oprot.trans.flush()
963
      return
964
    else:
965
      self._processMap[name](self, seqid, iprot, oprot)
966
    return True
967
 
968
  def process_createPromotion(self, seqid, iprot, oprot):
969
    args = createPromotion_args()
970
    args.read(iprot)
971
    iprot.readMessageEnd()
972
    result = createPromotion_result()
973
    try:
974
      self._handler.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn)
975
    except PromotionException, pex:
976
      result.pex = pex
977
    oprot.writeMessageBegin("createPromotion", TMessageType.REPLY, seqid)
978
    result.write(oprot)
979
    oprot.writeMessageEnd()
980
    oprot.trans.flush()
981
 
6301 amit.gupta 982
  def process_getCoupon(self, seqid, iprot, oprot):
983
    args = getCoupon_args()
984
    args.read(iprot)
985
    iprot.readMessageEnd()
986
    result = getCoupon_result()
987
    try:
988
      result.success = self._handler.getCoupon(args.couponCode)
989
    except PromotionException, pex:
990
      result.pex = pex
991
    oprot.writeMessageBegin("getCoupon", TMessageType.REPLY, seqid)
992
    result.write(oprot)
993
    oprot.writeMessageEnd()
994
    oprot.trans.flush()
995
 
996
  def process_isGiftVoucher(self, seqid, iprot, oprot):
997
    args = isGiftVoucher_args()
998
    args.read(iprot)
999
    iprot.readMessageEnd()
1000
    result = isGiftVoucher_result()
1001
    try:
1002
      result.success = self._handler.isGiftVoucher(args.couponCode)
1003
    except PromotionException, pex:
1004
      result.pex = pex
1005
    oprot.writeMessageBegin("isGiftVoucher", TMessageType.REPLY, seqid)
1006
    result.write(oprot)
1007
    oprot.writeMessageEnd()
1008
    oprot.trans.flush()
1009
 
6356 amit.gupta 1010
  def process_isCodApplicable(self, seqid, iprot, oprot):
1011
    args = isCodApplicable_args()
1012
    args.read(iprot)
1013
    iprot.readMessageEnd()
1014
    result = isCodApplicable_result()
1015
    try:
1016
      result.success = self._handler.isCodApplicable(args.couponCode)
1017
    except PromotionException, pex:
1018
      result.pex = pex
1019
    oprot.writeMessageBegin("isCodApplicable", TMessageType.REPLY, seqid)
1020
    result.write(oprot)
1021
    oprot.writeMessageEnd()
1022
    oprot.trans.flush()
1023
 
1976 varun.gupt 1024
  def process_getAllPromotions(self, seqid, iprot, oprot):
1025
    args = getAllPromotions_args()
1026
    args.read(iprot)
1027
    iprot.readMessageEnd()
1028
    result = getAllPromotions_result()
1029
    try:
1030
      result.success = self._handler.getAllPromotions()
1031
    except PromotionException, pex:
1032
      result.pex = pex
1033
    oprot.writeMessageBegin("getAllPromotions", TMessageType.REPLY, seqid)
1034
    result.write(oprot)
1035
    oprot.writeMessageEnd()
1036
    oprot.trans.flush()
1037
 
1038
  def process_getPromotionById(self, seqid, iprot, oprot):
1039
    args = getPromotionById_args()
1040
    args.read(iprot)
1041
    iprot.readMessageEnd()
1042
    result = getPromotionById_result()
1043
    try:
1044
      result.success = self._handler.getPromotionById(args.promotionId)
1045
    except PromotionException, pex:
1046
      result.pex = pex
1047
    oprot.writeMessageBegin("getPromotionById", TMessageType.REPLY, seqid)
1048
    result.write(oprot)
1049
    oprot.writeMessageEnd()
1050
    oprot.trans.flush()
1051
 
1052
  def process_generateCouponsForPromotion(self, seqid, iprot, oprot):
1053
    args = generateCouponsForPromotion_args()
1054
    args.read(iprot)
1055
    iprot.readMessageEnd()
1056
    result = generateCouponsForPromotion_result()
1057
    try:
1058
      self._handler.generateCouponsForPromotion(args.promotionId, args.couponCode)
1059
    except PromotionException, pex:
1060
      result.pex = pex
1061
    oprot.writeMessageBegin("generateCouponsForPromotion", TMessageType.REPLY, seqid)
1062
    result.write(oprot)
1063
    oprot.writeMessageEnd()
1064
    oprot.trans.flush()
1065
 
1066
  def process_applyCoupon(self, seqid, iprot, oprot):
1067
    args = applyCoupon_args()
1068
    args.read(iprot)
1069
    iprot.readMessageEnd()
1070
    result = applyCoupon_result()
1071
    try:
1072
      result.success = self._handler.applyCoupon(args.couponCode, args.cartId)
1073
    except PromotionException, pex:
1074
      result.pex = pex
1075
    oprot.writeMessageBegin("applyCoupon", TMessageType.REPLY, seqid)
1076
    result.write(oprot)
1077
    oprot.writeMessageEnd()
1078
    oprot.trans.flush()
1079
 
6433 anupam.sin 1080
  def process_applyRechargeCoupon(self, seqid, iprot, oprot):
1081
    args = applyRechargeCoupon_args()
1082
    args.read(iprot)
1083
    iprot.readMessageEnd()
1084
    result = applyRechargeCoupon_result()
1085
    try:
1086
      result.success = self._handler.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId)
1087
    except PromotionException, pex:
1088
      result.pex = pex
1089
    oprot.writeMessageBegin("applyRechargeCoupon", TMessageType.REPLY, seqid)
1090
    result.write(oprot)
1091
    oprot.writeMessageEnd()
1092
    oprot.trans.flush()
1093
 
1976 varun.gupt 1094
  def process_trackCouponUsage(self, seqid, iprot, oprot):
1095
    args = trackCouponUsage_args()
1096
    args.read(iprot)
1097
    iprot.readMessageEnd()
1098
    result = trackCouponUsage_result()
1099
    try:
1100
      self._handler.trackCouponUsage(args.couponCode, args.transactionId, args.userId)
1101
    except PromotionException, pex:
1102
      result.pex = pex
1103
    oprot.writeMessageBegin("trackCouponUsage", TMessageType.REPLY, seqid)
1104
    result.write(oprot)
1105
    oprot.writeMessageEnd()
1106
    oprot.trans.flush()
1107
 
1108
  def process_getCouponUsageCountByUser(self, seqid, iprot, oprot):
1109
    args = getCouponUsageCountByUser_args()
1110
    args.read(iprot)
1111
    iprot.readMessageEnd()
1112
    result = getCouponUsageCountByUser_result()
1113
    try:
1114
      result.success = self._handler.getCouponUsageCountByUser(args.couponCode, args.userId)
1115
    except PromotionException, pex:
1116
      result.pex = pex
1117
    oprot.writeMessageBegin("getCouponUsageCountByUser", TMessageType.REPLY, seqid)
1118
    result.write(oprot)
1119
    oprot.writeMessageEnd()
1120
    oprot.trans.flush()
1121
 
6497 amit.gupta 1122
  def process_getActiveCodes(self, seqid, iprot, oprot):
1123
    args = getActiveCodes_args()
1124
    args.read(iprot)
1125
    iprot.readMessageEnd()
1126
    result = getActiveCodes_result()
1127
    try:
1128
      result.success = self._handler.getActiveCodes(args.promotionId)
1129
    except PromotionException, pex:
1130
      result.pex = pex
1131
    oprot.writeMessageBegin("getActiveCodes", TMessageType.REPLY, seqid)
1132
    result.write(oprot)
1133
    oprot.writeMessageEnd()
1134
    oprot.trans.flush()
1135
 
1136
  def process_deleteCoupon(self, seqid, iprot, oprot):
1137
    args = deleteCoupon_args()
1138
    args.read(iprot)
1139
    iprot.readMessageEnd()
1140
    result = deleteCoupon_result()
1141
    try:
1142
      self._handler.deleteCoupon(args.couponCode)
1143
    except PromotionException, pex:
1144
      result.pex = pex
1145
    oprot.writeMessageBegin("deleteCoupon", TMessageType.REPLY, seqid)
1146
    result.write(oprot)
1147
    oprot.writeMessageEnd()
1148
    oprot.trans.flush()
1149
 
3385 varun.gupt 1150
  def process_getActiveCoupons(self, seqid, iprot, oprot):
1151
    args = getActiveCoupons_args()
1152
    args.read(iprot)
1153
    iprot.readMessageEnd()
1154
    result = getActiveCoupons_result()
1155
    try:
1156
      result.success = self._handler.getActiveCoupons()
1157
    except PromotionException, pex:
1158
      result.pex = pex
1159
    oprot.writeMessageBegin("getActiveCoupons", TMessageType.REPLY, seqid)
1160
    result.write(oprot)
1161
    oprot.writeMessageEnd()
1162
    oprot.trans.flush()
1976 varun.gupt 1163
 
6250 amit.gupta 1164
  def process_createCoupon(self, seqid, iprot, oprot):
1165
    args = createCoupon_args()
1166
    args.read(iprot)
1167
    iprot.readMessageEnd()
1168
    result = createCoupon_result()
1169
    try:
6356 amit.gupta 1170
      result.success = self._handler.createCoupon(args.promotionId, args.endOn, args.email, args.amount, args.isCod, args.usage)
6250 amit.gupta 1171
    except PromotionException, pex:
1172
      result.pex = pex
1173
    oprot.writeMessageBegin("createCoupon", TMessageType.REPLY, seqid)
1174
    result.write(oprot)
1175
    oprot.writeMessageEnd()
1176
    oprot.trans.flush()
1177
 
3385 varun.gupt 1178
  def process_getSuccessfulPaymentCountForCoupon(self, seqid, iprot, oprot):
1179
    args = getSuccessfulPaymentCountForCoupon_args()
1180
    args.read(iprot)
1181
    iprot.readMessageEnd()
1182
    result = getSuccessfulPaymentCountForCoupon_result()
1183
    try:
1184
      result.success = self._handler.getSuccessfulPaymentCountForCoupon(args.couponCode)
1185
    except PromotionException, pex:
1186
      result.pex = pex
1187
    oprot.writeMessageBegin("getSuccessfulPaymentCountForCoupon", TMessageType.REPLY, seqid)
1188
    result.write(oprot)
1189
    oprot.writeMessageEnd()
1190
    oprot.trans.flush()
1191
 
1192
  def process_getRuleDocString(self, seqid, iprot, oprot):
1193
    args = getRuleDocString_args()
1194
    args.read(iprot)
1195
    iprot.readMessageEnd()
1196
    result = getRuleDocString_result()
1197
    result.success = self._handler.getRuleDocString(args.ruleName)
1198
    oprot.writeMessageBegin("getRuleDocString", TMessageType.REPLY, seqid)
1199
    result.write(oprot)
1200
    oprot.writeMessageEnd()
1201
    oprot.trans.flush()
1202
 
4189 varun.gupt 1203
  def process_getItemDiscountMap(self, seqid, iprot, oprot):
1204
    args = getItemDiscountMap_args()
1205
    args.read(iprot)
1206
    iprot.readMessageEnd()
1207
    result = getItemDiscountMap_result()
1208
    try:
1209
      result.success = self._handler.getItemDiscountMap(args.itemIds)
1210
    except PromotionException, pex:
1211
      result.pex = pex
1212
    oprot.writeMessageBegin("getItemDiscountMap", TMessageType.REPLY, seqid)
1213
    result.write(oprot)
1214
    oprot.writeMessageEnd()
1215
    oprot.trans.flush()
3385 varun.gupt 1216
 
4494 varun.gupt 1217
  def process_getDiscountsForEntity(self, seqid, iprot, oprot):
1218
    args = getDiscountsForEntity_args()
1219
    args.read(iprot)
1220
    iprot.readMessageEnd()
1221
    result = getDiscountsForEntity_result()
1222
    result.success = self._handler.getDiscountsForEntity(args.entityId)
1223
    oprot.writeMessageBegin("getDiscountsForEntity", TMessageType.REPLY, seqid)
1224
    result.write(oprot)
1225
    oprot.writeMessageEnd()
1226
    oprot.trans.flush()
4189 varun.gupt 1227
 
5469 rajveer 1228
  def process_addVoucher(self, seqid, iprot, oprot):
1229
    args = addVoucher_args()
1230
    args.read(iprot)
1231
    iprot.readMessageEnd()
1232
    result = addVoucher_result()
1233
    self._handler.addVoucher(args.voucher)
1234
    oprot.writeMessageBegin("addVoucher", TMessageType.REPLY, seqid)
1235
    result.write(oprot)
1236
    oprot.writeMessageEnd()
1237
    oprot.trans.flush()
4494 varun.gupt 1238
 
5469 rajveer 1239
  def process_assignVoucher(self, seqid, iprot, oprot):
1240
    args = assignVoucher_args()
1241
    args.read(iprot)
1242
    iprot.readMessageEnd()
1243
    result = assignVoucher_result()
1244
    result.success = self._handler.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount)
1245
    oprot.writeMessageBegin("assignVoucher", TMessageType.REPLY, seqid)
1246
    result.write(oprot)
1247
    oprot.writeMessageEnd()
1248
    oprot.trans.flush()
1249
 
1250
  def process_markVoucherAsRedeemed(self, seqid, iprot, oprot):
1251
    args = markVoucherAsRedeemed_args()
1252
    args.read(iprot)
1253
    iprot.readMessageEnd()
1254
    result = markVoucherAsRedeemed_result()
1255
    result.success = self._handler.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn)
1256
    oprot.writeMessageBegin("markVoucherAsRedeemed", TMessageType.REPLY, seqid)
1257
    result.write(oprot)
1258
    oprot.writeMessageEnd()
1259
    oprot.trans.flush()
1260
 
1261
 
1976 varun.gupt 1262
# HELPER FUNCTIONS AND STRUCTURES
1263
 
1264
class createPromotion_args:
1265
  """
1266
  Attributes:
1267
   - name
1268
   - ruleExecutionSrc
1269
   - startOn
1270
   - endOn
1271
  """
1272
 
1273
  thrift_spec = (
1274
    None, # 0
1275
    (1, TType.STRING, 'name', None, None, ), # 1
1276
    (2, TType.STRING, 'ruleExecutionSrc', None, None, ), # 2
1277
    (3, TType.I64, 'startOn', None, None, ), # 3
1278
    (4, TType.I64, 'endOn', None, None, ), # 4
1279
  )
1280
 
1281
  def __init__(self, name=None, ruleExecutionSrc=None, startOn=None, endOn=None,):
1282
    self.name = name
1283
    self.ruleExecutionSrc = ruleExecutionSrc
1284
    self.startOn = startOn
1285
    self.endOn = endOn
1286
 
1287
  def read(self, iprot):
1288
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1289
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1290
      return
1291
    iprot.readStructBegin()
1292
    while True:
1293
      (fname, ftype, fid) = iprot.readFieldBegin()
1294
      if ftype == TType.STOP:
1295
        break
1296
      if fid == 1:
1297
        if ftype == TType.STRING:
1298
          self.name = iprot.readString();
1299
        else:
1300
          iprot.skip(ftype)
1301
      elif fid == 2:
1302
        if ftype == TType.STRING:
1303
          self.ruleExecutionSrc = iprot.readString();
1304
        else:
1305
          iprot.skip(ftype)
1306
      elif fid == 3:
1307
        if ftype == TType.I64:
1308
          self.startOn = iprot.readI64();
1309
        else:
1310
          iprot.skip(ftype)
1311
      elif fid == 4:
1312
        if ftype == TType.I64:
1313
          self.endOn = iprot.readI64();
1314
        else:
1315
          iprot.skip(ftype)
1316
      else:
1317
        iprot.skip(ftype)
1318
      iprot.readFieldEnd()
1319
    iprot.readStructEnd()
1320
 
1321
  def write(self, oprot):
1322
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1323
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1324
      return
1325
    oprot.writeStructBegin('createPromotion_args')
3431 rajveer 1326
    if self.name is not None:
1976 varun.gupt 1327
      oprot.writeFieldBegin('name', TType.STRING, 1)
1328
      oprot.writeString(self.name)
1329
      oprot.writeFieldEnd()
3431 rajveer 1330
    if self.ruleExecutionSrc is not None:
1976 varun.gupt 1331
      oprot.writeFieldBegin('ruleExecutionSrc', TType.STRING, 2)
1332
      oprot.writeString(self.ruleExecutionSrc)
1333
      oprot.writeFieldEnd()
3431 rajveer 1334
    if self.startOn is not None:
1976 varun.gupt 1335
      oprot.writeFieldBegin('startOn', TType.I64, 3)
1336
      oprot.writeI64(self.startOn)
1337
      oprot.writeFieldEnd()
3431 rajveer 1338
    if self.endOn is not None:
1976 varun.gupt 1339
      oprot.writeFieldBegin('endOn', TType.I64, 4)
1340
      oprot.writeI64(self.endOn)
1341
      oprot.writeFieldEnd()
1342
    oprot.writeFieldStop()
1343
    oprot.writeStructEnd()
1344
 
3431 rajveer 1345
  def validate(self):
1346
    return
1347
 
1348
 
1976 varun.gupt 1349
  def __repr__(self):
1350
    L = ['%s=%r' % (key, value)
1351
      for key, value in self.__dict__.iteritems()]
1352
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1353
 
1354
  def __eq__(self, other):
1355
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1356
 
1357
  def __ne__(self, other):
1358
    return not (self == other)
1359
 
1360
class createPromotion_result:
1361
  """
1362
  Attributes:
1363
   - pex
1364
  """
1365
 
1366
  thrift_spec = (
1367
    None, # 0
1368
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1369
  )
1370
 
1371
  def __init__(self, pex=None,):
1372
    self.pex = pex
1373
 
1374
  def read(self, iprot):
1375
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1376
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1377
      return
1378
    iprot.readStructBegin()
1379
    while True:
1380
      (fname, ftype, fid) = iprot.readFieldBegin()
1381
      if ftype == TType.STOP:
1382
        break
1383
      if fid == 1:
1384
        if ftype == TType.STRUCT:
1385
          self.pex = PromotionException()
1386
          self.pex.read(iprot)
1387
        else:
1388
          iprot.skip(ftype)
1389
      else:
1390
        iprot.skip(ftype)
1391
      iprot.readFieldEnd()
1392
    iprot.readStructEnd()
1393
 
1394
  def write(self, oprot):
1395
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1396
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1397
      return
1398
    oprot.writeStructBegin('createPromotion_result')
3431 rajveer 1399
    if self.pex is not None:
1976 varun.gupt 1400
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1401
      self.pex.write(oprot)
1402
      oprot.writeFieldEnd()
1403
    oprot.writeFieldStop()
1404
    oprot.writeStructEnd()
1405
 
3431 rajveer 1406
  def validate(self):
1407
    return
1408
 
1409
 
1976 varun.gupt 1410
  def __repr__(self):
1411
    L = ['%s=%r' % (key, value)
1412
      for key, value in self.__dict__.iteritems()]
1413
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1414
 
1415
  def __eq__(self, other):
1416
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1417
 
1418
  def __ne__(self, other):
1419
    return not (self == other)
1420
 
6301 amit.gupta 1421
class getCoupon_args:
1422
  """
1423
  Attributes:
1424
   - couponCode
1425
  """
1426
 
1427
  thrift_spec = (
1428
    None, # 0
1429
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1430
  )
1431
 
1432
  def __init__(self, couponCode=None,):
1433
    self.couponCode = couponCode
1434
 
1435
  def read(self, iprot):
1436
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1437
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1438
      return
1439
    iprot.readStructBegin()
1440
    while True:
1441
      (fname, ftype, fid) = iprot.readFieldBegin()
1442
      if ftype == TType.STOP:
1443
        break
1444
      if fid == 1:
1445
        if ftype == TType.STRING:
1446
          self.couponCode = iprot.readString();
1447
        else:
1448
          iprot.skip(ftype)
1449
      else:
1450
        iprot.skip(ftype)
1451
      iprot.readFieldEnd()
1452
    iprot.readStructEnd()
1453
 
1454
  def write(self, oprot):
1455
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1456
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1457
      return
1458
    oprot.writeStructBegin('getCoupon_args')
1459
    if self.couponCode is not None:
1460
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1461
      oprot.writeString(self.couponCode)
1462
      oprot.writeFieldEnd()
1463
    oprot.writeFieldStop()
1464
    oprot.writeStructEnd()
1465
 
1466
  def validate(self):
1467
    return
1468
 
1469
 
1470
  def __repr__(self):
1471
    L = ['%s=%r' % (key, value)
1472
      for key, value in self.__dict__.iteritems()]
1473
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1474
 
1475
  def __eq__(self, other):
1476
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1477
 
1478
  def __ne__(self, other):
1479
    return not (self == other)
1480
 
1481
class getCoupon_result:
1482
  """
1483
  Attributes:
1484
   - success
1485
   - pex
1486
  """
1487
 
1488
  thrift_spec = (
1489
    (0, TType.STRUCT, 'success', (Coupon, Coupon.thrift_spec), None, ), # 0
1490
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1491
  )
1492
 
1493
  def __init__(self, success=None, pex=None,):
1494
    self.success = success
1495
    self.pex = pex
1496
 
1497
  def read(self, iprot):
1498
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1499
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1500
      return
1501
    iprot.readStructBegin()
1502
    while True:
1503
      (fname, ftype, fid) = iprot.readFieldBegin()
1504
      if ftype == TType.STOP:
1505
        break
1506
      if fid == 0:
1507
        if ftype == TType.STRUCT:
1508
          self.success = Coupon()
1509
          self.success.read(iprot)
1510
        else:
1511
          iprot.skip(ftype)
1512
      elif fid == 1:
1513
        if ftype == TType.STRUCT:
1514
          self.pex = PromotionException()
1515
          self.pex.read(iprot)
1516
        else:
1517
          iprot.skip(ftype)
1518
      else:
1519
        iprot.skip(ftype)
1520
      iprot.readFieldEnd()
1521
    iprot.readStructEnd()
1522
 
1523
  def write(self, oprot):
1524
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1525
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1526
      return
1527
    oprot.writeStructBegin('getCoupon_result')
1528
    if self.success is not None:
1529
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1530
      self.success.write(oprot)
1531
      oprot.writeFieldEnd()
1532
    if self.pex is not None:
1533
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1534
      self.pex.write(oprot)
1535
      oprot.writeFieldEnd()
1536
    oprot.writeFieldStop()
1537
    oprot.writeStructEnd()
1538
 
1539
  def validate(self):
1540
    return
1541
 
1542
 
1543
  def __repr__(self):
1544
    L = ['%s=%r' % (key, value)
1545
      for key, value in self.__dict__.iteritems()]
1546
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1547
 
1548
  def __eq__(self, other):
1549
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1550
 
1551
  def __ne__(self, other):
1552
    return not (self == other)
1553
 
1554
class isGiftVoucher_args:
1555
  """
1556
  Attributes:
1557
   - couponCode
1558
  """
1559
 
1560
  thrift_spec = (
1561
    None, # 0
1562
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1563
  )
1564
 
1565
  def __init__(self, couponCode=None,):
1566
    self.couponCode = couponCode
1567
 
1568
  def read(self, iprot):
1569
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1570
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1571
      return
1572
    iprot.readStructBegin()
1573
    while True:
1574
      (fname, ftype, fid) = iprot.readFieldBegin()
1575
      if ftype == TType.STOP:
1576
        break
1577
      if fid == 1:
1578
        if ftype == TType.STRING:
1579
          self.couponCode = iprot.readString();
1580
        else:
1581
          iprot.skip(ftype)
1582
      else:
1583
        iprot.skip(ftype)
1584
      iprot.readFieldEnd()
1585
    iprot.readStructEnd()
1586
 
1587
  def write(self, oprot):
1588
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1589
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1590
      return
1591
    oprot.writeStructBegin('isGiftVoucher_args')
1592
    if self.couponCode is not None:
1593
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1594
      oprot.writeString(self.couponCode)
1595
      oprot.writeFieldEnd()
1596
    oprot.writeFieldStop()
1597
    oprot.writeStructEnd()
1598
 
1599
  def validate(self):
1600
    return
1601
 
1602
 
1603
  def __repr__(self):
1604
    L = ['%s=%r' % (key, value)
1605
      for key, value in self.__dict__.iteritems()]
1606
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1607
 
1608
  def __eq__(self, other):
1609
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1610
 
1611
  def __ne__(self, other):
1612
    return not (self == other)
1613
 
1614
class isGiftVoucher_result:
1615
  """
1616
  Attributes:
1617
   - success
1618
   - pex
1619
  """
1620
 
1621
  thrift_spec = (
1622
    (0, TType.BOOL, 'success', None, None, ), # 0
1623
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1624
  )
1625
 
1626
  def __init__(self, success=None, pex=None,):
1627
    self.success = success
1628
    self.pex = pex
1629
 
1630
  def read(self, iprot):
1631
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1632
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1633
      return
1634
    iprot.readStructBegin()
1635
    while True:
1636
      (fname, ftype, fid) = iprot.readFieldBegin()
1637
      if ftype == TType.STOP:
1638
        break
1639
      if fid == 0:
1640
        if ftype == TType.BOOL:
1641
          self.success = iprot.readBool();
1642
        else:
1643
          iprot.skip(ftype)
1644
      elif fid == 1:
1645
        if ftype == TType.STRUCT:
1646
          self.pex = PromotionException()
1647
          self.pex.read(iprot)
1648
        else:
1649
          iprot.skip(ftype)
1650
      else:
1651
        iprot.skip(ftype)
1652
      iprot.readFieldEnd()
1653
    iprot.readStructEnd()
1654
 
1655
  def write(self, oprot):
1656
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1657
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1658
      return
1659
    oprot.writeStructBegin('isGiftVoucher_result')
1660
    if self.success is not None:
1661
      oprot.writeFieldBegin('success', TType.BOOL, 0)
1662
      oprot.writeBool(self.success)
1663
      oprot.writeFieldEnd()
1664
    if self.pex is not None:
1665
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1666
      self.pex.write(oprot)
1667
      oprot.writeFieldEnd()
1668
    oprot.writeFieldStop()
1669
    oprot.writeStructEnd()
1670
 
1671
  def validate(self):
1672
    return
1673
 
1674
 
1675
  def __repr__(self):
1676
    L = ['%s=%r' % (key, value)
1677
      for key, value in self.__dict__.iteritems()]
1678
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1679
 
1680
  def __eq__(self, other):
1681
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1682
 
1683
  def __ne__(self, other):
1684
    return not (self == other)
1685
 
6356 amit.gupta 1686
class isCodApplicable_args:
1687
  """
1688
  Attributes:
1689
   - couponCode
1690
  """
1691
 
1692
  thrift_spec = (
1693
    None, # 0
1694
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1695
  )
1696
 
1697
  def __init__(self, couponCode=None,):
1698
    self.couponCode = couponCode
1699
 
1700
  def read(self, iprot):
1701
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1702
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1703
      return
1704
    iprot.readStructBegin()
1705
    while True:
1706
      (fname, ftype, fid) = iprot.readFieldBegin()
1707
      if ftype == TType.STOP:
1708
        break
1709
      if fid == 1:
1710
        if ftype == TType.STRING:
1711
          self.couponCode = iprot.readString();
1712
        else:
1713
          iprot.skip(ftype)
1714
      else:
1715
        iprot.skip(ftype)
1716
      iprot.readFieldEnd()
1717
    iprot.readStructEnd()
1718
 
1719
  def write(self, oprot):
1720
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1721
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1722
      return
1723
    oprot.writeStructBegin('isCodApplicable_args')
1724
    if self.couponCode is not None:
1725
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1726
      oprot.writeString(self.couponCode)
1727
      oprot.writeFieldEnd()
1728
    oprot.writeFieldStop()
1729
    oprot.writeStructEnd()
1730
 
1731
  def validate(self):
1732
    return
1733
 
1734
 
1735
  def __repr__(self):
1736
    L = ['%s=%r' % (key, value)
1737
      for key, value in self.__dict__.iteritems()]
1738
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1739
 
1740
  def __eq__(self, other):
1741
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1742
 
1743
  def __ne__(self, other):
1744
    return not (self == other)
1745
 
1746
class isCodApplicable_result:
1747
  """
1748
  Attributes:
1749
   - success
1750
   - pex
1751
  """
1752
 
1753
  thrift_spec = (
1754
    (0, TType.BOOL, 'success', None, None, ), # 0
1755
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1756
  )
1757
 
1758
  def __init__(self, success=None, pex=None,):
1759
    self.success = success
1760
    self.pex = pex
1761
 
1762
  def read(self, iprot):
1763
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1764
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1765
      return
1766
    iprot.readStructBegin()
1767
    while True:
1768
      (fname, ftype, fid) = iprot.readFieldBegin()
1769
      if ftype == TType.STOP:
1770
        break
1771
      if fid == 0:
1772
        if ftype == TType.BOOL:
1773
          self.success = iprot.readBool();
1774
        else:
1775
          iprot.skip(ftype)
1776
      elif fid == 1:
1777
        if ftype == TType.STRUCT:
1778
          self.pex = PromotionException()
1779
          self.pex.read(iprot)
1780
        else:
1781
          iprot.skip(ftype)
1782
      else:
1783
        iprot.skip(ftype)
1784
      iprot.readFieldEnd()
1785
    iprot.readStructEnd()
1786
 
1787
  def write(self, oprot):
1788
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1789
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1790
      return
1791
    oprot.writeStructBegin('isCodApplicable_result')
1792
    if self.success is not None:
1793
      oprot.writeFieldBegin('success', TType.BOOL, 0)
1794
      oprot.writeBool(self.success)
1795
      oprot.writeFieldEnd()
1796
    if self.pex is not None:
1797
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1798
      self.pex.write(oprot)
1799
      oprot.writeFieldEnd()
1800
    oprot.writeFieldStop()
1801
    oprot.writeStructEnd()
1802
 
1803
  def validate(self):
1804
    return
1805
 
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
 
1976 varun.gupt 1818
class getAllPromotions_args:
1819
 
1820
  thrift_spec = (
1821
  )
1822
 
1823
  def read(self, iprot):
1824
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1825
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1826
      return
1827
    iprot.readStructBegin()
1828
    while True:
1829
      (fname, ftype, fid) = iprot.readFieldBegin()
1830
      if ftype == TType.STOP:
1831
        break
1832
      else:
1833
        iprot.skip(ftype)
1834
      iprot.readFieldEnd()
1835
    iprot.readStructEnd()
1836
 
1837
  def write(self, oprot):
1838
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1839
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1840
      return
1841
    oprot.writeStructBegin('getAllPromotions_args')
1842
    oprot.writeFieldStop()
1843
    oprot.writeStructEnd()
1844
 
3431 rajveer 1845
  def validate(self):
1846
    return
1847
 
1848
 
1976 varun.gupt 1849
  def __repr__(self):
1850
    L = ['%s=%r' % (key, value)
1851
      for key, value in self.__dict__.iteritems()]
1852
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1853
 
1854
  def __eq__(self, other):
1855
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1856
 
1857
  def __ne__(self, other):
1858
    return not (self == other)
1859
 
1860
class getAllPromotions_result:
1861
  """
1862
  Attributes:
1863
   - success
1864
   - pex
1865
  """
1866
 
1867
  thrift_spec = (
1868
    (0, TType.LIST, 'success', (TType.STRUCT,(Promotion, Promotion.thrift_spec)), None, ), # 0
1869
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1870
  )
1871
 
1872
  def __init__(self, success=None, pex=None,):
1873
    self.success = success
1874
    self.pex = pex
1875
 
1876
  def read(self, iprot):
1877
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1878
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1879
      return
1880
    iprot.readStructBegin()
1881
    while True:
1882
      (fname, ftype, fid) = iprot.readFieldBegin()
1883
      if ftype == TType.STOP:
1884
        break
1885
      if fid == 0:
1886
        if ftype == TType.LIST:
1887
          self.success = []
5326 rajveer 1888
          (_etype24, _size21) = iprot.readListBegin()
1889
          for _i25 in xrange(_size21):
1890
            _elem26 = Promotion()
1891
            _elem26.read(iprot)
1892
            self.success.append(_elem26)
1976 varun.gupt 1893
          iprot.readListEnd()
1894
        else:
1895
          iprot.skip(ftype)
1896
      elif fid == 1:
1897
        if ftype == TType.STRUCT:
1898
          self.pex = PromotionException()
1899
          self.pex.read(iprot)
1900
        else:
1901
          iprot.skip(ftype)
1902
      else:
1903
        iprot.skip(ftype)
1904
      iprot.readFieldEnd()
1905
    iprot.readStructEnd()
1906
 
1907
  def write(self, oprot):
1908
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1909
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1910
      return
1911
    oprot.writeStructBegin('getAllPromotions_result')
3431 rajveer 1912
    if self.success is not None:
1976 varun.gupt 1913
      oprot.writeFieldBegin('success', TType.LIST, 0)
1914
      oprot.writeListBegin(TType.STRUCT, len(self.success))
5326 rajveer 1915
      for iter27 in self.success:
1916
        iter27.write(oprot)
1976 varun.gupt 1917
      oprot.writeListEnd()
1918
      oprot.writeFieldEnd()
3431 rajveer 1919
    if self.pex is not None:
1976 varun.gupt 1920
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1921
      self.pex.write(oprot)
1922
      oprot.writeFieldEnd()
1923
    oprot.writeFieldStop()
1924
    oprot.writeStructEnd()
1925
 
3431 rajveer 1926
  def validate(self):
1927
    return
1928
 
1929
 
1976 varun.gupt 1930
  def __repr__(self):
1931
    L = ['%s=%r' % (key, value)
1932
      for key, value in self.__dict__.iteritems()]
1933
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1934
 
1935
  def __eq__(self, other):
1936
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1937
 
1938
  def __ne__(self, other):
1939
    return not (self == other)
1940
 
1941
class getPromotionById_args:
1942
  """
1943
  Attributes:
1944
   - promotionId
1945
  """
1946
 
1947
  thrift_spec = (
1948
    None, # 0
1949
    (1, TType.I64, 'promotionId', None, None, ), # 1
1950
  )
1951
 
1952
  def __init__(self, promotionId=None,):
1953
    self.promotionId = promotionId
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 == 1:
1965
        if ftype == TType.I64:
1966
          self.promotionId = iprot.readI64();
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('getPromotionById_args')
3431 rajveer 1979
    if self.promotionId is not None:
1976 varun.gupt 1980
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
1981
      oprot.writeI64(self.promotionId)
1982
      oprot.writeFieldEnd()
1983
    oprot.writeFieldStop()
1984
    oprot.writeStructEnd()
1985
 
3431 rajveer 1986
  def validate(self):
1987
    return
1988
 
1989
 
1976 varun.gupt 1990
  def __repr__(self):
1991
    L = ['%s=%r' % (key, value)
1992
      for key, value in self.__dict__.iteritems()]
1993
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1994
 
1995
  def __eq__(self, other):
1996
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1997
 
1998
  def __ne__(self, other):
1999
    return not (self == other)
2000
 
2001
class getPromotionById_result:
2002
  """
2003
  Attributes:
2004
   - success
2005
   - pex
2006
  """
2007
 
2008
  thrift_spec = (
2009
    (0, TType.STRUCT, 'success', (Promotion, Promotion.thrift_spec), None, ), # 0
2010
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2011
  )
2012
 
2013
  def __init__(self, success=None, pex=None,):
2014
    self.success = success
2015
    self.pex = pex
2016
 
2017
  def read(self, iprot):
2018
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2019
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2020
      return
2021
    iprot.readStructBegin()
2022
    while True:
2023
      (fname, ftype, fid) = iprot.readFieldBegin()
2024
      if ftype == TType.STOP:
2025
        break
2026
      if fid == 0:
2027
        if ftype == TType.STRUCT:
2028
          self.success = Promotion()
2029
          self.success.read(iprot)
2030
        else:
2031
          iprot.skip(ftype)
2032
      elif fid == 1:
2033
        if ftype == TType.STRUCT:
2034
          self.pex = PromotionException()
2035
          self.pex.read(iprot)
2036
        else:
2037
          iprot.skip(ftype)
2038
      else:
2039
        iprot.skip(ftype)
2040
      iprot.readFieldEnd()
2041
    iprot.readStructEnd()
2042
 
2043
  def write(self, oprot):
2044
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2045
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2046
      return
2047
    oprot.writeStructBegin('getPromotionById_result')
3431 rajveer 2048
    if self.success is not None:
1976 varun.gupt 2049
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
2050
      self.success.write(oprot)
2051
      oprot.writeFieldEnd()
3431 rajveer 2052
    if self.pex is not None:
1976 varun.gupt 2053
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2054
      self.pex.write(oprot)
2055
      oprot.writeFieldEnd()
2056
    oprot.writeFieldStop()
2057
    oprot.writeStructEnd()
2058
 
3431 rajveer 2059
  def validate(self):
2060
    return
2061
 
2062
 
1976 varun.gupt 2063
  def __repr__(self):
2064
    L = ['%s=%r' % (key, value)
2065
      for key, value in self.__dict__.iteritems()]
2066
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2067
 
2068
  def __eq__(self, other):
2069
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2070
 
2071
  def __ne__(self, other):
2072
    return not (self == other)
2073
 
2074
class generateCouponsForPromotion_args:
2075
  """
2076
  Attributes:
2077
   - promotionId
2078
   - couponCode
2079
  """
2080
 
2081
  thrift_spec = (
2082
    None, # 0
2083
    (1, TType.I64, 'promotionId', None, None, ), # 1
2084
    (2, TType.STRING, 'couponCode', None, None, ), # 2
2085
  )
2086
 
2087
  def __init__(self, promotionId=None, couponCode=None,):
2088
    self.promotionId = promotionId
2089
    self.couponCode = couponCode
2090
 
2091
  def read(self, iprot):
2092
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2093
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2094
      return
2095
    iprot.readStructBegin()
2096
    while True:
2097
      (fname, ftype, fid) = iprot.readFieldBegin()
2098
      if ftype == TType.STOP:
2099
        break
2100
      if fid == 1:
2101
        if ftype == TType.I64:
2102
          self.promotionId = iprot.readI64();
2103
        else:
2104
          iprot.skip(ftype)
2105
      elif fid == 2:
2106
        if ftype == TType.STRING:
2107
          self.couponCode = iprot.readString();
2108
        else:
2109
          iprot.skip(ftype)
2110
      else:
2111
        iprot.skip(ftype)
2112
      iprot.readFieldEnd()
2113
    iprot.readStructEnd()
2114
 
2115
  def write(self, oprot):
2116
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2117
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2118
      return
2119
    oprot.writeStructBegin('generateCouponsForPromotion_args')
3431 rajveer 2120
    if self.promotionId is not None:
1976 varun.gupt 2121
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
2122
      oprot.writeI64(self.promotionId)
2123
      oprot.writeFieldEnd()
3431 rajveer 2124
    if self.couponCode is not None:
1976 varun.gupt 2125
      oprot.writeFieldBegin('couponCode', TType.STRING, 2)
2126
      oprot.writeString(self.couponCode)
2127
      oprot.writeFieldEnd()
2128
    oprot.writeFieldStop()
2129
    oprot.writeStructEnd()
2130
 
3431 rajveer 2131
  def validate(self):
2132
    return
2133
 
2134
 
1976 varun.gupt 2135
  def __repr__(self):
2136
    L = ['%s=%r' % (key, value)
2137
      for key, value in self.__dict__.iteritems()]
2138
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2139
 
2140
  def __eq__(self, other):
2141
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2142
 
2143
  def __ne__(self, other):
2144
    return not (self == other)
2145
 
2146
class generateCouponsForPromotion_result:
2147
  """
2148
  Attributes:
2149
   - pex
2150
  """
2151
 
2152
  thrift_spec = (
2153
    None, # 0
2154
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2155
  )
2156
 
2157
  def __init__(self, pex=None,):
2158
    self.pex = pex
2159
 
2160
  def read(self, iprot):
2161
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2162
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2163
      return
2164
    iprot.readStructBegin()
2165
    while True:
2166
      (fname, ftype, fid) = iprot.readFieldBegin()
2167
      if ftype == TType.STOP:
2168
        break
2169
      if fid == 1:
2170
        if ftype == TType.STRUCT:
2171
          self.pex = PromotionException()
2172
          self.pex.read(iprot)
2173
        else:
2174
          iprot.skip(ftype)
2175
      else:
2176
        iprot.skip(ftype)
2177
      iprot.readFieldEnd()
2178
    iprot.readStructEnd()
2179
 
2180
  def write(self, oprot):
2181
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2182
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2183
      return
2184
    oprot.writeStructBegin('generateCouponsForPromotion_result')
3431 rajveer 2185
    if self.pex is not None:
1976 varun.gupt 2186
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2187
      self.pex.write(oprot)
2188
      oprot.writeFieldEnd()
2189
    oprot.writeFieldStop()
2190
    oprot.writeStructEnd()
2191
 
3431 rajveer 2192
  def validate(self):
2193
    return
2194
 
2195
 
1976 varun.gupt 2196
  def __repr__(self):
2197
    L = ['%s=%r' % (key, value)
2198
      for key, value in self.__dict__.iteritems()]
2199
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2200
 
2201
  def __eq__(self, other):
2202
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2203
 
2204
  def __ne__(self, other):
2205
    return not (self == other)
2206
 
2207
class applyCoupon_args:
2208
  """
2209
  Attributes:
2210
   - couponCode
2211
   - cartId
2212
  """
2213
 
2214
  thrift_spec = (
2215
    None, # 0
2216
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2217
    (2, TType.I64, 'cartId', None, None, ), # 2
2218
  )
2219
 
2220
  def __init__(self, couponCode=None, cartId=None,):
2221
    self.couponCode = couponCode
2222
    self.cartId = cartId
2223
 
2224
  def read(self, iprot):
2225
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2226
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2227
      return
2228
    iprot.readStructBegin()
2229
    while True:
2230
      (fname, ftype, fid) = iprot.readFieldBegin()
2231
      if ftype == TType.STOP:
2232
        break
2233
      if fid == 1:
2234
        if ftype == TType.STRING:
2235
          self.couponCode = iprot.readString();
2236
        else:
2237
          iprot.skip(ftype)
2238
      elif fid == 2:
2239
        if ftype == TType.I64:
2240
          self.cartId = iprot.readI64();
2241
        else:
2242
          iprot.skip(ftype)
2243
      else:
2244
        iprot.skip(ftype)
2245
      iprot.readFieldEnd()
2246
    iprot.readStructEnd()
2247
 
2248
  def write(self, oprot):
2249
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2250
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2251
      return
2252
    oprot.writeStructBegin('applyCoupon_args')
3431 rajveer 2253
    if self.couponCode is not None:
1976 varun.gupt 2254
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
2255
      oprot.writeString(self.couponCode)
2256
      oprot.writeFieldEnd()
3431 rajveer 2257
    if self.cartId is not None:
1976 varun.gupt 2258
      oprot.writeFieldBegin('cartId', TType.I64, 2)
2259
      oprot.writeI64(self.cartId)
2260
      oprot.writeFieldEnd()
2261
    oprot.writeFieldStop()
2262
    oprot.writeStructEnd()
2263
 
3431 rajveer 2264
  def validate(self):
2265
    return
2266
 
2267
 
1976 varun.gupt 2268
  def __repr__(self):
2269
    L = ['%s=%r' % (key, value)
2270
      for key, value in self.__dict__.iteritems()]
2271
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2272
 
2273
  def __eq__(self, other):
2274
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2275
 
2276
  def __ne__(self, other):
2277
    return not (self == other)
2278
 
2279
class applyCoupon_result:
2280
  """
2281
  Attributes:
2282
   - success
2283
   - pex
2284
  """
2285
 
2286
  thrift_spec = (
2287
    (0, TType.STRUCT, 'success', (Cart, Cart.thrift_spec), None, ), # 0
2288
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2289
  )
2290
 
2291
  def __init__(self, success=None, pex=None,):
2292
    self.success = success
2293
    self.pex = pex
2294
 
2295
  def read(self, iprot):
2296
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2297
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2298
      return
2299
    iprot.readStructBegin()
2300
    while True:
2301
      (fname, ftype, fid) = iprot.readFieldBegin()
2302
      if ftype == TType.STOP:
2303
        break
2304
      if fid == 0:
2305
        if ftype == TType.STRUCT:
2306
          self.success = Cart()
2307
          self.success.read(iprot)
2308
        else:
2309
          iprot.skip(ftype)
2310
      elif fid == 1:
2311
        if ftype == TType.STRUCT:
2312
          self.pex = PromotionException()
2313
          self.pex.read(iprot)
2314
        else:
2315
          iprot.skip(ftype)
2316
      else:
2317
        iprot.skip(ftype)
2318
      iprot.readFieldEnd()
2319
    iprot.readStructEnd()
2320
 
2321
  def write(self, oprot):
2322
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2323
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2324
      return
2325
    oprot.writeStructBegin('applyCoupon_result')
3431 rajveer 2326
    if self.success is not None:
1976 varun.gupt 2327
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
2328
      self.success.write(oprot)
2329
      oprot.writeFieldEnd()
3431 rajveer 2330
    if self.pex is not None:
1976 varun.gupt 2331
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2332
      self.pex.write(oprot)
2333
      oprot.writeFieldEnd()
2334
    oprot.writeFieldStop()
2335
    oprot.writeStructEnd()
2336
 
3431 rajveer 2337
  def validate(self):
2338
    return
2339
 
2340
 
1976 varun.gupt 2341
  def __repr__(self):
2342
    L = ['%s=%r' % (key, value)
2343
      for key, value in self.__dict__.iteritems()]
2344
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2345
 
2346
  def __eq__(self, other):
2347
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2348
 
2349
  def __ne__(self, other):
2350
    return not (self == other)
2351
 
6433 anupam.sin 2352
class applyRechargeCoupon_args:
2353
  """
2354
  Attributes:
2355
   - couponCode
2356
   - totalAmount
2357
   - userId
2358
  """
2359
 
2360
  thrift_spec = (
2361
    None, # 0
2362
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2363
    (2, TType.I64, 'totalAmount', None, None, ), # 2
2364
    (3, TType.I64, 'userId', None, None, ), # 3
2365
  )
2366
 
2367
  def __init__(self, couponCode=None, totalAmount=None, userId=None,):
2368
    self.couponCode = couponCode
2369
    self.totalAmount = totalAmount
2370
    self.userId = userId
2371
 
2372
  def read(self, iprot):
2373
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2374
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2375
      return
2376
    iprot.readStructBegin()
2377
    while True:
2378
      (fname, ftype, fid) = iprot.readFieldBegin()
2379
      if ftype == TType.STOP:
2380
        break
2381
      if fid == 1:
2382
        if ftype == TType.STRING:
2383
          self.couponCode = iprot.readString();
2384
        else:
2385
          iprot.skip(ftype)
2386
      elif fid == 2:
2387
        if ftype == TType.I64:
2388
          self.totalAmount = iprot.readI64();
2389
        else:
2390
          iprot.skip(ftype)
2391
      elif fid == 3:
2392
        if ftype == TType.I64:
2393
          self.userId = iprot.readI64();
2394
        else:
2395
          iprot.skip(ftype)
2396
      else:
2397
        iprot.skip(ftype)
2398
      iprot.readFieldEnd()
2399
    iprot.readStructEnd()
2400
 
2401
  def write(self, oprot):
2402
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2403
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2404
      return
2405
    oprot.writeStructBegin('applyRechargeCoupon_args')
2406
    if self.couponCode is not None:
2407
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
2408
      oprot.writeString(self.couponCode)
2409
      oprot.writeFieldEnd()
2410
    if self.totalAmount is not None:
2411
      oprot.writeFieldBegin('totalAmount', TType.I64, 2)
2412
      oprot.writeI64(self.totalAmount)
2413
      oprot.writeFieldEnd()
2414
    if self.userId is not None:
2415
      oprot.writeFieldBegin('userId', TType.I64, 3)
2416
      oprot.writeI64(self.userId)
2417
      oprot.writeFieldEnd()
2418
    oprot.writeFieldStop()
2419
    oprot.writeStructEnd()
2420
 
2421
  def validate(self):
2422
    return
2423
 
2424
 
2425
  def __repr__(self):
2426
    L = ['%s=%r' % (key, value)
2427
      for key, value in self.__dict__.iteritems()]
2428
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2429
 
2430
  def __eq__(self, other):
2431
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2432
 
2433
  def __ne__(self, other):
2434
    return not (self == other)
2435
 
2436
class applyRechargeCoupon_result:
2437
  """
2438
  Attributes:
2439
   - success
2440
   - pex
2441
  """
2442
 
2443
  thrift_spec = (
2444
    (0, TType.MAP, 'success', (TType.I64,None,TType.STRING,None), None, ), # 0
2445
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2446
  )
2447
 
2448
  def __init__(self, success=None, pex=None,):
2449
    self.success = success
2450
    self.pex = pex
2451
 
2452
  def read(self, iprot):
2453
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2454
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2455
      return
2456
    iprot.readStructBegin()
2457
    while True:
2458
      (fname, ftype, fid) = iprot.readFieldBegin()
2459
      if ftype == TType.STOP:
2460
        break
2461
      if fid == 0:
2462
        if ftype == TType.MAP:
2463
          self.success = {}
2464
          (_ktype29, _vtype30, _size28 ) = iprot.readMapBegin() 
2465
          for _i32 in xrange(_size28):
2466
            _key33 = iprot.readI64();
2467
            _val34 = iprot.readString();
2468
            self.success[_key33] = _val34
2469
          iprot.readMapEnd()
2470
        else:
2471
          iprot.skip(ftype)
2472
      elif fid == 1:
2473
        if ftype == TType.STRUCT:
2474
          self.pex = PromotionException()
2475
          self.pex.read(iprot)
2476
        else:
2477
          iprot.skip(ftype)
2478
      else:
2479
        iprot.skip(ftype)
2480
      iprot.readFieldEnd()
2481
    iprot.readStructEnd()
2482
 
2483
  def write(self, oprot):
2484
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2485
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2486
      return
2487
    oprot.writeStructBegin('applyRechargeCoupon_result')
2488
    if self.success is not None:
2489
      oprot.writeFieldBegin('success', TType.MAP, 0)
2490
      oprot.writeMapBegin(TType.I64, TType.STRING, len(self.success))
2491
      for kiter35,viter36 in self.success.items():
2492
        oprot.writeI64(kiter35)
2493
        oprot.writeString(viter36)
2494
      oprot.writeMapEnd()
2495
      oprot.writeFieldEnd()
2496
    if self.pex is not None:
2497
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2498
      self.pex.write(oprot)
2499
      oprot.writeFieldEnd()
2500
    oprot.writeFieldStop()
2501
    oprot.writeStructEnd()
2502
 
2503
  def validate(self):
2504
    return
2505
 
2506
 
2507
  def __repr__(self):
2508
    L = ['%s=%r' % (key, value)
2509
      for key, value in self.__dict__.iteritems()]
2510
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2511
 
2512
  def __eq__(self, other):
2513
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2514
 
2515
  def __ne__(self, other):
2516
    return not (self == other)
2517
 
1976 varun.gupt 2518
class trackCouponUsage_args:
2519
  """
2520
  Attributes:
2521
   - couponCode
2522
   - transactionId
2523
   - userId
2524
  """
2525
 
2526
  thrift_spec = (
2527
    None, # 0
2528
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2529
    (2, TType.I64, 'transactionId', None, None, ), # 2
2530
    (3, TType.I64, 'userId', None, None, ), # 3
2531
  )
2532
 
2533
  def __init__(self, couponCode=None, transactionId=None, userId=None,):
2534
    self.couponCode = couponCode
2535
    self.transactionId = transactionId
2536
    self.userId = userId
2537
 
2538
  def read(self, iprot):
2539
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2540
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2541
      return
2542
    iprot.readStructBegin()
2543
    while True:
2544
      (fname, ftype, fid) = iprot.readFieldBegin()
2545
      if ftype == TType.STOP:
2546
        break
2547
      if fid == 1:
2548
        if ftype == TType.STRING:
2549
          self.couponCode = iprot.readString();
2550
        else:
2551
          iprot.skip(ftype)
2552
      elif fid == 2:
2553
        if ftype == TType.I64:
2554
          self.transactionId = iprot.readI64();
2555
        else:
2556
          iprot.skip(ftype)
2557
      elif fid == 3:
2558
        if ftype == TType.I64:
2559
          self.userId = iprot.readI64();
2560
        else:
2561
          iprot.skip(ftype)
2562
      else:
2563
        iprot.skip(ftype)
2564
      iprot.readFieldEnd()
2565
    iprot.readStructEnd()
2566
 
2567
  def write(self, oprot):
2568
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2569
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2570
      return
2571
    oprot.writeStructBegin('trackCouponUsage_args')
3431 rajveer 2572
    if self.couponCode is not None:
1976 varun.gupt 2573
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
2574
      oprot.writeString(self.couponCode)
2575
      oprot.writeFieldEnd()
3431 rajveer 2576
    if self.transactionId is not None:
1976 varun.gupt 2577
      oprot.writeFieldBegin('transactionId', TType.I64, 2)
2578
      oprot.writeI64(self.transactionId)
2579
      oprot.writeFieldEnd()
3431 rajveer 2580
    if self.userId is not None:
1976 varun.gupt 2581
      oprot.writeFieldBegin('userId', TType.I64, 3)
2582
      oprot.writeI64(self.userId)
2583
      oprot.writeFieldEnd()
2584
    oprot.writeFieldStop()
2585
    oprot.writeStructEnd()
2586
 
3431 rajveer 2587
  def validate(self):
2588
    return
2589
 
2590
 
1976 varun.gupt 2591
  def __repr__(self):
2592
    L = ['%s=%r' % (key, value)
2593
      for key, value in self.__dict__.iteritems()]
2594
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2595
 
2596
  def __eq__(self, other):
2597
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2598
 
2599
  def __ne__(self, other):
2600
    return not (self == other)
2601
 
2602
class trackCouponUsage_result:
2603
  """
2604
  Attributes:
2605
   - pex
2606
  """
2607
 
2608
  thrift_spec = (
2609
    None, # 0
2610
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2611
  )
2612
 
2613
  def __init__(self, pex=None,):
2614
    self.pex = pex
2615
 
2616
  def read(self, iprot):
2617
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2618
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2619
      return
2620
    iprot.readStructBegin()
2621
    while True:
2622
      (fname, ftype, fid) = iprot.readFieldBegin()
2623
      if ftype == TType.STOP:
2624
        break
2625
      if fid == 1:
2626
        if ftype == TType.STRUCT:
2627
          self.pex = PromotionException()
2628
          self.pex.read(iprot)
2629
        else:
2630
          iprot.skip(ftype)
2631
      else:
2632
        iprot.skip(ftype)
2633
      iprot.readFieldEnd()
2634
    iprot.readStructEnd()
2635
 
2636
  def write(self, oprot):
2637
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2638
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2639
      return
2640
    oprot.writeStructBegin('trackCouponUsage_result')
3431 rajveer 2641
    if self.pex is not None:
1976 varun.gupt 2642
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2643
      self.pex.write(oprot)
2644
      oprot.writeFieldEnd()
2645
    oprot.writeFieldStop()
2646
    oprot.writeStructEnd()
2647
 
3431 rajveer 2648
  def validate(self):
2649
    return
2650
 
2651
 
1976 varun.gupt 2652
  def __repr__(self):
2653
    L = ['%s=%r' % (key, value)
2654
      for key, value in self.__dict__.iteritems()]
2655
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2656
 
2657
  def __eq__(self, other):
2658
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2659
 
2660
  def __ne__(self, other):
2661
    return not (self == other)
2662
 
2663
class getCouponUsageCountByUser_args:
2664
  """
2665
  Attributes:
2666
   - couponCode
2667
   - userId
2668
  """
2669
 
2670
  thrift_spec = (
2671
    None, # 0
2672
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2673
    (2, TType.I64, 'userId', None, None, ), # 2
2674
  )
2675
 
2676
  def __init__(self, couponCode=None, userId=None,):
2677
    self.couponCode = couponCode
2678
    self.userId = userId
2679
 
2680
  def read(self, iprot):
2681
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2682
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2683
      return
2684
    iprot.readStructBegin()
2685
    while True:
2686
      (fname, ftype, fid) = iprot.readFieldBegin()
2687
      if ftype == TType.STOP:
2688
        break
2689
      if fid == 1:
2690
        if ftype == TType.STRING:
2691
          self.couponCode = iprot.readString();
2692
        else:
2693
          iprot.skip(ftype)
2694
      elif fid == 2:
2695
        if ftype == TType.I64:
2696
          self.userId = iprot.readI64();
2697
        else:
2698
          iprot.skip(ftype)
2699
      else:
2700
        iprot.skip(ftype)
2701
      iprot.readFieldEnd()
2702
    iprot.readStructEnd()
2703
 
2704
  def write(self, oprot):
2705
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2706
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2707
      return
2708
    oprot.writeStructBegin('getCouponUsageCountByUser_args')
3431 rajveer 2709
    if self.couponCode is not None:
1976 varun.gupt 2710
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
2711
      oprot.writeString(self.couponCode)
2712
      oprot.writeFieldEnd()
3431 rajveer 2713
    if self.userId is not None:
1976 varun.gupt 2714
      oprot.writeFieldBegin('userId', TType.I64, 2)
2715
      oprot.writeI64(self.userId)
2716
      oprot.writeFieldEnd()
2717
    oprot.writeFieldStop()
2718
    oprot.writeStructEnd()
2719
 
3431 rajveer 2720
  def validate(self):
2721
    return
2722
 
2723
 
1976 varun.gupt 2724
  def __repr__(self):
2725
    L = ['%s=%r' % (key, value)
2726
      for key, value in self.__dict__.iteritems()]
2727
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2728
 
2729
  def __eq__(self, other):
2730
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2731
 
2732
  def __ne__(self, other):
2733
    return not (self == other)
2734
 
2735
class getCouponUsageCountByUser_result:
2736
  """
2737
  Attributes:
2738
   - success
2739
   - pex
2740
  """
2741
 
2742
  thrift_spec = (
2743
    (0, TType.I64, 'success', None, None, ), # 0
2744
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2745
  )
2746
 
2747
  def __init__(self, success=None, pex=None,):
2748
    self.success = success
2749
    self.pex = pex
2750
 
2751
  def read(self, iprot):
2752
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2753
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2754
      return
2755
    iprot.readStructBegin()
2756
    while True:
2757
      (fname, ftype, fid) = iprot.readFieldBegin()
2758
      if ftype == TType.STOP:
2759
        break
2760
      if fid == 0:
2761
        if ftype == TType.I64:
2762
          self.success = iprot.readI64();
2763
        else:
2764
          iprot.skip(ftype)
2765
      elif fid == 1:
2766
        if ftype == TType.STRUCT:
2767
          self.pex = PromotionException()
2768
          self.pex.read(iprot)
2769
        else:
2770
          iprot.skip(ftype)
2771
      else:
2772
        iprot.skip(ftype)
2773
      iprot.readFieldEnd()
2774
    iprot.readStructEnd()
2775
 
2776
  def write(self, oprot):
2777
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2778
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2779
      return
2780
    oprot.writeStructBegin('getCouponUsageCountByUser_result')
3431 rajveer 2781
    if self.success is not None:
1976 varun.gupt 2782
      oprot.writeFieldBegin('success', TType.I64, 0)
2783
      oprot.writeI64(self.success)
2784
      oprot.writeFieldEnd()
3431 rajveer 2785
    if self.pex is not None:
1976 varun.gupt 2786
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2787
      self.pex.write(oprot)
2788
      oprot.writeFieldEnd()
2789
    oprot.writeFieldStop()
2790
    oprot.writeStructEnd()
2791
 
3431 rajveer 2792
  def validate(self):
2793
    return
2794
 
2795
 
1976 varun.gupt 2796
  def __repr__(self):
2797
    L = ['%s=%r' % (key, value)
2798
      for key, value in self.__dict__.iteritems()]
2799
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2800
 
2801
  def __eq__(self, other):
2802
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2803
 
2804
  def __ne__(self, other):
2805
    return not (self == other)
2806
 
6497 amit.gupta 2807
class getActiveCodes_args:
2808
  """
2809
  Attributes:
2810
   - promotionId
2811
  """
1976 varun.gupt 2812
 
3385 varun.gupt 2813
  thrift_spec = (
6497 amit.gupta 2814
    None, # 0
2815
    (1, TType.I64, 'promotionId', None, None, ), # 1
3385 varun.gupt 2816
  )
2817
 
6497 amit.gupta 2818
  def __init__(self, promotionId=None,):
2819
    self.promotionId = promotionId
2820
 
3385 varun.gupt 2821
  def read(self, iprot):
2822
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2823
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2824
      return
2825
    iprot.readStructBegin()
2826
    while True:
2827
      (fname, ftype, fid) = iprot.readFieldBegin()
2828
      if ftype == TType.STOP:
2829
        break
6497 amit.gupta 2830
      if fid == 1:
2831
        if ftype == TType.I64:
2832
          self.promotionId = iprot.readI64();
2833
        else:
2834
          iprot.skip(ftype)
3385 varun.gupt 2835
      else:
2836
        iprot.skip(ftype)
2837
      iprot.readFieldEnd()
2838
    iprot.readStructEnd()
2839
 
2840
  def write(self, oprot):
2841
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2842
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2843
      return
6497 amit.gupta 2844
    oprot.writeStructBegin('getActiveCodes_args')
2845
    if self.promotionId is not None:
2846
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
2847
      oprot.writeI64(self.promotionId)
2848
      oprot.writeFieldEnd()
3385 varun.gupt 2849
    oprot.writeFieldStop()
2850
    oprot.writeStructEnd()
2851
 
3431 rajveer 2852
  def validate(self):
2853
    return
2854
 
2855
 
3385 varun.gupt 2856
  def __repr__(self):
2857
    L = ['%s=%r' % (key, value)
2858
      for key, value in self.__dict__.iteritems()]
2859
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2860
 
2861
  def __eq__(self, other):
2862
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2863
 
2864
  def __ne__(self, other):
2865
    return not (self == other)
2866
 
6497 amit.gupta 2867
class getActiveCodes_result:
3385 varun.gupt 2868
  """
2869
  Attributes:
2870
   - success
2871
   - pex
2872
  """
2873
 
2874
  thrift_spec = (
2875
    (0, TType.LIST, 'success', (TType.STRUCT,(Coupon, Coupon.thrift_spec)), None, ), # 0
2876
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2877
  )
2878
 
2879
  def __init__(self, success=None, pex=None,):
2880
    self.success = success
2881
    self.pex = pex
2882
 
2883
  def read(self, iprot):
2884
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2885
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2886
      return
2887
    iprot.readStructBegin()
2888
    while True:
2889
      (fname, ftype, fid) = iprot.readFieldBegin()
2890
      if ftype == TType.STOP:
2891
        break
2892
      if fid == 0:
2893
        if ftype == TType.LIST:
2894
          self.success = []
6433 anupam.sin 2895
          (_etype40, _size37) = iprot.readListBegin()
2896
          for _i41 in xrange(_size37):
2897
            _elem42 = Coupon()
2898
            _elem42.read(iprot)
2899
            self.success.append(_elem42)
3385 varun.gupt 2900
          iprot.readListEnd()
2901
        else:
2902
          iprot.skip(ftype)
2903
      elif fid == 1:
2904
        if ftype == TType.STRUCT:
2905
          self.pex = PromotionException()
2906
          self.pex.read(iprot)
2907
        else:
2908
          iprot.skip(ftype)
2909
      else:
2910
        iprot.skip(ftype)
2911
      iprot.readFieldEnd()
2912
    iprot.readStructEnd()
2913
 
2914
  def write(self, oprot):
2915
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2916
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2917
      return
6497 amit.gupta 2918
    oprot.writeStructBegin('getActiveCodes_result')
3431 rajveer 2919
    if self.success is not None:
3385 varun.gupt 2920
      oprot.writeFieldBegin('success', TType.LIST, 0)
2921
      oprot.writeListBegin(TType.STRUCT, len(self.success))
6433 anupam.sin 2922
      for iter43 in self.success:
2923
        iter43.write(oprot)
3385 varun.gupt 2924
      oprot.writeListEnd()
2925
      oprot.writeFieldEnd()
3431 rajveer 2926
    if self.pex is not None:
3385 varun.gupt 2927
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2928
      self.pex.write(oprot)
2929
      oprot.writeFieldEnd()
2930
    oprot.writeFieldStop()
2931
    oprot.writeStructEnd()
2932
 
3431 rajveer 2933
  def validate(self):
2934
    return
2935
 
2936
 
3385 varun.gupt 2937
  def __repr__(self):
2938
    L = ['%s=%r' % (key, value)
2939
      for key, value in self.__dict__.iteritems()]
2940
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2941
 
2942
  def __eq__(self, other):
2943
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2944
 
2945
  def __ne__(self, other):
2946
    return not (self == other)
2947
 
6497 amit.gupta 2948
class deleteCoupon_args:
2949
  """
2950
  Attributes:
2951
   - couponCode
2952
  """
2953
 
2954
  thrift_spec = (
2955
    None, # 0
2956
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2957
  )
2958
 
2959
  def __init__(self, couponCode=None,):
2960
    self.couponCode = couponCode
2961
 
2962
  def read(self, iprot):
2963
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2964
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2965
      return
2966
    iprot.readStructBegin()
2967
    while True:
2968
      (fname, ftype, fid) = iprot.readFieldBegin()
2969
      if ftype == TType.STOP:
2970
        break
2971
      if fid == 1:
2972
        if ftype == TType.STRING:
2973
          self.couponCode = iprot.readString();
2974
        else:
2975
          iprot.skip(ftype)
2976
      else:
2977
        iprot.skip(ftype)
2978
      iprot.readFieldEnd()
2979
    iprot.readStructEnd()
2980
 
2981
  def write(self, oprot):
2982
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2983
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2984
      return
2985
    oprot.writeStructBegin('deleteCoupon_args')
2986
    if self.couponCode is not None:
2987
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
2988
      oprot.writeString(self.couponCode)
2989
      oprot.writeFieldEnd()
2990
    oprot.writeFieldStop()
2991
    oprot.writeStructEnd()
2992
 
2993
  def validate(self):
2994
    return
2995
 
2996
 
2997
  def __repr__(self):
2998
    L = ['%s=%r' % (key, value)
2999
      for key, value in self.__dict__.iteritems()]
3000
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3001
 
3002
  def __eq__(self, other):
3003
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3004
 
3005
  def __ne__(self, other):
3006
    return not (self == other)
3007
 
3008
class deleteCoupon_result:
3009
  """
3010
  Attributes:
3011
   - pex
3012
  """
3013
 
3014
  thrift_spec = (
3015
    None, # 0
3016
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3017
  )
3018
 
3019
  def __init__(self, pex=None,):
3020
    self.pex = pex
3021
 
3022
  def read(self, iprot):
3023
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3024
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3025
      return
3026
    iprot.readStructBegin()
3027
    while True:
3028
      (fname, ftype, fid) = iprot.readFieldBegin()
3029
      if ftype == TType.STOP:
3030
        break
3031
      if fid == 1:
3032
        if ftype == TType.STRUCT:
3033
          self.pex = PromotionException()
3034
          self.pex.read(iprot)
3035
        else:
3036
          iprot.skip(ftype)
3037
      else:
3038
        iprot.skip(ftype)
3039
      iprot.readFieldEnd()
3040
    iprot.readStructEnd()
3041
 
3042
  def write(self, oprot):
3043
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3044
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3045
      return
3046
    oprot.writeStructBegin('deleteCoupon_result')
3047
    if self.pex is not None:
3048
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3049
      self.pex.write(oprot)
3050
      oprot.writeFieldEnd()
3051
    oprot.writeFieldStop()
3052
    oprot.writeStructEnd()
3053
 
3054
  def validate(self):
3055
    return
3056
 
3057
 
3058
  def __repr__(self):
3059
    L = ['%s=%r' % (key, value)
3060
      for key, value in self.__dict__.iteritems()]
3061
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3062
 
3063
  def __eq__(self, other):
3064
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3065
 
3066
  def __ne__(self, other):
3067
    return not (self == other)
3068
 
3069
class getActiveCoupons_args:
3070
 
3071
  thrift_spec = (
3072
  )
3073
 
3074
  def read(self, iprot):
3075
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3076
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3077
      return
3078
    iprot.readStructBegin()
3079
    while True:
3080
      (fname, ftype, fid) = iprot.readFieldBegin()
3081
      if ftype == TType.STOP:
3082
        break
3083
      else:
3084
        iprot.skip(ftype)
3085
      iprot.readFieldEnd()
3086
    iprot.readStructEnd()
3087
 
3088
  def write(self, oprot):
3089
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3090
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3091
      return
3092
    oprot.writeStructBegin('getActiveCoupons_args')
3093
    oprot.writeFieldStop()
3094
    oprot.writeStructEnd()
3095
 
3096
  def validate(self):
3097
    return
3098
 
3099
 
3100
  def __repr__(self):
3101
    L = ['%s=%r' % (key, value)
3102
      for key, value in self.__dict__.iteritems()]
3103
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3104
 
3105
  def __eq__(self, other):
3106
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3107
 
3108
  def __ne__(self, other):
3109
    return not (self == other)
3110
 
3111
class getActiveCoupons_result:
3112
  """
3113
  Attributes:
3114
   - success
3115
   - pex
3116
  """
3117
 
3118
  thrift_spec = (
3119
    (0, TType.LIST, 'success', (TType.STRUCT,(Coupon, Coupon.thrift_spec)), None, ), # 0
3120
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3121
  )
3122
 
3123
  def __init__(self, success=None, pex=None,):
3124
    self.success = success
3125
    self.pex = pex
3126
 
3127
  def read(self, iprot):
3128
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3129
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3130
      return
3131
    iprot.readStructBegin()
3132
    while True:
3133
      (fname, ftype, fid) = iprot.readFieldBegin()
3134
      if ftype == TType.STOP:
3135
        break
3136
      if fid == 0:
3137
        if ftype == TType.LIST:
3138
          self.success = []
3139
          (_etype47, _size44) = iprot.readListBegin()
3140
          for _i48 in xrange(_size44):
3141
            _elem49 = Coupon()
3142
            _elem49.read(iprot)
3143
            self.success.append(_elem49)
3144
          iprot.readListEnd()
3145
        else:
3146
          iprot.skip(ftype)
3147
      elif fid == 1:
3148
        if ftype == TType.STRUCT:
3149
          self.pex = PromotionException()
3150
          self.pex.read(iprot)
3151
        else:
3152
          iprot.skip(ftype)
3153
      else:
3154
        iprot.skip(ftype)
3155
      iprot.readFieldEnd()
3156
    iprot.readStructEnd()
3157
 
3158
  def write(self, oprot):
3159
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3160
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3161
      return
3162
    oprot.writeStructBegin('getActiveCoupons_result')
3163
    if self.success is not None:
3164
      oprot.writeFieldBegin('success', TType.LIST, 0)
3165
      oprot.writeListBegin(TType.STRUCT, len(self.success))
3166
      for iter50 in self.success:
3167
        iter50.write(oprot)
3168
      oprot.writeListEnd()
3169
      oprot.writeFieldEnd()
3170
    if self.pex is not None:
3171
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3172
      self.pex.write(oprot)
3173
      oprot.writeFieldEnd()
3174
    oprot.writeFieldStop()
3175
    oprot.writeStructEnd()
3176
 
3177
  def validate(self):
3178
    return
3179
 
3180
 
3181
  def __repr__(self):
3182
    L = ['%s=%r' % (key, value)
3183
      for key, value in self.__dict__.iteritems()]
3184
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3185
 
3186
  def __eq__(self, other):
3187
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3188
 
3189
  def __ne__(self, other):
3190
    return not (self == other)
3191
 
6250 amit.gupta 3192
class createCoupon_args:
3193
  """
3194
  Attributes:
3195
   - promotionId
3196
   - endOn
3197
   - email
3198
   - amount
6356 amit.gupta 3199
   - isCod
6250 amit.gupta 3200
   - usage
3201
  """
3202
 
3203
  thrift_spec = (
3204
    None, # 0
3205
    (1, TType.I64, 'promotionId', None, None, ), # 1
3206
    (2, TType.I64, 'endOn', None, None, ), # 2
3207
    (3, TType.STRING, 'email', None, None, ), # 3
3208
    (4, TType.I64, 'amount', None, None, ), # 4
6356 amit.gupta 3209
    (5, TType.BOOL, 'isCod', None, None, ), # 5
3210
    (6, TType.I64, 'usage', None, None, ), # 6
6250 amit.gupta 3211
  )
3212
 
6356 amit.gupta 3213
  def __init__(self, promotionId=None, endOn=None, email=None, amount=None, isCod=None, usage=None,):
6250 amit.gupta 3214
    self.promotionId = promotionId
3215
    self.endOn = endOn
3216
    self.email = email
3217
    self.amount = amount
6356 amit.gupta 3218
    self.isCod = isCod
6250 amit.gupta 3219
    self.usage = usage
3220
 
3221
  def read(self, iprot):
3222
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3223
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3224
      return
3225
    iprot.readStructBegin()
3226
    while True:
3227
      (fname, ftype, fid) = iprot.readFieldBegin()
3228
      if ftype == TType.STOP:
3229
        break
3230
      if fid == 1:
3231
        if ftype == TType.I64:
3232
          self.promotionId = iprot.readI64();
3233
        else:
3234
          iprot.skip(ftype)
3235
      elif fid == 2:
3236
        if ftype == TType.I64:
3237
          self.endOn = iprot.readI64();
3238
        else:
3239
          iprot.skip(ftype)
3240
      elif fid == 3:
3241
        if ftype == TType.STRING:
3242
          self.email = iprot.readString();
3243
        else:
3244
          iprot.skip(ftype)
3245
      elif fid == 4:
3246
        if ftype == TType.I64:
3247
          self.amount = iprot.readI64();
3248
        else:
3249
          iprot.skip(ftype)
3250
      elif fid == 5:
6356 amit.gupta 3251
        if ftype == TType.BOOL:
3252
          self.isCod = iprot.readBool();
3253
        else:
3254
          iprot.skip(ftype)
3255
      elif fid == 6:
6250 amit.gupta 3256
        if ftype == TType.I64:
3257
          self.usage = iprot.readI64();
3258
        else:
3259
          iprot.skip(ftype)
3260
      else:
3261
        iprot.skip(ftype)
3262
      iprot.readFieldEnd()
3263
    iprot.readStructEnd()
3264
 
3265
  def write(self, oprot):
3266
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3267
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3268
      return
3269
    oprot.writeStructBegin('createCoupon_args')
3270
    if self.promotionId is not None:
3271
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
3272
      oprot.writeI64(self.promotionId)
3273
      oprot.writeFieldEnd()
3274
    if self.endOn is not None:
3275
      oprot.writeFieldBegin('endOn', TType.I64, 2)
3276
      oprot.writeI64(self.endOn)
3277
      oprot.writeFieldEnd()
3278
    if self.email is not None:
3279
      oprot.writeFieldBegin('email', TType.STRING, 3)
3280
      oprot.writeString(self.email)
3281
      oprot.writeFieldEnd()
3282
    if self.amount is not None:
3283
      oprot.writeFieldBegin('amount', TType.I64, 4)
3284
      oprot.writeI64(self.amount)
3285
      oprot.writeFieldEnd()
6356 amit.gupta 3286
    if self.isCod is not None:
3287
      oprot.writeFieldBegin('isCod', TType.BOOL, 5)
3288
      oprot.writeBool(self.isCod)
3289
      oprot.writeFieldEnd()
6250 amit.gupta 3290
    if self.usage is not None:
6356 amit.gupta 3291
      oprot.writeFieldBegin('usage', TType.I64, 6)
6250 amit.gupta 3292
      oprot.writeI64(self.usage)
3293
      oprot.writeFieldEnd()
3294
    oprot.writeFieldStop()
3295
    oprot.writeStructEnd()
3296
 
3297
  def validate(self):
3298
    return
3299
 
3300
 
3301
  def __repr__(self):
3302
    L = ['%s=%r' % (key, value)
3303
      for key, value in self.__dict__.iteritems()]
3304
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3305
 
3306
  def __eq__(self, other):
3307
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3308
 
3309
  def __ne__(self, other):
3310
    return not (self == other)
3311
 
3312
class createCoupon_result:
3313
  """
3314
  Attributes:
3315
   - success
3316
   - pex
3317
  """
3318
 
3319
  thrift_spec = (
3320
    (0, TType.STRING, 'success', None, None, ), # 0
3321
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3322
  )
3323
 
3324
  def __init__(self, success=None, pex=None,):
3325
    self.success = success
3326
    self.pex = pex
3327
 
3328
  def read(self, iprot):
3329
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3330
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3331
      return
3332
    iprot.readStructBegin()
3333
    while True:
3334
      (fname, ftype, fid) = iprot.readFieldBegin()
3335
      if ftype == TType.STOP:
3336
        break
3337
      if fid == 0:
3338
        if ftype == TType.STRING:
3339
          self.success = iprot.readString();
3340
        else:
3341
          iprot.skip(ftype)
3342
      elif fid == 1:
3343
        if ftype == TType.STRUCT:
3344
          self.pex = PromotionException()
3345
          self.pex.read(iprot)
3346
        else:
3347
          iprot.skip(ftype)
3348
      else:
3349
        iprot.skip(ftype)
3350
      iprot.readFieldEnd()
3351
    iprot.readStructEnd()
3352
 
3353
  def write(self, oprot):
3354
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3355
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3356
      return
3357
    oprot.writeStructBegin('createCoupon_result')
3358
    if self.success is not None:
3359
      oprot.writeFieldBegin('success', TType.STRING, 0)
3360
      oprot.writeString(self.success)
3361
      oprot.writeFieldEnd()
3362
    if self.pex is not None:
3363
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3364
      self.pex.write(oprot)
3365
      oprot.writeFieldEnd()
3366
    oprot.writeFieldStop()
3367
    oprot.writeStructEnd()
3368
 
3369
  def validate(self):
3370
    return
3371
 
3372
 
3373
  def __repr__(self):
3374
    L = ['%s=%r' % (key, value)
3375
      for key, value in self.__dict__.iteritems()]
3376
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3377
 
3378
  def __eq__(self, other):
3379
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3380
 
3381
  def __ne__(self, other):
3382
    return not (self == other)
3383
 
3385 varun.gupt 3384
class getSuccessfulPaymentCountForCoupon_args:
3385
  """
3386
  Attributes:
3387
   - couponCode
3388
  """
3389
 
3390
  thrift_spec = (
3391
    None, # 0
3392
    (1, TType.STRING, 'couponCode', None, None, ), # 1
3393
  )
3394
 
3395
  def __init__(self, couponCode=None,):
3396
    self.couponCode = couponCode
3397
 
3398
  def read(self, iprot):
3399
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3400
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3401
      return
3402
    iprot.readStructBegin()
3403
    while True:
3404
      (fname, ftype, fid) = iprot.readFieldBegin()
3405
      if ftype == TType.STOP:
3406
        break
3407
      if fid == 1:
3408
        if ftype == TType.STRING:
3409
          self.couponCode = iprot.readString();
3410
        else:
3411
          iprot.skip(ftype)
3412
      else:
3413
        iprot.skip(ftype)
3414
      iprot.readFieldEnd()
3415
    iprot.readStructEnd()
3416
 
3417
  def write(self, oprot):
3418
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3419
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3420
      return
3421
    oprot.writeStructBegin('getSuccessfulPaymentCountForCoupon_args')
3431 rajveer 3422
    if self.couponCode is not None:
3385 varun.gupt 3423
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
3424
      oprot.writeString(self.couponCode)
3425
      oprot.writeFieldEnd()
3426
    oprot.writeFieldStop()
3427
    oprot.writeStructEnd()
3428
 
3431 rajveer 3429
  def validate(self):
3430
    return
3431
 
3432
 
3385 varun.gupt 3433
  def __repr__(self):
3434
    L = ['%s=%r' % (key, value)
3435
      for key, value in self.__dict__.iteritems()]
3436
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3437
 
3438
  def __eq__(self, other):
3439
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3440
 
3441
  def __ne__(self, other):
3442
    return not (self == other)
3443
 
3444
class getSuccessfulPaymentCountForCoupon_result:
3445
  """
3446
  Attributes:
3447
   - success
3448
   - pex
3449
  """
3450
 
3451
  thrift_spec = (
3452
    (0, TType.I64, 'success', None, None, ), # 0
3453
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3454
  )
3455
 
3456
  def __init__(self, success=None, pex=None,):
3457
    self.success = success
3458
    self.pex = pex
3459
 
3460
  def read(self, iprot):
3461
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3462
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3463
      return
3464
    iprot.readStructBegin()
3465
    while True:
3466
      (fname, ftype, fid) = iprot.readFieldBegin()
3467
      if ftype == TType.STOP:
3468
        break
3469
      if fid == 0:
3470
        if ftype == TType.I64:
3471
          self.success = iprot.readI64();
3472
        else:
3473
          iprot.skip(ftype)
3474
      elif fid == 1:
3475
        if ftype == TType.STRUCT:
3476
          self.pex = PromotionException()
3477
          self.pex.read(iprot)
3478
        else:
3479
          iprot.skip(ftype)
3480
      else:
3481
        iprot.skip(ftype)
3482
      iprot.readFieldEnd()
3483
    iprot.readStructEnd()
3484
 
3485
  def write(self, oprot):
3486
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3487
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3488
      return
3489
    oprot.writeStructBegin('getSuccessfulPaymentCountForCoupon_result')
3431 rajveer 3490
    if self.success is not None:
3385 varun.gupt 3491
      oprot.writeFieldBegin('success', TType.I64, 0)
3492
      oprot.writeI64(self.success)
3493
      oprot.writeFieldEnd()
3431 rajveer 3494
    if self.pex is not None:
3385 varun.gupt 3495
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3496
      self.pex.write(oprot)
3497
      oprot.writeFieldEnd()
3498
    oprot.writeFieldStop()
3499
    oprot.writeStructEnd()
3500
 
3431 rajveer 3501
  def validate(self):
3502
    return
3503
 
3504
 
3385 varun.gupt 3505
  def __repr__(self):
3506
    L = ['%s=%r' % (key, value)
3507
      for key, value in self.__dict__.iteritems()]
3508
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3509
 
3510
  def __eq__(self, other):
3511
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3512
 
3513
  def __ne__(self, other):
3514
    return not (self == other)
3515
 
3516
class getRuleDocString_args:
3517
  """
3518
  Attributes:
3519
   - ruleName
3520
  """
3521
 
3522
  thrift_spec = (
3523
    None, # 0
3524
    (1, TType.STRING, 'ruleName', None, None, ), # 1
3525
  )
3526
 
3527
  def __init__(self, ruleName=None,):
3528
    self.ruleName = ruleName
3529
 
3530
  def read(self, iprot):
3531
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3532
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3533
      return
3534
    iprot.readStructBegin()
3535
    while True:
3536
      (fname, ftype, fid) = iprot.readFieldBegin()
3537
      if ftype == TType.STOP:
3538
        break
3539
      if fid == 1:
3540
        if ftype == TType.STRING:
3541
          self.ruleName = iprot.readString();
3542
        else:
3543
          iprot.skip(ftype)
3544
      else:
3545
        iprot.skip(ftype)
3546
      iprot.readFieldEnd()
3547
    iprot.readStructEnd()
3548
 
3549
  def write(self, oprot):
3550
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3551
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3552
      return
3553
    oprot.writeStructBegin('getRuleDocString_args')
3431 rajveer 3554
    if self.ruleName is not None:
3385 varun.gupt 3555
      oprot.writeFieldBegin('ruleName', TType.STRING, 1)
3556
      oprot.writeString(self.ruleName)
3557
      oprot.writeFieldEnd()
3558
    oprot.writeFieldStop()
3559
    oprot.writeStructEnd()
3560
 
3431 rajveer 3561
  def validate(self):
3562
    return
3563
 
3564
 
3385 varun.gupt 3565
  def __repr__(self):
3566
    L = ['%s=%r' % (key, value)
3567
      for key, value in self.__dict__.iteritems()]
3568
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3569
 
3570
  def __eq__(self, other):
3571
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3572
 
3573
  def __ne__(self, other):
3574
    return not (self == other)
3575
 
3576
class getRuleDocString_result:
3577
  """
3578
  Attributes:
3579
   - success
3580
  """
3581
 
3582
  thrift_spec = (
3583
    (0, TType.STRING, 'success', None, None, ), # 0
3584
  )
3585
 
3586
  def __init__(self, success=None,):
3587
    self.success = success
3588
 
3589
  def read(self, iprot):
3590
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3591
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3592
      return
3593
    iprot.readStructBegin()
3594
    while True:
3595
      (fname, ftype, fid) = iprot.readFieldBegin()
3596
      if ftype == TType.STOP:
3597
        break
3598
      if fid == 0:
3599
        if ftype == TType.STRING:
3600
          self.success = iprot.readString();
3601
        else:
3602
          iprot.skip(ftype)
3603
      else:
3604
        iprot.skip(ftype)
3605
      iprot.readFieldEnd()
3606
    iprot.readStructEnd()
3607
 
3608
  def write(self, oprot):
3609
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3610
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3611
      return
3612
    oprot.writeStructBegin('getRuleDocString_result')
3431 rajveer 3613
    if self.success is not None:
3385 varun.gupt 3614
      oprot.writeFieldBegin('success', TType.STRING, 0)
3615
      oprot.writeString(self.success)
3616
      oprot.writeFieldEnd()
3617
    oprot.writeFieldStop()
3618
    oprot.writeStructEnd()
3619
 
3431 rajveer 3620
  def validate(self):
3621
    return
3622
 
3623
 
3385 varun.gupt 3624
  def __repr__(self):
3625
    L = ['%s=%r' % (key, value)
3626
      for key, value in self.__dict__.iteritems()]
3627
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3628
 
3629
  def __eq__(self, other):
3630
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3631
 
3632
  def __ne__(self, other):
3633
    return not (self == other)
4189 varun.gupt 3634
 
3635
class getItemDiscountMap_args:
3636
  """
3637
  Attributes:
3638
   - itemIds
3639
  """
3640
 
3641
  thrift_spec = (
3642
    None, # 0
3643
    (1, TType.LIST, 'itemIds', (TType.I64,None), None, ), # 1
3644
  )
3645
 
3646
  def __init__(self, itemIds=None,):
3647
    self.itemIds = itemIds
3648
 
3649
  def read(self, iprot):
3650
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3651
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3652
      return
3653
    iprot.readStructBegin()
3654
    while True:
3655
      (fname, ftype, fid) = iprot.readFieldBegin()
3656
      if ftype == TType.STOP:
3657
        break
3658
      if fid == 1:
3659
        if ftype == TType.LIST:
3660
          self.itemIds = []
6497 amit.gupta 3661
          (_etype54, _size51) = iprot.readListBegin()
3662
          for _i55 in xrange(_size51):
3663
            _elem56 = iprot.readI64();
3664
            self.itemIds.append(_elem56)
4189 varun.gupt 3665
          iprot.readListEnd()
3666
        else:
3667
          iprot.skip(ftype)
3668
      else:
3669
        iprot.skip(ftype)
3670
      iprot.readFieldEnd()
3671
    iprot.readStructEnd()
3672
 
3673
  def write(self, oprot):
3674
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3675
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3676
      return
3677
    oprot.writeStructBegin('getItemDiscountMap_args')
3678
    if self.itemIds is not None:
3679
      oprot.writeFieldBegin('itemIds', TType.LIST, 1)
3680
      oprot.writeListBegin(TType.I64, len(self.itemIds))
6497 amit.gupta 3681
      for iter57 in self.itemIds:
3682
        oprot.writeI64(iter57)
4189 varun.gupt 3683
      oprot.writeListEnd()
3684
      oprot.writeFieldEnd()
3685
    oprot.writeFieldStop()
3686
    oprot.writeStructEnd()
3687
 
3688
  def validate(self):
3689
    return
3690
 
3691
 
3692
  def __repr__(self):
3693
    L = ['%s=%r' % (key, value)
3694
      for key, value in self.__dict__.iteritems()]
3695
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3696
 
3697
  def __eq__(self, other):
3698
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3699
 
3700
  def __ne__(self, other):
3701
    return not (self == other)
3702
 
3703
class getItemDiscountMap_result:
3704
  """
3705
  Attributes:
3706
   - success
3707
   - pex
3708
  """
3709
 
3710
  thrift_spec = (
3711
    (0, TType.LIST, 'success', (TType.STRUCT,(ItemCouponDiscount, ItemCouponDiscount.thrift_spec)), None, ), # 0
3712
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3713
  )
3714
 
3715
  def __init__(self, success=None, pex=None,):
3716
    self.success = success
3717
    self.pex = pex
3718
 
3719
  def read(self, iprot):
3720
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3721
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3722
      return
3723
    iprot.readStructBegin()
3724
    while True:
3725
      (fname, ftype, fid) = iprot.readFieldBegin()
3726
      if ftype == TType.STOP:
3727
        break
3728
      if fid == 0:
3729
        if ftype == TType.LIST:
3730
          self.success = []
6497 amit.gupta 3731
          (_etype61, _size58) = iprot.readListBegin()
3732
          for _i62 in xrange(_size58):
3733
            _elem63 = ItemCouponDiscount()
3734
            _elem63.read(iprot)
3735
            self.success.append(_elem63)
4189 varun.gupt 3736
          iprot.readListEnd()
3737
        else:
3738
          iprot.skip(ftype)
3739
      elif fid == 1:
3740
        if ftype == TType.STRUCT:
3741
          self.pex = PromotionException()
3742
          self.pex.read(iprot)
3743
        else:
3744
          iprot.skip(ftype)
3745
      else:
3746
        iprot.skip(ftype)
3747
      iprot.readFieldEnd()
3748
    iprot.readStructEnd()
3749
 
3750
  def write(self, oprot):
3751
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3752
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3753
      return
3754
    oprot.writeStructBegin('getItemDiscountMap_result')
3755
    if self.success is not None:
3756
      oprot.writeFieldBegin('success', TType.LIST, 0)
3757
      oprot.writeListBegin(TType.STRUCT, len(self.success))
6497 amit.gupta 3758
      for iter64 in self.success:
3759
        iter64.write(oprot)
4189 varun.gupt 3760
      oprot.writeListEnd()
3761
      oprot.writeFieldEnd()
3762
    if self.pex is not None:
3763
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3764
      self.pex.write(oprot)
3765
      oprot.writeFieldEnd()
3766
    oprot.writeFieldStop()
3767
    oprot.writeStructEnd()
3768
 
3769
  def validate(self):
3770
    return
3771
 
3772
 
3773
  def __repr__(self):
3774
    L = ['%s=%r' % (key, value)
3775
      for key, value in self.__dict__.iteritems()]
3776
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3777
 
3778
  def __eq__(self, other):
3779
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3780
 
3781
  def __ne__(self, other):
3782
    return not (self == other)
4494 varun.gupt 3783
 
3784
class getDiscountsForEntity_args:
3785
  """
3786
  Attributes:
3787
   - entityId
3788
  """
3789
 
3790
  thrift_spec = (
3791
    None, # 0
3792
    (1, TType.I64, 'entityId', None, None, ), # 1
3793
  )
3794
 
3795
  def __init__(self, entityId=None,):
3796
    self.entityId = entityId
3797
 
3798
  def read(self, iprot):
3799
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3800
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3801
      return
3802
    iprot.readStructBegin()
3803
    while True:
3804
      (fname, ftype, fid) = iprot.readFieldBegin()
3805
      if ftype == TType.STOP:
3806
        break
3807
      if fid == 1:
3808
        if ftype == TType.I64:
3809
          self.entityId = iprot.readI64();
3810
        else:
3811
          iprot.skip(ftype)
3812
      else:
3813
        iprot.skip(ftype)
3814
      iprot.readFieldEnd()
3815
    iprot.readStructEnd()
3816
 
3817
  def write(self, oprot):
3818
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3819
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3820
      return
3821
    oprot.writeStructBegin('getDiscountsForEntity_args')
3822
    if self.entityId is not None:
3823
      oprot.writeFieldBegin('entityId', TType.I64, 1)
3824
      oprot.writeI64(self.entityId)
3825
      oprot.writeFieldEnd()
3826
    oprot.writeFieldStop()
3827
    oprot.writeStructEnd()
3828
 
3829
  def validate(self):
3830
    return
3831
 
3832
 
3833
  def __repr__(self):
3834
    L = ['%s=%r' % (key, value)
3835
      for key, value in self.__dict__.iteritems()]
3836
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3837
 
3838
  def __eq__(self, other):
3839
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3840
 
3841
  def __ne__(self, other):
3842
    return not (self == other)
3843
 
3844
class getDiscountsForEntity_result:
3845
  """
3846
  Attributes:
3847
   - success
3848
  """
3849
 
3850
  thrift_spec = (
3851
    (0, TType.MAP, 'success', (TType.STRING,None,TType.DOUBLE,None), None, ), # 0
3852
  )
3853
 
3854
  def __init__(self, success=None,):
3855
    self.success = success
3856
 
3857
  def read(self, iprot):
3858
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3859
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3860
      return
3861
    iprot.readStructBegin()
3862
    while True:
3863
      (fname, ftype, fid) = iprot.readFieldBegin()
3864
      if ftype == TType.STOP:
3865
        break
3866
      if fid == 0:
3867
        if ftype == TType.MAP:
3868
          self.success = {}
6497 amit.gupta 3869
          (_ktype66, _vtype67, _size65 ) = iprot.readMapBegin() 
3870
          for _i69 in xrange(_size65):
3871
            _key70 = iprot.readString();
3872
            _val71 = iprot.readDouble();
3873
            self.success[_key70] = _val71
4494 varun.gupt 3874
          iprot.readMapEnd()
3875
        else:
3876
          iprot.skip(ftype)
3877
      else:
3878
        iprot.skip(ftype)
3879
      iprot.readFieldEnd()
3880
    iprot.readStructEnd()
3881
 
3882
  def write(self, oprot):
3883
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3884
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3885
      return
3886
    oprot.writeStructBegin('getDiscountsForEntity_result')
3887
    if self.success is not None:
3888
      oprot.writeFieldBegin('success', TType.MAP, 0)
3889
      oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.success))
6497 amit.gupta 3890
      for kiter72,viter73 in self.success.items():
3891
        oprot.writeString(kiter72)
3892
        oprot.writeDouble(viter73)
4494 varun.gupt 3893
      oprot.writeMapEnd()
3894
      oprot.writeFieldEnd()
3895
    oprot.writeFieldStop()
3896
    oprot.writeStructEnd()
3897
 
3898
  def validate(self):
3899
    return
3900
 
3901
 
3902
  def __repr__(self):
3903
    L = ['%s=%r' % (key, value)
3904
      for key, value in self.__dict__.iteritems()]
3905
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3906
 
3907
  def __eq__(self, other):
3908
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3909
 
3910
  def __ne__(self, other):
3911
    return not (self == other)
5469 rajveer 3912
 
3913
class addVoucher_args:
3914
  """
3915
  Attributes:
3916
   - voucher
3917
  """
3918
 
3919
  thrift_spec = (
3920
    None, # 0
3921
    (1, TType.STRUCT, 'voucher', (Voucher, Voucher.thrift_spec), None, ), # 1
3922
  )
3923
 
3924
  def __init__(self, voucher=None,):
3925
    self.voucher = voucher
3926
 
3927
  def read(self, iprot):
3928
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3929
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3930
      return
3931
    iprot.readStructBegin()
3932
    while True:
3933
      (fname, ftype, fid) = iprot.readFieldBegin()
3934
      if ftype == TType.STOP:
3935
        break
3936
      if fid == 1:
3937
        if ftype == TType.STRUCT:
3938
          self.voucher = Voucher()
3939
          self.voucher.read(iprot)
3940
        else:
3941
          iprot.skip(ftype)
3942
      else:
3943
        iprot.skip(ftype)
3944
      iprot.readFieldEnd()
3945
    iprot.readStructEnd()
3946
 
3947
  def write(self, oprot):
3948
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3949
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3950
      return
3951
    oprot.writeStructBegin('addVoucher_args')
3952
    if self.voucher is not None:
3953
      oprot.writeFieldBegin('voucher', TType.STRUCT, 1)
3954
      self.voucher.write(oprot)
3955
      oprot.writeFieldEnd()
3956
    oprot.writeFieldStop()
3957
    oprot.writeStructEnd()
3958
 
3959
  def validate(self):
3960
    return
3961
 
3962
 
3963
  def __repr__(self):
3964
    L = ['%s=%r' % (key, value)
3965
      for key, value in self.__dict__.iteritems()]
3966
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3967
 
3968
  def __eq__(self, other):
3969
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3970
 
3971
  def __ne__(self, other):
3972
    return not (self == other)
3973
 
3974
class addVoucher_result:
3975
 
3976
  thrift_spec = (
3977
  )
3978
 
3979
  def read(self, iprot):
3980
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3981
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3982
      return
3983
    iprot.readStructBegin()
3984
    while True:
3985
      (fname, ftype, fid) = iprot.readFieldBegin()
3986
      if ftype == TType.STOP:
3987
        break
3988
      else:
3989
        iprot.skip(ftype)
3990
      iprot.readFieldEnd()
3991
    iprot.readStructEnd()
3992
 
3993
  def write(self, oprot):
3994
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3995
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3996
      return
3997
    oprot.writeStructBegin('addVoucher_result')
3998
    oprot.writeFieldStop()
3999
    oprot.writeStructEnd()
4000
 
4001
  def validate(self):
4002
    return
4003
 
4004
 
4005
  def __repr__(self):
4006
    L = ['%s=%r' % (key, value)
4007
      for key, value in self.__dict__.iteritems()]
4008
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4009
 
4010
  def __eq__(self, other):
4011
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4012
 
4013
  def __ne__(self, other):
4014
    return not (self == other)
4015
 
4016
class assignVoucher_args:
4017
  """
4018
  Attributes:
4019
   - userId
4020
   - userEmail
4021
   - voucherType
4022
   - amount
4023
  """
4024
 
4025
  thrift_spec = (
4026
    None, # 0
4027
    (1, TType.I64, 'userId', None, None, ), # 1
4028
    (2, TType.STRING, 'userEmail', None, None, ), # 2
4029
    (3, TType.I32, 'voucherType', None, None, ), # 3
4030
    (4, TType.I64, 'amount', None, None, ), # 4
4031
  )
4032
 
4033
  def __init__(self, userId=None, userEmail=None, voucherType=None, amount=None,):
4034
    self.userId = userId
4035
    self.userEmail = userEmail
4036
    self.voucherType = voucherType
4037
    self.amount = amount
4038
 
4039
  def read(self, iprot):
4040
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4041
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4042
      return
4043
    iprot.readStructBegin()
4044
    while True:
4045
      (fname, ftype, fid) = iprot.readFieldBegin()
4046
      if ftype == TType.STOP:
4047
        break
4048
      if fid == 1:
4049
        if ftype == TType.I64:
4050
          self.userId = iprot.readI64();
4051
        else:
4052
          iprot.skip(ftype)
4053
      elif fid == 2:
4054
        if ftype == TType.STRING:
4055
          self.userEmail = iprot.readString();
4056
        else:
4057
          iprot.skip(ftype)
4058
      elif fid == 3:
4059
        if ftype == TType.I32:
4060
          self.voucherType = iprot.readI32();
4061
        else:
4062
          iprot.skip(ftype)
4063
      elif fid == 4:
4064
        if ftype == TType.I64:
4065
          self.amount = iprot.readI64();
4066
        else:
4067
          iprot.skip(ftype)
4068
      else:
4069
        iprot.skip(ftype)
4070
      iprot.readFieldEnd()
4071
    iprot.readStructEnd()
4072
 
4073
  def write(self, oprot):
4074
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4075
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4076
      return
4077
    oprot.writeStructBegin('assignVoucher_args')
4078
    if self.userId is not None:
4079
      oprot.writeFieldBegin('userId', TType.I64, 1)
4080
      oprot.writeI64(self.userId)
4081
      oprot.writeFieldEnd()
4082
    if self.userEmail is not None:
4083
      oprot.writeFieldBegin('userEmail', TType.STRING, 2)
4084
      oprot.writeString(self.userEmail)
4085
      oprot.writeFieldEnd()
4086
    if self.voucherType is not None:
4087
      oprot.writeFieldBegin('voucherType', TType.I32, 3)
4088
      oprot.writeI32(self.voucherType)
4089
      oprot.writeFieldEnd()
4090
    if self.amount is not None:
4091
      oprot.writeFieldBegin('amount', TType.I64, 4)
4092
      oprot.writeI64(self.amount)
4093
      oprot.writeFieldEnd()
4094
    oprot.writeFieldStop()
4095
    oprot.writeStructEnd()
4096
 
4097
  def validate(self):
4098
    return
4099
 
4100
 
4101
  def __repr__(self):
4102
    L = ['%s=%r' % (key, value)
4103
      for key, value in self.__dict__.iteritems()]
4104
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4105
 
4106
  def __eq__(self, other):
4107
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4108
 
4109
  def __ne__(self, other):
4110
    return not (self == other)
4111
 
4112
class assignVoucher_result:
4113
  """
4114
  Attributes:
4115
   - success
4116
  """
4117
 
4118
  thrift_spec = (
4119
    (0, TType.STRUCT, 'success', (Voucher, Voucher.thrift_spec), None, ), # 0
4120
  )
4121
 
4122
  def __init__(self, success=None,):
4123
    self.success = success
4124
 
4125
  def read(self, iprot):
4126
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4127
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4128
      return
4129
    iprot.readStructBegin()
4130
    while True:
4131
      (fname, ftype, fid) = iprot.readFieldBegin()
4132
      if ftype == TType.STOP:
4133
        break
4134
      if fid == 0:
4135
        if ftype == TType.STRUCT:
4136
          self.success = Voucher()
4137
          self.success.read(iprot)
4138
        else:
4139
          iprot.skip(ftype)
4140
      else:
4141
        iprot.skip(ftype)
4142
      iprot.readFieldEnd()
4143
    iprot.readStructEnd()
4144
 
4145
  def write(self, oprot):
4146
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4147
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4148
      return
4149
    oprot.writeStructBegin('assignVoucher_result')
4150
    if self.success is not None:
4151
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
4152
      self.success.write(oprot)
4153
      oprot.writeFieldEnd()
4154
    oprot.writeFieldStop()
4155
    oprot.writeStructEnd()
4156
 
4157
  def validate(self):
4158
    return
4159
 
4160
 
4161
  def __repr__(self):
4162
    L = ['%s=%r' % (key, value)
4163
      for key, value in self.__dict__.iteritems()]
4164
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4165
 
4166
  def __eq__(self, other):
4167
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4168
 
4169
  def __ne__(self, other):
4170
    return not (self == other)
4171
 
4172
class markVoucherAsRedeemed_args:
4173
  """
4174
  Attributes:
4175
   - voucherCode
4176
   - redeemedOn
4177
  """
4178
 
4179
  thrift_spec = (
4180
    None, # 0
4181
    (1, TType.STRING, 'voucherCode', None, None, ), # 1
4182
    (2, TType.I64, 'redeemedOn', None, None, ), # 2
4183
  )
4184
 
4185
  def __init__(self, voucherCode=None, redeemedOn=None,):
4186
    self.voucherCode = voucherCode
4187
    self.redeemedOn = redeemedOn
4188
 
4189
  def read(self, iprot):
4190
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4191
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4192
      return
4193
    iprot.readStructBegin()
4194
    while True:
4195
      (fname, ftype, fid) = iprot.readFieldBegin()
4196
      if ftype == TType.STOP:
4197
        break
4198
      if fid == 1:
4199
        if ftype == TType.STRING:
4200
          self.voucherCode = iprot.readString();
4201
        else:
4202
          iprot.skip(ftype)
4203
      elif fid == 2:
4204
        if ftype == TType.I64:
4205
          self.redeemedOn = iprot.readI64();
4206
        else:
4207
          iprot.skip(ftype)
4208
      else:
4209
        iprot.skip(ftype)
4210
      iprot.readFieldEnd()
4211
    iprot.readStructEnd()
4212
 
4213
  def write(self, oprot):
4214
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4215
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4216
      return
4217
    oprot.writeStructBegin('markVoucherAsRedeemed_args')
4218
    if self.voucherCode is not None:
4219
      oprot.writeFieldBegin('voucherCode', TType.STRING, 1)
4220
      oprot.writeString(self.voucherCode)
4221
      oprot.writeFieldEnd()
4222
    if self.redeemedOn is not None:
4223
      oprot.writeFieldBegin('redeemedOn', TType.I64, 2)
4224
      oprot.writeI64(self.redeemedOn)
4225
      oprot.writeFieldEnd()
4226
    oprot.writeFieldStop()
4227
    oprot.writeStructEnd()
4228
 
4229
  def validate(self):
4230
    return
4231
 
4232
 
4233
  def __repr__(self):
4234
    L = ['%s=%r' % (key, value)
4235
      for key, value in self.__dict__.iteritems()]
4236
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4237
 
4238
  def __eq__(self, other):
4239
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4240
 
4241
  def __ne__(self, other):
4242
    return not (self == other)
4243
 
4244
class markVoucherAsRedeemed_result:
4245
  """
4246
  Attributes:
4247
   - success
4248
  """
4249
 
4250
  thrift_spec = (
4251
    (0, TType.BOOL, 'success', None, None, ), # 0
4252
  )
4253
 
4254
  def __init__(self, success=None,):
4255
    self.success = success
4256
 
4257
  def read(self, iprot):
4258
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4259
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4260
      return
4261
    iprot.readStructBegin()
4262
    while True:
4263
      (fname, ftype, fid) = iprot.readFieldBegin()
4264
      if ftype == TType.STOP:
4265
        break
4266
      if fid == 0:
4267
        if ftype == TType.BOOL:
4268
          self.success = iprot.readBool();
4269
        else:
4270
          iprot.skip(ftype)
4271
      else:
4272
        iprot.skip(ftype)
4273
      iprot.readFieldEnd()
4274
    iprot.readStructEnd()
4275
 
4276
  def write(self, oprot):
4277
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4278
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4279
      return
4280
    oprot.writeStructBegin('markVoucherAsRedeemed_result')
4281
    if self.success is not None:
4282
      oprot.writeFieldBegin('success', TType.BOOL, 0)
4283
      oprot.writeBool(self.success)
4284
      oprot.writeFieldEnd()
4285
    oprot.writeFieldStop()
4286
    oprot.writeStructEnd()
4287
 
4288
  def validate(self):
4289
    return
4290
 
4291
 
4292
  def __repr__(self):
4293
    L = ['%s=%r' % (key, value)
4294
      for key, value in self.__dict__.iteritems()]
4295
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4296
 
4297
  def __eq__(self, other):
4298
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4299
 
4300
  def __ne__(self, other):
4301
    return not (self == other)