Subversion Repositories SmartDukaan

Rev

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