Subversion Repositories SmartDukaan

Rev

Rev 7746 | 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
 
6356 amit.gupta 54
  def isCodApplicable(self, couponCode):
55
    """
56
    Parameters:
57
     - couponCode
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
 
6356 amit.gupta 358
  def isCodApplicable(self, couponCode):
359
    """
360
    Parameters:
361
     - couponCode
362
    """
363
    self.send_isCodApplicable(couponCode)
364
    return self.recv_isCodApplicable()
365
 
366
  def send_isCodApplicable(self, couponCode):
367
    self._oprot.writeMessageBegin('isCodApplicable', TMessageType.CALL, self._seqid)
368
    args = isCodApplicable_args()
369
    args.couponCode = couponCode
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:
1150
      result.success = self._handler.isCodApplicable(args.couponCode)
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:
1983
   - couponCode
1984
  """
1985
 
1986
  thrift_spec = (
1987
    None, # 0
1988
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1989
  )
1990
 
1991
  def __init__(self, couponCode=None,):
1992
    self.couponCode = couponCode
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:
2004
        if ftype == TType.STRING:
2005
          self.couponCode = iprot.readString();
2006
        else:
2007
          iprot.skip(ftype)
2008
      else:
2009
        iprot.skip(ftype)
2010
      iprot.readFieldEnd()
2011
    iprot.readStructEnd()
2012
 
2013
  def write(self, oprot):
2014
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2015
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2016
      return
2017
    oprot.writeStructBegin('isCodApplicable_args')
2018
    if self.couponCode is not None:
2019
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
2020
      oprot.writeString(self.couponCode)
2021
      oprot.writeFieldEnd()
2022
    oprot.writeFieldStop()
2023
    oprot.writeStructEnd()
2024
 
2025
  def validate(self):
2026
    return
2027
 
2028
 
2029
  def __repr__(self):
2030
    L = ['%s=%r' % (key, value)
2031
      for key, value in self.__dict__.iteritems()]
2032
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2033
 
2034
  def __eq__(self, other):
2035
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2036
 
2037
  def __ne__(self, other):
2038
    return not (self == other)
2039
 
2040
class isCodApplicable_result:
2041
  """
2042
  Attributes:
2043
   - success
2044
   - pex
2045
  """
2046
 
2047
  thrift_spec = (
2048
    (0, TType.BOOL, 'success', None, None, ), # 0
2049
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2050
  )
2051
 
2052
  def __init__(self, success=None, pex=None,):
2053
    self.success = success
2054
    self.pex = pex
2055
 
2056
  def read(self, iprot):
2057
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2058
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2059
      return
2060
    iprot.readStructBegin()
2061
    while True:
2062
      (fname, ftype, fid) = iprot.readFieldBegin()
2063
      if ftype == TType.STOP:
2064
        break
2065
      if fid == 0:
2066
        if ftype == TType.BOOL:
2067
          self.success = iprot.readBool();
2068
        else:
2069
          iprot.skip(ftype)
2070
      elif fid == 1:
2071
        if ftype == TType.STRUCT:
2072
          self.pex = PromotionException()
2073
          self.pex.read(iprot)
2074
        else:
2075
          iprot.skip(ftype)
2076
      else:
2077
        iprot.skip(ftype)
2078
      iprot.readFieldEnd()
2079
    iprot.readStructEnd()
2080
 
2081
  def write(self, oprot):
2082
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2083
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2084
      return
2085
    oprot.writeStructBegin('isCodApplicable_result')
2086
    if self.success is not None:
2087
      oprot.writeFieldBegin('success', TType.BOOL, 0)
2088
      oprot.writeBool(self.success)
2089
      oprot.writeFieldEnd()
2090
    if self.pex is not None:
2091
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2092
      self.pex.write(oprot)
2093
      oprot.writeFieldEnd()
2094
    oprot.writeFieldStop()
2095
    oprot.writeStructEnd()
2096
 
2097
  def validate(self):
2098
    return
2099
 
2100
 
2101
  def __repr__(self):
2102
    L = ['%s=%r' % (key, value)
2103
      for key, value in self.__dict__.iteritems()]
2104
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2105
 
2106
  def __eq__(self, other):
2107
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2108
 
2109
  def __ne__(self, other):
2110
    return not (self == other)
2111
 
1976 varun.gupt 2112
class getAllPromotions_args:
2113
 
2114
  thrift_spec = (
2115
  )
2116
 
2117
  def read(self, iprot):
2118
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2119
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2120
      return
2121
    iprot.readStructBegin()
2122
    while True:
2123
      (fname, ftype, fid) = iprot.readFieldBegin()
2124
      if ftype == TType.STOP:
2125
        break
2126
      else:
2127
        iprot.skip(ftype)
2128
      iprot.readFieldEnd()
2129
    iprot.readStructEnd()
2130
 
2131
  def write(self, oprot):
2132
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2133
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2134
      return
2135
    oprot.writeStructBegin('getAllPromotions_args')
2136
    oprot.writeFieldStop()
2137
    oprot.writeStructEnd()
2138
 
3431 rajveer 2139
  def validate(self):
2140
    return
2141
 
2142
 
1976 varun.gupt 2143
  def __repr__(self):
2144
    L = ['%s=%r' % (key, value)
2145
      for key, value in self.__dict__.iteritems()]
2146
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2147
 
2148
  def __eq__(self, other):
2149
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2150
 
2151
  def __ne__(self, other):
2152
    return not (self == other)
2153
 
2154
class getAllPromotions_result:
2155
  """
2156
  Attributes:
2157
   - success
2158
   - pex
2159
  """
2160
 
2161
  thrift_spec = (
2162
    (0, TType.LIST, 'success', (TType.STRUCT,(Promotion, Promotion.thrift_spec)), None, ), # 0
2163
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2164
  )
2165
 
2166
  def __init__(self, success=None, pex=None,):
2167
    self.success = success
2168
    self.pex = pex
2169
 
2170
  def read(self, iprot):
2171
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2172
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2173
      return
2174
    iprot.readStructBegin()
2175
    while True:
2176
      (fname, ftype, fid) = iprot.readFieldBegin()
2177
      if ftype == TType.STOP:
2178
        break
2179
      if fid == 0:
2180
        if ftype == TType.LIST:
2181
          self.success = []
5326 rajveer 2182
          (_etype24, _size21) = iprot.readListBegin()
2183
          for _i25 in xrange(_size21):
2184
            _elem26 = Promotion()
2185
            _elem26.read(iprot)
2186
            self.success.append(_elem26)
1976 varun.gupt 2187
          iprot.readListEnd()
2188
        else:
2189
          iprot.skip(ftype)
2190
      elif fid == 1:
2191
        if ftype == TType.STRUCT:
2192
          self.pex = PromotionException()
2193
          self.pex.read(iprot)
2194
        else:
2195
          iprot.skip(ftype)
2196
      else:
2197
        iprot.skip(ftype)
2198
      iprot.readFieldEnd()
2199
    iprot.readStructEnd()
2200
 
2201
  def write(self, oprot):
2202
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2203
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2204
      return
2205
    oprot.writeStructBegin('getAllPromotions_result')
3431 rajveer 2206
    if self.success is not None:
1976 varun.gupt 2207
      oprot.writeFieldBegin('success', TType.LIST, 0)
2208
      oprot.writeListBegin(TType.STRUCT, len(self.success))
5326 rajveer 2209
      for iter27 in self.success:
2210
        iter27.write(oprot)
1976 varun.gupt 2211
      oprot.writeListEnd()
2212
      oprot.writeFieldEnd()
3431 rajveer 2213
    if self.pex is not None:
1976 varun.gupt 2214
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2215
      self.pex.write(oprot)
2216
      oprot.writeFieldEnd()
2217
    oprot.writeFieldStop()
2218
    oprot.writeStructEnd()
2219
 
3431 rajveer 2220
  def validate(self):
2221
    return
2222
 
2223
 
1976 varun.gupt 2224
  def __repr__(self):
2225
    L = ['%s=%r' % (key, value)
2226
      for key, value in self.__dict__.iteritems()]
2227
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2228
 
2229
  def __eq__(self, other):
2230
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2231
 
2232
  def __ne__(self, other):
2233
    return not (self == other)
2234
 
2235
class getPromotionById_args:
2236
  """
2237
  Attributes:
2238
   - promotionId
2239
  """
2240
 
2241
  thrift_spec = (
2242
    None, # 0
2243
    (1, TType.I64, 'promotionId', None, None, ), # 1
2244
  )
2245
 
2246
  def __init__(self, promotionId=None,):
2247
    self.promotionId = promotionId
2248
 
2249
  def read(self, iprot):
2250
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2251
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2252
      return
2253
    iprot.readStructBegin()
2254
    while True:
2255
      (fname, ftype, fid) = iprot.readFieldBegin()
2256
      if ftype == TType.STOP:
2257
        break
2258
      if fid == 1:
2259
        if ftype == TType.I64:
2260
          self.promotionId = iprot.readI64();
2261
        else:
2262
          iprot.skip(ftype)
2263
      else:
2264
        iprot.skip(ftype)
2265
      iprot.readFieldEnd()
2266
    iprot.readStructEnd()
2267
 
2268
  def write(self, oprot):
2269
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2270
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2271
      return
2272
    oprot.writeStructBegin('getPromotionById_args')
3431 rajveer 2273
    if self.promotionId is not None:
1976 varun.gupt 2274
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
2275
      oprot.writeI64(self.promotionId)
2276
      oprot.writeFieldEnd()
2277
    oprot.writeFieldStop()
2278
    oprot.writeStructEnd()
2279
 
3431 rajveer 2280
  def validate(self):
2281
    return
2282
 
2283
 
1976 varun.gupt 2284
  def __repr__(self):
2285
    L = ['%s=%r' % (key, value)
2286
      for key, value in self.__dict__.iteritems()]
2287
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2288
 
2289
  def __eq__(self, other):
2290
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2291
 
2292
  def __ne__(self, other):
2293
    return not (self == other)
2294
 
2295
class getPromotionById_result:
2296
  """
2297
  Attributes:
2298
   - success
2299
   - pex
2300
  """
2301
 
2302
  thrift_spec = (
2303
    (0, TType.STRUCT, 'success', (Promotion, Promotion.thrift_spec), None, ), # 0
2304
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2305
  )
2306
 
2307
  def __init__(self, success=None, pex=None,):
2308
    self.success = success
2309
    self.pex = pex
2310
 
2311
  def read(self, iprot):
2312
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2313
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2314
      return
2315
    iprot.readStructBegin()
2316
    while True:
2317
      (fname, ftype, fid) = iprot.readFieldBegin()
2318
      if ftype == TType.STOP:
2319
        break
2320
      if fid == 0:
2321
        if ftype == TType.STRUCT:
2322
          self.success = Promotion()
2323
          self.success.read(iprot)
2324
        else:
2325
          iprot.skip(ftype)
2326
      elif fid == 1:
2327
        if ftype == TType.STRUCT:
2328
          self.pex = PromotionException()
2329
          self.pex.read(iprot)
2330
        else:
2331
          iprot.skip(ftype)
2332
      else:
2333
        iprot.skip(ftype)
2334
      iprot.readFieldEnd()
2335
    iprot.readStructEnd()
2336
 
2337
  def write(self, oprot):
2338
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2339
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2340
      return
2341
    oprot.writeStructBegin('getPromotionById_result')
3431 rajveer 2342
    if self.success is not None:
1976 varun.gupt 2343
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
2344
      self.success.write(oprot)
2345
      oprot.writeFieldEnd()
3431 rajveer 2346
    if self.pex is not None:
1976 varun.gupt 2347
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2348
      self.pex.write(oprot)
2349
      oprot.writeFieldEnd()
2350
    oprot.writeFieldStop()
2351
    oprot.writeStructEnd()
2352
 
3431 rajveer 2353
  def validate(self):
2354
    return
2355
 
2356
 
1976 varun.gupt 2357
  def __repr__(self):
2358
    L = ['%s=%r' % (key, value)
2359
      for key, value in self.__dict__.iteritems()]
2360
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2361
 
2362
  def __eq__(self, other):
2363
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2364
 
2365
  def __ne__(self, other):
2366
    return not (self == other)
2367
 
2368
class generateCouponsForPromotion_args:
2369
  """
2370
  Attributes:
2371
   - promotionId
2372
   - couponCode
2373
  """
2374
 
2375
  thrift_spec = (
2376
    None, # 0
2377
    (1, TType.I64, 'promotionId', None, None, ), # 1
2378
    (2, TType.STRING, 'couponCode', None, None, ), # 2
2379
  )
2380
 
2381
  def __init__(self, promotionId=None, couponCode=None,):
2382
    self.promotionId = promotionId
2383
    self.couponCode = couponCode
2384
 
2385
  def read(self, iprot):
2386
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2387
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2388
      return
2389
    iprot.readStructBegin()
2390
    while True:
2391
      (fname, ftype, fid) = iprot.readFieldBegin()
2392
      if ftype == TType.STOP:
2393
        break
2394
      if fid == 1:
2395
        if ftype == TType.I64:
2396
          self.promotionId = iprot.readI64();
2397
        else:
2398
          iprot.skip(ftype)
2399
      elif fid == 2:
2400
        if ftype == TType.STRING:
2401
          self.couponCode = iprot.readString();
2402
        else:
2403
          iprot.skip(ftype)
2404
      else:
2405
        iprot.skip(ftype)
2406
      iprot.readFieldEnd()
2407
    iprot.readStructEnd()
2408
 
2409
  def write(self, oprot):
2410
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2411
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2412
      return
2413
    oprot.writeStructBegin('generateCouponsForPromotion_args')
3431 rajveer 2414
    if self.promotionId is not None:
1976 varun.gupt 2415
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
2416
      oprot.writeI64(self.promotionId)
2417
      oprot.writeFieldEnd()
3431 rajveer 2418
    if self.couponCode is not None:
1976 varun.gupt 2419
      oprot.writeFieldBegin('couponCode', TType.STRING, 2)
2420
      oprot.writeString(self.couponCode)
2421
      oprot.writeFieldEnd()
2422
    oprot.writeFieldStop()
2423
    oprot.writeStructEnd()
2424
 
3431 rajveer 2425
  def validate(self):
2426
    return
2427
 
2428
 
1976 varun.gupt 2429
  def __repr__(self):
2430
    L = ['%s=%r' % (key, value)
2431
      for key, value in self.__dict__.iteritems()]
2432
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2433
 
2434
  def __eq__(self, other):
2435
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2436
 
2437
  def __ne__(self, other):
2438
    return not (self == other)
2439
 
2440
class generateCouponsForPromotion_result:
2441
  """
2442
  Attributes:
2443
   - pex
2444
  """
2445
 
2446
  thrift_spec = (
2447
    None, # 0
2448
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2449
  )
2450
 
2451
  def __init__(self, pex=None,):
2452
    self.pex = pex
2453
 
2454
  def read(self, iprot):
2455
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2456
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2457
      return
2458
    iprot.readStructBegin()
2459
    while True:
2460
      (fname, ftype, fid) = iprot.readFieldBegin()
2461
      if ftype == TType.STOP:
2462
        break
2463
      if fid == 1:
2464
        if ftype == TType.STRUCT:
2465
          self.pex = PromotionException()
2466
          self.pex.read(iprot)
2467
        else:
2468
          iprot.skip(ftype)
2469
      else:
2470
        iprot.skip(ftype)
2471
      iprot.readFieldEnd()
2472
    iprot.readStructEnd()
2473
 
2474
  def write(self, oprot):
2475
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2476
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2477
      return
2478
    oprot.writeStructBegin('generateCouponsForPromotion_result')
3431 rajveer 2479
    if self.pex is not None:
1976 varun.gupt 2480
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2481
      self.pex.write(oprot)
2482
      oprot.writeFieldEnd()
2483
    oprot.writeFieldStop()
2484
    oprot.writeStructEnd()
2485
 
3431 rajveer 2486
  def validate(self):
2487
    return
2488
 
2489
 
1976 varun.gupt 2490
  def __repr__(self):
2491
    L = ['%s=%r' % (key, value)
2492
      for key, value in self.__dict__.iteritems()]
2493
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2494
 
2495
  def __eq__(self, other):
2496
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2497
 
2498
  def __ne__(self, other):
2499
    return not (self == other)
2500
 
2501
class applyCoupon_args:
2502
  """
2503
  Attributes:
2504
   - couponCode
2505
   - cartId
2506
  """
2507
 
2508
  thrift_spec = (
2509
    None, # 0
2510
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2511
    (2, TType.I64, 'cartId', None, None, ), # 2
2512
  )
2513
 
2514
  def __init__(self, couponCode=None, cartId=None,):
2515
    self.couponCode = couponCode
2516
    self.cartId = cartId
2517
 
2518
  def read(self, iprot):
2519
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2520
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2521
      return
2522
    iprot.readStructBegin()
2523
    while True:
2524
      (fname, ftype, fid) = iprot.readFieldBegin()
2525
      if ftype == TType.STOP:
2526
        break
2527
      if fid == 1:
2528
        if ftype == TType.STRING:
2529
          self.couponCode = iprot.readString();
2530
        else:
2531
          iprot.skip(ftype)
2532
      elif fid == 2:
2533
        if ftype == TType.I64:
2534
          self.cartId = iprot.readI64();
2535
        else:
2536
          iprot.skip(ftype)
2537
      else:
2538
        iprot.skip(ftype)
2539
      iprot.readFieldEnd()
2540
    iprot.readStructEnd()
2541
 
2542
  def write(self, oprot):
2543
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2544
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2545
      return
2546
    oprot.writeStructBegin('applyCoupon_args')
3431 rajveer 2547
    if self.couponCode is not None:
1976 varun.gupt 2548
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
2549
      oprot.writeString(self.couponCode)
2550
      oprot.writeFieldEnd()
3431 rajveer 2551
    if self.cartId is not None:
1976 varun.gupt 2552
      oprot.writeFieldBegin('cartId', TType.I64, 2)
2553
      oprot.writeI64(self.cartId)
2554
      oprot.writeFieldEnd()
2555
    oprot.writeFieldStop()
2556
    oprot.writeStructEnd()
2557
 
3431 rajveer 2558
  def validate(self):
2559
    return
2560
 
2561
 
1976 varun.gupt 2562
  def __repr__(self):
2563
    L = ['%s=%r' % (key, value)
2564
      for key, value in self.__dict__.iteritems()]
2565
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2566
 
2567
  def __eq__(self, other):
2568
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2569
 
2570
  def __ne__(self, other):
2571
    return not (self == other)
2572
 
2573
class applyCoupon_result:
2574
  """
2575
  Attributes:
2576
   - success
2577
   - pex
2578
  """
2579
 
2580
  thrift_spec = (
2581
    (0, TType.STRUCT, 'success', (Cart, Cart.thrift_spec), None, ), # 0
2582
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2583
  )
2584
 
2585
  def __init__(self, success=None, pex=None,):
2586
    self.success = success
2587
    self.pex = pex
2588
 
2589
  def read(self, iprot):
2590
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2591
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2592
      return
2593
    iprot.readStructBegin()
2594
    while True:
2595
      (fname, ftype, fid) = iprot.readFieldBegin()
2596
      if ftype == TType.STOP:
2597
        break
2598
      if fid == 0:
2599
        if ftype == TType.STRUCT:
2600
          self.success = Cart()
2601
          self.success.read(iprot)
2602
        else:
2603
          iprot.skip(ftype)
2604
      elif fid == 1:
2605
        if ftype == TType.STRUCT:
2606
          self.pex = PromotionException()
2607
          self.pex.read(iprot)
2608
        else:
2609
          iprot.skip(ftype)
2610
      else:
2611
        iprot.skip(ftype)
2612
      iprot.readFieldEnd()
2613
    iprot.readStructEnd()
2614
 
2615
  def write(self, oprot):
2616
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2617
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2618
      return
2619
    oprot.writeStructBegin('applyCoupon_result')
3431 rajveer 2620
    if self.success is not None:
1976 varun.gupt 2621
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
2622
      self.success.write(oprot)
2623
      oprot.writeFieldEnd()
3431 rajveer 2624
    if self.pex is not None:
1976 varun.gupt 2625
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2626
      self.pex.write(oprot)
2627
      oprot.writeFieldEnd()
2628
    oprot.writeFieldStop()
2629
    oprot.writeStructEnd()
2630
 
3431 rajveer 2631
  def validate(self):
2632
    return
2633
 
2634
 
1976 varun.gupt 2635
  def __repr__(self):
2636
    L = ['%s=%r' % (key, value)
2637
      for key, value in self.__dict__.iteritems()]
2638
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2639
 
2640
  def __eq__(self, other):
2641
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2642
 
2643
  def __ne__(self, other):
2644
    return not (self == other)
2645
 
6736 amit.gupta 2646
class getEmiDiscount_args:
2647
  """
2648
  Attributes:
2649
   - cartId
2650
  """
2651
 
2652
  thrift_spec = (
2653
    None, # 0
2654
    (1, TType.I64, 'cartId', None, None, ), # 1
2655
  )
2656
 
2657
  def __init__(self, cartId=None,):
2658
    self.cartId = cartId
2659
 
2660
  def read(self, iprot):
2661
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2662
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2663
      return
2664
    iprot.readStructBegin()
2665
    while True:
2666
      (fname, ftype, fid) = iprot.readFieldBegin()
2667
      if ftype == TType.STOP:
2668
        break
2669
      if fid == 1:
2670
        if ftype == TType.I64:
2671
          self.cartId = iprot.readI64();
2672
        else:
2673
          iprot.skip(ftype)
2674
      else:
2675
        iprot.skip(ftype)
2676
      iprot.readFieldEnd()
2677
    iprot.readStructEnd()
2678
 
2679
  def write(self, oprot):
2680
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2681
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2682
      return
2683
    oprot.writeStructBegin('getEmiDiscount_args')
2684
    if self.cartId is not None:
2685
      oprot.writeFieldBegin('cartId', TType.I64, 1)
2686
      oprot.writeI64(self.cartId)
2687
      oprot.writeFieldEnd()
2688
    oprot.writeFieldStop()
2689
    oprot.writeStructEnd()
2690
 
2691
  def validate(self):
2692
    return
2693
 
2694
 
2695
  def __repr__(self):
2696
    L = ['%s=%r' % (key, value)
2697
      for key, value in self.__dict__.iteritems()]
2698
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2699
 
2700
  def __eq__(self, other):
2701
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2702
 
2703
  def __ne__(self, other):
2704
    return not (self == other)
2705
 
2706
class getEmiDiscount_result:
2707
  """
2708
  Attributes:
2709
   - success
2710
   - pex
2711
  """
2712
 
2713
  thrift_spec = (
2714
    (0, TType.MAP, 'success', (TType.I64,None,TType.DOUBLE,None), None, ), # 0
2715
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2716
  )
2717
 
2718
  def __init__(self, success=None, pex=None,):
2719
    self.success = success
2720
    self.pex = pex
2721
 
2722
  def read(self, iprot):
2723
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2724
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2725
      return
2726
    iprot.readStructBegin()
2727
    while True:
2728
      (fname, ftype, fid) = iprot.readFieldBegin()
2729
      if ftype == TType.STOP:
2730
        break
2731
      if fid == 0:
2732
        if ftype == TType.MAP:
2733
          self.success = {}
2734
          (_ktype29, _vtype30, _size28 ) = iprot.readMapBegin() 
2735
          for _i32 in xrange(_size28):
2736
            _key33 = iprot.readI64();
2737
            _val34 = iprot.readDouble();
2738
            self.success[_key33] = _val34
2739
          iprot.readMapEnd()
2740
        else:
2741
          iprot.skip(ftype)
2742
      elif fid == 1:
2743
        if ftype == TType.STRUCT:
2744
          self.pex = PromotionException()
2745
          self.pex.read(iprot)
2746
        else:
2747
          iprot.skip(ftype)
2748
      else:
2749
        iprot.skip(ftype)
2750
      iprot.readFieldEnd()
2751
    iprot.readStructEnd()
2752
 
2753
  def write(self, oprot):
2754
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2755
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2756
      return
2757
    oprot.writeStructBegin('getEmiDiscount_result')
2758
    if self.success is not None:
2759
      oprot.writeFieldBegin('success', TType.MAP, 0)
2760
      oprot.writeMapBegin(TType.I64, TType.DOUBLE, len(self.success))
2761
      for kiter35,viter36 in self.success.items():
2762
        oprot.writeI64(kiter35)
2763
        oprot.writeDouble(viter36)
2764
      oprot.writeMapEnd()
2765
      oprot.writeFieldEnd()
2766
    if self.pex is not None:
2767
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2768
      self.pex.write(oprot)
2769
      oprot.writeFieldEnd()
2770
    oprot.writeFieldStop()
2771
    oprot.writeStructEnd()
2772
 
2773
  def validate(self):
2774
    return
2775
 
2776
 
2777
  def __repr__(self):
2778
    L = ['%s=%r' % (key, value)
2779
      for key, value in self.__dict__.iteritems()]
2780
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2781
 
2782
  def __eq__(self, other):
2783
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2784
 
2785
  def __ne__(self, other):
2786
    return not (self == other)
2787
 
6433 anupam.sin 2788
class applyRechargeCoupon_args:
2789
  """
2790
  Attributes:
2791
   - couponCode
2792
   - totalAmount
2793
   - userId
2794
  """
2795
 
2796
  thrift_spec = (
2797
    None, # 0
2798
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2799
    (2, TType.I64, 'totalAmount', None, None, ), # 2
2800
    (3, TType.I64, 'userId', None, None, ), # 3
2801
  )
2802
 
2803
  def __init__(self, couponCode=None, totalAmount=None, userId=None,):
2804
    self.couponCode = couponCode
2805
    self.totalAmount = totalAmount
2806
    self.userId = userId
2807
 
2808
  def read(self, iprot):
2809
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2810
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2811
      return
2812
    iprot.readStructBegin()
2813
    while True:
2814
      (fname, ftype, fid) = iprot.readFieldBegin()
2815
      if ftype == TType.STOP:
2816
        break
2817
      if fid == 1:
2818
        if ftype == TType.STRING:
2819
          self.couponCode = iprot.readString();
2820
        else:
2821
          iprot.skip(ftype)
2822
      elif fid == 2:
2823
        if ftype == TType.I64:
2824
          self.totalAmount = iprot.readI64();
2825
        else:
2826
          iprot.skip(ftype)
2827
      elif fid == 3:
2828
        if ftype == TType.I64:
2829
          self.userId = iprot.readI64();
2830
        else:
2831
          iprot.skip(ftype)
2832
      else:
2833
        iprot.skip(ftype)
2834
      iprot.readFieldEnd()
2835
    iprot.readStructEnd()
2836
 
2837
  def write(self, oprot):
2838
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2839
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2840
      return
2841
    oprot.writeStructBegin('applyRechargeCoupon_args')
2842
    if self.couponCode is not None:
2843
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
2844
      oprot.writeString(self.couponCode)
2845
      oprot.writeFieldEnd()
2846
    if self.totalAmount is not None:
2847
      oprot.writeFieldBegin('totalAmount', TType.I64, 2)
2848
      oprot.writeI64(self.totalAmount)
2849
      oprot.writeFieldEnd()
2850
    if self.userId is not None:
2851
      oprot.writeFieldBegin('userId', TType.I64, 3)
2852
      oprot.writeI64(self.userId)
2853
      oprot.writeFieldEnd()
2854
    oprot.writeFieldStop()
2855
    oprot.writeStructEnd()
2856
 
2857
  def validate(self):
2858
    return
2859
 
2860
 
2861
  def __repr__(self):
2862
    L = ['%s=%r' % (key, value)
2863
      for key, value in self.__dict__.iteritems()]
2864
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2865
 
2866
  def __eq__(self, other):
2867
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2868
 
2869
  def __ne__(self, other):
2870
    return not (self == other)
2871
 
2872
class applyRechargeCoupon_result:
2873
  """
2874
  Attributes:
2875
   - success
2876
   - pex
2877
  """
2878
 
2879
  thrift_spec = (
2880
    (0, TType.MAP, 'success', (TType.I64,None,TType.STRING,None), None, ), # 0
2881
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2882
  )
2883
 
2884
  def __init__(self, success=None, pex=None,):
2885
    self.success = success
2886
    self.pex = pex
2887
 
2888
  def read(self, iprot):
2889
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2890
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2891
      return
2892
    iprot.readStructBegin()
2893
    while True:
2894
      (fname, ftype, fid) = iprot.readFieldBegin()
2895
      if ftype == TType.STOP:
2896
        break
2897
      if fid == 0:
2898
        if ftype == TType.MAP:
2899
          self.success = {}
6736 amit.gupta 2900
          (_ktype38, _vtype39, _size37 ) = iprot.readMapBegin() 
2901
          for _i41 in xrange(_size37):
2902
            _key42 = iprot.readI64();
2903
            _val43 = iprot.readString();
2904
            self.success[_key42] = _val43
6433 anupam.sin 2905
          iprot.readMapEnd()
2906
        else:
2907
          iprot.skip(ftype)
2908
      elif fid == 1:
2909
        if ftype == TType.STRUCT:
2910
          self.pex = PromotionException()
2911
          self.pex.read(iprot)
2912
        else:
2913
          iprot.skip(ftype)
2914
      else:
2915
        iprot.skip(ftype)
2916
      iprot.readFieldEnd()
2917
    iprot.readStructEnd()
2918
 
2919
  def write(self, oprot):
2920
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2921
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2922
      return
2923
    oprot.writeStructBegin('applyRechargeCoupon_result')
2924
    if self.success is not None:
2925
      oprot.writeFieldBegin('success', TType.MAP, 0)
2926
      oprot.writeMapBegin(TType.I64, TType.STRING, len(self.success))
6736 amit.gupta 2927
      for kiter44,viter45 in self.success.items():
2928
        oprot.writeI64(kiter44)
2929
        oprot.writeString(viter45)
6433 anupam.sin 2930
      oprot.writeMapEnd()
2931
      oprot.writeFieldEnd()
2932
    if self.pex is not None:
2933
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2934
      self.pex.write(oprot)
2935
      oprot.writeFieldEnd()
2936
    oprot.writeFieldStop()
2937
    oprot.writeStructEnd()
2938
 
2939
  def validate(self):
2940
    return
2941
 
2942
 
2943
  def __repr__(self):
2944
    L = ['%s=%r' % (key, value)
2945
      for key, value in self.__dict__.iteritems()]
2946
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2947
 
2948
  def __eq__(self, other):
2949
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2950
 
2951
  def __ne__(self, other):
2952
    return not (self == other)
2953
 
1976 varun.gupt 2954
class trackCouponUsage_args:
2955
  """
2956
  Attributes:
2957
   - couponCode
2958
   - transactionId
2959
   - userId
2960
  """
2961
 
2962
  thrift_spec = (
2963
    None, # 0
2964
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2965
    (2, TType.I64, 'transactionId', None, None, ), # 2
2966
    (3, TType.I64, 'userId', None, None, ), # 3
2967
  )
2968
 
2969
  def __init__(self, couponCode=None, transactionId=None, userId=None,):
2970
    self.couponCode = couponCode
2971
    self.transactionId = transactionId
2972
    self.userId = userId
2973
 
2974
  def read(self, iprot):
2975
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2976
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2977
      return
2978
    iprot.readStructBegin()
2979
    while True:
2980
      (fname, ftype, fid) = iprot.readFieldBegin()
2981
      if ftype == TType.STOP:
2982
        break
2983
      if fid == 1:
2984
        if ftype == TType.STRING:
2985
          self.couponCode = iprot.readString();
2986
        else:
2987
          iprot.skip(ftype)
2988
      elif fid == 2:
2989
        if ftype == TType.I64:
2990
          self.transactionId = iprot.readI64();
2991
        else:
2992
          iprot.skip(ftype)
2993
      elif fid == 3:
2994
        if ftype == TType.I64:
2995
          self.userId = iprot.readI64();
2996
        else:
2997
          iprot.skip(ftype)
2998
      else:
2999
        iprot.skip(ftype)
3000
      iprot.readFieldEnd()
3001
    iprot.readStructEnd()
3002
 
3003
  def write(self, oprot):
3004
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3005
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3006
      return
3007
    oprot.writeStructBegin('trackCouponUsage_args')
3431 rajveer 3008
    if self.couponCode is not None:
1976 varun.gupt 3009
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
3010
      oprot.writeString(self.couponCode)
3011
      oprot.writeFieldEnd()
3431 rajveer 3012
    if self.transactionId is not None:
1976 varun.gupt 3013
      oprot.writeFieldBegin('transactionId', TType.I64, 2)
3014
      oprot.writeI64(self.transactionId)
3015
      oprot.writeFieldEnd()
3431 rajveer 3016
    if self.userId is not None:
1976 varun.gupt 3017
      oprot.writeFieldBegin('userId', TType.I64, 3)
3018
      oprot.writeI64(self.userId)
3019
      oprot.writeFieldEnd()
3020
    oprot.writeFieldStop()
3021
    oprot.writeStructEnd()
3022
 
3431 rajveer 3023
  def validate(self):
3024
    return
3025
 
3026
 
1976 varun.gupt 3027
  def __repr__(self):
3028
    L = ['%s=%r' % (key, value)
3029
      for key, value in self.__dict__.iteritems()]
3030
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3031
 
3032
  def __eq__(self, other):
3033
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3034
 
3035
  def __ne__(self, other):
3036
    return not (self == other)
3037
 
3038
class trackCouponUsage_result:
3039
  """
3040
  Attributes:
3041
   - pex
3042
  """
3043
 
3044
  thrift_spec = (
3045
    None, # 0
3046
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3047
  )
3048
 
3049
  def __init__(self, pex=None,):
3050
    self.pex = pex
3051
 
3052
  def read(self, iprot):
3053
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3054
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3055
      return
3056
    iprot.readStructBegin()
3057
    while True:
3058
      (fname, ftype, fid) = iprot.readFieldBegin()
3059
      if ftype == TType.STOP:
3060
        break
3061
      if fid == 1:
3062
        if ftype == TType.STRUCT:
3063
          self.pex = PromotionException()
3064
          self.pex.read(iprot)
3065
        else:
3066
          iprot.skip(ftype)
3067
      else:
3068
        iprot.skip(ftype)
3069
      iprot.readFieldEnd()
3070
    iprot.readStructEnd()
3071
 
3072
  def write(self, oprot):
3073
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3074
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3075
      return
3076
    oprot.writeStructBegin('trackCouponUsage_result')
3431 rajveer 3077
    if self.pex is not None:
1976 varun.gupt 3078
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3079
      self.pex.write(oprot)
3080
      oprot.writeFieldEnd()
3081
    oprot.writeFieldStop()
3082
    oprot.writeStructEnd()
3083
 
3431 rajveer 3084
  def validate(self):
3085
    return
3086
 
3087
 
1976 varun.gupt 3088
  def __repr__(self):
3089
    L = ['%s=%r' % (key, value)
3090
      for key, value in self.__dict__.iteritems()]
3091
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3092
 
3093
  def __eq__(self, other):
3094
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3095
 
3096
  def __ne__(self, other):
3097
    return not (self == other)
3098
 
3099
class getCouponUsageCountByUser_args:
3100
  """
3101
  Attributes:
3102
   - couponCode
3103
   - userId
3104
  """
3105
 
3106
  thrift_spec = (
3107
    None, # 0
3108
    (1, TType.STRING, 'couponCode', None, None, ), # 1
3109
    (2, TType.I64, 'userId', None, None, ), # 2
3110
  )
3111
 
3112
  def __init__(self, couponCode=None, userId=None,):
3113
    self.couponCode = couponCode
3114
    self.userId = userId
3115
 
3116
  def read(self, iprot):
3117
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3118
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3119
      return
3120
    iprot.readStructBegin()
3121
    while True:
3122
      (fname, ftype, fid) = iprot.readFieldBegin()
3123
      if ftype == TType.STOP:
3124
        break
3125
      if fid == 1:
3126
        if ftype == TType.STRING:
3127
          self.couponCode = iprot.readString();
3128
        else:
3129
          iprot.skip(ftype)
3130
      elif fid == 2:
3131
        if ftype == TType.I64:
3132
          self.userId = iprot.readI64();
3133
        else:
3134
          iprot.skip(ftype)
3135
      else:
3136
        iprot.skip(ftype)
3137
      iprot.readFieldEnd()
3138
    iprot.readStructEnd()
3139
 
3140
  def write(self, oprot):
3141
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3142
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3143
      return
3144
    oprot.writeStructBegin('getCouponUsageCountByUser_args')
3431 rajveer 3145
    if self.couponCode is not None:
1976 varun.gupt 3146
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
3147
      oprot.writeString(self.couponCode)
3148
      oprot.writeFieldEnd()
3431 rajveer 3149
    if self.userId is not None:
1976 varun.gupt 3150
      oprot.writeFieldBegin('userId', TType.I64, 2)
3151
      oprot.writeI64(self.userId)
3152
      oprot.writeFieldEnd()
3153
    oprot.writeFieldStop()
3154
    oprot.writeStructEnd()
3155
 
3431 rajveer 3156
  def validate(self):
3157
    return
3158
 
3159
 
1976 varun.gupt 3160
  def __repr__(self):
3161
    L = ['%s=%r' % (key, value)
3162
      for key, value in self.__dict__.iteritems()]
3163
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3164
 
3165
  def __eq__(self, other):
3166
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3167
 
3168
  def __ne__(self, other):
3169
    return not (self == other)
3170
 
3171
class getCouponUsageCountByUser_result:
3172
  """
3173
  Attributes:
3174
   - success
3175
   - pex
3176
  """
3177
 
3178
  thrift_spec = (
3179
    (0, TType.I64, 'success', None, None, ), # 0
3180
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3181
  )
3182
 
3183
  def __init__(self, success=None, pex=None,):
3184
    self.success = success
3185
    self.pex = pex
3186
 
3187
  def read(self, iprot):
3188
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3189
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3190
      return
3191
    iprot.readStructBegin()
3192
    while True:
3193
      (fname, ftype, fid) = iprot.readFieldBegin()
3194
      if ftype == TType.STOP:
3195
        break
3196
      if fid == 0:
3197
        if ftype == TType.I64:
3198
          self.success = iprot.readI64();
3199
        else:
3200
          iprot.skip(ftype)
3201
      elif fid == 1:
3202
        if ftype == TType.STRUCT:
3203
          self.pex = PromotionException()
3204
          self.pex.read(iprot)
3205
        else:
3206
          iprot.skip(ftype)
3207
      else:
3208
        iprot.skip(ftype)
3209
      iprot.readFieldEnd()
3210
    iprot.readStructEnd()
3211
 
3212
  def write(self, oprot):
3213
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3214
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3215
      return
3216
    oprot.writeStructBegin('getCouponUsageCountByUser_result')
3431 rajveer 3217
    if self.success is not None:
1976 varun.gupt 3218
      oprot.writeFieldBegin('success', TType.I64, 0)
3219
      oprot.writeI64(self.success)
3220
      oprot.writeFieldEnd()
3431 rajveer 3221
    if self.pex is not None:
1976 varun.gupt 3222
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3223
      self.pex.write(oprot)
3224
      oprot.writeFieldEnd()
3225
    oprot.writeFieldStop()
3226
    oprot.writeStructEnd()
3227
 
3431 rajveer 3228
  def validate(self):
3229
    return
3230
 
3231
 
1976 varun.gupt 3232
  def __repr__(self):
3233
    L = ['%s=%r' % (key, value)
3234
      for key, value in self.__dict__.iteritems()]
3235
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3236
 
3237
  def __eq__(self, other):
3238
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3239
 
3240
  def __ne__(self, other):
3241
    return not (self == other)
3242
 
6497 amit.gupta 3243
class getActiveCodes_args:
3244
  """
3245
  Attributes:
3246
   - promotionId
3247
  """
1976 varun.gupt 3248
 
3385 varun.gupt 3249
  thrift_spec = (
6497 amit.gupta 3250
    None, # 0
3251
    (1, TType.I64, 'promotionId', None, None, ), # 1
3385 varun.gupt 3252
  )
3253
 
6497 amit.gupta 3254
  def __init__(self, promotionId=None,):
3255
    self.promotionId = promotionId
3256
 
3385 varun.gupt 3257
  def read(self, iprot):
3258
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3259
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3260
      return
3261
    iprot.readStructBegin()
3262
    while True:
3263
      (fname, ftype, fid) = iprot.readFieldBegin()
3264
      if ftype == TType.STOP:
3265
        break
6497 amit.gupta 3266
      if fid == 1:
3267
        if ftype == TType.I64:
3268
          self.promotionId = iprot.readI64();
3269
        else:
3270
          iprot.skip(ftype)
3385 varun.gupt 3271
      else:
3272
        iprot.skip(ftype)
3273
      iprot.readFieldEnd()
3274
    iprot.readStructEnd()
3275
 
3276
  def write(self, oprot):
3277
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3278
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3279
      return
6497 amit.gupta 3280
    oprot.writeStructBegin('getActiveCodes_args')
3281
    if self.promotionId is not None:
3282
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
3283
      oprot.writeI64(self.promotionId)
3284
      oprot.writeFieldEnd()
3385 varun.gupt 3285
    oprot.writeFieldStop()
3286
    oprot.writeStructEnd()
3287
 
3431 rajveer 3288
  def validate(self):
3289
    return
3290
 
3291
 
3385 varun.gupt 3292
  def __repr__(self):
3293
    L = ['%s=%r' % (key, value)
3294
      for key, value in self.__dict__.iteritems()]
3295
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3296
 
3297
  def __eq__(self, other):
3298
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3299
 
3300
  def __ne__(self, other):
3301
    return not (self == other)
3302
 
6497 amit.gupta 3303
class getActiveCodes_result:
3385 varun.gupt 3304
  """
3305
  Attributes:
3306
   - success
3307
   - pex
3308
  """
3309
 
3310
  thrift_spec = (
3311
    (0, TType.LIST, 'success', (TType.STRUCT,(Coupon, Coupon.thrift_spec)), None, ), # 0
3312
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3313
  )
3314
 
3315
  def __init__(self, success=None, pex=None,):
3316
    self.success = success
3317
    self.pex = pex
3318
 
3319
  def read(self, iprot):
3320
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3321
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3322
      return
3323
    iprot.readStructBegin()
3324
    while True:
3325
      (fname, ftype, fid) = iprot.readFieldBegin()
3326
      if ftype == TType.STOP:
3327
        break
3328
      if fid == 0:
3329
        if ftype == TType.LIST:
3330
          self.success = []
6736 amit.gupta 3331
          (_etype49, _size46) = iprot.readListBegin()
3332
          for _i50 in xrange(_size46):
3333
            _elem51 = Coupon()
3334
            _elem51.read(iprot)
3335
            self.success.append(_elem51)
3385 varun.gupt 3336
          iprot.readListEnd()
3337
        else:
3338
          iprot.skip(ftype)
3339
      elif fid == 1:
3340
        if ftype == TType.STRUCT:
3341
          self.pex = PromotionException()
3342
          self.pex.read(iprot)
3343
        else:
3344
          iprot.skip(ftype)
3345
      else:
3346
        iprot.skip(ftype)
3347
      iprot.readFieldEnd()
3348
    iprot.readStructEnd()
3349
 
3350
  def write(self, oprot):
3351
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3352
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3353
      return
6497 amit.gupta 3354
    oprot.writeStructBegin('getActiveCodes_result')
3431 rajveer 3355
    if self.success is not None:
3385 varun.gupt 3356
      oprot.writeFieldBegin('success', TType.LIST, 0)
3357
      oprot.writeListBegin(TType.STRUCT, len(self.success))
6736 amit.gupta 3358
      for iter52 in self.success:
3359
        iter52.write(oprot)
3385 varun.gupt 3360
      oprot.writeListEnd()
3361
      oprot.writeFieldEnd()
3431 rajveer 3362
    if self.pex is not None:
3385 varun.gupt 3363
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3364
      self.pex.write(oprot)
3365
      oprot.writeFieldEnd()
3366
    oprot.writeFieldStop()
3367
    oprot.writeStructEnd()
3368
 
3431 rajveer 3369
  def validate(self):
3370
    return
3371
 
3372
 
3385 varun.gupt 3373
  def __repr__(self):
3374
    L = ['%s=%r' % (key, value)
3375
      for key, value in self.__dict__.iteritems()]
3376
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3377
 
3378
  def __eq__(self, other):
3379
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3380
 
3381
  def __ne__(self, other):
3382
    return not (self == other)
3383
 
6497 amit.gupta 3384
class deleteCoupon_args:
3385
  """
3386
  Attributes:
3387
   - couponCode
3388
  """
3389
 
3390
  thrift_spec = (
3391
    None, # 0
3392
    (1, TType.STRING, 'couponCode', None, None, ), # 1
3393
  )
3394
 
3395
  def __init__(self, couponCode=None,):
3396
    self.couponCode = couponCode
3397
 
3398
  def read(self, iprot):
3399
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3400
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3401
      return
3402
    iprot.readStructBegin()
3403
    while True:
3404
      (fname, ftype, fid) = iprot.readFieldBegin()
3405
      if ftype == TType.STOP:
3406
        break
3407
      if fid == 1:
3408
        if ftype == TType.STRING:
3409
          self.couponCode = iprot.readString();
3410
        else:
3411
          iprot.skip(ftype)
3412
      else:
3413
        iprot.skip(ftype)
3414
      iprot.readFieldEnd()
3415
    iprot.readStructEnd()
3416
 
3417
  def write(self, oprot):
3418
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3419
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3420
      return
3421
    oprot.writeStructBegin('deleteCoupon_args')
3422
    if self.couponCode is not None:
3423
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
3424
      oprot.writeString(self.couponCode)
3425
      oprot.writeFieldEnd()
3426
    oprot.writeFieldStop()
3427
    oprot.writeStructEnd()
3428
 
3429
  def validate(self):
3430
    return
3431
 
3432
 
3433
  def __repr__(self):
3434
    L = ['%s=%r' % (key, value)
3435
      for key, value in self.__dict__.iteritems()]
3436
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3437
 
3438
  def __eq__(self, other):
3439
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3440
 
3441
  def __ne__(self, other):
3442
    return not (self == other)
3443
 
3444
class deleteCoupon_result:
3445
  """
3446
  Attributes:
3447
   - pex
3448
  """
3449
 
3450
  thrift_spec = (
3451
    None, # 0
3452
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3453
  )
3454
 
3455
  def __init__(self, pex=None,):
3456
    self.pex = pex
3457
 
3458
  def read(self, iprot):
3459
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3460
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3461
      return
3462
    iprot.readStructBegin()
3463
    while True:
3464
      (fname, ftype, fid) = iprot.readFieldBegin()
3465
      if ftype == TType.STOP:
3466
        break
3467
      if fid == 1:
3468
        if ftype == TType.STRUCT:
3469
          self.pex = PromotionException()
3470
          self.pex.read(iprot)
3471
        else:
3472
          iprot.skip(ftype)
3473
      else:
3474
        iprot.skip(ftype)
3475
      iprot.readFieldEnd()
3476
    iprot.readStructEnd()
3477
 
3478
  def write(self, oprot):
3479
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3480
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3481
      return
3482
    oprot.writeStructBegin('deleteCoupon_result')
3483
    if self.pex is not None:
3484
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3485
      self.pex.write(oprot)
3486
      oprot.writeFieldEnd()
3487
    oprot.writeFieldStop()
3488
    oprot.writeStructEnd()
3489
 
3490
  def validate(self):
3491
    return
3492
 
3493
 
3494
  def __repr__(self):
3495
    L = ['%s=%r' % (key, value)
3496
      for key, value in self.__dict__.iteritems()]
3497
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3498
 
3499
  def __eq__(self, other):
3500
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3501
 
3502
  def __ne__(self, other):
3503
    return not (self == other)
3504
 
7092 amit.gupta 3505
class getAllCouponsByPromotionId_args:
3506
  """
3507
  Attributes:
3508
   - promotionId
3509
  """
6497 amit.gupta 3510
 
3511
  thrift_spec = (
7092 amit.gupta 3512
    None, # 0
3513
    (1, TType.I64, 'promotionId', None, None, ), # 1
6497 amit.gupta 3514
  )
3515
 
7092 amit.gupta 3516
  def __init__(self, promotionId=None,):
3517
    self.promotionId = promotionId
3518
 
6497 amit.gupta 3519
  def read(self, iprot):
3520
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3521
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3522
      return
3523
    iprot.readStructBegin()
3524
    while True:
3525
      (fname, ftype, fid) = iprot.readFieldBegin()
3526
      if ftype == TType.STOP:
3527
        break
7092 amit.gupta 3528
      if fid == 1:
3529
        if ftype == TType.I64:
3530
          self.promotionId = iprot.readI64();
3531
        else:
3532
          iprot.skip(ftype)
6497 amit.gupta 3533
      else:
3534
        iprot.skip(ftype)
3535
      iprot.readFieldEnd()
3536
    iprot.readStructEnd()
3537
 
3538
  def write(self, oprot):
3539
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3540
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3541
      return
7092 amit.gupta 3542
    oprot.writeStructBegin('getAllCouponsByPromotionId_args')
3543
    if self.promotionId is not None:
3544
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
3545
      oprot.writeI64(self.promotionId)
3546
      oprot.writeFieldEnd()
6497 amit.gupta 3547
    oprot.writeFieldStop()
3548
    oprot.writeStructEnd()
3549
 
3550
  def validate(self):
3551
    return
3552
 
3553
 
3554
  def __repr__(self):
3555
    L = ['%s=%r' % (key, value)
3556
      for key, value in self.__dict__.iteritems()]
3557
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3558
 
3559
  def __eq__(self, other):
3560
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3561
 
3562
  def __ne__(self, other):
3563
    return not (self == other)
3564
 
7092 amit.gupta 3565
class getAllCouponsByPromotionId_result:
6497 amit.gupta 3566
  """
3567
  Attributes:
3568
   - success
3569
   - pex
3570
  """
3571
 
3572
  thrift_spec = (
3573
    (0, TType.LIST, 'success', (TType.STRUCT,(Coupon, Coupon.thrift_spec)), None, ), # 0
3574
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3575
  )
3576
 
3577
  def __init__(self, success=None, pex=None,):
3578
    self.success = success
3579
    self.pex = pex
3580
 
3581
  def read(self, iprot):
3582
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3583
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3584
      return
3585
    iprot.readStructBegin()
3586
    while True:
3587
      (fname, ftype, fid) = iprot.readFieldBegin()
3588
      if ftype == TType.STOP:
3589
        break
3590
      if fid == 0:
3591
        if ftype == TType.LIST:
3592
          self.success = []
6736 amit.gupta 3593
          (_etype56, _size53) = iprot.readListBegin()
3594
          for _i57 in xrange(_size53):
3595
            _elem58 = Coupon()
3596
            _elem58.read(iprot)
3597
            self.success.append(_elem58)
6497 amit.gupta 3598
          iprot.readListEnd()
3599
        else:
3600
          iprot.skip(ftype)
3601
      elif fid == 1:
3602
        if ftype == TType.STRUCT:
3603
          self.pex = PromotionException()
3604
          self.pex.read(iprot)
3605
        else:
3606
          iprot.skip(ftype)
3607
      else:
3608
        iprot.skip(ftype)
3609
      iprot.readFieldEnd()
3610
    iprot.readStructEnd()
3611
 
3612
  def write(self, oprot):
3613
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3614
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3615
      return
7092 amit.gupta 3616
    oprot.writeStructBegin('getAllCouponsByPromotionId_result')
6497 amit.gupta 3617
    if self.success is not None:
3618
      oprot.writeFieldBegin('success', TType.LIST, 0)
3619
      oprot.writeListBegin(TType.STRUCT, len(self.success))
6736 amit.gupta 3620
      for iter59 in self.success:
3621
        iter59.write(oprot)
6497 amit.gupta 3622
      oprot.writeListEnd()
3623
      oprot.writeFieldEnd()
3624
    if self.pex is not None:
3625
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3626
      self.pex.write(oprot)
3627
      oprot.writeFieldEnd()
3628
    oprot.writeFieldStop()
3629
    oprot.writeStructEnd()
3630
 
3631
  def validate(self):
3632
    return
3633
 
3634
 
3635
  def __repr__(self):
3636
    L = ['%s=%r' % (key, value)
3637
      for key, value in self.__dict__.iteritems()]
3638
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3639
 
3640
  def __eq__(self, other):
3641
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3642
 
3643
  def __ne__(self, other):
3644
    return not (self == other)
3645
 
7092 amit.gupta 3646
class getActiveCoupons_args:
3647
 
3648
  thrift_spec = (
3649
  )
3650
 
3651
  def read(self, iprot):
3652
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3653
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3654
      return
3655
    iprot.readStructBegin()
3656
    while True:
3657
      (fname, ftype, fid) = iprot.readFieldBegin()
3658
      if ftype == TType.STOP:
3659
        break
3660
      else:
3661
        iprot.skip(ftype)
3662
      iprot.readFieldEnd()
3663
    iprot.readStructEnd()
3664
 
3665
  def write(self, oprot):
3666
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3667
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3668
      return
3669
    oprot.writeStructBegin('getActiveCoupons_args')
3670
    oprot.writeFieldStop()
3671
    oprot.writeStructEnd()
3672
 
3673
  def validate(self):
3674
    return
3675
 
3676
 
3677
  def __repr__(self):
3678
    L = ['%s=%r' % (key, value)
3679
      for key, value in self.__dict__.iteritems()]
3680
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3681
 
3682
  def __eq__(self, other):
3683
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3684
 
3685
  def __ne__(self, other):
3686
    return not (self == other)
3687
 
3688
class getActiveCoupons_result:
3689
  """
3690
  Attributes:
3691
   - success
3692
   - pex
3693
  """
3694
 
3695
  thrift_spec = (
3696
    (0, TType.LIST, 'success', (TType.STRUCT,(Coupon, Coupon.thrift_spec)), None, ), # 0
3697
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3698
  )
3699
 
3700
  def __init__(self, success=None, pex=None,):
3701
    self.success = success
3702
    self.pex = pex
3703
 
3704
  def read(self, iprot):
3705
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3706
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3707
      return
3708
    iprot.readStructBegin()
3709
    while True:
3710
      (fname, ftype, fid) = iprot.readFieldBegin()
3711
      if ftype == TType.STOP:
3712
        break
3713
      if fid == 0:
3714
        if ftype == TType.LIST:
3715
          self.success = []
3716
          (_etype63, _size60) = iprot.readListBegin()
3717
          for _i64 in xrange(_size60):
3718
            _elem65 = Coupon()
3719
            _elem65.read(iprot)
3720
            self.success.append(_elem65)
3721
          iprot.readListEnd()
3722
        else:
3723
          iprot.skip(ftype)
3724
      elif fid == 1:
3725
        if ftype == TType.STRUCT:
3726
          self.pex = PromotionException()
3727
          self.pex.read(iprot)
3728
        else:
3729
          iprot.skip(ftype)
3730
      else:
3731
        iprot.skip(ftype)
3732
      iprot.readFieldEnd()
3733
    iprot.readStructEnd()
3734
 
3735
  def write(self, oprot):
3736
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3737
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3738
      return
3739
    oprot.writeStructBegin('getActiveCoupons_result')
3740
    if self.success is not None:
3741
      oprot.writeFieldBegin('success', TType.LIST, 0)
3742
      oprot.writeListBegin(TType.STRUCT, len(self.success))
3743
      for iter66 in self.success:
3744
        iter66.write(oprot)
3745
      oprot.writeListEnd()
3746
      oprot.writeFieldEnd()
3747
    if self.pex is not None:
3748
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3749
      self.pex.write(oprot)
3750
      oprot.writeFieldEnd()
3751
    oprot.writeFieldStop()
3752
    oprot.writeStructEnd()
3753
 
3754
  def validate(self):
3755
    return
3756
 
3757
 
3758
  def __repr__(self):
3759
    L = ['%s=%r' % (key, value)
3760
      for key, value in self.__dict__.iteritems()]
3761
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3762
 
3763
  def __eq__(self, other):
3764
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3765
 
3766
  def __ne__(self, other):
3767
    return not (self == other)
3768
 
6250 amit.gupta 3769
class createCoupon_args:
3770
  """
3771
  Attributes:
3772
   - promotionId
8707 manish.sha 3773
   - couponCategory
6730 anupam.sin 3774
   - couponCode
6679 anupam.sin 3775
   - arguments
6356 amit.gupta 3776
   - isCod
6561 amit.gupta 3777
   - prefix
6250 amit.gupta 3778
  """
3779
 
3780
  thrift_spec = (
3781
    None, # 0
3782
    (1, TType.I64, 'promotionId', None, None, ), # 1
8707 manish.sha 3783
    (2, TType.I64, 'couponCategory', None, None, ), # 2
3784
    (3, TType.STRING, 'couponCode', None, None, ), # 3
3785
    (4, TType.STRING, 'arguments', None, None, ), # 4
3786
    (5, TType.BOOL, 'isCod', None, None, ), # 5
3787
    (6, TType.STRING, 'prefix', None, None, ), # 6
6250 amit.gupta 3788
  )
3789
 
8707 manish.sha 3790
  def __init__(self, promotionId=None, couponCategory=None, couponCode=None, arguments=None, isCod=None, prefix=None,):
6250 amit.gupta 3791
    self.promotionId = promotionId
8707 manish.sha 3792
    self.couponCategory = couponCategory
6730 anupam.sin 3793
    self.couponCode = couponCode
6679 anupam.sin 3794
    self.arguments = arguments
6356 amit.gupta 3795
    self.isCod = isCod
6561 amit.gupta 3796
    self.prefix = prefix
6250 amit.gupta 3797
 
3798
  def read(self, iprot):
3799
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3800
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3801
      return
3802
    iprot.readStructBegin()
3803
    while True:
3804
      (fname, ftype, fid) = iprot.readFieldBegin()
3805
      if ftype == TType.STOP:
3806
        break
3807
      if fid == 1:
3808
        if ftype == TType.I64:
3809
          self.promotionId = iprot.readI64();
3810
        else:
3811
          iprot.skip(ftype)
3812
      elif fid == 2:
8707 manish.sha 3813
        if ftype == TType.I64:
3814
          self.couponCategory = iprot.readI64();
3815
        else:
3816
          iprot.skip(ftype)
3817
      elif fid == 3:
6679 anupam.sin 3818
        if ftype == TType.STRING:
6730 anupam.sin 3819
          self.couponCode = iprot.readString();
3820
        else:
3821
          iprot.skip(ftype)
8707 manish.sha 3822
      elif fid == 4:
6730 anupam.sin 3823
        if ftype == TType.STRING:
6679 anupam.sin 3824
          self.arguments = iprot.readString();
6250 amit.gupta 3825
        else:
3826
          iprot.skip(ftype)
8707 manish.sha 3827
      elif fid == 5:
6356 amit.gupta 3828
        if ftype == TType.BOOL:
3829
          self.isCod = iprot.readBool();
3830
        else:
3831
          iprot.skip(ftype)
8707 manish.sha 3832
      elif fid == 6:
6561 amit.gupta 3833
        if ftype == TType.STRING:
3834
          self.prefix = iprot.readString();
3835
        else:
3836
          iprot.skip(ftype)
6250 amit.gupta 3837
      else:
3838
        iprot.skip(ftype)
3839
      iprot.readFieldEnd()
3840
    iprot.readStructEnd()
3841
 
3842
  def write(self, oprot):
3843
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3844
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3845
      return
3846
    oprot.writeStructBegin('createCoupon_args')
3847
    if self.promotionId is not None:
3848
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
3849
      oprot.writeI64(self.promotionId)
3850
      oprot.writeFieldEnd()
8707 manish.sha 3851
    if self.couponCategory is not None:
3852
      oprot.writeFieldBegin('couponCategory', TType.I64, 2)
3853
      oprot.writeI64(self.couponCategory)
3854
      oprot.writeFieldEnd()
6730 anupam.sin 3855
    if self.couponCode is not None:
8707 manish.sha 3856
      oprot.writeFieldBegin('couponCode', TType.STRING, 3)
6730 anupam.sin 3857
      oprot.writeString(self.couponCode)
3858
      oprot.writeFieldEnd()
6679 anupam.sin 3859
    if self.arguments is not None:
8707 manish.sha 3860
      oprot.writeFieldBegin('arguments', TType.STRING, 4)
6679 anupam.sin 3861
      oprot.writeString(self.arguments)
6250 amit.gupta 3862
      oprot.writeFieldEnd()
6356 amit.gupta 3863
    if self.isCod is not None:
8707 manish.sha 3864
      oprot.writeFieldBegin('isCod', TType.BOOL, 5)
6356 amit.gupta 3865
      oprot.writeBool(self.isCod)
3866
      oprot.writeFieldEnd()
6561 amit.gupta 3867
    if self.prefix is not None:
8707 manish.sha 3868
      oprot.writeFieldBegin('prefix', TType.STRING, 6)
6561 amit.gupta 3869
      oprot.writeString(self.prefix)
3870
      oprot.writeFieldEnd()
6250 amit.gupta 3871
    oprot.writeFieldStop()
3872
    oprot.writeStructEnd()
3873
 
3874
  def validate(self):
3875
    return
3876
 
3877
 
3878
  def __repr__(self):
3879
    L = ['%s=%r' % (key, value)
3880
      for key, value in self.__dict__.iteritems()]
3881
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3882
 
3883
  def __eq__(self, other):
3884
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3885
 
3886
  def __ne__(self, other):
3887
    return not (self == other)
3888
 
3889
class createCoupon_result:
3890
  """
3891
  Attributes:
3892
   - success
3893
   - pex
3894
  """
3895
 
3896
  thrift_spec = (
3897
    (0, TType.STRING, 'success', None, None, ), # 0
3898
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
3899
  )
3900
 
3901
  def __init__(self, success=None, pex=None,):
3902
    self.success = success
3903
    self.pex = pex
3904
 
3905
  def read(self, iprot):
3906
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3907
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3908
      return
3909
    iprot.readStructBegin()
3910
    while True:
3911
      (fname, ftype, fid) = iprot.readFieldBegin()
3912
      if ftype == TType.STOP:
3913
        break
3914
      if fid == 0:
3915
        if ftype == TType.STRING:
3916
          self.success = iprot.readString();
3917
        else:
3918
          iprot.skip(ftype)
3919
      elif fid == 1:
3920
        if ftype == TType.STRUCT:
3921
          self.pex = PromotionException()
3922
          self.pex.read(iprot)
3923
        else:
3924
          iprot.skip(ftype)
3925
      else:
3926
        iprot.skip(ftype)
3927
      iprot.readFieldEnd()
3928
    iprot.readStructEnd()
3929
 
3930
  def write(self, oprot):
3931
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3932
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3933
      return
3934
    oprot.writeStructBegin('createCoupon_result')
3935
    if self.success is not None:
3936
      oprot.writeFieldBegin('success', TType.STRING, 0)
3937
      oprot.writeString(self.success)
3938
      oprot.writeFieldEnd()
3939
    if self.pex is not None:
3940
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3941
      self.pex.write(oprot)
3942
      oprot.writeFieldEnd()
3943
    oprot.writeFieldStop()
3944
    oprot.writeStructEnd()
3945
 
3946
  def validate(self):
3947
    return
3948
 
3949
 
3950
  def __repr__(self):
3951
    L = ['%s=%r' % (key, value)
3952
      for key, value in self.__dict__.iteritems()]
3953
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
3954
 
3955
  def __eq__(self, other):
3956
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
3957
 
3958
  def __ne__(self, other):
3959
    return not (self == other)
3960
 
3385 varun.gupt 3961
class getSuccessfulPaymentCountForCoupon_args:
3962
  """
3963
  Attributes:
3964
   - couponCode
3965
  """
3966
 
3967
  thrift_spec = (
3968
    None, # 0
3969
    (1, TType.STRING, 'couponCode', None, None, ), # 1
3970
  )
3971
 
3972
  def __init__(self, couponCode=None,):
3973
    self.couponCode = couponCode
3974
 
3975
  def read(self, iprot):
3976
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3977
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3978
      return
3979
    iprot.readStructBegin()
3980
    while True:
3981
      (fname, ftype, fid) = iprot.readFieldBegin()
3982
      if ftype == TType.STOP:
3983
        break
3984
      if fid == 1:
3985
        if ftype == TType.STRING:
3986
          self.couponCode = iprot.readString();
3987
        else:
3988
          iprot.skip(ftype)
3989
      else:
3990
        iprot.skip(ftype)
3991
      iprot.readFieldEnd()
3992
    iprot.readStructEnd()
3993
 
3994
  def write(self, oprot):
3995
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
3996
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
3997
      return
3998
    oprot.writeStructBegin('getSuccessfulPaymentCountForCoupon_args')
3431 rajveer 3999
    if self.couponCode is not None:
3385 varun.gupt 4000
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
4001
      oprot.writeString(self.couponCode)
4002
      oprot.writeFieldEnd()
4003
    oprot.writeFieldStop()
4004
    oprot.writeStructEnd()
4005
 
3431 rajveer 4006
  def validate(self):
4007
    return
4008
 
4009
 
3385 varun.gupt 4010
  def __repr__(self):
4011
    L = ['%s=%r' % (key, value)
4012
      for key, value in self.__dict__.iteritems()]
4013
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4014
 
4015
  def __eq__(self, other):
4016
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4017
 
4018
  def __ne__(self, other):
4019
    return not (self == other)
4020
 
4021
class getSuccessfulPaymentCountForCoupon_result:
4022
  """
4023
  Attributes:
4024
   - success
4025
   - pex
4026
  """
4027
 
4028
  thrift_spec = (
4029
    (0, TType.I64, 'success', None, None, ), # 0
4030
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
4031
  )
4032
 
4033
  def __init__(self, success=None, pex=None,):
4034
    self.success = success
4035
    self.pex = pex
4036
 
4037
  def read(self, iprot):
4038
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4039
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4040
      return
4041
    iprot.readStructBegin()
4042
    while True:
4043
      (fname, ftype, fid) = iprot.readFieldBegin()
4044
      if ftype == TType.STOP:
4045
        break
4046
      if fid == 0:
4047
        if ftype == TType.I64:
4048
          self.success = iprot.readI64();
4049
        else:
4050
          iprot.skip(ftype)
4051
      elif fid == 1:
4052
        if ftype == TType.STRUCT:
4053
          self.pex = PromotionException()
4054
          self.pex.read(iprot)
4055
        else:
4056
          iprot.skip(ftype)
4057
      else:
4058
        iprot.skip(ftype)
4059
      iprot.readFieldEnd()
4060
    iprot.readStructEnd()
4061
 
4062
  def write(self, oprot):
4063
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4064
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4065
      return
4066
    oprot.writeStructBegin('getSuccessfulPaymentCountForCoupon_result')
3431 rajveer 4067
    if self.success is not None:
3385 varun.gupt 4068
      oprot.writeFieldBegin('success', TType.I64, 0)
4069
      oprot.writeI64(self.success)
4070
      oprot.writeFieldEnd()
3431 rajveer 4071
    if self.pex is not None:
3385 varun.gupt 4072
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
4073
      self.pex.write(oprot)
4074
      oprot.writeFieldEnd()
4075
    oprot.writeFieldStop()
4076
    oprot.writeStructEnd()
4077
 
3431 rajveer 4078
  def validate(self):
4079
    return
4080
 
4081
 
3385 varun.gupt 4082
  def __repr__(self):
4083
    L = ['%s=%r' % (key, value)
4084
      for key, value in self.__dict__.iteritems()]
4085
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4086
 
4087
  def __eq__(self, other):
4088
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4089
 
4090
  def __ne__(self, other):
4091
    return not (self == other)
4092
 
4093
class getRuleDocString_args:
4094
  """
4095
  Attributes:
4096
   - ruleName
4097
  """
4098
 
4099
  thrift_spec = (
4100
    None, # 0
4101
    (1, TType.STRING, 'ruleName', None, None, ), # 1
4102
  )
4103
 
4104
  def __init__(self, ruleName=None,):
4105
    self.ruleName = ruleName
4106
 
4107
  def read(self, iprot):
4108
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4109
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4110
      return
4111
    iprot.readStructBegin()
4112
    while True:
4113
      (fname, ftype, fid) = iprot.readFieldBegin()
4114
      if ftype == TType.STOP:
4115
        break
4116
      if fid == 1:
4117
        if ftype == TType.STRING:
4118
          self.ruleName = iprot.readString();
4119
        else:
4120
          iprot.skip(ftype)
4121
      else:
4122
        iprot.skip(ftype)
4123
      iprot.readFieldEnd()
4124
    iprot.readStructEnd()
4125
 
4126
  def write(self, oprot):
4127
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4128
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4129
      return
4130
    oprot.writeStructBegin('getRuleDocString_args')
3431 rajveer 4131
    if self.ruleName is not None:
3385 varun.gupt 4132
      oprot.writeFieldBegin('ruleName', TType.STRING, 1)
4133
      oprot.writeString(self.ruleName)
4134
      oprot.writeFieldEnd()
4135
    oprot.writeFieldStop()
4136
    oprot.writeStructEnd()
4137
 
3431 rajveer 4138
  def validate(self):
4139
    return
4140
 
4141
 
3385 varun.gupt 4142
  def __repr__(self):
4143
    L = ['%s=%r' % (key, value)
4144
      for key, value in self.__dict__.iteritems()]
4145
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4146
 
4147
  def __eq__(self, other):
4148
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4149
 
4150
  def __ne__(self, other):
4151
    return not (self == other)
4152
 
4153
class getRuleDocString_result:
4154
  """
4155
  Attributes:
4156
   - success
4157
  """
4158
 
4159
  thrift_spec = (
4160
    (0, TType.STRING, 'success', None, None, ), # 0
4161
  )
4162
 
4163
  def __init__(self, success=None,):
4164
    self.success = success
4165
 
4166
  def read(self, iprot):
4167
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4168
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4169
      return
4170
    iprot.readStructBegin()
4171
    while True:
4172
      (fname, ftype, fid) = iprot.readFieldBegin()
4173
      if ftype == TType.STOP:
4174
        break
4175
      if fid == 0:
4176
        if ftype == TType.STRING:
4177
          self.success = iprot.readString();
4178
        else:
4179
          iprot.skip(ftype)
4180
      else:
4181
        iprot.skip(ftype)
4182
      iprot.readFieldEnd()
4183
    iprot.readStructEnd()
4184
 
4185
  def write(self, oprot):
4186
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4187
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4188
      return
4189
    oprot.writeStructBegin('getRuleDocString_result')
3431 rajveer 4190
    if self.success is not None:
3385 varun.gupt 4191
      oprot.writeFieldBegin('success', TType.STRING, 0)
4192
      oprot.writeString(self.success)
4193
      oprot.writeFieldEnd()
4194
    oprot.writeFieldStop()
4195
    oprot.writeStructEnd()
4196
 
3431 rajveer 4197
  def validate(self):
4198
    return
4199
 
4200
 
3385 varun.gupt 4201
  def __repr__(self):
4202
    L = ['%s=%r' % (key, value)
4203
      for key, value in self.__dict__.iteritems()]
4204
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4205
 
4206
  def __eq__(self, other):
4207
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4208
 
4209
  def __ne__(self, other):
4210
    return not (self == other)
4189 varun.gupt 4211
 
4212
class getItemDiscountMap_args:
4213
  """
4214
  Attributes:
4215
   - itemIds
4216
  """
4217
 
4218
  thrift_spec = (
4219
    None, # 0
4220
    (1, TType.LIST, 'itemIds', (TType.I64,None), None, ), # 1
4221
  )
4222
 
4223
  def __init__(self, itemIds=None,):
4224
    self.itemIds = itemIds
4225
 
4226
  def read(self, iprot):
4227
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4228
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4229
      return
4230
    iprot.readStructBegin()
4231
    while True:
4232
      (fname, ftype, fid) = iprot.readFieldBegin()
4233
      if ftype == TType.STOP:
4234
        break
4235
      if fid == 1:
4236
        if ftype == TType.LIST:
4237
          self.itemIds = []
7092 amit.gupta 4238
          (_etype70, _size67) = iprot.readListBegin()
4239
          for _i71 in xrange(_size67):
4240
            _elem72 = iprot.readI64();
4241
            self.itemIds.append(_elem72)
4189 varun.gupt 4242
          iprot.readListEnd()
4243
        else:
4244
          iprot.skip(ftype)
4245
      else:
4246
        iprot.skip(ftype)
4247
      iprot.readFieldEnd()
4248
    iprot.readStructEnd()
4249
 
4250
  def write(self, oprot):
4251
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4252
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4253
      return
4254
    oprot.writeStructBegin('getItemDiscountMap_args')
4255
    if self.itemIds is not None:
4256
      oprot.writeFieldBegin('itemIds', TType.LIST, 1)
4257
      oprot.writeListBegin(TType.I64, len(self.itemIds))
7092 amit.gupta 4258
      for iter73 in self.itemIds:
4259
        oprot.writeI64(iter73)
4189 varun.gupt 4260
      oprot.writeListEnd()
4261
      oprot.writeFieldEnd()
4262
    oprot.writeFieldStop()
4263
    oprot.writeStructEnd()
4264
 
4265
  def validate(self):
4266
    return
4267
 
4268
 
4269
  def __repr__(self):
4270
    L = ['%s=%r' % (key, value)
4271
      for key, value in self.__dict__.iteritems()]
4272
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4273
 
4274
  def __eq__(self, other):
4275
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4276
 
4277
  def __ne__(self, other):
4278
    return not (self == other)
4279
 
4280
class getItemDiscountMap_result:
4281
  """
4282
  Attributes:
4283
   - success
4284
   - pex
4285
  """
4286
 
4287
  thrift_spec = (
4288
    (0, TType.LIST, 'success', (TType.STRUCT,(ItemCouponDiscount, ItemCouponDiscount.thrift_spec)), None, ), # 0
4289
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
4290
  )
4291
 
4292
  def __init__(self, success=None, pex=None,):
4293
    self.success = success
4294
    self.pex = pex
4295
 
4296
  def read(self, iprot):
4297
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4298
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4299
      return
4300
    iprot.readStructBegin()
4301
    while True:
4302
      (fname, ftype, fid) = iprot.readFieldBegin()
4303
      if ftype == TType.STOP:
4304
        break
4305
      if fid == 0:
4306
        if ftype == TType.LIST:
4307
          self.success = []
7092 amit.gupta 4308
          (_etype77, _size74) = iprot.readListBegin()
4309
          for _i78 in xrange(_size74):
4310
            _elem79 = ItemCouponDiscount()
4311
            _elem79.read(iprot)
4312
            self.success.append(_elem79)
4189 varun.gupt 4313
          iprot.readListEnd()
4314
        else:
4315
          iprot.skip(ftype)
4316
      elif fid == 1:
4317
        if ftype == TType.STRUCT:
4318
          self.pex = PromotionException()
4319
          self.pex.read(iprot)
4320
        else:
4321
          iprot.skip(ftype)
4322
      else:
4323
        iprot.skip(ftype)
4324
      iprot.readFieldEnd()
4325
    iprot.readStructEnd()
4326
 
4327
  def write(self, oprot):
4328
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4329
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4330
      return
4331
    oprot.writeStructBegin('getItemDiscountMap_result')
4332
    if self.success is not None:
4333
      oprot.writeFieldBegin('success', TType.LIST, 0)
4334
      oprot.writeListBegin(TType.STRUCT, len(self.success))
7092 amit.gupta 4335
      for iter80 in self.success:
4336
        iter80.write(oprot)
4189 varun.gupt 4337
      oprot.writeListEnd()
4338
      oprot.writeFieldEnd()
4339
    if self.pex is not None:
4340
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
4341
      self.pex.write(oprot)
4342
      oprot.writeFieldEnd()
4343
    oprot.writeFieldStop()
4344
    oprot.writeStructEnd()
4345
 
4346
  def validate(self):
4347
    return
4348
 
4349
 
4350
  def __repr__(self):
4351
    L = ['%s=%r' % (key, value)
4352
      for key, value in self.__dict__.iteritems()]
4353
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4354
 
4355
  def __eq__(self, other):
4356
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4357
 
4358
  def __ne__(self, other):
4359
    return not (self == other)
4494 varun.gupt 4360
 
4361
class getDiscountsForEntity_args:
4362
  """
4363
  Attributes:
4364
   - entityId
4365
  """
4366
 
4367
  thrift_spec = (
4368
    None, # 0
4369
    (1, TType.I64, 'entityId', None, None, ), # 1
4370
  )
4371
 
4372
  def __init__(self, entityId=None,):
4373
    self.entityId = entityId
4374
 
4375
  def read(self, iprot):
4376
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4377
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4378
      return
4379
    iprot.readStructBegin()
4380
    while True:
4381
      (fname, ftype, fid) = iprot.readFieldBegin()
4382
      if ftype == TType.STOP:
4383
        break
4384
      if fid == 1:
4385
        if ftype == TType.I64:
4386
          self.entityId = iprot.readI64();
4387
        else:
4388
          iprot.skip(ftype)
4389
      else:
4390
        iprot.skip(ftype)
4391
      iprot.readFieldEnd()
4392
    iprot.readStructEnd()
4393
 
4394
  def write(self, oprot):
4395
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4396
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4397
      return
4398
    oprot.writeStructBegin('getDiscountsForEntity_args')
4399
    if self.entityId is not None:
4400
      oprot.writeFieldBegin('entityId', TType.I64, 1)
4401
      oprot.writeI64(self.entityId)
4402
      oprot.writeFieldEnd()
4403
    oprot.writeFieldStop()
4404
    oprot.writeStructEnd()
4405
 
4406
  def validate(self):
4407
    return
4408
 
4409
 
4410
  def __repr__(self):
4411
    L = ['%s=%r' % (key, value)
4412
      for key, value in self.__dict__.iteritems()]
4413
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4414
 
4415
  def __eq__(self, other):
4416
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4417
 
4418
  def __ne__(self, other):
4419
    return not (self == other)
4420
 
4421
class getDiscountsForEntity_result:
4422
  """
4423
  Attributes:
4424
   - success
4425
  """
4426
 
4427
  thrift_spec = (
4428
    (0, TType.MAP, 'success', (TType.STRING,None,TType.DOUBLE,None), None, ), # 0
4429
  )
4430
 
4431
  def __init__(self, success=None,):
4432
    self.success = success
4433
 
4434
  def read(self, iprot):
4435
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4436
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4437
      return
4438
    iprot.readStructBegin()
4439
    while True:
4440
      (fname, ftype, fid) = iprot.readFieldBegin()
4441
      if ftype == TType.STOP:
4442
        break
4443
      if fid == 0:
4444
        if ftype == TType.MAP:
4445
          self.success = {}
7092 amit.gupta 4446
          (_ktype82, _vtype83, _size81 ) = iprot.readMapBegin() 
4447
          for _i85 in xrange(_size81):
4448
            _key86 = iprot.readString();
4449
            _val87 = iprot.readDouble();
4450
            self.success[_key86] = _val87
4494 varun.gupt 4451
          iprot.readMapEnd()
4452
        else:
4453
          iprot.skip(ftype)
4454
      else:
4455
        iprot.skip(ftype)
4456
      iprot.readFieldEnd()
4457
    iprot.readStructEnd()
4458
 
4459
  def write(self, oprot):
4460
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4461
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4462
      return
4463
    oprot.writeStructBegin('getDiscountsForEntity_result')
4464
    if self.success is not None:
4465
      oprot.writeFieldBegin('success', TType.MAP, 0)
4466
      oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.success))
7092 amit.gupta 4467
      for kiter88,viter89 in self.success.items():
4468
        oprot.writeString(kiter88)
4469
        oprot.writeDouble(viter89)
4494 varun.gupt 4470
      oprot.writeMapEnd()
4471
      oprot.writeFieldEnd()
4472
    oprot.writeFieldStop()
4473
    oprot.writeStructEnd()
4474
 
4475
  def validate(self):
4476
    return
4477
 
4478
 
4479
  def __repr__(self):
4480
    L = ['%s=%r' % (key, value)
4481
      for key, value in self.__dict__.iteritems()]
4482
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4483
 
4484
  def __eq__(self, other):
4485
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4486
 
4487
  def __ne__(self, other):
4488
    return not (self == other)
5469 rajveer 4489
 
4490
class addVoucher_args:
4491
  """
4492
  Attributes:
4493
   - voucher
4494
  """
4495
 
4496
  thrift_spec = (
4497
    None, # 0
4498
    (1, TType.STRUCT, 'voucher', (Voucher, Voucher.thrift_spec), None, ), # 1
4499
  )
4500
 
4501
  def __init__(self, voucher=None,):
4502
    self.voucher = voucher
4503
 
4504
  def read(self, iprot):
4505
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4506
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4507
      return
4508
    iprot.readStructBegin()
4509
    while True:
4510
      (fname, ftype, fid) = iprot.readFieldBegin()
4511
      if ftype == TType.STOP:
4512
        break
4513
      if fid == 1:
4514
        if ftype == TType.STRUCT:
4515
          self.voucher = Voucher()
4516
          self.voucher.read(iprot)
4517
        else:
4518
          iprot.skip(ftype)
4519
      else:
4520
        iprot.skip(ftype)
4521
      iprot.readFieldEnd()
4522
    iprot.readStructEnd()
4523
 
4524
  def write(self, oprot):
4525
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4526
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4527
      return
4528
    oprot.writeStructBegin('addVoucher_args')
4529
    if self.voucher is not None:
4530
      oprot.writeFieldBegin('voucher', TType.STRUCT, 1)
4531
      self.voucher.write(oprot)
4532
      oprot.writeFieldEnd()
4533
    oprot.writeFieldStop()
4534
    oprot.writeStructEnd()
4535
 
4536
  def validate(self):
4537
    return
4538
 
4539
 
4540
  def __repr__(self):
4541
    L = ['%s=%r' % (key, value)
4542
      for key, value in self.__dict__.iteritems()]
4543
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4544
 
4545
  def __eq__(self, other):
4546
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4547
 
4548
  def __ne__(self, other):
4549
    return not (self == other)
4550
 
4551
class addVoucher_result:
4552
 
4553
  thrift_spec = (
4554
  )
4555
 
4556
  def read(self, iprot):
4557
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4558
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4559
      return
4560
    iprot.readStructBegin()
4561
    while True:
4562
      (fname, ftype, fid) = iprot.readFieldBegin()
4563
      if ftype == TType.STOP:
4564
        break
4565
      else:
4566
        iprot.skip(ftype)
4567
      iprot.readFieldEnd()
4568
    iprot.readStructEnd()
4569
 
4570
  def write(self, oprot):
4571
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4572
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4573
      return
4574
    oprot.writeStructBegin('addVoucher_result')
4575
    oprot.writeFieldStop()
4576
    oprot.writeStructEnd()
4577
 
4578
  def validate(self):
4579
    return
4580
 
4581
 
4582
  def __repr__(self):
4583
    L = ['%s=%r' % (key, value)
4584
      for key, value in self.__dict__.iteritems()]
4585
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4586
 
4587
  def __eq__(self, other):
4588
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4589
 
4590
  def __ne__(self, other):
4591
    return not (self == other)
4592
 
4593
class assignVoucher_args:
4594
  """
4595
  Attributes:
4596
   - userId
4597
   - userEmail
4598
   - voucherType
4599
   - amount
4600
  """
4601
 
4602
  thrift_spec = (
4603
    None, # 0
4604
    (1, TType.I64, 'userId', None, None, ), # 1
4605
    (2, TType.STRING, 'userEmail', None, None, ), # 2
4606
    (3, TType.I32, 'voucherType', None, None, ), # 3
4607
    (4, TType.I64, 'amount', None, None, ), # 4
4608
  )
4609
 
4610
  def __init__(self, userId=None, userEmail=None, voucherType=None, amount=None,):
4611
    self.userId = userId
4612
    self.userEmail = userEmail
4613
    self.voucherType = voucherType
4614
    self.amount = amount
4615
 
4616
  def read(self, iprot):
4617
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4618
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4619
      return
4620
    iprot.readStructBegin()
4621
    while True:
4622
      (fname, ftype, fid) = iprot.readFieldBegin()
4623
      if ftype == TType.STOP:
4624
        break
4625
      if fid == 1:
4626
        if ftype == TType.I64:
4627
          self.userId = iprot.readI64();
4628
        else:
4629
          iprot.skip(ftype)
4630
      elif fid == 2:
4631
        if ftype == TType.STRING:
4632
          self.userEmail = iprot.readString();
4633
        else:
4634
          iprot.skip(ftype)
4635
      elif fid == 3:
4636
        if ftype == TType.I32:
4637
          self.voucherType = iprot.readI32();
4638
        else:
4639
          iprot.skip(ftype)
4640
      elif fid == 4:
4641
        if ftype == TType.I64:
4642
          self.amount = iprot.readI64();
4643
        else:
4644
          iprot.skip(ftype)
4645
      else:
4646
        iprot.skip(ftype)
4647
      iprot.readFieldEnd()
4648
    iprot.readStructEnd()
4649
 
4650
  def write(self, oprot):
4651
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4652
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4653
      return
4654
    oprot.writeStructBegin('assignVoucher_args')
4655
    if self.userId is not None:
4656
      oprot.writeFieldBegin('userId', TType.I64, 1)
4657
      oprot.writeI64(self.userId)
4658
      oprot.writeFieldEnd()
4659
    if self.userEmail is not None:
4660
      oprot.writeFieldBegin('userEmail', TType.STRING, 2)
4661
      oprot.writeString(self.userEmail)
4662
      oprot.writeFieldEnd()
4663
    if self.voucherType is not None:
4664
      oprot.writeFieldBegin('voucherType', TType.I32, 3)
4665
      oprot.writeI32(self.voucherType)
4666
      oprot.writeFieldEnd()
4667
    if self.amount is not None:
4668
      oprot.writeFieldBegin('amount', TType.I64, 4)
4669
      oprot.writeI64(self.amount)
4670
      oprot.writeFieldEnd()
4671
    oprot.writeFieldStop()
4672
    oprot.writeStructEnd()
4673
 
4674
  def validate(self):
4675
    return
4676
 
4677
 
4678
  def __repr__(self):
4679
    L = ['%s=%r' % (key, value)
4680
      for key, value in self.__dict__.iteritems()]
4681
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4682
 
4683
  def __eq__(self, other):
4684
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4685
 
4686
  def __ne__(self, other):
4687
    return not (self == other)
4688
 
4689
class assignVoucher_result:
4690
  """
4691
  Attributes:
4692
   - success
4693
  """
4694
 
4695
  thrift_spec = (
4696
    (0, TType.STRUCT, 'success', (Voucher, Voucher.thrift_spec), None, ), # 0
4697
  )
4698
 
4699
  def __init__(self, success=None,):
4700
    self.success = success
4701
 
4702
  def read(self, iprot):
4703
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4704
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4705
      return
4706
    iprot.readStructBegin()
4707
    while True:
4708
      (fname, ftype, fid) = iprot.readFieldBegin()
4709
      if ftype == TType.STOP:
4710
        break
4711
      if fid == 0:
4712
        if ftype == TType.STRUCT:
4713
          self.success = Voucher()
4714
          self.success.read(iprot)
4715
        else:
4716
          iprot.skip(ftype)
4717
      else:
4718
        iprot.skip(ftype)
4719
      iprot.readFieldEnd()
4720
    iprot.readStructEnd()
4721
 
4722
  def write(self, oprot):
4723
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4724
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4725
      return
4726
    oprot.writeStructBegin('assignVoucher_result')
4727
    if self.success is not None:
4728
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
4729
      self.success.write(oprot)
4730
      oprot.writeFieldEnd()
4731
    oprot.writeFieldStop()
4732
    oprot.writeStructEnd()
4733
 
4734
  def validate(self):
4735
    return
4736
 
4737
 
4738
  def __repr__(self):
4739
    L = ['%s=%r' % (key, value)
4740
      for key, value in self.__dict__.iteritems()]
4741
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4742
 
4743
  def __eq__(self, other):
4744
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4745
 
4746
  def __ne__(self, other):
4747
    return not (self == other)
4748
 
4749
class markVoucherAsRedeemed_args:
4750
  """
4751
  Attributes:
4752
   - voucherCode
4753
   - redeemedOn
4754
  """
4755
 
4756
  thrift_spec = (
4757
    None, # 0
4758
    (1, TType.STRING, 'voucherCode', None, None, ), # 1
4759
    (2, TType.I64, 'redeemedOn', None, None, ), # 2
4760
  )
4761
 
4762
  def __init__(self, voucherCode=None, redeemedOn=None,):
4763
    self.voucherCode = voucherCode
4764
    self.redeemedOn = redeemedOn
4765
 
4766
  def read(self, iprot):
4767
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4768
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4769
      return
4770
    iprot.readStructBegin()
4771
    while True:
4772
      (fname, ftype, fid) = iprot.readFieldBegin()
4773
      if ftype == TType.STOP:
4774
        break
4775
      if fid == 1:
4776
        if ftype == TType.STRING:
4777
          self.voucherCode = iprot.readString();
4778
        else:
4779
          iprot.skip(ftype)
4780
      elif fid == 2:
4781
        if ftype == TType.I64:
4782
          self.redeemedOn = iprot.readI64();
4783
        else:
4784
          iprot.skip(ftype)
4785
      else:
4786
        iprot.skip(ftype)
4787
      iprot.readFieldEnd()
4788
    iprot.readStructEnd()
4789
 
4790
  def write(self, oprot):
4791
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4792
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4793
      return
4794
    oprot.writeStructBegin('markVoucherAsRedeemed_args')
4795
    if self.voucherCode is not None:
4796
      oprot.writeFieldBegin('voucherCode', TType.STRING, 1)
4797
      oprot.writeString(self.voucherCode)
4798
      oprot.writeFieldEnd()
4799
    if self.redeemedOn is not None:
4800
      oprot.writeFieldBegin('redeemedOn', TType.I64, 2)
4801
      oprot.writeI64(self.redeemedOn)
4802
      oprot.writeFieldEnd()
4803
    oprot.writeFieldStop()
4804
    oprot.writeStructEnd()
4805
 
4806
  def validate(self):
4807
    return
4808
 
4809
 
4810
  def __repr__(self):
4811
    L = ['%s=%r' % (key, value)
4812
      for key, value in self.__dict__.iteritems()]
4813
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4814
 
4815
  def __eq__(self, other):
4816
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4817
 
4818
  def __ne__(self, other):
4819
    return not (self == other)
4820
 
4821
class markVoucherAsRedeemed_result:
4822
  """
4823
  Attributes:
4824
   - success
4825
  """
4826
 
4827
  thrift_spec = (
4828
    (0, TType.BOOL, 'success', None, None, ), # 0
4829
  )
4830
 
4831
  def __init__(self, success=None,):
4832
    self.success = success
4833
 
4834
  def read(self, iprot):
4835
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
4836
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
4837
      return
4838
    iprot.readStructBegin()
4839
    while True:
4840
      (fname, ftype, fid) = iprot.readFieldBegin()
4841
      if ftype == TType.STOP:
4842
        break
4843
      if fid == 0:
4844
        if ftype == TType.BOOL:
4845
          self.success = iprot.readBool();
4846
        else:
4847
          iprot.skip(ftype)
4848
      else:
4849
        iprot.skip(ftype)
4850
      iprot.readFieldEnd()
4851
    iprot.readStructEnd()
4852
 
4853
  def write(self, oprot):
4854
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4855
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4856
      return
4857
    oprot.writeStructBegin('markVoucherAsRedeemed_result')
4858
    if self.success is not None:
4859
      oprot.writeFieldBegin('success', TType.BOOL, 0)
4860
      oprot.writeBool(self.success)
4861
      oprot.writeFieldEnd()
4862
    oprot.writeFieldStop()
4863
    oprot.writeStructEnd()
4864
 
4865
  def validate(self):
4866
    return
4867
 
4868
 
4869
  def __repr__(self):
4870
    L = ['%s=%r' % (key, value)
4871
      for key, value in self.__dict__.iteritems()]
4872
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
4873
 
4874
  def __eq__(self, other):
4875
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4876
 
4877
  def __ne__(self, other):
4878
    return not (self == other)