Subversion Repositories SmartDukaan

Rev

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

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