Subversion Repositories SmartDukaan

Rev

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