Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1976 varun.gupt 1
#
3431 rajveer 2
# Autogenerated by Thrift Compiler (0.7.0)
1976 varun.gupt 3
#
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
#
6
 
7
from thrift.Thrift import *
3376 rajveer 8
import shop2020.thriftpy.generic.GenericService
1976 varun.gupt 9
from ttypes import *
10
from thrift.Thrift import TProcessor
11
from thrift.transport import TTransport
3431 rajveer 12
from thrift.protocol import TBinaryProtocol, TProtocol
1976 varun.gupt 13
try:
14
  from thrift.protocol import fastbinary
15
except:
16
  fastbinary = None
17
 
18
 
3376 rajveer 19
class Iface(shop2020.thriftpy.generic.GenericService.Iface):
1976 varun.gupt 20
  """
21
  Promotion Service
22
  """
23
  def createPromotion(self, name, ruleExecutionSrc, startOn, endOn):
24
    """
25
    Parameters:
26
     - name
27
     - ruleExecutionSrc
28
     - startOn
29
     - endOn
30
    """
31
    pass
32
 
33
  def getAllPromotions(self, ):
34
    pass
35
 
36
  def getPromotionById(self, promotionId):
37
    """
38
    Parameters:
39
     - promotionId
40
    """
41
    pass
42
 
43
  def generateCouponsForPromotion(self, promotionId, couponCode):
44
    """
45
    Parameters:
46
     - promotionId
47
     - couponCode
48
    """
49
    pass
50
 
51
  def applyCoupon(self, couponCode, cartId):
52
    """
53
    Parameters:
54
     - couponCode
55
     - cartId
56
    """
57
    pass
58
 
59
  def trackCouponUsage(self, couponCode, transactionId, userId):
60
    """
61
    Parameters:
62
     - couponCode
63
     - transactionId
64
     - userId
65
    """
66
    pass
67
 
68
  def getCouponUsageCountByUser(self, couponCode, userId):
69
    """
70
    Parameters:
71
     - couponCode
72
     - userId
73
    """
74
    pass
75
 
3385 varun.gupt 76
  def getActiveCoupons(self, ):
77
    """
78
    Returns a list of active coupons
79
    """
80
    pass
1976 varun.gupt 81
 
3385 varun.gupt 82
  def getSuccessfulPaymentCountForCoupon(self, couponCode):
83
    """
84
    Returns the count of successful payments done using a given coupon
3431 rajveer 85
 
3385 varun.gupt 86
    Parameters:
87
     - couponCode
88
    """
89
    pass
90
 
91
  def getRuleDocString(self, ruleName):
92
    """
93
    Returns the doc string of the rule module
3431 rajveer 94
 
3385 varun.gupt 95
    Parameters:
96
     - ruleName
97
    """
98
    pass
99
 
4189 varun.gupt 100
  def getItemDiscountMap(self, itemIds):
101
    """
102
    Parameters:
103
     - itemIds
104
    """
105
    pass
3385 varun.gupt 106
 
4494 varun.gupt 107
  def getDiscountsForEntity(self, entityId):
108
    """
109
    Parameters:
110
     - entityId
111
    """
112
    pass
4189 varun.gupt 113
 
4494 varun.gupt 114
 
3376 rajveer 115
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1976 varun.gupt 116
  """
117
  Promotion Service
118
  """
119
  def __init__(self, iprot, oprot=None):
3376 rajveer 120
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1976 varun.gupt 121
 
122
  def createPromotion(self, name, ruleExecutionSrc, startOn, endOn):
123
    """
124
    Parameters:
125
     - name
126
     - ruleExecutionSrc
127
     - startOn
128
     - endOn
129
    """
130
    self.send_createPromotion(name, ruleExecutionSrc, startOn, endOn)
131
    self.recv_createPromotion()
132
 
133
  def send_createPromotion(self, name, ruleExecutionSrc, startOn, endOn):
134
    self._oprot.writeMessageBegin('createPromotion', TMessageType.CALL, self._seqid)
135
    args = createPromotion_args()
136
    args.name = name
137
    args.ruleExecutionSrc = ruleExecutionSrc
138
    args.startOn = startOn
139
    args.endOn = endOn
140
    args.write(self._oprot)
141
    self._oprot.writeMessageEnd()
142
    self._oprot.trans.flush()
143
 
144
  def recv_createPromotion(self, ):
145
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
146
    if mtype == TMessageType.EXCEPTION:
147
      x = TApplicationException()
148
      x.read(self._iprot)
149
      self._iprot.readMessageEnd()
150
      raise x
151
    result = createPromotion_result()
152
    result.read(self._iprot)
153
    self._iprot.readMessageEnd()
3431 rajveer 154
    if result.pex is not None:
1976 varun.gupt 155
      raise result.pex
156
    return
157
 
158
  def getAllPromotions(self, ):
159
    self.send_getAllPromotions()
160
    return self.recv_getAllPromotions()
161
 
162
  def send_getAllPromotions(self, ):
163
    self._oprot.writeMessageBegin('getAllPromotions', TMessageType.CALL, self._seqid)
164
    args = getAllPromotions_args()
165
    args.write(self._oprot)
166
    self._oprot.writeMessageEnd()
167
    self._oprot.trans.flush()
168
 
169
  def recv_getAllPromotions(self, ):
170
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
171
    if mtype == TMessageType.EXCEPTION:
172
      x = TApplicationException()
173
      x.read(self._iprot)
174
      self._iprot.readMessageEnd()
175
      raise x
176
    result = getAllPromotions_result()
177
    result.read(self._iprot)
178
    self._iprot.readMessageEnd()
3431 rajveer 179
    if result.success is not None:
1976 varun.gupt 180
      return result.success
3431 rajveer 181
    if result.pex is not None:
1976 varun.gupt 182
      raise result.pex
183
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
184
 
185
  def getPromotionById(self, promotionId):
186
    """
187
    Parameters:
188
     - promotionId
189
    """
190
    self.send_getPromotionById(promotionId)
191
    return self.recv_getPromotionById()
192
 
193
  def send_getPromotionById(self, promotionId):
194
    self._oprot.writeMessageBegin('getPromotionById', TMessageType.CALL, self._seqid)
195
    args = getPromotionById_args()
196
    args.promotionId = promotionId
197
    args.write(self._oprot)
198
    self._oprot.writeMessageEnd()
199
    self._oprot.trans.flush()
200
 
201
  def recv_getPromotionById(self, ):
202
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
203
    if mtype == TMessageType.EXCEPTION:
204
      x = TApplicationException()
205
      x.read(self._iprot)
206
      self._iprot.readMessageEnd()
207
      raise x
208
    result = getPromotionById_result()
209
    result.read(self._iprot)
210
    self._iprot.readMessageEnd()
3431 rajveer 211
    if result.success is not None:
1976 varun.gupt 212
      return result.success
3431 rajveer 213
    if result.pex is not None:
1976 varun.gupt 214
      raise result.pex
215
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
216
 
217
  def generateCouponsForPromotion(self, promotionId, couponCode):
218
    """
219
    Parameters:
220
     - promotionId
221
     - couponCode
222
    """
223
    self.send_generateCouponsForPromotion(promotionId, couponCode)
224
    self.recv_generateCouponsForPromotion()
225
 
226
  def send_generateCouponsForPromotion(self, promotionId, couponCode):
227
    self._oprot.writeMessageBegin('generateCouponsForPromotion', TMessageType.CALL, self._seqid)
228
    args = generateCouponsForPromotion_args()
229
    args.promotionId = promotionId
230
    args.couponCode = couponCode
231
    args.write(self._oprot)
232
    self._oprot.writeMessageEnd()
233
    self._oprot.trans.flush()
234
 
235
  def recv_generateCouponsForPromotion(self, ):
236
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
237
    if mtype == TMessageType.EXCEPTION:
238
      x = TApplicationException()
239
      x.read(self._iprot)
240
      self._iprot.readMessageEnd()
241
      raise x
242
    result = generateCouponsForPromotion_result()
243
    result.read(self._iprot)
244
    self._iprot.readMessageEnd()
3431 rajveer 245
    if result.pex is not None:
1976 varun.gupt 246
      raise result.pex
247
    return
248
 
249
  def applyCoupon(self, couponCode, cartId):
250
    """
251
    Parameters:
252
     - couponCode
253
     - cartId
254
    """
255
    self.send_applyCoupon(couponCode, cartId)
256
    return self.recv_applyCoupon()
257
 
258
  def send_applyCoupon(self, couponCode, cartId):
259
    self._oprot.writeMessageBegin('applyCoupon', TMessageType.CALL, self._seqid)
260
    args = applyCoupon_args()
261
    args.couponCode = couponCode
262
    args.cartId = cartId
263
    args.write(self._oprot)
264
    self._oprot.writeMessageEnd()
265
    self._oprot.trans.flush()
266
 
267
  def recv_applyCoupon(self, ):
268
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
269
    if mtype == TMessageType.EXCEPTION:
270
      x = TApplicationException()
271
      x.read(self._iprot)
272
      self._iprot.readMessageEnd()
273
      raise x
274
    result = applyCoupon_result()
275
    result.read(self._iprot)
276
    self._iprot.readMessageEnd()
3431 rajveer 277
    if result.success is not None:
1976 varun.gupt 278
      return result.success
3431 rajveer 279
    if result.pex is not None:
1976 varun.gupt 280
      raise result.pex
281
    raise TApplicationException(TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
282
 
283
  def trackCouponUsage(self, couponCode, transactionId, userId):
284
    """
285
    Parameters:
286
     - couponCode
287
     - transactionId
288
     - userId
289
    """
290
    self.send_trackCouponUsage(couponCode, transactionId, userId)
291
    self.recv_trackCouponUsage()
292
 
293
  def send_trackCouponUsage(self, couponCode, transactionId, userId):
294
    self._oprot.writeMessageBegin('trackCouponUsage', TMessageType.CALL, self._seqid)
295
    args = trackCouponUsage_args()
296
    args.couponCode = couponCode
297
    args.transactionId = transactionId
298
    args.userId = userId
299
    args.write(self._oprot)
300
    self._oprot.writeMessageEnd()
301
    self._oprot.trans.flush()
302
 
303
  def recv_trackCouponUsage(self, ):
304
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
305
    if mtype == TMessageType.EXCEPTION:
306
      x = TApplicationException()
307
      x.read(self._iprot)
308
      self._iprot.readMessageEnd()
309
      raise x
310
    result = trackCouponUsage_result()
311
    result.read(self._iprot)
312
    self._iprot.readMessageEnd()
3431 rajveer 313
    if result.pex is not None:
1976 varun.gupt 314
      raise result.pex
315
    return
316
 
317
  def getCouponUsageCountByUser(self, couponCode, userId):
318
    """
319
    Parameters:
320
     - couponCode
321
     - userId
322
    """
323
    self.send_getCouponUsageCountByUser(couponCode, userId)
324
    return self.recv_getCouponUsageCountByUser()
325
 
326
  def send_getCouponUsageCountByUser(self, couponCode, userId):
327
    self._oprot.writeMessageBegin('getCouponUsageCountByUser', TMessageType.CALL, self._seqid)
328
    args = getCouponUsageCountByUser_args()
329
    args.couponCode = couponCode
330
    args.userId = userId
331
    args.write(self._oprot)
332
    self._oprot.writeMessageEnd()
333
    self._oprot.trans.flush()
334
 
335
  def recv_getCouponUsageCountByUser(self, ):
336
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
337
    if mtype == TMessageType.EXCEPTION:
338
      x = TApplicationException()
339
      x.read(self._iprot)
340
      self._iprot.readMessageEnd()
341
      raise x
342
    result = getCouponUsageCountByUser_result()
343
    result.read(self._iprot)
344
    self._iprot.readMessageEnd()
3431 rajveer 345
    if result.success is not None:
1976 varun.gupt 346
      return result.success
3431 rajveer 347
    if result.pex is not None:
1976 varun.gupt 348
      raise result.pex
349
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
350
 
3385 varun.gupt 351
  def getActiveCoupons(self, ):
352
    """
353
    Returns a list of active coupons
354
    """
355
    self.send_getActiveCoupons()
356
    return self.recv_getActiveCoupons()
1976 varun.gupt 357
 
3385 varun.gupt 358
  def send_getActiveCoupons(self, ):
359
    self._oprot.writeMessageBegin('getActiveCoupons', TMessageType.CALL, self._seqid)
360
    args = getActiveCoupons_args()
361
    args.write(self._oprot)
362
    self._oprot.writeMessageEnd()
363
    self._oprot.trans.flush()
364
 
365
  def recv_getActiveCoupons(self, ):
366
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
367
    if mtype == TMessageType.EXCEPTION:
368
      x = TApplicationException()
369
      x.read(self._iprot)
370
      self._iprot.readMessageEnd()
371
      raise x
372
    result = getActiveCoupons_result()
373
    result.read(self._iprot)
374
    self._iprot.readMessageEnd()
3431 rajveer 375
    if result.success is not None:
3385 varun.gupt 376
      return result.success
3431 rajveer 377
    if result.pex is not None:
3385 varun.gupt 378
      raise result.pex
379
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
380
 
381
  def getSuccessfulPaymentCountForCoupon(self, couponCode):
382
    """
383
    Returns the count of successful payments done using a given coupon
3431 rajveer 384
 
3385 varun.gupt 385
    Parameters:
386
     - couponCode
387
    """
388
    self.send_getSuccessfulPaymentCountForCoupon(couponCode)
389
    return self.recv_getSuccessfulPaymentCountForCoupon()
390
 
391
  def send_getSuccessfulPaymentCountForCoupon(self, couponCode):
392
    self._oprot.writeMessageBegin('getSuccessfulPaymentCountForCoupon', TMessageType.CALL, self._seqid)
393
    args = getSuccessfulPaymentCountForCoupon_args()
394
    args.couponCode = couponCode
395
    args.write(self._oprot)
396
    self._oprot.writeMessageEnd()
397
    self._oprot.trans.flush()
398
 
399
  def recv_getSuccessfulPaymentCountForCoupon(self, ):
400
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
401
    if mtype == TMessageType.EXCEPTION:
402
      x = TApplicationException()
403
      x.read(self._iprot)
404
      self._iprot.readMessageEnd()
405
      raise x
406
    result = getSuccessfulPaymentCountForCoupon_result()
407
    result.read(self._iprot)
408
    self._iprot.readMessageEnd()
3431 rajveer 409
    if result.success is not None:
3385 varun.gupt 410
      return result.success
3431 rajveer 411
    if result.pex is not None:
3385 varun.gupt 412
      raise result.pex
413
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
414
 
415
  def getRuleDocString(self, ruleName):
416
    """
417
    Returns the doc string of the rule module
3431 rajveer 418
 
3385 varun.gupt 419
    Parameters:
420
     - ruleName
421
    """
422
    self.send_getRuleDocString(ruleName)
423
    return self.recv_getRuleDocString()
424
 
425
  def send_getRuleDocString(self, ruleName):
426
    self._oprot.writeMessageBegin('getRuleDocString', TMessageType.CALL, self._seqid)
427
    args = getRuleDocString_args()
428
    args.ruleName = ruleName
429
    args.write(self._oprot)
430
    self._oprot.writeMessageEnd()
431
    self._oprot.trans.flush()
432
 
433
  def recv_getRuleDocString(self, ):
434
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
435
    if mtype == TMessageType.EXCEPTION:
436
      x = TApplicationException()
437
      x.read(self._iprot)
438
      self._iprot.readMessageEnd()
439
      raise x
440
    result = getRuleDocString_result()
441
    result.read(self._iprot)
442
    self._iprot.readMessageEnd()
3431 rajveer 443
    if result.success is not None:
3385 varun.gupt 444
      return result.success
445
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
446
 
4189 varun.gupt 447
  def getItemDiscountMap(self, itemIds):
448
    """
449
    Parameters:
450
     - itemIds
451
    """
452
    self.send_getItemDiscountMap(itemIds)
453
    return self.recv_getItemDiscountMap()
3385 varun.gupt 454
 
4189 varun.gupt 455
  def send_getItemDiscountMap(self, itemIds):
456
    self._oprot.writeMessageBegin('getItemDiscountMap', TMessageType.CALL, self._seqid)
457
    args = getItemDiscountMap_args()
458
    args.itemIds = itemIds
459
    args.write(self._oprot)
460
    self._oprot.writeMessageEnd()
461
    self._oprot.trans.flush()
462
 
463
  def recv_getItemDiscountMap(self, ):
464
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
465
    if mtype == TMessageType.EXCEPTION:
466
      x = TApplicationException()
467
      x.read(self._iprot)
468
      self._iprot.readMessageEnd()
469
      raise x
470
    result = getItemDiscountMap_result()
471
    result.read(self._iprot)
472
    self._iprot.readMessageEnd()
473
    if result.success is not None:
474
      return result.success
475
    if result.pex is not None:
476
      raise result.pex
477
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
478
 
4494 varun.gupt 479
  def getDiscountsForEntity(self, entityId):
480
    """
481
    Parameters:
482
     - entityId
483
    """
484
    self.send_getDiscountsForEntity(entityId)
485
    return self.recv_getDiscountsForEntity()
4189 varun.gupt 486
 
4494 varun.gupt 487
  def send_getDiscountsForEntity(self, entityId):
488
    self._oprot.writeMessageBegin('getDiscountsForEntity', TMessageType.CALL, self._seqid)
489
    args = getDiscountsForEntity_args()
490
    args.entityId = entityId
491
    args.write(self._oprot)
492
    self._oprot.writeMessageEnd()
493
    self._oprot.trans.flush()
494
 
495
  def recv_getDiscountsForEntity(self, ):
496
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
497
    if mtype == TMessageType.EXCEPTION:
498
      x = TApplicationException()
499
      x.read(self._iprot)
500
      self._iprot.readMessageEnd()
501
      raise x
502
    result = getDiscountsForEntity_result()
503
    result.read(self._iprot)
504
    self._iprot.readMessageEnd()
505
    if result.success is not None:
506
      return result.success
507
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
508
 
509
 
3376 rajveer 510
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1976 varun.gupt 511
  def __init__(self, handler):
3376 rajveer 512
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1976 varun.gupt 513
    self._processMap["createPromotion"] = Processor.process_createPromotion
514
    self._processMap["getAllPromotions"] = Processor.process_getAllPromotions
515
    self._processMap["getPromotionById"] = Processor.process_getPromotionById
516
    self._processMap["generateCouponsForPromotion"] = Processor.process_generateCouponsForPromotion
517
    self._processMap["applyCoupon"] = Processor.process_applyCoupon
518
    self._processMap["trackCouponUsage"] = Processor.process_trackCouponUsage
519
    self._processMap["getCouponUsageCountByUser"] = Processor.process_getCouponUsageCountByUser
3385 varun.gupt 520
    self._processMap["getActiveCoupons"] = Processor.process_getActiveCoupons
521
    self._processMap["getSuccessfulPaymentCountForCoupon"] = Processor.process_getSuccessfulPaymentCountForCoupon
522
    self._processMap["getRuleDocString"] = Processor.process_getRuleDocString
4189 varun.gupt 523
    self._processMap["getItemDiscountMap"] = Processor.process_getItemDiscountMap
4494 varun.gupt 524
    self._processMap["getDiscountsForEntity"] = Processor.process_getDiscountsForEntity
1976 varun.gupt 525
 
526
  def process(self, iprot, oprot):
527
    (name, type, seqid) = iprot.readMessageBegin()
528
    if name not in self._processMap:
529
      iprot.skip(TType.STRUCT)
530
      iprot.readMessageEnd()
531
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
532
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
533
      x.write(oprot)
534
      oprot.writeMessageEnd()
535
      oprot.trans.flush()
536
      return
537
    else:
538
      self._processMap[name](self, seqid, iprot, oprot)
539
    return True
540
 
541
  def process_createPromotion(self, seqid, iprot, oprot):
542
    args = createPromotion_args()
543
    args.read(iprot)
544
    iprot.readMessageEnd()
545
    result = createPromotion_result()
546
    try:
547
      self._handler.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn)
548
    except PromotionException, pex:
549
      result.pex = pex
550
    oprot.writeMessageBegin("createPromotion", TMessageType.REPLY, seqid)
551
    result.write(oprot)
552
    oprot.writeMessageEnd()
553
    oprot.trans.flush()
554
 
555
  def process_getAllPromotions(self, seqid, iprot, oprot):
556
    args = getAllPromotions_args()
557
    args.read(iprot)
558
    iprot.readMessageEnd()
559
    result = getAllPromotions_result()
560
    try:
561
      result.success = self._handler.getAllPromotions()
562
    except PromotionException, pex:
563
      result.pex = pex
564
    oprot.writeMessageBegin("getAllPromotions", TMessageType.REPLY, seqid)
565
    result.write(oprot)
566
    oprot.writeMessageEnd()
567
    oprot.trans.flush()
568
 
569
  def process_getPromotionById(self, seqid, iprot, oprot):
570
    args = getPromotionById_args()
571
    args.read(iprot)
572
    iprot.readMessageEnd()
573
    result = getPromotionById_result()
574
    try:
575
      result.success = self._handler.getPromotionById(args.promotionId)
576
    except PromotionException, pex:
577
      result.pex = pex
578
    oprot.writeMessageBegin("getPromotionById", TMessageType.REPLY, seqid)
579
    result.write(oprot)
580
    oprot.writeMessageEnd()
581
    oprot.trans.flush()
582
 
583
  def process_generateCouponsForPromotion(self, seqid, iprot, oprot):
584
    args = generateCouponsForPromotion_args()
585
    args.read(iprot)
586
    iprot.readMessageEnd()
587
    result = generateCouponsForPromotion_result()
588
    try:
589
      self._handler.generateCouponsForPromotion(args.promotionId, args.couponCode)
590
    except PromotionException, pex:
591
      result.pex = pex
592
    oprot.writeMessageBegin("generateCouponsForPromotion", TMessageType.REPLY, seqid)
593
    result.write(oprot)
594
    oprot.writeMessageEnd()
595
    oprot.trans.flush()
596
 
597
  def process_applyCoupon(self, seqid, iprot, oprot):
598
    args = applyCoupon_args()
599
    args.read(iprot)
600
    iprot.readMessageEnd()
601
    result = applyCoupon_result()
602
    try:
603
      result.success = self._handler.applyCoupon(args.couponCode, args.cartId)
604
    except PromotionException, pex:
605
      result.pex = pex
606
    oprot.writeMessageBegin("applyCoupon", TMessageType.REPLY, seqid)
607
    result.write(oprot)
608
    oprot.writeMessageEnd()
609
    oprot.trans.flush()
610
 
611
  def process_trackCouponUsage(self, seqid, iprot, oprot):
612
    args = trackCouponUsage_args()
613
    args.read(iprot)
614
    iprot.readMessageEnd()
615
    result = trackCouponUsage_result()
616
    try:
617
      self._handler.trackCouponUsage(args.couponCode, args.transactionId, args.userId)
618
    except PromotionException, pex:
619
      result.pex = pex
620
    oprot.writeMessageBegin("trackCouponUsage", TMessageType.REPLY, seqid)
621
    result.write(oprot)
622
    oprot.writeMessageEnd()
623
    oprot.trans.flush()
624
 
625
  def process_getCouponUsageCountByUser(self, seqid, iprot, oprot):
626
    args = getCouponUsageCountByUser_args()
627
    args.read(iprot)
628
    iprot.readMessageEnd()
629
    result = getCouponUsageCountByUser_result()
630
    try:
631
      result.success = self._handler.getCouponUsageCountByUser(args.couponCode, args.userId)
632
    except PromotionException, pex:
633
      result.pex = pex
634
    oprot.writeMessageBegin("getCouponUsageCountByUser", TMessageType.REPLY, seqid)
635
    result.write(oprot)
636
    oprot.writeMessageEnd()
637
    oprot.trans.flush()
638
 
3385 varun.gupt 639
  def process_getActiveCoupons(self, seqid, iprot, oprot):
640
    args = getActiveCoupons_args()
641
    args.read(iprot)
642
    iprot.readMessageEnd()
643
    result = getActiveCoupons_result()
644
    try:
645
      result.success = self._handler.getActiveCoupons()
646
    except PromotionException, pex:
647
      result.pex = pex
648
    oprot.writeMessageBegin("getActiveCoupons", TMessageType.REPLY, seqid)
649
    result.write(oprot)
650
    oprot.writeMessageEnd()
651
    oprot.trans.flush()
1976 varun.gupt 652
 
3385 varun.gupt 653
  def process_getSuccessfulPaymentCountForCoupon(self, seqid, iprot, oprot):
654
    args = getSuccessfulPaymentCountForCoupon_args()
655
    args.read(iprot)
656
    iprot.readMessageEnd()
657
    result = getSuccessfulPaymentCountForCoupon_result()
658
    try:
659
      result.success = self._handler.getSuccessfulPaymentCountForCoupon(args.couponCode)
660
    except PromotionException, pex:
661
      result.pex = pex
662
    oprot.writeMessageBegin("getSuccessfulPaymentCountForCoupon", TMessageType.REPLY, seqid)
663
    result.write(oprot)
664
    oprot.writeMessageEnd()
665
    oprot.trans.flush()
666
 
667
  def process_getRuleDocString(self, seqid, iprot, oprot):
668
    args = getRuleDocString_args()
669
    args.read(iprot)
670
    iprot.readMessageEnd()
671
    result = getRuleDocString_result()
672
    result.success = self._handler.getRuleDocString(args.ruleName)
673
    oprot.writeMessageBegin("getRuleDocString", TMessageType.REPLY, seqid)
674
    result.write(oprot)
675
    oprot.writeMessageEnd()
676
    oprot.trans.flush()
677
 
4189 varun.gupt 678
  def process_getItemDiscountMap(self, seqid, iprot, oprot):
679
    args = getItemDiscountMap_args()
680
    args.read(iprot)
681
    iprot.readMessageEnd()
682
    result = getItemDiscountMap_result()
683
    try:
684
      result.success = self._handler.getItemDiscountMap(args.itemIds)
685
    except PromotionException, pex:
686
      result.pex = pex
687
    oprot.writeMessageBegin("getItemDiscountMap", TMessageType.REPLY, seqid)
688
    result.write(oprot)
689
    oprot.writeMessageEnd()
690
    oprot.trans.flush()
3385 varun.gupt 691
 
4494 varun.gupt 692
  def process_getDiscountsForEntity(self, seqid, iprot, oprot):
693
    args = getDiscountsForEntity_args()
694
    args.read(iprot)
695
    iprot.readMessageEnd()
696
    result = getDiscountsForEntity_result()
697
    result.success = self._handler.getDiscountsForEntity(args.entityId)
698
    oprot.writeMessageBegin("getDiscountsForEntity", TMessageType.REPLY, seqid)
699
    result.write(oprot)
700
    oprot.writeMessageEnd()
701
    oprot.trans.flush()
4189 varun.gupt 702
 
4494 varun.gupt 703
 
1976 varun.gupt 704
# HELPER FUNCTIONS AND STRUCTURES
705
 
706
class createPromotion_args:
707
  """
708
  Attributes:
709
   - name
710
   - ruleExecutionSrc
711
   - startOn
712
   - endOn
713
  """
714
 
715
  thrift_spec = (
716
    None, # 0
717
    (1, TType.STRING, 'name', None, None, ), # 1
718
    (2, TType.STRING, 'ruleExecutionSrc', None, None, ), # 2
719
    (3, TType.I64, 'startOn', None, None, ), # 3
720
    (4, TType.I64, 'endOn', None, None, ), # 4
721
  )
722
 
723
  def __init__(self, name=None, ruleExecutionSrc=None, startOn=None, endOn=None,):
724
    self.name = name
725
    self.ruleExecutionSrc = ruleExecutionSrc
726
    self.startOn = startOn
727
    self.endOn = endOn
728
 
729
  def read(self, iprot):
730
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
731
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
732
      return
733
    iprot.readStructBegin()
734
    while True:
735
      (fname, ftype, fid) = iprot.readFieldBegin()
736
      if ftype == TType.STOP:
737
        break
738
      if fid == 1:
739
        if ftype == TType.STRING:
740
          self.name = iprot.readString();
741
        else:
742
          iprot.skip(ftype)
743
      elif fid == 2:
744
        if ftype == TType.STRING:
745
          self.ruleExecutionSrc = iprot.readString();
746
        else:
747
          iprot.skip(ftype)
748
      elif fid == 3:
749
        if ftype == TType.I64:
750
          self.startOn = iprot.readI64();
751
        else:
752
          iprot.skip(ftype)
753
      elif fid == 4:
754
        if ftype == TType.I64:
755
          self.endOn = iprot.readI64();
756
        else:
757
          iprot.skip(ftype)
758
      else:
759
        iprot.skip(ftype)
760
      iprot.readFieldEnd()
761
    iprot.readStructEnd()
762
 
763
  def write(self, oprot):
764
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
765
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
766
      return
767
    oprot.writeStructBegin('createPromotion_args')
3431 rajveer 768
    if self.name is not None:
1976 varun.gupt 769
      oprot.writeFieldBegin('name', TType.STRING, 1)
770
      oprot.writeString(self.name)
771
      oprot.writeFieldEnd()
3431 rajveer 772
    if self.ruleExecutionSrc is not None:
1976 varun.gupt 773
      oprot.writeFieldBegin('ruleExecutionSrc', TType.STRING, 2)
774
      oprot.writeString(self.ruleExecutionSrc)
775
      oprot.writeFieldEnd()
3431 rajveer 776
    if self.startOn is not None:
1976 varun.gupt 777
      oprot.writeFieldBegin('startOn', TType.I64, 3)
778
      oprot.writeI64(self.startOn)
779
      oprot.writeFieldEnd()
3431 rajveer 780
    if self.endOn is not None:
1976 varun.gupt 781
      oprot.writeFieldBegin('endOn', TType.I64, 4)
782
      oprot.writeI64(self.endOn)
783
      oprot.writeFieldEnd()
784
    oprot.writeFieldStop()
785
    oprot.writeStructEnd()
786
 
3431 rajveer 787
  def validate(self):
788
    return
789
 
790
 
1976 varun.gupt 791
  def __repr__(self):
792
    L = ['%s=%r' % (key, value)
793
      for key, value in self.__dict__.iteritems()]
794
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
795
 
796
  def __eq__(self, other):
797
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
798
 
799
  def __ne__(self, other):
800
    return not (self == other)
801
 
802
class createPromotion_result:
803
  """
804
  Attributes:
805
   - pex
806
  """
807
 
808
  thrift_spec = (
809
    None, # 0
810
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
811
  )
812
 
813
  def __init__(self, pex=None,):
814
    self.pex = pex
815
 
816
  def read(self, iprot):
817
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
818
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
819
      return
820
    iprot.readStructBegin()
821
    while True:
822
      (fname, ftype, fid) = iprot.readFieldBegin()
823
      if ftype == TType.STOP:
824
        break
825
      if fid == 1:
826
        if ftype == TType.STRUCT:
827
          self.pex = PromotionException()
828
          self.pex.read(iprot)
829
        else:
830
          iprot.skip(ftype)
831
      else:
832
        iprot.skip(ftype)
833
      iprot.readFieldEnd()
834
    iprot.readStructEnd()
835
 
836
  def write(self, oprot):
837
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
838
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
839
      return
840
    oprot.writeStructBegin('createPromotion_result')
3431 rajveer 841
    if self.pex is not None:
1976 varun.gupt 842
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
843
      self.pex.write(oprot)
844
      oprot.writeFieldEnd()
845
    oprot.writeFieldStop()
846
    oprot.writeStructEnd()
847
 
3431 rajveer 848
  def validate(self):
849
    return
850
 
851
 
1976 varun.gupt 852
  def __repr__(self):
853
    L = ['%s=%r' % (key, value)
854
      for key, value in self.__dict__.iteritems()]
855
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
856
 
857
  def __eq__(self, other):
858
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
859
 
860
  def __ne__(self, other):
861
    return not (self == other)
862
 
863
class getAllPromotions_args:
864
 
865
  thrift_spec = (
866
  )
867
 
868
  def read(self, iprot):
869
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
870
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
871
      return
872
    iprot.readStructBegin()
873
    while True:
874
      (fname, ftype, fid) = iprot.readFieldBegin()
875
      if ftype == TType.STOP:
876
        break
877
      else:
878
        iprot.skip(ftype)
879
      iprot.readFieldEnd()
880
    iprot.readStructEnd()
881
 
882
  def write(self, oprot):
883
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
884
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
885
      return
886
    oprot.writeStructBegin('getAllPromotions_args')
887
    oprot.writeFieldStop()
888
    oprot.writeStructEnd()
889
 
3431 rajveer 890
  def validate(self):
891
    return
892
 
893
 
1976 varun.gupt 894
  def __repr__(self):
895
    L = ['%s=%r' % (key, value)
896
      for key, value in self.__dict__.iteritems()]
897
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
898
 
899
  def __eq__(self, other):
900
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
901
 
902
  def __ne__(self, other):
903
    return not (self == other)
904
 
905
class getAllPromotions_result:
906
  """
907
  Attributes:
908
   - success
909
   - pex
910
  """
911
 
912
  thrift_spec = (
913
    (0, TType.LIST, 'success', (TType.STRUCT,(Promotion, Promotion.thrift_spec)), None, ), # 0
914
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
915
  )
916
 
917
  def __init__(self, success=None, pex=None,):
918
    self.success = success
919
    self.pex = pex
920
 
921
  def read(self, iprot):
922
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
923
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
924
      return
925
    iprot.readStructBegin()
926
    while True:
927
      (fname, ftype, fid) = iprot.readFieldBegin()
928
      if ftype == TType.STOP:
929
        break
930
      if fid == 0:
931
        if ftype == TType.LIST:
932
          self.success = []
3554 varun.gupt 933
          (_etype31, _size28) = iprot.readListBegin()
934
          for _i32 in xrange(_size28):
935
            _elem33 = Promotion()
936
            _elem33.read(iprot)
937
            self.success.append(_elem33)
1976 varun.gupt 938
          iprot.readListEnd()
939
        else:
940
          iprot.skip(ftype)
941
      elif fid == 1:
942
        if ftype == TType.STRUCT:
943
          self.pex = PromotionException()
944
          self.pex.read(iprot)
945
        else:
946
          iprot.skip(ftype)
947
      else:
948
        iprot.skip(ftype)
949
      iprot.readFieldEnd()
950
    iprot.readStructEnd()
951
 
952
  def write(self, oprot):
953
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
954
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
955
      return
956
    oprot.writeStructBegin('getAllPromotions_result')
3431 rajveer 957
    if self.success is not None:
1976 varun.gupt 958
      oprot.writeFieldBegin('success', TType.LIST, 0)
959
      oprot.writeListBegin(TType.STRUCT, len(self.success))
3554 varun.gupt 960
      for iter34 in self.success:
961
        iter34.write(oprot)
1976 varun.gupt 962
      oprot.writeListEnd()
963
      oprot.writeFieldEnd()
3431 rajveer 964
    if self.pex is not None:
1976 varun.gupt 965
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
966
      self.pex.write(oprot)
967
      oprot.writeFieldEnd()
968
    oprot.writeFieldStop()
969
    oprot.writeStructEnd()
970
 
3431 rajveer 971
  def validate(self):
972
    return
973
 
974
 
1976 varun.gupt 975
  def __repr__(self):
976
    L = ['%s=%r' % (key, value)
977
      for key, value in self.__dict__.iteritems()]
978
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
979
 
980
  def __eq__(self, other):
981
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
982
 
983
  def __ne__(self, other):
984
    return not (self == other)
985
 
986
class getPromotionById_args:
987
  """
988
  Attributes:
989
   - promotionId
990
  """
991
 
992
  thrift_spec = (
993
    None, # 0
994
    (1, TType.I64, 'promotionId', None, None, ), # 1
995
  )
996
 
997
  def __init__(self, promotionId=None,):
998
    self.promotionId = promotionId
999
 
1000
  def read(self, iprot):
1001
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1002
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1003
      return
1004
    iprot.readStructBegin()
1005
    while True:
1006
      (fname, ftype, fid) = iprot.readFieldBegin()
1007
      if ftype == TType.STOP:
1008
        break
1009
      if fid == 1:
1010
        if ftype == TType.I64:
1011
          self.promotionId = iprot.readI64();
1012
        else:
1013
          iprot.skip(ftype)
1014
      else:
1015
        iprot.skip(ftype)
1016
      iprot.readFieldEnd()
1017
    iprot.readStructEnd()
1018
 
1019
  def write(self, oprot):
1020
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1021
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1022
      return
1023
    oprot.writeStructBegin('getPromotionById_args')
3431 rajveer 1024
    if self.promotionId is not None:
1976 varun.gupt 1025
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
1026
      oprot.writeI64(self.promotionId)
1027
      oprot.writeFieldEnd()
1028
    oprot.writeFieldStop()
1029
    oprot.writeStructEnd()
1030
 
3431 rajveer 1031
  def validate(self):
1032
    return
1033
 
1034
 
1976 varun.gupt 1035
  def __repr__(self):
1036
    L = ['%s=%r' % (key, value)
1037
      for key, value in self.__dict__.iteritems()]
1038
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1039
 
1040
  def __eq__(self, other):
1041
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1042
 
1043
  def __ne__(self, other):
1044
    return not (self == other)
1045
 
1046
class getPromotionById_result:
1047
  """
1048
  Attributes:
1049
   - success
1050
   - pex
1051
  """
1052
 
1053
  thrift_spec = (
1054
    (0, TType.STRUCT, 'success', (Promotion, Promotion.thrift_spec), None, ), # 0
1055
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1056
  )
1057
 
1058
  def __init__(self, success=None, pex=None,):
1059
    self.success = success
1060
    self.pex = pex
1061
 
1062
  def read(self, iprot):
1063
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1064
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1065
      return
1066
    iprot.readStructBegin()
1067
    while True:
1068
      (fname, ftype, fid) = iprot.readFieldBegin()
1069
      if ftype == TType.STOP:
1070
        break
1071
      if fid == 0:
1072
        if ftype == TType.STRUCT:
1073
          self.success = Promotion()
1074
          self.success.read(iprot)
1075
        else:
1076
          iprot.skip(ftype)
1077
      elif fid == 1:
1078
        if ftype == TType.STRUCT:
1079
          self.pex = PromotionException()
1080
          self.pex.read(iprot)
1081
        else:
1082
          iprot.skip(ftype)
1083
      else:
1084
        iprot.skip(ftype)
1085
      iprot.readFieldEnd()
1086
    iprot.readStructEnd()
1087
 
1088
  def write(self, oprot):
1089
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1090
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1091
      return
1092
    oprot.writeStructBegin('getPromotionById_result')
3431 rajveer 1093
    if self.success is not None:
1976 varun.gupt 1094
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1095
      self.success.write(oprot)
1096
      oprot.writeFieldEnd()
3431 rajveer 1097
    if self.pex is not None:
1976 varun.gupt 1098
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1099
      self.pex.write(oprot)
1100
      oprot.writeFieldEnd()
1101
    oprot.writeFieldStop()
1102
    oprot.writeStructEnd()
1103
 
3431 rajveer 1104
  def validate(self):
1105
    return
1106
 
1107
 
1976 varun.gupt 1108
  def __repr__(self):
1109
    L = ['%s=%r' % (key, value)
1110
      for key, value in self.__dict__.iteritems()]
1111
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1112
 
1113
  def __eq__(self, other):
1114
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1115
 
1116
  def __ne__(self, other):
1117
    return not (self == other)
1118
 
1119
class generateCouponsForPromotion_args:
1120
  """
1121
  Attributes:
1122
   - promotionId
1123
   - couponCode
1124
  """
1125
 
1126
  thrift_spec = (
1127
    None, # 0
1128
    (1, TType.I64, 'promotionId', None, None, ), # 1
1129
    (2, TType.STRING, 'couponCode', None, None, ), # 2
1130
  )
1131
 
1132
  def __init__(self, promotionId=None, couponCode=None,):
1133
    self.promotionId = promotionId
1134
    self.couponCode = couponCode
1135
 
1136
  def read(self, iprot):
1137
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1138
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1139
      return
1140
    iprot.readStructBegin()
1141
    while True:
1142
      (fname, ftype, fid) = iprot.readFieldBegin()
1143
      if ftype == TType.STOP:
1144
        break
1145
      if fid == 1:
1146
        if ftype == TType.I64:
1147
          self.promotionId = iprot.readI64();
1148
        else:
1149
          iprot.skip(ftype)
1150
      elif fid == 2:
1151
        if ftype == TType.STRING:
1152
          self.couponCode = iprot.readString();
1153
        else:
1154
          iprot.skip(ftype)
1155
      else:
1156
        iprot.skip(ftype)
1157
      iprot.readFieldEnd()
1158
    iprot.readStructEnd()
1159
 
1160
  def write(self, oprot):
1161
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1162
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1163
      return
1164
    oprot.writeStructBegin('generateCouponsForPromotion_args')
3431 rajveer 1165
    if self.promotionId is not None:
1976 varun.gupt 1166
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
1167
      oprot.writeI64(self.promotionId)
1168
      oprot.writeFieldEnd()
3431 rajveer 1169
    if self.couponCode is not None:
1976 varun.gupt 1170
      oprot.writeFieldBegin('couponCode', TType.STRING, 2)
1171
      oprot.writeString(self.couponCode)
1172
      oprot.writeFieldEnd()
1173
    oprot.writeFieldStop()
1174
    oprot.writeStructEnd()
1175
 
3431 rajveer 1176
  def validate(self):
1177
    return
1178
 
1179
 
1976 varun.gupt 1180
  def __repr__(self):
1181
    L = ['%s=%r' % (key, value)
1182
      for key, value in self.__dict__.iteritems()]
1183
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1184
 
1185
  def __eq__(self, other):
1186
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1187
 
1188
  def __ne__(self, other):
1189
    return not (self == other)
1190
 
1191
class generateCouponsForPromotion_result:
1192
  """
1193
  Attributes:
1194
   - pex
1195
  """
1196
 
1197
  thrift_spec = (
1198
    None, # 0
1199
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1200
  )
1201
 
1202
  def __init__(self, pex=None,):
1203
    self.pex = pex
1204
 
1205
  def read(self, iprot):
1206
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1207
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1208
      return
1209
    iprot.readStructBegin()
1210
    while True:
1211
      (fname, ftype, fid) = iprot.readFieldBegin()
1212
      if ftype == TType.STOP:
1213
        break
1214
      if fid == 1:
1215
        if ftype == TType.STRUCT:
1216
          self.pex = PromotionException()
1217
          self.pex.read(iprot)
1218
        else:
1219
          iprot.skip(ftype)
1220
      else:
1221
        iprot.skip(ftype)
1222
      iprot.readFieldEnd()
1223
    iprot.readStructEnd()
1224
 
1225
  def write(self, oprot):
1226
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1227
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1228
      return
1229
    oprot.writeStructBegin('generateCouponsForPromotion_result')
3431 rajveer 1230
    if self.pex is not None:
1976 varun.gupt 1231
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1232
      self.pex.write(oprot)
1233
      oprot.writeFieldEnd()
1234
    oprot.writeFieldStop()
1235
    oprot.writeStructEnd()
1236
 
3431 rajveer 1237
  def validate(self):
1238
    return
1239
 
1240
 
1976 varun.gupt 1241
  def __repr__(self):
1242
    L = ['%s=%r' % (key, value)
1243
      for key, value in self.__dict__.iteritems()]
1244
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1245
 
1246
  def __eq__(self, other):
1247
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1248
 
1249
  def __ne__(self, other):
1250
    return not (self == other)
1251
 
1252
class applyCoupon_args:
1253
  """
1254
  Attributes:
1255
   - couponCode
1256
   - cartId
1257
  """
1258
 
1259
  thrift_spec = (
1260
    None, # 0
1261
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1262
    (2, TType.I64, 'cartId', None, None, ), # 2
1263
  )
1264
 
1265
  def __init__(self, couponCode=None, cartId=None,):
1266
    self.couponCode = couponCode
1267
    self.cartId = cartId
1268
 
1269
  def read(self, iprot):
1270
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1271
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1272
      return
1273
    iprot.readStructBegin()
1274
    while True:
1275
      (fname, ftype, fid) = iprot.readFieldBegin()
1276
      if ftype == TType.STOP:
1277
        break
1278
      if fid == 1:
1279
        if ftype == TType.STRING:
1280
          self.couponCode = iprot.readString();
1281
        else:
1282
          iprot.skip(ftype)
1283
      elif fid == 2:
1284
        if ftype == TType.I64:
1285
          self.cartId = iprot.readI64();
1286
        else:
1287
          iprot.skip(ftype)
1288
      else:
1289
        iprot.skip(ftype)
1290
      iprot.readFieldEnd()
1291
    iprot.readStructEnd()
1292
 
1293
  def write(self, oprot):
1294
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1295
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1296
      return
1297
    oprot.writeStructBegin('applyCoupon_args')
3431 rajveer 1298
    if self.couponCode is not None:
1976 varun.gupt 1299
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1300
      oprot.writeString(self.couponCode)
1301
      oprot.writeFieldEnd()
3431 rajveer 1302
    if self.cartId is not None:
1976 varun.gupt 1303
      oprot.writeFieldBegin('cartId', TType.I64, 2)
1304
      oprot.writeI64(self.cartId)
1305
      oprot.writeFieldEnd()
1306
    oprot.writeFieldStop()
1307
    oprot.writeStructEnd()
1308
 
3431 rajveer 1309
  def validate(self):
1310
    return
1311
 
1312
 
1976 varun.gupt 1313
  def __repr__(self):
1314
    L = ['%s=%r' % (key, value)
1315
      for key, value in self.__dict__.iteritems()]
1316
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1317
 
1318
  def __eq__(self, other):
1319
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1320
 
1321
  def __ne__(self, other):
1322
    return not (self == other)
1323
 
1324
class applyCoupon_result:
1325
  """
1326
  Attributes:
1327
   - success
1328
   - pex
1329
  """
1330
 
1331
  thrift_spec = (
1332
    (0, TType.STRUCT, 'success', (Cart, Cart.thrift_spec), None, ), # 0
1333
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1334
  )
1335
 
1336
  def __init__(self, success=None, pex=None,):
1337
    self.success = success
1338
    self.pex = pex
1339
 
1340
  def read(self, iprot):
1341
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1342
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1343
      return
1344
    iprot.readStructBegin()
1345
    while True:
1346
      (fname, ftype, fid) = iprot.readFieldBegin()
1347
      if ftype == TType.STOP:
1348
        break
1349
      if fid == 0:
1350
        if ftype == TType.STRUCT:
1351
          self.success = Cart()
1352
          self.success.read(iprot)
1353
        else:
1354
          iprot.skip(ftype)
1355
      elif fid == 1:
1356
        if ftype == TType.STRUCT:
1357
          self.pex = PromotionException()
1358
          self.pex.read(iprot)
1359
        else:
1360
          iprot.skip(ftype)
1361
      else:
1362
        iprot.skip(ftype)
1363
      iprot.readFieldEnd()
1364
    iprot.readStructEnd()
1365
 
1366
  def write(self, oprot):
1367
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1368
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1369
      return
1370
    oprot.writeStructBegin('applyCoupon_result')
3431 rajveer 1371
    if self.success is not None:
1976 varun.gupt 1372
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1373
      self.success.write(oprot)
1374
      oprot.writeFieldEnd()
3431 rajveer 1375
    if self.pex is not None:
1976 varun.gupt 1376
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1377
      self.pex.write(oprot)
1378
      oprot.writeFieldEnd()
1379
    oprot.writeFieldStop()
1380
    oprot.writeStructEnd()
1381
 
3431 rajveer 1382
  def validate(self):
1383
    return
1384
 
1385
 
1976 varun.gupt 1386
  def __repr__(self):
1387
    L = ['%s=%r' % (key, value)
1388
      for key, value in self.__dict__.iteritems()]
1389
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1390
 
1391
  def __eq__(self, other):
1392
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1393
 
1394
  def __ne__(self, other):
1395
    return not (self == other)
1396
 
1397
class trackCouponUsage_args:
1398
  """
1399
  Attributes:
1400
   - couponCode
1401
   - transactionId
1402
   - userId
1403
  """
1404
 
1405
  thrift_spec = (
1406
    None, # 0
1407
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1408
    (2, TType.I64, 'transactionId', None, None, ), # 2
1409
    (3, TType.I64, 'userId', None, None, ), # 3
1410
  )
1411
 
1412
  def __init__(self, couponCode=None, transactionId=None, userId=None,):
1413
    self.couponCode = couponCode
1414
    self.transactionId = transactionId
1415
    self.userId = userId
1416
 
1417
  def read(self, iprot):
1418
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1419
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1420
      return
1421
    iprot.readStructBegin()
1422
    while True:
1423
      (fname, ftype, fid) = iprot.readFieldBegin()
1424
      if ftype == TType.STOP:
1425
        break
1426
      if fid == 1:
1427
        if ftype == TType.STRING:
1428
          self.couponCode = iprot.readString();
1429
        else:
1430
          iprot.skip(ftype)
1431
      elif fid == 2:
1432
        if ftype == TType.I64:
1433
          self.transactionId = iprot.readI64();
1434
        else:
1435
          iprot.skip(ftype)
1436
      elif fid == 3:
1437
        if ftype == TType.I64:
1438
          self.userId = iprot.readI64();
1439
        else:
1440
          iprot.skip(ftype)
1441
      else:
1442
        iprot.skip(ftype)
1443
      iprot.readFieldEnd()
1444
    iprot.readStructEnd()
1445
 
1446
  def write(self, oprot):
1447
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1448
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1449
      return
1450
    oprot.writeStructBegin('trackCouponUsage_args')
3431 rajveer 1451
    if self.couponCode is not None:
1976 varun.gupt 1452
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1453
      oprot.writeString(self.couponCode)
1454
      oprot.writeFieldEnd()
3431 rajveer 1455
    if self.transactionId is not None:
1976 varun.gupt 1456
      oprot.writeFieldBegin('transactionId', TType.I64, 2)
1457
      oprot.writeI64(self.transactionId)
1458
      oprot.writeFieldEnd()
3431 rajveer 1459
    if self.userId is not None:
1976 varun.gupt 1460
      oprot.writeFieldBegin('userId', TType.I64, 3)
1461
      oprot.writeI64(self.userId)
1462
      oprot.writeFieldEnd()
1463
    oprot.writeFieldStop()
1464
    oprot.writeStructEnd()
1465
 
3431 rajveer 1466
  def validate(self):
1467
    return
1468
 
1469
 
1976 varun.gupt 1470
  def __repr__(self):
1471
    L = ['%s=%r' % (key, value)
1472
      for key, value in self.__dict__.iteritems()]
1473
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1474
 
1475
  def __eq__(self, other):
1476
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1477
 
1478
  def __ne__(self, other):
1479
    return not (self == other)
1480
 
1481
class trackCouponUsage_result:
1482
  """
1483
  Attributes:
1484
   - pex
1485
  """
1486
 
1487
  thrift_spec = (
1488
    None, # 0
1489
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1490
  )
1491
 
1492
  def __init__(self, pex=None,):
1493
    self.pex = pex
1494
 
1495
  def read(self, iprot):
1496
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1497
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1498
      return
1499
    iprot.readStructBegin()
1500
    while True:
1501
      (fname, ftype, fid) = iprot.readFieldBegin()
1502
      if ftype == TType.STOP:
1503
        break
1504
      if fid == 1:
1505
        if ftype == TType.STRUCT:
1506
          self.pex = PromotionException()
1507
          self.pex.read(iprot)
1508
        else:
1509
          iprot.skip(ftype)
1510
      else:
1511
        iprot.skip(ftype)
1512
      iprot.readFieldEnd()
1513
    iprot.readStructEnd()
1514
 
1515
  def write(self, oprot):
1516
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1517
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1518
      return
1519
    oprot.writeStructBegin('trackCouponUsage_result')
3431 rajveer 1520
    if self.pex is not None:
1976 varun.gupt 1521
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1522
      self.pex.write(oprot)
1523
      oprot.writeFieldEnd()
1524
    oprot.writeFieldStop()
1525
    oprot.writeStructEnd()
1526
 
3431 rajveer 1527
  def validate(self):
1528
    return
1529
 
1530
 
1976 varun.gupt 1531
  def __repr__(self):
1532
    L = ['%s=%r' % (key, value)
1533
      for key, value in self.__dict__.iteritems()]
1534
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1535
 
1536
  def __eq__(self, other):
1537
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1538
 
1539
  def __ne__(self, other):
1540
    return not (self == other)
1541
 
1542
class getCouponUsageCountByUser_args:
1543
  """
1544
  Attributes:
1545
   - couponCode
1546
   - userId
1547
  """
1548
 
1549
  thrift_spec = (
1550
    None, # 0
1551
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1552
    (2, TType.I64, 'userId', None, None, ), # 2
1553
  )
1554
 
1555
  def __init__(self, couponCode=None, userId=None,):
1556
    self.couponCode = couponCode
1557
    self.userId = userId
1558
 
1559
  def read(self, iprot):
1560
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1561
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1562
      return
1563
    iprot.readStructBegin()
1564
    while True:
1565
      (fname, ftype, fid) = iprot.readFieldBegin()
1566
      if ftype == TType.STOP:
1567
        break
1568
      if fid == 1:
1569
        if ftype == TType.STRING:
1570
          self.couponCode = iprot.readString();
1571
        else:
1572
          iprot.skip(ftype)
1573
      elif fid == 2:
1574
        if ftype == TType.I64:
1575
          self.userId = iprot.readI64();
1576
        else:
1577
          iprot.skip(ftype)
1578
      else:
1579
        iprot.skip(ftype)
1580
      iprot.readFieldEnd()
1581
    iprot.readStructEnd()
1582
 
1583
  def write(self, oprot):
1584
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1585
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1586
      return
1587
    oprot.writeStructBegin('getCouponUsageCountByUser_args')
3431 rajveer 1588
    if self.couponCode is not None:
1976 varun.gupt 1589
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1590
      oprot.writeString(self.couponCode)
1591
      oprot.writeFieldEnd()
3431 rajveer 1592
    if self.userId is not None:
1976 varun.gupt 1593
      oprot.writeFieldBegin('userId', TType.I64, 2)
1594
      oprot.writeI64(self.userId)
1595
      oprot.writeFieldEnd()
1596
    oprot.writeFieldStop()
1597
    oprot.writeStructEnd()
1598
 
3431 rajveer 1599
  def validate(self):
1600
    return
1601
 
1602
 
1976 varun.gupt 1603
  def __repr__(self):
1604
    L = ['%s=%r' % (key, value)
1605
      for key, value in self.__dict__.iteritems()]
1606
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1607
 
1608
  def __eq__(self, other):
1609
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1610
 
1611
  def __ne__(self, other):
1612
    return not (self == other)
1613
 
1614
class getCouponUsageCountByUser_result:
1615
  """
1616
  Attributes:
1617
   - success
1618
   - pex
1619
  """
1620
 
1621
  thrift_spec = (
1622
    (0, TType.I64, 'success', None, None, ), # 0
1623
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1624
  )
1625
 
1626
  def __init__(self, success=None, pex=None,):
1627
    self.success = success
1628
    self.pex = pex
1629
 
1630
  def read(self, iprot):
1631
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1632
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1633
      return
1634
    iprot.readStructBegin()
1635
    while True:
1636
      (fname, ftype, fid) = iprot.readFieldBegin()
1637
      if ftype == TType.STOP:
1638
        break
1639
      if fid == 0:
1640
        if ftype == TType.I64:
1641
          self.success = iprot.readI64();
1642
        else:
1643
          iprot.skip(ftype)
1644
      elif fid == 1:
1645
        if ftype == TType.STRUCT:
1646
          self.pex = PromotionException()
1647
          self.pex.read(iprot)
1648
        else:
1649
          iprot.skip(ftype)
1650
      else:
1651
        iprot.skip(ftype)
1652
      iprot.readFieldEnd()
1653
    iprot.readStructEnd()
1654
 
1655
  def write(self, oprot):
1656
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1657
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1658
      return
1659
    oprot.writeStructBegin('getCouponUsageCountByUser_result')
3431 rajveer 1660
    if self.success is not None:
1976 varun.gupt 1661
      oprot.writeFieldBegin('success', TType.I64, 0)
1662
      oprot.writeI64(self.success)
1663
      oprot.writeFieldEnd()
3431 rajveer 1664
    if self.pex is not None:
1976 varun.gupt 1665
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1666
      self.pex.write(oprot)
1667
      oprot.writeFieldEnd()
1668
    oprot.writeFieldStop()
1669
    oprot.writeStructEnd()
1670
 
3431 rajveer 1671
  def validate(self):
1672
    return
1673
 
1674
 
1976 varun.gupt 1675
  def __repr__(self):
1676
    L = ['%s=%r' % (key, value)
1677
      for key, value in self.__dict__.iteritems()]
1678
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1679
 
1680
  def __eq__(self, other):
1681
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1682
 
1683
  def __ne__(self, other):
1684
    return not (self == other)
1685
 
3385 varun.gupt 1686
class getActiveCoupons_args:
1976 varun.gupt 1687
 
3385 varun.gupt 1688
  thrift_spec = (
1689
  )
1690
 
1691
  def read(self, iprot):
1692
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1693
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1694
      return
1695
    iprot.readStructBegin()
1696
    while True:
1697
      (fname, ftype, fid) = iprot.readFieldBegin()
1698
      if ftype == TType.STOP:
1699
        break
1700
      else:
1701
        iprot.skip(ftype)
1702
      iprot.readFieldEnd()
1703
    iprot.readStructEnd()
1704
 
1705
  def write(self, oprot):
1706
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1707
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1708
      return
1709
    oprot.writeStructBegin('getActiveCoupons_args')
1710
    oprot.writeFieldStop()
1711
    oprot.writeStructEnd()
1712
 
3431 rajveer 1713
  def validate(self):
1714
    return
1715
 
1716
 
3385 varun.gupt 1717
  def __repr__(self):
1718
    L = ['%s=%r' % (key, value)
1719
      for key, value in self.__dict__.iteritems()]
1720
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1721
 
1722
  def __eq__(self, other):
1723
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1724
 
1725
  def __ne__(self, other):
1726
    return not (self == other)
1727
 
1728
class getActiveCoupons_result:
1729
  """
1730
  Attributes:
1731
   - success
1732
   - pex
1733
  """
1734
 
1735
  thrift_spec = (
1736
    (0, TType.LIST, 'success', (TType.STRUCT,(Coupon, Coupon.thrift_spec)), None, ), # 0
1737
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1738
  )
1739
 
1740
  def __init__(self, success=None, pex=None,):
1741
    self.success = success
1742
    self.pex = pex
1743
 
1744
  def read(self, iprot):
1745
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1746
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1747
      return
1748
    iprot.readStructBegin()
1749
    while True:
1750
      (fname, ftype, fid) = iprot.readFieldBegin()
1751
      if ftype == TType.STOP:
1752
        break
1753
      if fid == 0:
1754
        if ftype == TType.LIST:
1755
          self.success = []
3554 varun.gupt 1756
          (_etype38, _size35) = iprot.readListBegin()
1757
          for _i39 in xrange(_size35):
1758
            _elem40 = Coupon()
1759
            _elem40.read(iprot)
1760
            self.success.append(_elem40)
3385 varun.gupt 1761
          iprot.readListEnd()
1762
        else:
1763
          iprot.skip(ftype)
1764
      elif fid == 1:
1765
        if ftype == TType.STRUCT:
1766
          self.pex = PromotionException()
1767
          self.pex.read(iprot)
1768
        else:
1769
          iprot.skip(ftype)
1770
      else:
1771
        iprot.skip(ftype)
1772
      iprot.readFieldEnd()
1773
    iprot.readStructEnd()
1774
 
1775
  def write(self, oprot):
1776
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1777
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1778
      return
1779
    oprot.writeStructBegin('getActiveCoupons_result')
3431 rajveer 1780
    if self.success is not None:
3385 varun.gupt 1781
      oprot.writeFieldBegin('success', TType.LIST, 0)
1782
      oprot.writeListBegin(TType.STRUCT, len(self.success))
3554 varun.gupt 1783
      for iter41 in self.success:
1784
        iter41.write(oprot)
3385 varun.gupt 1785
      oprot.writeListEnd()
1786
      oprot.writeFieldEnd()
3431 rajveer 1787
    if self.pex is not None:
3385 varun.gupt 1788
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1789
      self.pex.write(oprot)
1790
      oprot.writeFieldEnd()
1791
    oprot.writeFieldStop()
1792
    oprot.writeStructEnd()
1793
 
3431 rajveer 1794
  def validate(self):
1795
    return
1796
 
1797
 
3385 varun.gupt 1798
  def __repr__(self):
1799
    L = ['%s=%r' % (key, value)
1800
      for key, value in self.__dict__.iteritems()]
1801
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1802
 
1803
  def __eq__(self, other):
1804
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1805
 
1806
  def __ne__(self, other):
1807
    return not (self == other)
1808
 
1809
class getSuccessfulPaymentCountForCoupon_args:
1810
  """
1811
  Attributes:
1812
   - couponCode
1813
  """
1814
 
1815
  thrift_spec = (
1816
    None, # 0
1817
    (1, TType.STRING, 'couponCode', None, None, ), # 1
1818
  )
1819
 
1820
  def __init__(self, couponCode=None,):
1821
    self.couponCode = couponCode
1822
 
1823
  def read(self, iprot):
1824
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1825
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1826
      return
1827
    iprot.readStructBegin()
1828
    while True:
1829
      (fname, ftype, fid) = iprot.readFieldBegin()
1830
      if ftype == TType.STOP:
1831
        break
1832
      if fid == 1:
1833
        if ftype == TType.STRING:
1834
          self.couponCode = iprot.readString();
1835
        else:
1836
          iprot.skip(ftype)
1837
      else:
1838
        iprot.skip(ftype)
1839
      iprot.readFieldEnd()
1840
    iprot.readStructEnd()
1841
 
1842
  def write(self, oprot):
1843
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1844
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1845
      return
1846
    oprot.writeStructBegin('getSuccessfulPaymentCountForCoupon_args')
3431 rajveer 1847
    if self.couponCode is not None:
3385 varun.gupt 1848
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
1849
      oprot.writeString(self.couponCode)
1850
      oprot.writeFieldEnd()
1851
    oprot.writeFieldStop()
1852
    oprot.writeStructEnd()
1853
 
3431 rajveer 1854
  def validate(self):
1855
    return
1856
 
1857
 
3385 varun.gupt 1858
  def __repr__(self):
1859
    L = ['%s=%r' % (key, value)
1860
      for key, value in self.__dict__.iteritems()]
1861
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1862
 
1863
  def __eq__(self, other):
1864
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1865
 
1866
  def __ne__(self, other):
1867
    return not (self == other)
1868
 
1869
class getSuccessfulPaymentCountForCoupon_result:
1870
  """
1871
  Attributes:
1872
   - success
1873
   - pex
1874
  """
1875
 
1876
  thrift_spec = (
1877
    (0, TType.I64, 'success', None, None, ), # 0
1878
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
1879
  )
1880
 
1881
  def __init__(self, success=None, pex=None,):
1882
    self.success = success
1883
    self.pex = pex
1884
 
1885
  def read(self, iprot):
1886
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1887
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1888
      return
1889
    iprot.readStructBegin()
1890
    while True:
1891
      (fname, ftype, fid) = iprot.readFieldBegin()
1892
      if ftype == TType.STOP:
1893
        break
1894
      if fid == 0:
1895
        if ftype == TType.I64:
1896
          self.success = iprot.readI64();
1897
        else:
1898
          iprot.skip(ftype)
1899
      elif fid == 1:
1900
        if ftype == TType.STRUCT:
1901
          self.pex = PromotionException()
1902
          self.pex.read(iprot)
1903
        else:
1904
          iprot.skip(ftype)
1905
      else:
1906
        iprot.skip(ftype)
1907
      iprot.readFieldEnd()
1908
    iprot.readStructEnd()
1909
 
1910
  def write(self, oprot):
1911
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1912
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1913
      return
1914
    oprot.writeStructBegin('getSuccessfulPaymentCountForCoupon_result')
3431 rajveer 1915
    if self.success is not None:
3385 varun.gupt 1916
      oprot.writeFieldBegin('success', TType.I64, 0)
1917
      oprot.writeI64(self.success)
1918
      oprot.writeFieldEnd()
3431 rajveer 1919
    if self.pex is not None:
3385 varun.gupt 1920
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1921
      self.pex.write(oprot)
1922
      oprot.writeFieldEnd()
1923
    oprot.writeFieldStop()
1924
    oprot.writeStructEnd()
1925
 
3431 rajveer 1926
  def validate(self):
1927
    return
1928
 
1929
 
3385 varun.gupt 1930
  def __repr__(self):
1931
    L = ['%s=%r' % (key, value)
1932
      for key, value in self.__dict__.iteritems()]
1933
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1934
 
1935
  def __eq__(self, other):
1936
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1937
 
1938
  def __ne__(self, other):
1939
    return not (self == other)
1940
 
1941
class getRuleDocString_args:
1942
  """
1943
  Attributes:
1944
   - ruleName
1945
  """
1946
 
1947
  thrift_spec = (
1948
    None, # 0
1949
    (1, TType.STRING, 'ruleName', None, None, ), # 1
1950
  )
1951
 
1952
  def __init__(self, ruleName=None,):
1953
    self.ruleName = ruleName
1954
 
1955
  def read(self, iprot):
1956
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1957
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1958
      return
1959
    iprot.readStructBegin()
1960
    while True:
1961
      (fname, ftype, fid) = iprot.readFieldBegin()
1962
      if ftype == TType.STOP:
1963
        break
1964
      if fid == 1:
1965
        if ftype == TType.STRING:
1966
          self.ruleName = iprot.readString();
1967
        else:
1968
          iprot.skip(ftype)
1969
      else:
1970
        iprot.skip(ftype)
1971
      iprot.readFieldEnd()
1972
    iprot.readStructEnd()
1973
 
1974
  def write(self, oprot):
1975
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1976
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1977
      return
1978
    oprot.writeStructBegin('getRuleDocString_args')
3431 rajveer 1979
    if self.ruleName is not None:
3385 varun.gupt 1980
      oprot.writeFieldBegin('ruleName', TType.STRING, 1)
1981
      oprot.writeString(self.ruleName)
1982
      oprot.writeFieldEnd()
1983
    oprot.writeFieldStop()
1984
    oprot.writeStructEnd()
1985
 
3431 rajveer 1986
  def validate(self):
1987
    return
1988
 
1989
 
3385 varun.gupt 1990
  def __repr__(self):
1991
    L = ['%s=%r' % (key, value)
1992
      for key, value in self.__dict__.iteritems()]
1993
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1994
 
1995
  def __eq__(self, other):
1996
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1997
 
1998
  def __ne__(self, other):
1999
    return not (self == other)
2000
 
2001
class getRuleDocString_result:
2002
  """
2003
  Attributes:
2004
   - success
2005
  """
2006
 
2007
  thrift_spec = (
2008
    (0, TType.STRING, 'success', None, None, ), # 0
2009
  )
2010
 
2011
  def __init__(self, success=None,):
2012
    self.success = success
2013
 
2014
  def read(self, iprot):
2015
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2016
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2017
      return
2018
    iprot.readStructBegin()
2019
    while True:
2020
      (fname, ftype, fid) = iprot.readFieldBegin()
2021
      if ftype == TType.STOP:
2022
        break
2023
      if fid == 0:
2024
        if ftype == TType.STRING:
2025
          self.success = iprot.readString();
2026
        else:
2027
          iprot.skip(ftype)
2028
      else:
2029
        iprot.skip(ftype)
2030
      iprot.readFieldEnd()
2031
    iprot.readStructEnd()
2032
 
2033
  def write(self, oprot):
2034
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2035
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2036
      return
2037
    oprot.writeStructBegin('getRuleDocString_result')
3431 rajveer 2038
    if self.success is not None:
3385 varun.gupt 2039
      oprot.writeFieldBegin('success', TType.STRING, 0)
2040
      oprot.writeString(self.success)
2041
      oprot.writeFieldEnd()
2042
    oprot.writeFieldStop()
2043
    oprot.writeStructEnd()
2044
 
3431 rajveer 2045
  def validate(self):
2046
    return
2047
 
2048
 
3385 varun.gupt 2049
  def __repr__(self):
2050
    L = ['%s=%r' % (key, value)
2051
      for key, value in self.__dict__.iteritems()]
2052
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2053
 
2054
  def __eq__(self, other):
2055
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2056
 
2057
  def __ne__(self, other):
2058
    return not (self == other)
4189 varun.gupt 2059
 
2060
class getItemDiscountMap_args:
2061
  """
2062
  Attributes:
2063
   - itemIds
2064
  """
2065
 
2066
  thrift_spec = (
2067
    None, # 0
2068
    (1, TType.LIST, 'itemIds', (TType.I64,None), None, ), # 1
2069
  )
2070
 
2071
  def __init__(self, itemIds=None,):
2072
    self.itemIds = itemIds
2073
 
2074
  def read(self, iprot):
2075
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2076
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2077
      return
2078
    iprot.readStructBegin()
2079
    while True:
2080
      (fname, ftype, fid) = iprot.readFieldBegin()
2081
      if ftype == TType.STOP:
2082
        break
2083
      if fid == 1:
2084
        if ftype == TType.LIST:
2085
          self.itemIds = []
2086
          (_etype45, _size42) = iprot.readListBegin()
2087
          for _i46 in xrange(_size42):
2088
            _elem47 = iprot.readI64();
2089
            self.itemIds.append(_elem47)
2090
          iprot.readListEnd()
2091
        else:
2092
          iprot.skip(ftype)
2093
      else:
2094
        iprot.skip(ftype)
2095
      iprot.readFieldEnd()
2096
    iprot.readStructEnd()
2097
 
2098
  def write(self, oprot):
2099
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2100
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2101
      return
2102
    oprot.writeStructBegin('getItemDiscountMap_args')
2103
    if self.itemIds is not None:
2104
      oprot.writeFieldBegin('itemIds', TType.LIST, 1)
2105
      oprot.writeListBegin(TType.I64, len(self.itemIds))
2106
      for iter48 in self.itemIds:
2107
        oprot.writeI64(iter48)
2108
      oprot.writeListEnd()
2109
      oprot.writeFieldEnd()
2110
    oprot.writeFieldStop()
2111
    oprot.writeStructEnd()
2112
 
2113
  def validate(self):
2114
    return
2115
 
2116
 
2117
  def __repr__(self):
2118
    L = ['%s=%r' % (key, value)
2119
      for key, value in self.__dict__.iteritems()]
2120
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2121
 
2122
  def __eq__(self, other):
2123
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2124
 
2125
  def __ne__(self, other):
2126
    return not (self == other)
2127
 
2128
class getItemDiscountMap_result:
2129
  """
2130
  Attributes:
2131
   - success
2132
   - pex
2133
  """
2134
 
2135
  thrift_spec = (
2136
    (0, TType.LIST, 'success', (TType.STRUCT,(ItemCouponDiscount, ItemCouponDiscount.thrift_spec)), None, ), # 0
2137
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
2138
  )
2139
 
2140
  def __init__(self, success=None, pex=None,):
2141
    self.success = success
2142
    self.pex = pex
2143
 
2144
  def read(self, iprot):
2145
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2146
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2147
      return
2148
    iprot.readStructBegin()
2149
    while True:
2150
      (fname, ftype, fid) = iprot.readFieldBegin()
2151
      if ftype == TType.STOP:
2152
        break
2153
      if fid == 0:
2154
        if ftype == TType.LIST:
2155
          self.success = []
2156
          (_etype52, _size49) = iprot.readListBegin()
2157
          for _i53 in xrange(_size49):
2158
            _elem54 = ItemCouponDiscount()
2159
            _elem54.read(iprot)
2160
            self.success.append(_elem54)
2161
          iprot.readListEnd()
2162
        else:
2163
          iprot.skip(ftype)
2164
      elif fid == 1:
2165
        if ftype == TType.STRUCT:
2166
          self.pex = PromotionException()
2167
          self.pex.read(iprot)
2168
        else:
2169
          iprot.skip(ftype)
2170
      else:
2171
        iprot.skip(ftype)
2172
      iprot.readFieldEnd()
2173
    iprot.readStructEnd()
2174
 
2175
  def write(self, oprot):
2176
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2177
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2178
      return
2179
    oprot.writeStructBegin('getItemDiscountMap_result')
2180
    if self.success is not None:
2181
      oprot.writeFieldBegin('success', TType.LIST, 0)
2182
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2183
      for iter55 in self.success:
2184
        iter55.write(oprot)
2185
      oprot.writeListEnd()
2186
      oprot.writeFieldEnd()
2187
    if self.pex is not None:
2188
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
2189
      self.pex.write(oprot)
2190
      oprot.writeFieldEnd()
2191
    oprot.writeFieldStop()
2192
    oprot.writeStructEnd()
2193
 
2194
  def validate(self):
2195
    return
2196
 
2197
 
2198
  def __repr__(self):
2199
    L = ['%s=%r' % (key, value)
2200
      for key, value in self.__dict__.iteritems()]
2201
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2202
 
2203
  def __eq__(self, other):
2204
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2205
 
2206
  def __ne__(self, other):
2207
    return not (self == other)
4494 varun.gupt 2208
 
2209
class getDiscountsForEntity_args:
2210
  """
2211
  Attributes:
2212
   - entityId
2213
  """
2214
 
2215
  thrift_spec = (
2216
    None, # 0
2217
    (1, TType.I64, 'entityId', None, None, ), # 1
2218
  )
2219
 
2220
  def __init__(self, entityId=None,):
2221
    self.entityId = entityId
2222
 
2223
  def read(self, iprot):
2224
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2225
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2226
      return
2227
    iprot.readStructBegin()
2228
    while True:
2229
      (fname, ftype, fid) = iprot.readFieldBegin()
2230
      if ftype == TType.STOP:
2231
        break
2232
      if fid == 1:
2233
        if ftype == TType.I64:
2234
          self.entityId = iprot.readI64();
2235
        else:
2236
          iprot.skip(ftype)
2237
      else:
2238
        iprot.skip(ftype)
2239
      iprot.readFieldEnd()
2240
    iprot.readStructEnd()
2241
 
2242
  def write(self, oprot):
2243
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2244
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2245
      return
2246
    oprot.writeStructBegin('getDiscountsForEntity_args')
2247
    if self.entityId is not None:
2248
      oprot.writeFieldBegin('entityId', TType.I64, 1)
2249
      oprot.writeI64(self.entityId)
2250
      oprot.writeFieldEnd()
2251
    oprot.writeFieldStop()
2252
    oprot.writeStructEnd()
2253
 
2254
  def validate(self):
2255
    return
2256
 
2257
 
2258
  def __repr__(self):
2259
    L = ['%s=%r' % (key, value)
2260
      for key, value in self.__dict__.iteritems()]
2261
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2262
 
2263
  def __eq__(self, other):
2264
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2265
 
2266
  def __ne__(self, other):
2267
    return not (self == other)
2268
 
2269
class getDiscountsForEntity_result:
2270
  """
2271
  Attributes:
2272
   - success
2273
  """
2274
 
2275
  thrift_spec = (
2276
    (0, TType.MAP, 'success', (TType.STRING,None,TType.DOUBLE,None), None, ), # 0
2277
  )
2278
 
2279
  def __init__(self, success=None,):
2280
    self.success = success
2281
 
2282
  def read(self, iprot):
2283
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2284
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2285
      return
2286
    iprot.readStructBegin()
2287
    while True:
2288
      (fname, ftype, fid) = iprot.readFieldBegin()
2289
      if ftype == TType.STOP:
2290
        break
2291
      if fid == 0:
2292
        if ftype == TType.MAP:
2293
          self.success = {}
2294
          (_ktype57, _vtype58, _size56 ) = iprot.readMapBegin() 
2295
          for _i60 in xrange(_size56):
2296
            _key61 = iprot.readString();
2297
            _val62 = iprot.readDouble();
2298
            self.success[_key61] = _val62
2299
          iprot.readMapEnd()
2300
        else:
2301
          iprot.skip(ftype)
2302
      else:
2303
        iprot.skip(ftype)
2304
      iprot.readFieldEnd()
2305
    iprot.readStructEnd()
2306
 
2307
  def write(self, oprot):
2308
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2309
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2310
      return
2311
    oprot.writeStructBegin('getDiscountsForEntity_result')
2312
    if self.success is not None:
2313
      oprot.writeFieldBegin('success', TType.MAP, 0)
2314
      oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.success))
2315
      for kiter63,viter64 in self.success.items():
2316
        oprot.writeString(kiter63)
2317
        oprot.writeDouble(viter64)
2318
      oprot.writeMapEnd()
2319
      oprot.writeFieldEnd()
2320
    oprot.writeFieldStop()
2321
    oprot.writeStructEnd()
2322
 
2323
  def validate(self):
2324
    return
2325
 
2326
 
2327
  def __repr__(self):
2328
    L = ['%s=%r' % (key, value)
2329
      for key, value in self.__dict__.iteritems()]
2330
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2331
 
2332
  def __eq__(self, other):
2333
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2334
 
2335
  def __ne__(self, other):
2336
    return not (self == other)