Subversion Repositories SmartDukaan

Rev

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