Subversion Repositories SmartDukaan

Rev

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