Subversion Repositories SmartDukaan

Rev

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