Subversion Repositories SmartDukaan

Rev

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

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