Subversion Repositories SmartDukaan

Rev

Rev 11819 | Details | Compare with Previous | Last modification | View Log | RSS feed

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