Subversion Repositories SmartDukaan

Rev

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