Subversion Repositories SmartDukaan

Rev

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