Subversion Repositories SmartDukaan

Rev

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