Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1982 varun.gupt 1
/**
2
 * Autogenerated by Thrift
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class PromotionService {
27
 
28
  /**
29
   * Promotion Service
30
   */
3374 rajveer 31
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
1982 varun.gupt 32
 
33
    /**
34
     * For closing the open session in sqlalchemy
35
     */
36
    public void closeSession() throws TException;
37
 
38
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, TException;
39
 
40
    public List<Promotion> getAllPromotions() throws PromotionException, TException;
41
 
42
    public Promotion getPromotionById(long promotionId) throws PromotionException, TException;
43
 
44
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, TException;
45
 
46
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, TException;
47
 
48
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, TException;
49
 
50
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, TException;
51
 
3385 varun.gupt 52
    /**
53
     * Returns a list of active coupons
54
     */
55
    public List<Coupon> getActiveCoupons() throws PromotionException, TException;
56
 
57
    /**
58
     * Returns the count of successful payments done using a given coupon
59
     * 
60
     * @param couponCode
61
     */
62
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, TException;
63
 
64
    /**
65
     * Returns the doc string of the rule module
66
     * 
67
     * @param ruleName
68
     */
69
    public String getRuleDocString(String ruleName) throws TException;
70
 
1982 varun.gupt 71
  }
72
 
3374 rajveer 73
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
1982 varun.gupt 74
    public Client(TProtocol prot)
75
    {
76
      this(prot, prot);
77
    }
78
 
79
    public Client(TProtocol iprot, TProtocol oprot)
80
    {
3374 rajveer 81
      super(iprot, oprot);
1982 varun.gupt 82
    }
83
 
84
    public void closeSession() throws TException
85
    {
86
      send_closeSession();
87
      recv_closeSession();
88
    }
89
 
90
    public void send_closeSession() throws TException
91
    {
92
      oprot_.writeMessageBegin(new TMessage("closeSession", TMessageType.CALL, seqid_));
93
      closeSession_args args = new closeSession_args();
94
      args.write(oprot_);
95
      oprot_.writeMessageEnd();
96
      oprot_.getTransport().flush();
97
    }
98
 
99
    public void recv_closeSession() throws TException
100
    {
101
      TMessage msg = iprot_.readMessageBegin();
102
      if (msg.type == TMessageType.EXCEPTION) {
103
        TApplicationException x = TApplicationException.read(iprot_);
104
        iprot_.readMessageEnd();
105
        throw x;
106
      }
107
      closeSession_result result = new closeSession_result();
108
      result.read(iprot_);
109
      iprot_.readMessageEnd();
110
      return;
111
    }
112
 
113
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, TException
114
    {
115
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
116
      recv_createPromotion();
117
    }
118
 
119
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws TException
120
    {
121
      oprot_.writeMessageBegin(new TMessage("createPromotion", TMessageType.CALL, seqid_));
122
      createPromotion_args args = new createPromotion_args();
123
      args.name = name;
124
      args.ruleExecutionSrc = ruleExecutionSrc;
125
      args.startOn = startOn;
126
      args.endOn = endOn;
127
      args.write(oprot_);
128
      oprot_.writeMessageEnd();
129
      oprot_.getTransport().flush();
130
    }
131
 
132
    public void recv_createPromotion() throws PromotionException, TException
133
    {
134
      TMessage msg = iprot_.readMessageBegin();
135
      if (msg.type == TMessageType.EXCEPTION) {
136
        TApplicationException x = TApplicationException.read(iprot_);
137
        iprot_.readMessageEnd();
138
        throw x;
139
      }
140
      createPromotion_result result = new createPromotion_result();
141
      result.read(iprot_);
142
      iprot_.readMessageEnd();
143
      if (result.pex != null) {
144
        throw result.pex;
145
      }
146
      return;
147
    }
148
 
149
    public List<Promotion> getAllPromotions() throws PromotionException, TException
150
    {
151
      send_getAllPromotions();
152
      return recv_getAllPromotions();
153
    }
154
 
155
    public void send_getAllPromotions() throws TException
156
    {
157
      oprot_.writeMessageBegin(new TMessage("getAllPromotions", TMessageType.CALL, seqid_));
158
      getAllPromotions_args args = new getAllPromotions_args();
159
      args.write(oprot_);
160
      oprot_.writeMessageEnd();
161
      oprot_.getTransport().flush();
162
    }
163
 
164
    public List<Promotion> recv_getAllPromotions() throws PromotionException, TException
165
    {
166
      TMessage msg = iprot_.readMessageBegin();
167
      if (msg.type == TMessageType.EXCEPTION) {
168
        TApplicationException x = TApplicationException.read(iprot_);
169
        iprot_.readMessageEnd();
170
        throw x;
171
      }
172
      getAllPromotions_result result = new getAllPromotions_result();
173
      result.read(iprot_);
174
      iprot_.readMessageEnd();
175
      if (result.isSetSuccess()) {
176
        return result.success;
177
      }
178
      if (result.pex != null) {
179
        throw result.pex;
180
      }
181
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
182
    }
183
 
184
    public Promotion getPromotionById(long promotionId) throws PromotionException, TException
185
    {
186
      send_getPromotionById(promotionId);
187
      return recv_getPromotionById();
188
    }
189
 
190
    public void send_getPromotionById(long promotionId) throws TException
191
    {
192
      oprot_.writeMessageBegin(new TMessage("getPromotionById", TMessageType.CALL, seqid_));
193
      getPromotionById_args args = new getPromotionById_args();
194
      args.promotionId = promotionId;
195
      args.write(oprot_);
196
      oprot_.writeMessageEnd();
197
      oprot_.getTransport().flush();
198
    }
199
 
200
    public Promotion recv_getPromotionById() throws PromotionException, TException
201
    {
202
      TMessage msg = iprot_.readMessageBegin();
203
      if (msg.type == TMessageType.EXCEPTION) {
204
        TApplicationException x = TApplicationException.read(iprot_);
205
        iprot_.readMessageEnd();
206
        throw x;
207
      }
208
      getPromotionById_result result = new getPromotionById_result();
209
      result.read(iprot_);
210
      iprot_.readMessageEnd();
211
      if (result.isSetSuccess()) {
212
        return result.success;
213
      }
214
      if (result.pex != null) {
215
        throw result.pex;
216
      }
217
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
218
    }
219
 
220
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, TException
221
    {
222
      send_generateCouponsForPromotion(promotionId, couponCode);
223
      recv_generateCouponsForPromotion();
224
    }
225
 
226
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws TException
227
    {
228
      oprot_.writeMessageBegin(new TMessage("generateCouponsForPromotion", TMessageType.CALL, seqid_));
229
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
230
      args.promotionId = promotionId;
231
      args.couponCode = couponCode;
232
      args.write(oprot_);
233
      oprot_.writeMessageEnd();
234
      oprot_.getTransport().flush();
235
    }
236
 
237
    public void recv_generateCouponsForPromotion() throws PromotionException, TException
238
    {
239
      TMessage msg = iprot_.readMessageBegin();
240
      if (msg.type == TMessageType.EXCEPTION) {
241
        TApplicationException x = TApplicationException.read(iprot_);
242
        iprot_.readMessageEnd();
243
        throw x;
244
      }
245
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
246
      result.read(iprot_);
247
      iprot_.readMessageEnd();
248
      if (result.pex != null) {
249
        throw result.pex;
250
      }
251
      return;
252
    }
253
 
254
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, TException
255
    {
256
      send_applyCoupon(couponCode, cartId);
257
      return recv_applyCoupon();
258
    }
259
 
260
    public void send_applyCoupon(String couponCode, long cartId) throws TException
261
    {
262
      oprot_.writeMessageBegin(new TMessage("applyCoupon", TMessageType.CALL, seqid_));
263
      applyCoupon_args args = new applyCoupon_args();
264
      args.couponCode = couponCode;
265
      args.cartId = cartId;
266
      args.write(oprot_);
267
      oprot_.writeMessageEnd();
268
      oprot_.getTransport().flush();
269
    }
270
 
271
    public Cart recv_applyCoupon() throws PromotionException, TException
272
    {
273
      TMessage msg = iprot_.readMessageBegin();
274
      if (msg.type == TMessageType.EXCEPTION) {
275
        TApplicationException x = TApplicationException.read(iprot_);
276
        iprot_.readMessageEnd();
277
        throw x;
278
      }
279
      applyCoupon_result result = new applyCoupon_result();
280
      result.read(iprot_);
281
      iprot_.readMessageEnd();
282
      if (result.isSetSuccess()) {
283
        return result.success;
284
      }
285
      if (result.pex != null) {
286
        throw result.pex;
287
      }
288
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
289
    }
290
 
291
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, TException
292
    {
293
      send_trackCouponUsage(couponCode, transactionId, userId);
294
      recv_trackCouponUsage();
295
    }
296
 
297
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws TException
298
    {
299
      oprot_.writeMessageBegin(new TMessage("trackCouponUsage", TMessageType.CALL, seqid_));
300
      trackCouponUsage_args args = new trackCouponUsage_args();
301
      args.couponCode = couponCode;
302
      args.transactionId = transactionId;
303
      args.userId = userId;
304
      args.write(oprot_);
305
      oprot_.writeMessageEnd();
306
      oprot_.getTransport().flush();
307
    }
308
 
309
    public void recv_trackCouponUsage() throws PromotionException, TException
310
    {
311
      TMessage msg = iprot_.readMessageBegin();
312
      if (msg.type == TMessageType.EXCEPTION) {
313
        TApplicationException x = TApplicationException.read(iprot_);
314
        iprot_.readMessageEnd();
315
        throw x;
316
      }
317
      trackCouponUsage_result result = new trackCouponUsage_result();
318
      result.read(iprot_);
319
      iprot_.readMessageEnd();
320
      if (result.pex != null) {
321
        throw result.pex;
322
      }
323
      return;
324
    }
325
 
326
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, TException
327
    {
328
      send_getCouponUsageCountByUser(couponCode, userId);
329
      return recv_getCouponUsageCountByUser();
330
    }
331
 
332
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws TException
333
    {
334
      oprot_.writeMessageBegin(new TMessage("getCouponUsageCountByUser", TMessageType.CALL, seqid_));
335
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
336
      args.couponCode = couponCode;
337
      args.userId = userId;
338
      args.write(oprot_);
339
      oprot_.writeMessageEnd();
340
      oprot_.getTransport().flush();
341
    }
342
 
343
    public long recv_getCouponUsageCountByUser() throws PromotionException, TException
344
    {
345
      TMessage msg = iprot_.readMessageBegin();
346
      if (msg.type == TMessageType.EXCEPTION) {
347
        TApplicationException x = TApplicationException.read(iprot_);
348
        iprot_.readMessageEnd();
349
        throw x;
350
      }
351
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
352
      result.read(iprot_);
353
      iprot_.readMessageEnd();
354
      if (result.isSetSuccess()) {
355
        return result.success;
356
      }
357
      if (result.pex != null) {
358
        throw result.pex;
359
      }
360
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
361
    }
362
 
3385 varun.gupt 363
    public List<Coupon> getActiveCoupons() throws PromotionException, TException
364
    {
365
      send_getActiveCoupons();
366
      return recv_getActiveCoupons();
367
    }
368
 
369
    public void send_getActiveCoupons() throws TException
370
    {
371
      oprot_.writeMessageBegin(new TMessage("getActiveCoupons", TMessageType.CALL, seqid_));
372
      getActiveCoupons_args args = new getActiveCoupons_args();
373
      args.write(oprot_);
374
      oprot_.writeMessageEnd();
375
      oprot_.getTransport().flush();
376
    }
377
 
378
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, TException
379
    {
380
      TMessage msg = iprot_.readMessageBegin();
381
      if (msg.type == TMessageType.EXCEPTION) {
382
        TApplicationException x = TApplicationException.read(iprot_);
383
        iprot_.readMessageEnd();
384
        throw x;
385
      }
386
      getActiveCoupons_result result = new getActiveCoupons_result();
387
      result.read(iprot_);
388
      iprot_.readMessageEnd();
389
      if (result.isSetSuccess()) {
390
        return result.success;
391
      }
392
      if (result.pex != null) {
393
        throw result.pex;
394
      }
395
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
396
    }
397
 
398
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, TException
399
    {
400
      send_getSuccessfulPaymentCountForCoupon(couponCode);
401
      return recv_getSuccessfulPaymentCountForCoupon();
402
    }
403
 
404
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws TException
405
    {
406
      oprot_.writeMessageBegin(new TMessage("getSuccessfulPaymentCountForCoupon", TMessageType.CALL, seqid_));
407
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
408
      args.couponCode = couponCode;
409
      args.write(oprot_);
410
      oprot_.writeMessageEnd();
411
      oprot_.getTransport().flush();
412
    }
413
 
414
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, TException
415
    {
416
      TMessage msg = iprot_.readMessageBegin();
417
      if (msg.type == TMessageType.EXCEPTION) {
418
        TApplicationException x = TApplicationException.read(iprot_);
419
        iprot_.readMessageEnd();
420
        throw x;
421
      }
422
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
423
      result.read(iprot_);
424
      iprot_.readMessageEnd();
425
      if (result.isSetSuccess()) {
426
        return result.success;
427
      }
428
      if (result.pex != null) {
429
        throw result.pex;
430
      }
431
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
432
    }
433
 
434
    public String getRuleDocString(String ruleName) throws TException
435
    {
436
      send_getRuleDocString(ruleName);
437
      return recv_getRuleDocString();
438
    }
439
 
440
    public void send_getRuleDocString(String ruleName) throws TException
441
    {
442
      oprot_.writeMessageBegin(new TMessage("getRuleDocString", TMessageType.CALL, seqid_));
443
      getRuleDocString_args args = new getRuleDocString_args();
444
      args.ruleName = ruleName;
445
      args.write(oprot_);
446
      oprot_.writeMessageEnd();
447
      oprot_.getTransport().flush();
448
    }
449
 
450
    public String recv_getRuleDocString() throws TException
451
    {
452
      TMessage msg = iprot_.readMessageBegin();
453
      if (msg.type == TMessageType.EXCEPTION) {
454
        TApplicationException x = TApplicationException.read(iprot_);
455
        iprot_.readMessageEnd();
456
        throw x;
457
      }
458
      getRuleDocString_result result = new getRuleDocString_result();
459
      result.read(iprot_);
460
      iprot_.readMessageEnd();
461
      if (result.isSetSuccess()) {
462
        return result.success;
463
      }
464
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
465
    }
466
 
1982 varun.gupt 467
  }
3374 rajveer 468
  public static class Processor extends in.shop2020.generic.GenericService.Processor implements TProcessor {
1982 varun.gupt 469
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
470
    public Processor(Iface iface)
471
    {
3374 rajveer 472
      super(iface);
1982 varun.gupt 473
      iface_ = iface;
474
      processMap_.put("closeSession", new closeSession());
475
      processMap_.put("createPromotion", new createPromotion());
476
      processMap_.put("getAllPromotions", new getAllPromotions());
477
      processMap_.put("getPromotionById", new getPromotionById());
478
      processMap_.put("generateCouponsForPromotion", new generateCouponsForPromotion());
479
      processMap_.put("applyCoupon", new applyCoupon());
480
      processMap_.put("trackCouponUsage", new trackCouponUsage());
481
      processMap_.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
3385 varun.gupt 482
      processMap_.put("getActiveCoupons", new getActiveCoupons());
483
      processMap_.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
484
      processMap_.put("getRuleDocString", new getRuleDocString());
1982 varun.gupt 485
    }
486
 
487
    private Iface iface_;
488
 
489
    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
490
    {
491
      TMessage msg = iprot.readMessageBegin();
492
      ProcessFunction fn = processMap_.get(msg.name);
493
      if (fn == null) {
494
        TProtocolUtil.skip(iprot, TType.STRUCT);
495
        iprot.readMessageEnd();
496
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
497
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
498
        x.write(oprot);
499
        oprot.writeMessageEnd();
500
        oprot.getTransport().flush();
501
        return true;
502
      }
503
      fn.process(msg.seqid, iprot, oprot);
504
      return true;
505
    }
506
 
507
    private class closeSession implements ProcessFunction {
508
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
509
      {
510
        closeSession_args args = new closeSession_args();
511
        args.read(iprot);
512
        iprot.readMessageEnd();
513
        closeSession_result result = new closeSession_result();
514
        iface_.closeSession();
515
        oprot.writeMessageBegin(new TMessage("closeSession", TMessageType.REPLY, seqid));
516
        result.write(oprot);
517
        oprot.writeMessageEnd();
518
        oprot.getTransport().flush();
519
      }
520
 
521
    }
522
 
523
    private class createPromotion implements ProcessFunction {
524
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
525
      {
526
        createPromotion_args args = new createPromotion_args();
527
        args.read(iprot);
528
        iprot.readMessageEnd();
529
        createPromotion_result result = new createPromotion_result();
530
        try {
531
          iface_.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
532
        } catch (PromotionException pex) {
533
          result.pex = pex;
534
        } catch (Throwable th) {
535
          LOGGER.error("Internal error processing createPromotion", th);
536
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing createPromotion");
537
          oprot.writeMessageBegin(new TMessage("createPromotion", TMessageType.EXCEPTION, seqid));
538
          x.write(oprot);
539
          oprot.writeMessageEnd();
540
          oprot.getTransport().flush();
541
          return;
542
        }
543
        oprot.writeMessageBegin(new TMessage("createPromotion", TMessageType.REPLY, seqid));
544
        result.write(oprot);
545
        oprot.writeMessageEnd();
546
        oprot.getTransport().flush();
547
      }
548
 
549
    }
550
 
551
    private class getAllPromotions implements ProcessFunction {
552
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
553
      {
554
        getAllPromotions_args args = new getAllPromotions_args();
555
        args.read(iprot);
556
        iprot.readMessageEnd();
557
        getAllPromotions_result result = new getAllPromotions_result();
558
        try {
559
          result.success = iface_.getAllPromotions();
560
        } catch (PromotionException pex) {
561
          result.pex = pex;
562
        } catch (Throwable th) {
563
          LOGGER.error("Internal error processing getAllPromotions", th);
564
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllPromotions");
565
          oprot.writeMessageBegin(new TMessage("getAllPromotions", TMessageType.EXCEPTION, seqid));
566
          x.write(oprot);
567
          oprot.writeMessageEnd();
568
          oprot.getTransport().flush();
569
          return;
570
        }
571
        oprot.writeMessageBegin(new TMessage("getAllPromotions", TMessageType.REPLY, seqid));
572
        result.write(oprot);
573
        oprot.writeMessageEnd();
574
        oprot.getTransport().flush();
575
      }
576
 
577
    }
578
 
579
    private class getPromotionById implements ProcessFunction {
580
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
581
      {
582
        getPromotionById_args args = new getPromotionById_args();
583
        args.read(iprot);
584
        iprot.readMessageEnd();
585
        getPromotionById_result result = new getPromotionById_result();
586
        try {
587
          result.success = iface_.getPromotionById(args.promotionId);
588
        } catch (PromotionException pex) {
589
          result.pex = pex;
590
        } catch (Throwable th) {
591
          LOGGER.error("Internal error processing getPromotionById", th);
592
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPromotionById");
593
          oprot.writeMessageBegin(new TMessage("getPromotionById", TMessageType.EXCEPTION, seqid));
594
          x.write(oprot);
595
          oprot.writeMessageEnd();
596
          oprot.getTransport().flush();
597
          return;
598
        }
599
        oprot.writeMessageBegin(new TMessage("getPromotionById", TMessageType.REPLY, seqid));
600
        result.write(oprot);
601
        oprot.writeMessageEnd();
602
        oprot.getTransport().flush();
603
      }
604
 
605
    }
606
 
607
    private class generateCouponsForPromotion implements ProcessFunction {
608
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
609
      {
610
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
611
        args.read(iprot);
612
        iprot.readMessageEnd();
613
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
614
        try {
615
          iface_.generateCouponsForPromotion(args.promotionId, args.couponCode);
616
        } catch (PromotionException pex) {
617
          result.pex = pex;
618
        } catch (Throwable th) {
619
          LOGGER.error("Internal error processing generateCouponsForPromotion", th);
620
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing generateCouponsForPromotion");
621
          oprot.writeMessageBegin(new TMessage("generateCouponsForPromotion", TMessageType.EXCEPTION, seqid));
622
          x.write(oprot);
623
          oprot.writeMessageEnd();
624
          oprot.getTransport().flush();
625
          return;
626
        }
627
        oprot.writeMessageBegin(new TMessage("generateCouponsForPromotion", TMessageType.REPLY, seqid));
628
        result.write(oprot);
629
        oprot.writeMessageEnd();
630
        oprot.getTransport().flush();
631
      }
632
 
633
    }
634
 
635
    private class applyCoupon implements ProcessFunction {
636
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
637
      {
638
        applyCoupon_args args = new applyCoupon_args();
639
        args.read(iprot);
640
        iprot.readMessageEnd();
641
        applyCoupon_result result = new applyCoupon_result();
642
        try {
643
          result.success = iface_.applyCoupon(args.couponCode, args.cartId);
644
        } catch (PromotionException pex) {
645
          result.pex = pex;
646
        } catch (Throwable th) {
647
          LOGGER.error("Internal error processing applyCoupon", th);
648
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing applyCoupon");
649
          oprot.writeMessageBegin(new TMessage("applyCoupon", TMessageType.EXCEPTION, seqid));
650
          x.write(oprot);
651
          oprot.writeMessageEnd();
652
          oprot.getTransport().flush();
653
          return;
654
        }
655
        oprot.writeMessageBegin(new TMessage("applyCoupon", TMessageType.REPLY, seqid));
656
        result.write(oprot);
657
        oprot.writeMessageEnd();
658
        oprot.getTransport().flush();
659
      }
660
 
661
    }
662
 
663
    private class trackCouponUsage implements ProcessFunction {
664
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
665
      {
666
        trackCouponUsage_args args = new trackCouponUsage_args();
667
        args.read(iprot);
668
        iprot.readMessageEnd();
669
        trackCouponUsage_result result = new trackCouponUsage_result();
670
        try {
671
          iface_.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
672
        } catch (PromotionException pex) {
673
          result.pex = pex;
674
        } catch (Throwable th) {
675
          LOGGER.error("Internal error processing trackCouponUsage", th);
676
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing trackCouponUsage");
677
          oprot.writeMessageBegin(new TMessage("trackCouponUsage", TMessageType.EXCEPTION, seqid));
678
          x.write(oprot);
679
          oprot.writeMessageEnd();
680
          oprot.getTransport().flush();
681
          return;
682
        }
683
        oprot.writeMessageBegin(new TMessage("trackCouponUsage", TMessageType.REPLY, seqid));
684
        result.write(oprot);
685
        oprot.writeMessageEnd();
686
        oprot.getTransport().flush();
687
      }
688
 
689
    }
690
 
691
    private class getCouponUsageCountByUser implements ProcessFunction {
692
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
693
      {
694
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
695
        args.read(iprot);
696
        iprot.readMessageEnd();
697
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
698
        try {
699
          result.success = iface_.getCouponUsageCountByUser(args.couponCode, args.userId);
700
          result.setSuccessIsSet(true);
701
        } catch (PromotionException pex) {
702
          result.pex = pex;
703
        } catch (Throwable th) {
704
          LOGGER.error("Internal error processing getCouponUsageCountByUser", th);
705
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getCouponUsageCountByUser");
706
          oprot.writeMessageBegin(new TMessage("getCouponUsageCountByUser", TMessageType.EXCEPTION, seqid));
707
          x.write(oprot);
708
          oprot.writeMessageEnd();
709
          oprot.getTransport().flush();
710
          return;
711
        }
712
        oprot.writeMessageBegin(new TMessage("getCouponUsageCountByUser", TMessageType.REPLY, seqid));
713
        result.write(oprot);
714
        oprot.writeMessageEnd();
715
        oprot.getTransport().flush();
716
      }
717
 
718
    }
719
 
3385 varun.gupt 720
    private class getActiveCoupons implements ProcessFunction {
721
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
722
      {
723
        getActiveCoupons_args args = new getActiveCoupons_args();
724
        args.read(iprot);
725
        iprot.readMessageEnd();
726
        getActiveCoupons_result result = new getActiveCoupons_result();
727
        try {
728
          result.success = iface_.getActiveCoupons();
729
        } catch (PromotionException pex) {
730
          result.pex = pex;
731
        } catch (Throwable th) {
732
          LOGGER.error("Internal error processing getActiveCoupons", th);
733
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getActiveCoupons");
734
          oprot.writeMessageBegin(new TMessage("getActiveCoupons", TMessageType.EXCEPTION, seqid));
735
          x.write(oprot);
736
          oprot.writeMessageEnd();
737
          oprot.getTransport().flush();
738
          return;
739
        }
740
        oprot.writeMessageBegin(new TMessage("getActiveCoupons", TMessageType.REPLY, seqid));
741
        result.write(oprot);
742
        oprot.writeMessageEnd();
743
        oprot.getTransport().flush();
744
      }
745
 
746
    }
747
 
748
    private class getSuccessfulPaymentCountForCoupon implements ProcessFunction {
749
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
750
      {
751
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
752
        args.read(iprot);
753
        iprot.readMessageEnd();
754
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
755
        try {
756
          result.success = iface_.getSuccessfulPaymentCountForCoupon(args.couponCode);
757
          result.setSuccessIsSet(true);
758
        } catch (PromotionException pex) {
759
          result.pex = pex;
760
        } catch (Throwable th) {
761
          LOGGER.error("Internal error processing getSuccessfulPaymentCountForCoupon", th);
762
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getSuccessfulPaymentCountForCoupon");
763
          oprot.writeMessageBegin(new TMessage("getSuccessfulPaymentCountForCoupon", TMessageType.EXCEPTION, seqid));
764
          x.write(oprot);
765
          oprot.writeMessageEnd();
766
          oprot.getTransport().flush();
767
          return;
768
        }
769
        oprot.writeMessageBegin(new TMessage("getSuccessfulPaymentCountForCoupon", TMessageType.REPLY, seqid));
770
        result.write(oprot);
771
        oprot.writeMessageEnd();
772
        oprot.getTransport().flush();
773
      }
774
 
775
    }
776
 
777
    private class getRuleDocString implements ProcessFunction {
778
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
779
      {
780
        getRuleDocString_args args = new getRuleDocString_args();
781
        args.read(iprot);
782
        iprot.readMessageEnd();
783
        getRuleDocString_result result = new getRuleDocString_result();
784
        result.success = iface_.getRuleDocString(args.ruleName);
785
        oprot.writeMessageBegin(new TMessage("getRuleDocString", TMessageType.REPLY, seqid));
786
        result.write(oprot);
787
        oprot.writeMessageEnd();
788
        oprot.getTransport().flush();
789
      }
790
 
791
    }
792
 
1982 varun.gupt 793
  }
794
 
795
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
796
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
797
 
798
 
799
 
800
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
801
    public enum _Fields implements TFieldIdEnum {
802
;
803
 
804
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
805
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
806
 
807
      static {
808
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
809
          byId.put((int)field._thriftId, field);
810
          byName.put(field.getFieldName(), field);
811
        }
812
      }
813
 
814
      /**
815
       * Find the _Fields constant that matches fieldId, or null if its not found.
816
       */
817
      public static _Fields findByThriftId(int fieldId) {
818
        return byId.get(fieldId);
819
      }
820
 
821
      /**
822
       * Find the _Fields constant that matches fieldId, throwing an exception
823
       * if it is not found.
824
       */
825
      public static _Fields findByThriftIdOrThrow(int fieldId) {
826
        _Fields fields = findByThriftId(fieldId);
827
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
828
        return fields;
829
      }
830
 
831
      /**
832
       * Find the _Fields constant that matches name, or null if its not found.
833
       */
834
      public static _Fields findByName(String name) {
835
        return byName.get(name);
836
      }
837
 
838
      private final short _thriftId;
839
      private final String _fieldName;
840
 
841
      _Fields(short thriftId, String fieldName) {
842
        _thriftId = thriftId;
843
        _fieldName = fieldName;
844
      }
845
 
846
      public short getThriftFieldId() {
847
        return _thriftId;
848
      }
849
 
850
      public String getFieldName() {
851
        return _fieldName;
852
      }
853
    }
854
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
855
    }});
856
 
857
    static {
858
      FieldMetaData.addStructMetaDataMap(closeSession_args.class, metaDataMap);
859
    }
860
 
861
    public closeSession_args() {
862
    }
863
 
864
    /**
865
     * Performs a deep copy on <i>other</i>.
866
     */
867
    public closeSession_args(closeSession_args other) {
868
    }
869
 
870
    public closeSession_args deepCopy() {
871
      return new closeSession_args(this);
872
    }
873
 
874
    @Deprecated
875
    public closeSession_args clone() {
876
      return new closeSession_args(this);
877
    }
878
 
879
    public void setFieldValue(_Fields field, Object value) {
880
      switch (field) {
881
      }
882
    }
883
 
884
    public void setFieldValue(int fieldID, Object value) {
885
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
886
    }
887
 
888
    public Object getFieldValue(_Fields field) {
889
      switch (field) {
890
      }
891
      throw new IllegalStateException();
892
    }
893
 
894
    public Object getFieldValue(int fieldId) {
895
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
896
    }
897
 
898
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
899
    public boolean isSet(_Fields field) {
900
      switch (field) {
901
      }
902
      throw new IllegalStateException();
903
    }
904
 
905
    public boolean isSet(int fieldID) {
906
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
907
    }
908
 
909
    @Override
910
    public boolean equals(Object that) {
911
      if (that == null)
912
        return false;
913
      if (that instanceof closeSession_args)
914
        return this.equals((closeSession_args)that);
915
      return false;
916
    }
917
 
918
    public boolean equals(closeSession_args that) {
919
      if (that == null)
920
        return false;
921
 
922
      return true;
923
    }
924
 
925
    @Override
926
    public int hashCode() {
927
      return 0;
928
    }
929
 
930
    public int compareTo(closeSession_args other) {
931
      if (!getClass().equals(other.getClass())) {
932
        return getClass().getName().compareTo(other.getClass().getName());
933
      }
934
 
935
      int lastComparison = 0;
936
      closeSession_args typedOther = (closeSession_args)other;
937
 
938
      return 0;
939
    }
940
 
941
    public void read(TProtocol iprot) throws TException {
942
      TField field;
943
      iprot.readStructBegin();
944
      while (true)
945
      {
946
        field = iprot.readFieldBegin();
947
        if (field.type == TType.STOP) { 
948
          break;
949
        }
950
        _Fields fieldId = _Fields.findByThriftId(field.id);
951
        if (fieldId == null) {
952
          TProtocolUtil.skip(iprot, field.type);
953
        } else {
954
          switch (fieldId) {
955
          }
956
          iprot.readFieldEnd();
957
        }
958
      }
959
      iprot.readStructEnd();
960
      validate();
961
    }
962
 
963
    public void write(TProtocol oprot) throws TException {
964
      validate();
965
 
966
      oprot.writeStructBegin(STRUCT_DESC);
967
      oprot.writeFieldStop();
968
      oprot.writeStructEnd();
969
    }
970
 
971
    @Override
972
    public String toString() {
973
      StringBuilder sb = new StringBuilder("closeSession_args(");
974
      boolean first = true;
975
 
976
      sb.append(")");
977
      return sb.toString();
978
    }
979
 
980
    public void validate() throws TException {
981
      // check for required fields
982
    }
983
 
984
  }
985
 
986
  public static class closeSession_result implements TBase<closeSession_result._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_result>   {
987
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_result");
988
 
989
 
990
 
991
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
992
    public enum _Fields implements TFieldIdEnum {
993
;
994
 
995
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
996
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
997
 
998
      static {
999
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1000
          byId.put((int)field._thriftId, field);
1001
          byName.put(field.getFieldName(), field);
1002
        }
1003
      }
1004
 
1005
      /**
1006
       * Find the _Fields constant that matches fieldId, or null if its not found.
1007
       */
1008
      public static _Fields findByThriftId(int fieldId) {
1009
        return byId.get(fieldId);
1010
      }
1011
 
1012
      /**
1013
       * Find the _Fields constant that matches fieldId, throwing an exception
1014
       * if it is not found.
1015
       */
1016
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1017
        _Fields fields = findByThriftId(fieldId);
1018
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1019
        return fields;
1020
      }
1021
 
1022
      /**
1023
       * Find the _Fields constant that matches name, or null if its not found.
1024
       */
1025
      public static _Fields findByName(String name) {
1026
        return byName.get(name);
1027
      }
1028
 
1029
      private final short _thriftId;
1030
      private final String _fieldName;
1031
 
1032
      _Fields(short thriftId, String fieldName) {
1033
        _thriftId = thriftId;
1034
        _fieldName = fieldName;
1035
      }
1036
 
1037
      public short getThriftFieldId() {
1038
        return _thriftId;
1039
      }
1040
 
1041
      public String getFieldName() {
1042
        return _fieldName;
1043
      }
1044
    }
1045
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1046
    }});
1047
 
1048
    static {
1049
      FieldMetaData.addStructMetaDataMap(closeSession_result.class, metaDataMap);
1050
    }
1051
 
1052
    public closeSession_result() {
1053
    }
1054
 
1055
    /**
1056
     * Performs a deep copy on <i>other</i>.
1057
     */
1058
    public closeSession_result(closeSession_result other) {
1059
    }
1060
 
1061
    public closeSession_result deepCopy() {
1062
      return new closeSession_result(this);
1063
    }
1064
 
1065
    @Deprecated
1066
    public closeSession_result clone() {
1067
      return new closeSession_result(this);
1068
    }
1069
 
1070
    public void setFieldValue(_Fields field, Object value) {
1071
      switch (field) {
1072
      }
1073
    }
1074
 
1075
    public void setFieldValue(int fieldID, Object value) {
1076
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1077
    }
1078
 
1079
    public Object getFieldValue(_Fields field) {
1080
      switch (field) {
1081
      }
1082
      throw new IllegalStateException();
1083
    }
1084
 
1085
    public Object getFieldValue(int fieldId) {
1086
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1087
    }
1088
 
1089
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1090
    public boolean isSet(_Fields field) {
1091
      switch (field) {
1092
      }
1093
      throw new IllegalStateException();
1094
    }
1095
 
1096
    public boolean isSet(int fieldID) {
1097
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1098
    }
1099
 
1100
    @Override
1101
    public boolean equals(Object that) {
1102
      if (that == null)
1103
        return false;
1104
      if (that instanceof closeSession_result)
1105
        return this.equals((closeSession_result)that);
1106
      return false;
1107
    }
1108
 
1109
    public boolean equals(closeSession_result that) {
1110
      if (that == null)
1111
        return false;
1112
 
1113
      return true;
1114
    }
1115
 
1116
    @Override
1117
    public int hashCode() {
1118
      return 0;
1119
    }
1120
 
1121
    public int compareTo(closeSession_result other) {
1122
      if (!getClass().equals(other.getClass())) {
1123
        return getClass().getName().compareTo(other.getClass().getName());
1124
      }
1125
 
1126
      int lastComparison = 0;
1127
      closeSession_result typedOther = (closeSession_result)other;
1128
 
1129
      return 0;
1130
    }
1131
 
1132
    public void read(TProtocol iprot) throws TException {
1133
      TField field;
1134
      iprot.readStructBegin();
1135
      while (true)
1136
      {
1137
        field = iprot.readFieldBegin();
1138
        if (field.type == TType.STOP) { 
1139
          break;
1140
        }
1141
        _Fields fieldId = _Fields.findByThriftId(field.id);
1142
        if (fieldId == null) {
1143
          TProtocolUtil.skip(iprot, field.type);
1144
        } else {
1145
          switch (fieldId) {
1146
          }
1147
          iprot.readFieldEnd();
1148
        }
1149
      }
1150
      iprot.readStructEnd();
1151
      validate();
1152
    }
1153
 
1154
    public void write(TProtocol oprot) throws TException {
1155
      oprot.writeStructBegin(STRUCT_DESC);
1156
 
1157
      oprot.writeFieldStop();
1158
      oprot.writeStructEnd();
1159
    }
1160
 
1161
    @Override
1162
    public String toString() {
1163
      StringBuilder sb = new StringBuilder("closeSession_result(");
1164
      boolean first = true;
1165
 
1166
      sb.append(")");
1167
      return sb.toString();
1168
    }
1169
 
1170
    public void validate() throws TException {
1171
      // check for required fields
1172
    }
1173
 
1174
  }
1175
 
1176
  public static class createPromotion_args implements TBase<createPromotion_args._Fields>, java.io.Serializable, Cloneable, Comparable<createPromotion_args>   {
1177
    private static final TStruct STRUCT_DESC = new TStruct("createPromotion_args");
1178
 
1179
    private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1);
1180
    private static final TField RULE_EXECUTION_SRC_FIELD_DESC = new TField("ruleExecutionSrc", TType.STRING, (short)2);
1181
    private static final TField START_ON_FIELD_DESC = new TField("startOn", TType.I64, (short)3);
1182
    private static final TField END_ON_FIELD_DESC = new TField("endOn", TType.I64, (short)4);
1183
 
1184
    private String name;
1185
    private String ruleExecutionSrc;
1186
    private long startOn;
1187
    private long endOn;
1188
 
1189
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1190
    public enum _Fields implements TFieldIdEnum {
1191
      NAME((short)1, "name"),
1192
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1193
      START_ON((short)3, "startOn"),
1194
      END_ON((short)4, "endOn");
1195
 
1196
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1197
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1198
 
1199
      static {
1200
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1201
          byId.put((int)field._thriftId, field);
1202
          byName.put(field.getFieldName(), field);
1203
        }
1204
      }
1205
 
1206
      /**
1207
       * Find the _Fields constant that matches fieldId, or null if its not found.
1208
       */
1209
      public static _Fields findByThriftId(int fieldId) {
1210
        return byId.get(fieldId);
1211
      }
1212
 
1213
      /**
1214
       * Find the _Fields constant that matches fieldId, throwing an exception
1215
       * if it is not found.
1216
       */
1217
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1218
        _Fields fields = findByThriftId(fieldId);
1219
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1220
        return fields;
1221
      }
1222
 
1223
      /**
1224
       * Find the _Fields constant that matches name, or null if its not found.
1225
       */
1226
      public static _Fields findByName(String name) {
1227
        return byName.get(name);
1228
      }
1229
 
1230
      private final short _thriftId;
1231
      private final String _fieldName;
1232
 
1233
      _Fields(short thriftId, String fieldName) {
1234
        _thriftId = thriftId;
1235
        _fieldName = fieldName;
1236
      }
1237
 
1238
      public short getThriftFieldId() {
1239
        return _thriftId;
1240
      }
1241
 
1242
      public String getFieldName() {
1243
        return _fieldName;
1244
      }
1245
    }
1246
 
1247
    // isset id assignments
1248
    private static final int __STARTON_ISSET_ID = 0;
1249
    private static final int __ENDON_ISSET_ID = 1;
1250
    private BitSet __isset_bit_vector = new BitSet(2);
1251
 
1252
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1253
      put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
1254
          new FieldValueMetaData(TType.STRING)));
1255
      put(_Fields.RULE_EXECUTION_SRC, new FieldMetaData("ruleExecutionSrc", TFieldRequirementType.DEFAULT, 
1256
          new FieldValueMetaData(TType.STRING)));
1257
      put(_Fields.START_ON, new FieldMetaData("startOn", TFieldRequirementType.DEFAULT, 
1258
          new FieldValueMetaData(TType.I64)));
1259
      put(_Fields.END_ON, new FieldMetaData("endOn", TFieldRequirementType.DEFAULT, 
1260
          new FieldValueMetaData(TType.I64)));
1261
    }});
1262
 
1263
    static {
1264
      FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1265
    }
1266
 
1267
    public createPromotion_args() {
1268
    }
1269
 
1270
    public createPromotion_args(
1271
      String name,
1272
      String ruleExecutionSrc,
1273
      long startOn,
1274
      long endOn)
1275
    {
1276
      this();
1277
      this.name = name;
1278
      this.ruleExecutionSrc = ruleExecutionSrc;
1279
      this.startOn = startOn;
1280
      setStartOnIsSet(true);
1281
      this.endOn = endOn;
1282
      setEndOnIsSet(true);
1283
    }
1284
 
1285
    /**
1286
     * Performs a deep copy on <i>other</i>.
1287
     */
1288
    public createPromotion_args(createPromotion_args other) {
1289
      __isset_bit_vector.clear();
1290
      __isset_bit_vector.or(other.__isset_bit_vector);
1291
      if (other.isSetName()) {
1292
        this.name = other.name;
1293
      }
1294
      if (other.isSetRuleExecutionSrc()) {
1295
        this.ruleExecutionSrc = other.ruleExecutionSrc;
1296
      }
1297
      this.startOn = other.startOn;
1298
      this.endOn = other.endOn;
1299
    }
1300
 
1301
    public createPromotion_args deepCopy() {
1302
      return new createPromotion_args(this);
1303
    }
1304
 
1305
    @Deprecated
1306
    public createPromotion_args clone() {
1307
      return new createPromotion_args(this);
1308
    }
1309
 
1310
    public String getName() {
1311
      return this.name;
1312
    }
1313
 
1314
    public createPromotion_args setName(String name) {
1315
      this.name = name;
1316
      return this;
1317
    }
1318
 
1319
    public void unsetName() {
1320
      this.name = null;
1321
    }
1322
 
1323
    /** Returns true if field name is set (has been asigned a value) and false otherwise */
1324
    public boolean isSetName() {
1325
      return this.name != null;
1326
    }
1327
 
1328
    public void setNameIsSet(boolean value) {
1329
      if (!value) {
1330
        this.name = null;
1331
      }
1332
    }
1333
 
1334
    public String getRuleExecutionSrc() {
1335
      return this.ruleExecutionSrc;
1336
    }
1337
 
1338
    public createPromotion_args setRuleExecutionSrc(String ruleExecutionSrc) {
1339
      this.ruleExecutionSrc = ruleExecutionSrc;
1340
      return this;
1341
    }
1342
 
1343
    public void unsetRuleExecutionSrc() {
1344
      this.ruleExecutionSrc = null;
1345
    }
1346
 
1347
    /** Returns true if field ruleExecutionSrc is set (has been asigned a value) and false otherwise */
1348
    public boolean isSetRuleExecutionSrc() {
1349
      return this.ruleExecutionSrc != null;
1350
    }
1351
 
1352
    public void setRuleExecutionSrcIsSet(boolean value) {
1353
      if (!value) {
1354
        this.ruleExecutionSrc = null;
1355
      }
1356
    }
1357
 
1358
    public long getStartOn() {
1359
      return this.startOn;
1360
    }
1361
 
1362
    public createPromotion_args setStartOn(long startOn) {
1363
      this.startOn = startOn;
1364
      setStartOnIsSet(true);
1365
      return this;
1366
    }
1367
 
1368
    public void unsetStartOn() {
1369
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
1370
    }
1371
 
1372
    /** Returns true if field startOn is set (has been asigned a value) and false otherwise */
1373
    public boolean isSetStartOn() {
1374
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
1375
    }
1376
 
1377
    public void setStartOnIsSet(boolean value) {
1378
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
1379
    }
1380
 
1381
    public long getEndOn() {
1382
      return this.endOn;
1383
    }
1384
 
1385
    public createPromotion_args setEndOn(long endOn) {
1386
      this.endOn = endOn;
1387
      setEndOnIsSet(true);
1388
      return this;
1389
    }
1390
 
1391
    public void unsetEndOn() {
1392
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
1393
    }
1394
 
1395
    /** Returns true if field endOn is set (has been asigned a value) and false otherwise */
1396
    public boolean isSetEndOn() {
1397
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
1398
    }
1399
 
1400
    public void setEndOnIsSet(boolean value) {
1401
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
1402
    }
1403
 
1404
    public void setFieldValue(_Fields field, Object value) {
1405
      switch (field) {
1406
      case NAME:
1407
        if (value == null) {
1408
          unsetName();
1409
        } else {
1410
          setName((String)value);
1411
        }
1412
        break;
1413
 
1414
      case RULE_EXECUTION_SRC:
1415
        if (value == null) {
1416
          unsetRuleExecutionSrc();
1417
        } else {
1418
          setRuleExecutionSrc((String)value);
1419
        }
1420
        break;
1421
 
1422
      case START_ON:
1423
        if (value == null) {
1424
          unsetStartOn();
1425
        } else {
1426
          setStartOn((Long)value);
1427
        }
1428
        break;
1429
 
1430
      case END_ON:
1431
        if (value == null) {
1432
          unsetEndOn();
1433
        } else {
1434
          setEndOn((Long)value);
1435
        }
1436
        break;
1437
 
1438
      }
1439
    }
1440
 
1441
    public void setFieldValue(int fieldID, Object value) {
1442
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1443
    }
1444
 
1445
    public Object getFieldValue(_Fields field) {
1446
      switch (field) {
1447
      case NAME:
1448
        return getName();
1449
 
1450
      case RULE_EXECUTION_SRC:
1451
        return getRuleExecutionSrc();
1452
 
1453
      case START_ON:
1454
        return new Long(getStartOn());
1455
 
1456
      case END_ON:
1457
        return new Long(getEndOn());
1458
 
1459
      }
1460
      throw new IllegalStateException();
1461
    }
1462
 
1463
    public Object getFieldValue(int fieldId) {
1464
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1465
    }
1466
 
1467
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1468
    public boolean isSet(_Fields field) {
1469
      switch (field) {
1470
      case NAME:
1471
        return isSetName();
1472
      case RULE_EXECUTION_SRC:
1473
        return isSetRuleExecutionSrc();
1474
      case START_ON:
1475
        return isSetStartOn();
1476
      case END_ON:
1477
        return isSetEndOn();
1478
      }
1479
      throw new IllegalStateException();
1480
    }
1481
 
1482
    public boolean isSet(int fieldID) {
1483
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1484
    }
1485
 
1486
    @Override
1487
    public boolean equals(Object that) {
1488
      if (that == null)
1489
        return false;
1490
      if (that instanceof createPromotion_args)
1491
        return this.equals((createPromotion_args)that);
1492
      return false;
1493
    }
1494
 
1495
    public boolean equals(createPromotion_args that) {
1496
      if (that == null)
1497
        return false;
1498
 
1499
      boolean this_present_name = true && this.isSetName();
1500
      boolean that_present_name = true && that.isSetName();
1501
      if (this_present_name || that_present_name) {
1502
        if (!(this_present_name && that_present_name))
1503
          return false;
1504
        if (!this.name.equals(that.name))
1505
          return false;
1506
      }
1507
 
1508
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
1509
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
1510
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
1511
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
1512
          return false;
1513
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
1514
          return false;
1515
      }
1516
 
1517
      boolean this_present_startOn = true;
1518
      boolean that_present_startOn = true;
1519
      if (this_present_startOn || that_present_startOn) {
1520
        if (!(this_present_startOn && that_present_startOn))
1521
          return false;
1522
        if (this.startOn != that.startOn)
1523
          return false;
1524
      }
1525
 
1526
      boolean this_present_endOn = true;
1527
      boolean that_present_endOn = true;
1528
      if (this_present_endOn || that_present_endOn) {
1529
        if (!(this_present_endOn && that_present_endOn))
1530
          return false;
1531
        if (this.endOn != that.endOn)
1532
          return false;
1533
      }
1534
 
1535
      return true;
1536
    }
1537
 
1538
    @Override
1539
    public int hashCode() {
1540
      return 0;
1541
    }
1542
 
1543
    public int compareTo(createPromotion_args other) {
1544
      if (!getClass().equals(other.getClass())) {
1545
        return getClass().getName().compareTo(other.getClass().getName());
1546
      }
1547
 
1548
      int lastComparison = 0;
1549
      createPromotion_args typedOther = (createPromotion_args)other;
1550
 
1551
      lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
1552
      if (lastComparison != 0) {
1553
        return lastComparison;
1554
      }
1555
      lastComparison = TBaseHelper.compareTo(name, typedOther.name);
1556
      if (lastComparison != 0) {
1557
        return lastComparison;
1558
      }
1559
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(isSetRuleExecutionSrc());
1560
      if (lastComparison != 0) {
1561
        return lastComparison;
1562
      }
1563
      lastComparison = TBaseHelper.compareTo(ruleExecutionSrc, typedOther.ruleExecutionSrc);
1564
      if (lastComparison != 0) {
1565
        return lastComparison;
1566
      }
1567
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(isSetStartOn());
1568
      if (lastComparison != 0) {
1569
        return lastComparison;
1570
      }
1571
      lastComparison = TBaseHelper.compareTo(startOn, typedOther.startOn);
1572
      if (lastComparison != 0) {
1573
        return lastComparison;
1574
      }
1575
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(isSetEndOn());
1576
      if (lastComparison != 0) {
1577
        return lastComparison;
1578
      }
1579
      lastComparison = TBaseHelper.compareTo(endOn, typedOther.endOn);
1580
      if (lastComparison != 0) {
1581
        return lastComparison;
1582
      }
1583
      return 0;
1584
    }
1585
 
1586
    public void read(TProtocol iprot) throws TException {
1587
      TField field;
1588
      iprot.readStructBegin();
1589
      while (true)
1590
      {
1591
        field = iprot.readFieldBegin();
1592
        if (field.type == TType.STOP) { 
1593
          break;
1594
        }
1595
        _Fields fieldId = _Fields.findByThriftId(field.id);
1596
        if (fieldId == null) {
1597
          TProtocolUtil.skip(iprot, field.type);
1598
        } else {
1599
          switch (fieldId) {
1600
            case NAME:
1601
              if (field.type == TType.STRING) {
1602
                this.name = iprot.readString();
1603
              } else { 
1604
                TProtocolUtil.skip(iprot, field.type);
1605
              }
1606
              break;
1607
            case RULE_EXECUTION_SRC:
1608
              if (field.type == TType.STRING) {
1609
                this.ruleExecutionSrc = iprot.readString();
1610
              } else { 
1611
                TProtocolUtil.skip(iprot, field.type);
1612
              }
1613
              break;
1614
            case START_ON:
1615
              if (field.type == TType.I64) {
1616
                this.startOn = iprot.readI64();
1617
                setStartOnIsSet(true);
1618
              } else { 
1619
                TProtocolUtil.skip(iprot, field.type);
1620
              }
1621
              break;
1622
            case END_ON:
1623
              if (field.type == TType.I64) {
1624
                this.endOn = iprot.readI64();
1625
                setEndOnIsSet(true);
1626
              } else { 
1627
                TProtocolUtil.skip(iprot, field.type);
1628
              }
1629
              break;
1630
          }
1631
          iprot.readFieldEnd();
1632
        }
1633
      }
1634
      iprot.readStructEnd();
1635
      validate();
1636
    }
1637
 
1638
    public void write(TProtocol oprot) throws TException {
1639
      validate();
1640
 
1641
      oprot.writeStructBegin(STRUCT_DESC);
1642
      if (this.name != null) {
1643
        oprot.writeFieldBegin(NAME_FIELD_DESC);
1644
        oprot.writeString(this.name);
1645
        oprot.writeFieldEnd();
1646
      }
1647
      if (this.ruleExecutionSrc != null) {
1648
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
1649
        oprot.writeString(this.ruleExecutionSrc);
1650
        oprot.writeFieldEnd();
1651
      }
1652
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
1653
      oprot.writeI64(this.startOn);
1654
      oprot.writeFieldEnd();
1655
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
1656
      oprot.writeI64(this.endOn);
1657
      oprot.writeFieldEnd();
1658
      oprot.writeFieldStop();
1659
      oprot.writeStructEnd();
1660
    }
1661
 
1662
    @Override
1663
    public String toString() {
1664
      StringBuilder sb = new StringBuilder("createPromotion_args(");
1665
      boolean first = true;
1666
 
1667
      sb.append("name:");
1668
      if (this.name == null) {
1669
        sb.append("null");
1670
      } else {
1671
        sb.append(this.name);
1672
      }
1673
      first = false;
1674
      if (!first) sb.append(", ");
1675
      sb.append("ruleExecutionSrc:");
1676
      if (this.ruleExecutionSrc == null) {
1677
        sb.append("null");
1678
      } else {
1679
        sb.append(this.ruleExecutionSrc);
1680
      }
1681
      first = false;
1682
      if (!first) sb.append(", ");
1683
      sb.append("startOn:");
1684
      sb.append(this.startOn);
1685
      first = false;
1686
      if (!first) sb.append(", ");
1687
      sb.append("endOn:");
1688
      sb.append(this.endOn);
1689
      first = false;
1690
      sb.append(")");
1691
      return sb.toString();
1692
    }
1693
 
1694
    public void validate() throws TException {
1695
      // check for required fields
1696
    }
1697
 
1698
  }
1699
 
1700
  public static class createPromotion_result implements TBase<createPromotion_result._Fields>, java.io.Serializable, Cloneable, Comparable<createPromotion_result>   {
1701
    private static final TStruct STRUCT_DESC = new TStruct("createPromotion_result");
1702
 
1703
    private static final TField PEX_FIELD_DESC = new TField("pex", TType.STRUCT, (short)1);
1704
 
1705
    private PromotionException pex;
1706
 
1707
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1708
    public enum _Fields implements TFieldIdEnum {
1709
      PEX((short)1, "pex");
1710
 
1711
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1712
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1713
 
1714
      static {
1715
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1716
          byId.put((int)field._thriftId, field);
1717
          byName.put(field.getFieldName(), field);
1718
        }
1719
      }
1720
 
1721
      /**
1722
       * Find the _Fields constant that matches fieldId, or null if its not found.
1723
       */
1724
      public static _Fields findByThriftId(int fieldId) {
1725
        return byId.get(fieldId);
1726
      }
1727
 
1728
      /**
1729
       * Find the _Fields constant that matches fieldId, throwing an exception
1730
       * if it is not found.
1731
       */
1732
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1733
        _Fields fields = findByThriftId(fieldId);
1734
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1735
        return fields;
1736
      }
1737
 
1738
      /**
1739
       * Find the _Fields constant that matches name, or null if its not found.
1740
       */
1741
      public static _Fields findByName(String name) {
1742
        return byName.get(name);
1743
      }
1744
 
1745
      private final short _thriftId;
1746
      private final String _fieldName;
1747
 
1748
      _Fields(short thriftId, String fieldName) {
1749
        _thriftId = thriftId;
1750
        _fieldName = fieldName;
1751
      }
1752
 
1753
      public short getThriftFieldId() {
1754
        return _thriftId;
1755
      }
1756
 
1757
      public String getFieldName() {
1758
        return _fieldName;
1759
      }
1760
    }
1761
 
1762
    // isset id assignments
1763
 
1764
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1765
      put(_Fields.PEX, new FieldMetaData("pex", TFieldRequirementType.DEFAULT, 
1766
          new FieldValueMetaData(TType.STRUCT)));
1767
    }});
1768
 
1769
    static {
1770
      FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1771
    }
1772
 
1773
    public createPromotion_result() {
1774
    }
1775
 
1776
    public createPromotion_result(
1777
      PromotionException pex)
1778
    {
1779
      this();
1780
      this.pex = pex;
1781
    }
1782
 
1783
    /**
1784
     * Performs a deep copy on <i>other</i>.
1785
     */
1786
    public createPromotion_result(createPromotion_result other) {
1787
      if (other.isSetPex()) {
1788
        this.pex = new PromotionException(other.pex);
1789
      }
1790
    }
1791
 
1792
    public createPromotion_result deepCopy() {
1793
      return new createPromotion_result(this);
1794
    }
1795
 
1796
    @Deprecated
1797
    public createPromotion_result clone() {
1798
      return new createPromotion_result(this);
1799
    }
1800
 
1801
    public PromotionException getPex() {
1802
      return this.pex;
1803
    }
1804
 
1805
    public createPromotion_result setPex(PromotionException pex) {
1806
      this.pex = pex;
1807
      return this;
1808
    }
1809
 
1810
    public void unsetPex() {
1811
      this.pex = null;
1812
    }
1813
 
1814
    /** Returns true if field pex is set (has been asigned a value) and false otherwise */
1815
    public boolean isSetPex() {
1816
      return this.pex != null;
1817
    }
1818
 
1819
    public void setPexIsSet(boolean value) {
1820
      if (!value) {
1821
        this.pex = null;
1822
      }
1823
    }
1824
 
1825
    public void setFieldValue(_Fields field, Object value) {
1826
      switch (field) {
1827
      case PEX:
1828
        if (value == null) {
1829
          unsetPex();
1830
        } else {
1831
          setPex((PromotionException)value);
1832
        }
1833
        break;
1834
 
1835
      }
1836
    }
1837
 
1838
    public void setFieldValue(int fieldID, Object value) {
1839
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1840
    }
1841
 
1842
    public Object getFieldValue(_Fields field) {
1843
      switch (field) {
1844
      case PEX:
1845
        return getPex();
1846
 
1847
      }
1848
      throw new IllegalStateException();
1849
    }
1850
 
1851
    public Object getFieldValue(int fieldId) {
1852
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1853
    }
1854
 
1855
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1856
    public boolean isSet(_Fields field) {
1857
      switch (field) {
1858
      case PEX:
1859
        return isSetPex();
1860
      }
1861
      throw new IllegalStateException();
1862
    }
1863
 
1864
    public boolean isSet(int fieldID) {
1865
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1866
    }
1867
 
1868
    @Override
1869
    public boolean equals(Object that) {
1870
      if (that == null)
1871
        return false;
1872
      if (that instanceof createPromotion_result)
1873
        return this.equals((createPromotion_result)that);
1874
      return false;
1875
    }
1876
 
1877
    public boolean equals(createPromotion_result that) {
1878
      if (that == null)
1879
        return false;
1880
 
1881
      boolean this_present_pex = true && this.isSetPex();
1882
      boolean that_present_pex = true && that.isSetPex();
1883
      if (this_present_pex || that_present_pex) {
1884
        if (!(this_present_pex && that_present_pex))
1885
          return false;
1886
        if (!this.pex.equals(that.pex))
1887
          return false;
1888
      }
1889
 
1890
      return true;
1891
    }
1892
 
1893
    @Override
1894
    public int hashCode() {
1895
      return 0;
1896
    }
1897
 
1898
    public int compareTo(createPromotion_result other) {
1899
      if (!getClass().equals(other.getClass())) {
1900
        return getClass().getName().compareTo(other.getClass().getName());
1901
      }
1902
 
1903
      int lastComparison = 0;
1904
      createPromotion_result typedOther = (createPromotion_result)other;
1905
 
1906
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(isSetPex());
1907
      if (lastComparison != 0) {
1908
        return lastComparison;
1909
      }
1910
      lastComparison = TBaseHelper.compareTo(pex, typedOther.pex);
1911
      if (lastComparison != 0) {
1912
        return lastComparison;
1913
      }
1914
      return 0;
1915
    }
1916
 
1917
    public void read(TProtocol iprot) throws TException {
1918
      TField field;
1919
      iprot.readStructBegin();
1920
      while (true)
1921
      {
1922
        field = iprot.readFieldBegin();
1923
        if (field.type == TType.STOP) { 
1924
          break;
1925
        }
1926
        _Fields fieldId = _Fields.findByThriftId(field.id);
1927
        if (fieldId == null) {
1928
          TProtocolUtil.skip(iprot, field.type);
1929
        } else {
1930
          switch (fieldId) {
1931
            case PEX:
1932
              if (field.type == TType.STRUCT) {
1933
                this.pex = new PromotionException();
1934
                this.pex.read(iprot);
1935
              } else { 
1936
                TProtocolUtil.skip(iprot, field.type);
1937
              }
1938
              break;
1939
          }
1940
          iprot.readFieldEnd();
1941
        }
1942
      }
1943
      iprot.readStructEnd();
1944
      validate();
1945
    }
1946
 
1947
    public void write(TProtocol oprot) throws TException {
1948
      oprot.writeStructBegin(STRUCT_DESC);
1949
 
1950
      if (this.isSetPex()) {
1951
        oprot.writeFieldBegin(PEX_FIELD_DESC);
1952
        this.pex.write(oprot);
1953
        oprot.writeFieldEnd();
1954
      }
1955
      oprot.writeFieldStop();
1956
      oprot.writeStructEnd();
1957
    }
1958
 
1959
    @Override
1960
    public String toString() {
1961
      StringBuilder sb = new StringBuilder("createPromotion_result(");
1962
      boolean first = true;
1963
 
1964
      sb.append("pex:");
1965
      if (this.pex == null) {
1966
        sb.append("null");
1967
      } else {
1968
        sb.append(this.pex);
1969
      }
1970
      first = false;
1971
      sb.append(")");
1972
      return sb.toString();
1973
    }
1974
 
1975
    public void validate() throws TException {
1976
      // check for required fields
1977
    }
1978
 
1979
  }
1980
 
1981
  public static class getAllPromotions_args implements TBase<getAllPromotions_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllPromotions_args>   {
1982
    private static final TStruct STRUCT_DESC = new TStruct("getAllPromotions_args");
1983
 
1984
 
1985
 
1986
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1987
    public enum _Fields implements TFieldIdEnum {
1988
;
1989
 
1990
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1991
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1992
 
1993
      static {
1994
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1995
          byId.put((int)field._thriftId, field);
1996
          byName.put(field.getFieldName(), field);
1997
        }
1998
      }
1999
 
2000
      /**
2001
       * Find the _Fields constant that matches fieldId, or null if its not found.
2002
       */
2003
      public static _Fields findByThriftId(int fieldId) {
2004
        return byId.get(fieldId);
2005
      }
2006
 
2007
      /**
2008
       * Find the _Fields constant that matches fieldId, throwing an exception
2009
       * if it is not found.
2010
       */
2011
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2012
        _Fields fields = findByThriftId(fieldId);
2013
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2014
        return fields;
2015
      }
2016
 
2017
      /**
2018
       * Find the _Fields constant that matches name, or null if its not found.
2019
       */
2020
      public static _Fields findByName(String name) {
2021
        return byName.get(name);
2022
      }
2023
 
2024
      private final short _thriftId;
2025
      private final String _fieldName;
2026
 
2027
      _Fields(short thriftId, String fieldName) {
2028
        _thriftId = thriftId;
2029
        _fieldName = fieldName;
2030
      }
2031
 
2032
      public short getThriftFieldId() {
2033
        return _thriftId;
2034
      }
2035
 
2036
      public String getFieldName() {
2037
        return _fieldName;
2038
      }
2039
    }
2040
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2041
    }});
2042
 
2043
    static {
2044
      FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
2045
    }
2046
 
2047
    public getAllPromotions_args() {
2048
    }
2049
 
2050
    /**
2051
     * Performs a deep copy on <i>other</i>.
2052
     */
2053
    public getAllPromotions_args(getAllPromotions_args other) {
2054
    }
2055
 
2056
    public getAllPromotions_args deepCopy() {
2057
      return new getAllPromotions_args(this);
2058
    }
2059
 
2060
    @Deprecated
2061
    public getAllPromotions_args clone() {
2062
      return new getAllPromotions_args(this);
2063
    }
2064
 
2065
    public void setFieldValue(_Fields field, Object value) {
2066
      switch (field) {
2067
      }
2068
    }
2069
 
2070
    public void setFieldValue(int fieldID, Object value) {
2071
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2072
    }
2073
 
2074
    public Object getFieldValue(_Fields field) {
2075
      switch (field) {
2076
      }
2077
      throw new IllegalStateException();
2078
    }
2079
 
2080
    public Object getFieldValue(int fieldId) {
2081
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2082
    }
2083
 
2084
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2085
    public boolean isSet(_Fields field) {
2086
      switch (field) {
2087
      }
2088
      throw new IllegalStateException();
2089
    }
2090
 
2091
    public boolean isSet(int fieldID) {
2092
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2093
    }
2094
 
2095
    @Override
2096
    public boolean equals(Object that) {
2097
      if (that == null)
2098
        return false;
2099
      if (that instanceof getAllPromotions_args)
2100
        return this.equals((getAllPromotions_args)that);
2101
      return false;
2102
    }
2103
 
2104
    public boolean equals(getAllPromotions_args that) {
2105
      if (that == null)
2106
        return false;
2107
 
2108
      return true;
2109
    }
2110
 
2111
    @Override
2112
    public int hashCode() {
2113
      return 0;
2114
    }
2115
 
2116
    public int compareTo(getAllPromotions_args other) {
2117
      if (!getClass().equals(other.getClass())) {
2118
        return getClass().getName().compareTo(other.getClass().getName());
2119
      }
2120
 
2121
      int lastComparison = 0;
2122
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
2123
 
2124
      return 0;
2125
    }
2126
 
2127
    public void read(TProtocol iprot) throws TException {
2128
      TField field;
2129
      iprot.readStructBegin();
2130
      while (true)
2131
      {
2132
        field = iprot.readFieldBegin();
2133
        if (field.type == TType.STOP) { 
2134
          break;
2135
        }
2136
        _Fields fieldId = _Fields.findByThriftId(field.id);
2137
        if (fieldId == null) {
2138
          TProtocolUtil.skip(iprot, field.type);
2139
        } else {
2140
          switch (fieldId) {
2141
          }
2142
          iprot.readFieldEnd();
2143
        }
2144
      }
2145
      iprot.readStructEnd();
2146
      validate();
2147
    }
2148
 
2149
    public void write(TProtocol oprot) throws TException {
2150
      validate();
2151
 
2152
      oprot.writeStructBegin(STRUCT_DESC);
2153
      oprot.writeFieldStop();
2154
      oprot.writeStructEnd();
2155
    }
2156
 
2157
    @Override
2158
    public String toString() {
2159
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
2160
      boolean first = true;
2161
 
2162
      sb.append(")");
2163
      return sb.toString();
2164
    }
2165
 
2166
    public void validate() throws TException {
2167
      // check for required fields
2168
    }
2169
 
2170
  }
2171
 
2172
  public static class getAllPromotions_result implements TBase<getAllPromotions_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllPromotions_result>   {
2173
    private static final TStruct STRUCT_DESC = new TStruct("getAllPromotions_result");
2174
 
2175
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
2176
    private static final TField PEX_FIELD_DESC = new TField("pex", TType.STRUCT, (short)1);
2177
 
2178
    private List<Promotion> success;
2179
    private PromotionException pex;
2180
 
2181
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2182
    public enum _Fields implements TFieldIdEnum {
2183
      SUCCESS((short)0, "success"),
2184
      PEX((short)1, "pex");
2185
 
2186
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2187
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2188
 
2189
      static {
2190
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2191
          byId.put((int)field._thriftId, field);
2192
          byName.put(field.getFieldName(), field);
2193
        }
2194
      }
2195
 
2196
      /**
2197
       * Find the _Fields constant that matches fieldId, or null if its not found.
2198
       */
2199
      public static _Fields findByThriftId(int fieldId) {
2200
        return byId.get(fieldId);
2201
      }
2202
 
2203
      /**
2204
       * Find the _Fields constant that matches fieldId, throwing an exception
2205
       * if it is not found.
2206
       */
2207
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2208
        _Fields fields = findByThriftId(fieldId);
2209
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2210
        return fields;
2211
      }
2212
 
2213
      /**
2214
       * Find the _Fields constant that matches name, or null if its not found.
2215
       */
2216
      public static _Fields findByName(String name) {
2217
        return byName.get(name);
2218
      }
2219
 
2220
      private final short _thriftId;
2221
      private final String _fieldName;
2222
 
2223
      _Fields(short thriftId, String fieldName) {
2224
        _thriftId = thriftId;
2225
        _fieldName = fieldName;
2226
      }
2227
 
2228
      public short getThriftFieldId() {
2229
        return _thriftId;
2230
      }
2231
 
2232
      public String getFieldName() {
2233
        return _fieldName;
2234
      }
2235
    }
2236
 
2237
    // isset id assignments
2238
 
2239
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2240
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
2241
          new ListMetaData(TType.LIST, 
2242
              new StructMetaData(TType.STRUCT, Promotion.class))));
2243
      put(_Fields.PEX, new FieldMetaData("pex", TFieldRequirementType.DEFAULT, 
2244
          new FieldValueMetaData(TType.STRUCT)));
2245
    }});
2246
 
2247
    static {
2248
      FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
2249
    }
2250
 
2251
    public getAllPromotions_result() {
2252
    }
2253
 
2254
    public getAllPromotions_result(
2255
      List<Promotion> success,
2256
      PromotionException pex)
2257
    {
2258
      this();
2259
      this.success = success;
2260
      this.pex = pex;
2261
    }
2262
 
2263
    /**
2264
     * Performs a deep copy on <i>other</i>.
2265
     */
2266
    public getAllPromotions_result(getAllPromotions_result other) {
2267
      if (other.isSetSuccess()) {
2268
        List<Promotion> __this__success = new ArrayList<Promotion>();
2269
        for (Promotion other_element : other.success) {
2270
          __this__success.add(new Promotion(other_element));
2271
        }
2272
        this.success = __this__success;
2273
      }
2274
      if (other.isSetPex()) {
2275
        this.pex = new PromotionException(other.pex);
2276
      }
2277
    }
2278
 
2279
    public getAllPromotions_result deepCopy() {
2280
      return new getAllPromotions_result(this);
2281
    }
2282
 
2283
    @Deprecated
2284
    public getAllPromotions_result clone() {
2285
      return new getAllPromotions_result(this);
2286
    }
2287
 
2288
    public int getSuccessSize() {
2289
      return (this.success == null) ? 0 : this.success.size();
2290
    }
2291
 
2292
    public java.util.Iterator<Promotion> getSuccessIterator() {
2293
      return (this.success == null) ? null : this.success.iterator();
2294
    }
2295
 
2296
    public void addToSuccess(Promotion elem) {
2297
      if (this.success == null) {
2298
        this.success = new ArrayList<Promotion>();
2299
      }
2300
      this.success.add(elem);
2301
    }
2302
 
2303
    public List<Promotion> getSuccess() {
2304
      return this.success;
2305
    }
2306
 
2307
    public getAllPromotions_result setSuccess(List<Promotion> success) {
2308
      this.success = success;
2309
      return this;
2310
    }
2311
 
2312
    public void unsetSuccess() {
2313
      this.success = null;
2314
    }
2315
 
2316
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
2317
    public boolean isSetSuccess() {
2318
      return this.success != null;
2319
    }
2320
 
2321
    public void setSuccessIsSet(boolean value) {
2322
      if (!value) {
2323
        this.success = null;
2324
      }
2325
    }
2326
 
2327
    public PromotionException getPex() {
2328
      return this.pex;
2329
    }
2330
 
2331
    public getAllPromotions_result setPex(PromotionException pex) {
2332
      this.pex = pex;
2333
      return this;
2334
    }
2335
 
2336
    public void unsetPex() {
2337
      this.pex = null;
2338
    }
2339
 
2340
    /** Returns true if field pex is set (has been asigned a value) and false otherwise */
2341
    public boolean isSetPex() {
2342
      return this.pex != null;
2343
    }
2344
 
2345
    public void setPexIsSet(boolean value) {
2346
      if (!value) {
2347
        this.pex = null;
2348
      }
2349
    }
2350
 
2351
    public void setFieldValue(_Fields field, Object value) {
2352
      switch (field) {
2353
      case SUCCESS:
2354
        if (value == null) {
2355
          unsetSuccess();
2356
        } else {
2357
          setSuccess((List<Promotion>)value);
2358
        }
2359
        break;
2360
 
2361
      case PEX:
2362
        if (value == null) {
2363
          unsetPex();
2364
        } else {
2365
          setPex((PromotionException)value);
2366
        }
2367
        break;
2368
 
2369
      }
2370
    }
2371
 
2372
    public void setFieldValue(int fieldID, Object value) {
2373
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2374
    }
2375
 
2376
    public Object getFieldValue(_Fields field) {
2377
      switch (field) {
2378
      case SUCCESS:
2379
        return getSuccess();
2380
 
2381
      case PEX:
2382
        return getPex();
2383
 
2384
      }
2385
      throw new IllegalStateException();
2386
    }
2387
 
2388
    public Object getFieldValue(int fieldId) {
2389
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2390
    }
2391
 
2392
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2393
    public boolean isSet(_Fields field) {
2394
      switch (field) {
2395
      case SUCCESS:
2396
        return isSetSuccess();
2397
      case PEX:
2398
        return isSetPex();
2399
      }
2400
      throw new IllegalStateException();
2401
    }
2402
 
2403
    public boolean isSet(int fieldID) {
2404
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2405
    }
2406
 
2407
    @Override
2408
    public boolean equals(Object that) {
2409
      if (that == null)
2410
        return false;
2411
      if (that instanceof getAllPromotions_result)
2412
        return this.equals((getAllPromotions_result)that);
2413
      return false;
2414
    }
2415
 
2416
    public boolean equals(getAllPromotions_result that) {
2417
      if (that == null)
2418
        return false;
2419
 
2420
      boolean this_present_success = true && this.isSetSuccess();
2421
      boolean that_present_success = true && that.isSetSuccess();
2422
      if (this_present_success || that_present_success) {
2423
        if (!(this_present_success && that_present_success))
2424
          return false;
2425
        if (!this.success.equals(that.success))
2426
          return false;
2427
      }
2428
 
2429
      boolean this_present_pex = true && this.isSetPex();
2430
      boolean that_present_pex = true && that.isSetPex();
2431
      if (this_present_pex || that_present_pex) {
2432
        if (!(this_present_pex && that_present_pex))
2433
          return false;
2434
        if (!this.pex.equals(that.pex))
2435
          return false;
2436
      }
2437
 
2438
      return true;
2439
    }
2440
 
2441
    @Override
2442
    public int hashCode() {
2443
      return 0;
2444
    }
2445
 
2446
    public int compareTo(getAllPromotions_result other) {
2447
      if (!getClass().equals(other.getClass())) {
2448
        return getClass().getName().compareTo(other.getClass().getName());
2449
      }
2450
 
2451
      int lastComparison = 0;
2452
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
2453
 
2454
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
2455
      if (lastComparison != 0) {
2456
        return lastComparison;
2457
      }
2458
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
2459
      if (lastComparison != 0) {
2460
        return lastComparison;
2461
      }
2462
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(isSetPex());
2463
      if (lastComparison != 0) {
2464
        return lastComparison;
2465
      }
2466
      lastComparison = TBaseHelper.compareTo(pex, typedOther.pex);
2467
      if (lastComparison != 0) {
2468
        return lastComparison;
2469
      }
2470
      return 0;
2471
    }
2472
 
2473
    public void read(TProtocol iprot) throws TException {
2474
      TField field;
2475
      iprot.readStructBegin();
2476
      while (true)
2477
      {
2478
        field = iprot.readFieldBegin();
2479
        if (field.type == TType.STOP) { 
2480
          break;
2481
        }
2482
        _Fields fieldId = _Fields.findByThriftId(field.id);
2483
        if (fieldId == null) {
2484
          TProtocolUtil.skip(iprot, field.type);
2485
        } else {
2486
          switch (fieldId) {
2487
            case SUCCESS:
2488
              if (field.type == TType.LIST) {
2489
                {
2981 rajveer 2490
                  TList _list12 = iprot.readListBegin();
2491
                  this.success = new ArrayList<Promotion>(_list12.size);
2492
                  for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 2493
                  {
2981 rajveer 2494
                    Promotion _elem14;
2495
                    _elem14 = new Promotion();
2496
                    _elem14.read(iprot);
2497
                    this.success.add(_elem14);
1982 varun.gupt 2498
                  }
2499
                  iprot.readListEnd();
2500
                }
2501
              } else { 
2502
                TProtocolUtil.skip(iprot, field.type);
2503
              }
2504
              break;
2505
            case PEX:
2506
              if (field.type == TType.STRUCT) {
2507
                this.pex = new PromotionException();
2508
                this.pex.read(iprot);
2509
              } else { 
2510
                TProtocolUtil.skip(iprot, field.type);
2511
              }
2512
              break;
2513
          }
2514
          iprot.readFieldEnd();
2515
        }
2516
      }
2517
      iprot.readStructEnd();
2518
      validate();
2519
    }
2520
 
2521
    public void write(TProtocol oprot) throws TException {
2522
      oprot.writeStructBegin(STRUCT_DESC);
2523
 
2524
      if (this.isSetSuccess()) {
2525
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2526
        {
2527
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
2981 rajveer 2528
          for (Promotion _iter15 : this.success)
1982 varun.gupt 2529
          {
2981 rajveer 2530
            _iter15.write(oprot);
1982 varun.gupt 2531
          }
2532
          oprot.writeListEnd();
2533
        }
2534
        oprot.writeFieldEnd();
2535
      } else if (this.isSetPex()) {
2536
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2537
        this.pex.write(oprot);
2538
        oprot.writeFieldEnd();
2539
      }
2540
      oprot.writeFieldStop();
2541
      oprot.writeStructEnd();
2542
    }
2543
 
2544
    @Override
2545
    public String toString() {
2546
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
2547
      boolean first = true;
2548
 
2549
      sb.append("success:");
2550
      if (this.success == null) {
2551
        sb.append("null");
2552
      } else {
2553
        sb.append(this.success);
2554
      }
2555
      first = false;
2556
      if (!first) sb.append(", ");
2557
      sb.append("pex:");
2558
      if (this.pex == null) {
2559
        sb.append("null");
2560
      } else {
2561
        sb.append(this.pex);
2562
      }
2563
      first = false;
2564
      sb.append(")");
2565
      return sb.toString();
2566
    }
2567
 
2568
    public void validate() throws TException {
2569
      // check for required fields
2570
    }
2571
 
2572
  }
2573
 
2574
  public static class getPromotionById_args implements TBase<getPromotionById_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPromotionById_args>   {
2575
    private static final TStruct STRUCT_DESC = new TStruct("getPromotionById_args");
2576
 
2577
    private static final TField PROMOTION_ID_FIELD_DESC = new TField("promotionId", TType.I64, (short)1);
2578
 
2579
    private long promotionId;
2580
 
2581
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2582
    public enum _Fields implements TFieldIdEnum {
2583
      PROMOTION_ID((short)1, "promotionId");
2584
 
2585
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2586
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2587
 
2588
      static {
2589
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2590
          byId.put((int)field._thriftId, field);
2591
          byName.put(field.getFieldName(), field);
2592
        }
2593
      }
2594
 
2595
      /**
2596
       * Find the _Fields constant that matches fieldId, or null if its not found.
2597
       */
2598
      public static _Fields findByThriftId(int fieldId) {
2599
        return byId.get(fieldId);
2600
      }
2601
 
2602
      /**
2603
       * Find the _Fields constant that matches fieldId, throwing an exception
2604
       * if it is not found.
2605
       */
2606
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2607
        _Fields fields = findByThriftId(fieldId);
2608
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2609
        return fields;
2610
      }
2611
 
2612
      /**
2613
       * Find the _Fields constant that matches name, or null if its not found.
2614
       */
2615
      public static _Fields findByName(String name) {
2616
        return byName.get(name);
2617
      }
2618
 
2619
      private final short _thriftId;
2620
      private final String _fieldName;
2621
 
2622
      _Fields(short thriftId, String fieldName) {
2623
        _thriftId = thriftId;
2624
        _fieldName = fieldName;
2625
      }
2626
 
2627
      public short getThriftFieldId() {
2628
        return _thriftId;
2629
      }
2630
 
2631
      public String getFieldName() {
2632
        return _fieldName;
2633
      }
2634
    }
2635
 
2636
    // isset id assignments
2637
    private static final int __PROMOTIONID_ISSET_ID = 0;
2638
    private BitSet __isset_bit_vector = new BitSet(1);
2639
 
2640
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2641
      put(_Fields.PROMOTION_ID, new FieldMetaData("promotionId", TFieldRequirementType.DEFAULT, 
2642
          new FieldValueMetaData(TType.I64)));
2643
    }});
2644
 
2645
    static {
2646
      FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
2647
    }
2648
 
2649
    public getPromotionById_args() {
2650
    }
2651
 
2652
    public getPromotionById_args(
2653
      long promotionId)
2654
    {
2655
      this();
2656
      this.promotionId = promotionId;
2657
      setPromotionIdIsSet(true);
2658
    }
2659
 
2660
    /**
2661
     * Performs a deep copy on <i>other</i>.
2662
     */
2663
    public getPromotionById_args(getPromotionById_args other) {
2664
      __isset_bit_vector.clear();
2665
      __isset_bit_vector.or(other.__isset_bit_vector);
2666
      this.promotionId = other.promotionId;
2667
    }
2668
 
2669
    public getPromotionById_args deepCopy() {
2670
      return new getPromotionById_args(this);
2671
    }
2672
 
2673
    @Deprecated
2674
    public getPromotionById_args clone() {
2675
      return new getPromotionById_args(this);
2676
    }
2677
 
2678
    public long getPromotionId() {
2679
      return this.promotionId;
2680
    }
2681
 
2682
    public getPromotionById_args setPromotionId(long promotionId) {
2683
      this.promotionId = promotionId;
2684
      setPromotionIdIsSet(true);
2685
      return this;
2686
    }
2687
 
2688
    public void unsetPromotionId() {
2689
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
2690
    }
2691
 
2692
    /** Returns true if field promotionId is set (has been asigned a value) and false otherwise */
2693
    public boolean isSetPromotionId() {
2694
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
2695
    }
2696
 
2697
    public void setPromotionIdIsSet(boolean value) {
2698
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
2699
    }
2700
 
2701
    public void setFieldValue(_Fields field, Object value) {
2702
      switch (field) {
2703
      case PROMOTION_ID:
2704
        if (value == null) {
2705
          unsetPromotionId();
2706
        } else {
2707
          setPromotionId((Long)value);
2708
        }
2709
        break;
2710
 
2711
      }
2712
    }
2713
 
2714
    public void setFieldValue(int fieldID, Object value) {
2715
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2716
    }
2717
 
2718
    public Object getFieldValue(_Fields field) {
2719
      switch (field) {
2720
      case PROMOTION_ID:
2721
        return new Long(getPromotionId());
2722
 
2723
      }
2724
      throw new IllegalStateException();
2725
    }
2726
 
2727
    public Object getFieldValue(int fieldId) {
2728
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2729
    }
2730
 
2731
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2732
    public boolean isSet(_Fields field) {
2733
      switch (field) {
2734
      case PROMOTION_ID:
2735
        return isSetPromotionId();
2736
      }
2737
      throw new IllegalStateException();
2738
    }
2739
 
2740
    public boolean isSet(int fieldID) {
2741
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2742
    }
2743
 
2744
    @Override
2745
    public boolean equals(Object that) {
2746
      if (that == null)
2747
        return false;
2748
      if (that instanceof getPromotionById_args)
2749
        return this.equals((getPromotionById_args)that);
2750
      return false;
2751
    }
2752
 
2753
    public boolean equals(getPromotionById_args that) {
2754
      if (that == null)
2755
        return false;
2756
 
2757
      boolean this_present_promotionId = true;
2758
      boolean that_present_promotionId = true;
2759
      if (this_present_promotionId || that_present_promotionId) {
2760
        if (!(this_present_promotionId && that_present_promotionId))
2761
          return false;
2762
        if (this.promotionId != that.promotionId)
2763
          return false;
2764
      }
2765
 
2766
      return true;
2767
    }
2768
 
2769
    @Override
2770
    public int hashCode() {
2771
      return 0;
2772
    }
2773
 
2774
    public int compareTo(getPromotionById_args other) {
2775
      if (!getClass().equals(other.getClass())) {
2776
        return getClass().getName().compareTo(other.getClass().getName());
2777
      }
2778
 
2779
      int lastComparison = 0;
2780
      getPromotionById_args typedOther = (getPromotionById_args)other;
2781
 
2782
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(isSetPromotionId());
2783
      if (lastComparison != 0) {
2784
        return lastComparison;
2785
      }
2786
      lastComparison = TBaseHelper.compareTo(promotionId, typedOther.promotionId);
2787
      if (lastComparison != 0) {
2788
        return lastComparison;
2789
      }
2790
      return 0;
2791
    }
2792
 
2793
    public void read(TProtocol iprot) throws TException {
2794
      TField field;
2795
      iprot.readStructBegin();
2796
      while (true)
2797
      {
2798
        field = iprot.readFieldBegin();
2799
        if (field.type == TType.STOP) { 
2800
          break;
2801
        }
2802
        _Fields fieldId = _Fields.findByThriftId(field.id);
2803
        if (fieldId == null) {
2804
          TProtocolUtil.skip(iprot, field.type);
2805
        } else {
2806
          switch (fieldId) {
2807
            case PROMOTION_ID:
2808
              if (field.type == TType.I64) {
2809
                this.promotionId = iprot.readI64();
2810
                setPromotionIdIsSet(true);
2811
              } else { 
2812
                TProtocolUtil.skip(iprot, field.type);
2813
              }
2814
              break;
2815
          }
2816
          iprot.readFieldEnd();
2817
        }
2818
      }
2819
      iprot.readStructEnd();
2820
      validate();
2821
    }
2822
 
2823
    public void write(TProtocol oprot) throws TException {
2824
      validate();
2825
 
2826
      oprot.writeStructBegin(STRUCT_DESC);
2827
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
2828
      oprot.writeI64(this.promotionId);
2829
      oprot.writeFieldEnd();
2830
      oprot.writeFieldStop();
2831
      oprot.writeStructEnd();
2832
    }
2833
 
2834
    @Override
2835
    public String toString() {
2836
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
2837
      boolean first = true;
2838
 
2839
      sb.append("promotionId:");
2840
      sb.append(this.promotionId);
2841
      first = false;
2842
      sb.append(")");
2843
      return sb.toString();
2844
    }
2845
 
2846
    public void validate() throws TException {
2847
      // check for required fields
2848
    }
2849
 
2850
  }
2851
 
2852
  public static class getPromotionById_result implements TBase<getPromotionById_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPromotionById_result>   {
2853
    private static final TStruct STRUCT_DESC = new TStruct("getPromotionById_result");
2854
 
2855
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
2856
    private static final TField PEX_FIELD_DESC = new TField("pex", TType.STRUCT, (short)1);
2857
 
2858
    private Promotion success;
2859
    private PromotionException pex;
2860
 
2861
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2862
    public enum _Fields implements TFieldIdEnum {
2863
      SUCCESS((short)0, "success"),
2864
      PEX((short)1, "pex");
2865
 
2866
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2867
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2868
 
2869
      static {
2870
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2871
          byId.put((int)field._thriftId, field);
2872
          byName.put(field.getFieldName(), field);
2873
        }
2874
      }
2875
 
2876
      /**
2877
       * Find the _Fields constant that matches fieldId, or null if its not found.
2878
       */
2879
      public static _Fields findByThriftId(int fieldId) {
2880
        return byId.get(fieldId);
2881
      }
2882
 
2883
      /**
2884
       * Find the _Fields constant that matches fieldId, throwing an exception
2885
       * if it is not found.
2886
       */
2887
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2888
        _Fields fields = findByThriftId(fieldId);
2889
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2890
        return fields;
2891
      }
2892
 
2893
      /**
2894
       * Find the _Fields constant that matches name, or null if its not found.
2895
       */
2896
      public static _Fields findByName(String name) {
2897
        return byName.get(name);
2898
      }
2899
 
2900
      private final short _thriftId;
2901
      private final String _fieldName;
2902
 
2903
      _Fields(short thriftId, String fieldName) {
2904
        _thriftId = thriftId;
2905
        _fieldName = fieldName;
2906
      }
2907
 
2908
      public short getThriftFieldId() {
2909
        return _thriftId;
2910
      }
2911
 
2912
      public String getFieldName() {
2913
        return _fieldName;
2914
      }
2915
    }
2916
 
2917
    // isset id assignments
2918
 
2919
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2920
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
2921
          new StructMetaData(TType.STRUCT, Promotion.class)));
2922
      put(_Fields.PEX, new FieldMetaData("pex", TFieldRequirementType.DEFAULT, 
2923
          new FieldValueMetaData(TType.STRUCT)));
2924
    }});
2925
 
2926
    static {
2927
      FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
2928
    }
2929
 
2930
    public getPromotionById_result() {
2931
    }
2932
 
2933
    public getPromotionById_result(
2934
      Promotion success,
2935
      PromotionException pex)
2936
    {
2937
      this();
2938
      this.success = success;
2939
      this.pex = pex;
2940
    }
2941
 
2942
    /**
2943
     * Performs a deep copy on <i>other</i>.
2944
     */
2945
    public getPromotionById_result(getPromotionById_result other) {
2946
      if (other.isSetSuccess()) {
2947
        this.success = new Promotion(other.success);
2948
      }
2949
      if (other.isSetPex()) {
2950
        this.pex = new PromotionException(other.pex);
2951
      }
2952
    }
2953
 
2954
    public getPromotionById_result deepCopy() {
2955
      return new getPromotionById_result(this);
2956
    }
2957
 
2958
    @Deprecated
2959
    public getPromotionById_result clone() {
2960
      return new getPromotionById_result(this);
2961
    }
2962
 
2963
    public Promotion getSuccess() {
2964
      return this.success;
2965
    }
2966
 
2967
    public getPromotionById_result setSuccess(Promotion success) {
2968
      this.success = success;
2969
      return this;
2970
    }
2971
 
2972
    public void unsetSuccess() {
2973
      this.success = null;
2974
    }
2975
 
2976
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
2977
    public boolean isSetSuccess() {
2978
      return this.success != null;
2979
    }
2980
 
2981
    public void setSuccessIsSet(boolean value) {
2982
      if (!value) {
2983
        this.success = null;
2984
      }
2985
    }
2986
 
2987
    public PromotionException getPex() {
2988
      return this.pex;
2989
    }
2990
 
2991
    public getPromotionById_result setPex(PromotionException pex) {
2992
      this.pex = pex;
2993
      return this;
2994
    }
2995
 
2996
    public void unsetPex() {
2997
      this.pex = null;
2998
    }
2999
 
3000
    /** Returns true if field pex is set (has been asigned a value) and false otherwise */
3001
    public boolean isSetPex() {
3002
      return this.pex != null;
3003
    }
3004
 
3005
    public void setPexIsSet(boolean value) {
3006
      if (!value) {
3007
        this.pex = null;
3008
      }
3009
    }
3010
 
3011
    public void setFieldValue(_Fields field, Object value) {
3012
      switch (field) {
3013
      case SUCCESS:
3014
        if (value == null) {
3015
          unsetSuccess();
3016
        } else {
3017
          setSuccess((Promotion)value);
3018
        }
3019
        break;
3020
 
3021
      case PEX:
3022
        if (value == null) {
3023
          unsetPex();
3024
        } else {
3025
          setPex((PromotionException)value);
3026
        }
3027
        break;
3028
 
3029
      }
3030
    }
3031
 
3032
    public void setFieldValue(int fieldID, Object value) {
3033
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3034
    }
3035
 
3036
    public Object getFieldValue(_Fields field) {
3037
      switch (field) {
3038
      case SUCCESS:
3039
        return getSuccess();
3040
 
3041
      case PEX:
3042
        return getPex();
3043
 
3044
      }
3045
      throw new IllegalStateException();
3046
    }
3047
 
3048
    public Object getFieldValue(int fieldId) {
3049
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3050
    }
3051
 
3052
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3053
    public boolean isSet(_Fields field) {
3054
      switch (field) {
3055
      case SUCCESS:
3056
        return isSetSuccess();
3057
      case PEX:
3058
        return isSetPex();
3059
      }
3060
      throw new IllegalStateException();
3061
    }
3062
 
3063
    public boolean isSet(int fieldID) {
3064
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3065
    }
3066
 
3067
    @Override
3068
    public boolean equals(Object that) {
3069
      if (that == null)
3070
        return false;
3071
      if (that instanceof getPromotionById_result)
3072
        return this.equals((getPromotionById_result)that);
3073
      return false;
3074
    }
3075
 
3076
    public boolean equals(getPromotionById_result that) {
3077
      if (that == null)
3078
        return false;
3079
 
3080
      boolean this_present_success = true && this.isSetSuccess();
3081
      boolean that_present_success = true && that.isSetSuccess();
3082
      if (this_present_success || that_present_success) {
3083
        if (!(this_present_success && that_present_success))
3084
          return false;
3085
        if (!this.success.equals(that.success))
3086
          return false;
3087
      }
3088
 
3089
      boolean this_present_pex = true && this.isSetPex();
3090
      boolean that_present_pex = true && that.isSetPex();
3091
      if (this_present_pex || that_present_pex) {
3092
        if (!(this_present_pex && that_present_pex))
3093
          return false;
3094
        if (!this.pex.equals(that.pex))
3095
          return false;
3096
      }
3097
 
3098
      return true;
3099
    }
3100
 
3101
    @Override
3102
    public int hashCode() {
3103
      return 0;
3104
    }
3105
 
3106
    public int compareTo(getPromotionById_result other) {
3107
      if (!getClass().equals(other.getClass())) {
3108
        return getClass().getName().compareTo(other.getClass().getName());
3109
      }
3110
 
3111
      int lastComparison = 0;
3112
      getPromotionById_result typedOther = (getPromotionById_result)other;
3113
 
3114
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
3115
      if (lastComparison != 0) {
3116
        return lastComparison;
3117
      }
3118
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
3119
      if (lastComparison != 0) {
3120
        return lastComparison;
3121
      }
3122
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(isSetPex());
3123
      if (lastComparison != 0) {
3124
        return lastComparison;
3125
      }
3126
      lastComparison = TBaseHelper.compareTo(pex, typedOther.pex);
3127
      if (lastComparison != 0) {
3128
        return lastComparison;
3129
      }
3130
      return 0;
3131
    }
3132
 
3133
    public void read(TProtocol iprot) throws TException {
3134
      TField field;
3135
      iprot.readStructBegin();
3136
      while (true)
3137
      {
3138
        field = iprot.readFieldBegin();
3139
        if (field.type == TType.STOP) { 
3140
          break;
3141
        }
3142
        _Fields fieldId = _Fields.findByThriftId(field.id);
3143
        if (fieldId == null) {
3144
          TProtocolUtil.skip(iprot, field.type);
3145
        } else {
3146
          switch (fieldId) {
3147
            case SUCCESS:
3148
              if (field.type == TType.STRUCT) {
3149
                this.success = new Promotion();
3150
                this.success.read(iprot);
3151
              } else { 
3152
                TProtocolUtil.skip(iprot, field.type);
3153
              }
3154
              break;
3155
            case PEX:
3156
              if (field.type == TType.STRUCT) {
3157
                this.pex = new PromotionException();
3158
                this.pex.read(iprot);
3159
              } else { 
3160
                TProtocolUtil.skip(iprot, field.type);
3161
              }
3162
              break;
3163
          }
3164
          iprot.readFieldEnd();
3165
        }
3166
      }
3167
      iprot.readStructEnd();
3168
      validate();
3169
    }
3170
 
3171
    public void write(TProtocol oprot) throws TException {
3172
      oprot.writeStructBegin(STRUCT_DESC);
3173
 
3174
      if (this.isSetSuccess()) {
3175
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3176
        this.success.write(oprot);
3177
        oprot.writeFieldEnd();
3178
      } else if (this.isSetPex()) {
3179
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3180
        this.pex.write(oprot);
3181
        oprot.writeFieldEnd();
3182
      }
3183
      oprot.writeFieldStop();
3184
      oprot.writeStructEnd();
3185
    }
3186
 
3187
    @Override
3188
    public String toString() {
3189
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
3190
      boolean first = true;
3191
 
3192
      sb.append("success:");
3193
      if (this.success == null) {
3194
        sb.append("null");
3195
      } else {
3196
        sb.append(this.success);
3197
      }
3198
      first = false;
3199
      if (!first) sb.append(", ");
3200
      sb.append("pex:");
3201
      if (this.pex == null) {
3202
        sb.append("null");
3203
      } else {
3204
        sb.append(this.pex);
3205
      }
3206
      first = false;
3207
      sb.append(")");
3208
      return sb.toString();
3209
    }
3210
 
3211
    public void validate() throws TException {
3212
      // check for required fields
3213
    }
3214
 
3215
  }
3216
 
3217
  public static class generateCouponsForPromotion_args implements TBase<generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable, Comparable<generateCouponsForPromotion_args>   {
3218
    private static final TStruct STRUCT_DESC = new TStruct("generateCouponsForPromotion_args");
3219
 
3220
    private static final TField PROMOTION_ID_FIELD_DESC = new TField("promotionId", TType.I64, (short)1);
3221
    private static final TField COUPON_CODE_FIELD_DESC = new TField("couponCode", TType.STRING, (short)2);
3222
 
3223
    private long promotionId;
3224
    private String couponCode;
3225
 
3226
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3227
    public enum _Fields implements TFieldIdEnum {
3228
      PROMOTION_ID((short)1, "promotionId"),
3229
      COUPON_CODE((short)2, "couponCode");
3230
 
3231
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3232
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3233
 
3234
      static {
3235
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3236
          byId.put((int)field._thriftId, field);
3237
          byName.put(field.getFieldName(), field);
3238
        }
3239
      }
3240
 
3241
      /**
3242
       * Find the _Fields constant that matches fieldId, or null if its not found.
3243
       */
3244
      public static _Fields findByThriftId(int fieldId) {
3245
        return byId.get(fieldId);
3246
      }
3247
 
3248
      /**
3249
       * Find the _Fields constant that matches fieldId, throwing an exception
3250
       * if it is not found.
3251
       */
3252
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3253
        _Fields fields = findByThriftId(fieldId);
3254
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3255
        return fields;
3256
      }
3257
 
3258
      /**
3259
       * Find the _Fields constant that matches name, or null if its not found.
3260
       */
3261
      public static _Fields findByName(String name) {
3262
        return byName.get(name);
3263
      }
3264
 
3265
      private final short _thriftId;
3266
      private final String _fieldName;
3267
 
3268
      _Fields(short thriftId, String fieldName) {
3269
        _thriftId = thriftId;
3270
        _fieldName = fieldName;
3271
      }
3272
 
3273
      public short getThriftFieldId() {
3274
        return _thriftId;
3275
      }
3276
 
3277
      public String getFieldName() {
3278
        return _fieldName;
3279
      }
3280
    }
3281
 
3282
    // isset id assignments
3283
    private static final int __PROMOTIONID_ISSET_ID = 0;
3284
    private BitSet __isset_bit_vector = new BitSet(1);
3285
 
3286
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3287
      put(_Fields.PROMOTION_ID, new FieldMetaData("promotionId", TFieldRequirementType.DEFAULT, 
3288
          new FieldValueMetaData(TType.I64)));
3289
      put(_Fields.COUPON_CODE, new FieldMetaData("couponCode", TFieldRequirementType.DEFAULT, 
3290
          new FieldValueMetaData(TType.STRING)));
3291
    }});
3292
 
3293
    static {
3294
      FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
3295
    }
3296
 
3297
    public generateCouponsForPromotion_args() {
3298
    }
3299
 
3300
    public generateCouponsForPromotion_args(
3301
      long promotionId,
3302
      String couponCode)
3303
    {
3304
      this();
3305
      this.promotionId = promotionId;
3306
      setPromotionIdIsSet(true);
3307
      this.couponCode = couponCode;
3308
    }
3309
 
3310
    /**
3311
     * Performs a deep copy on <i>other</i>.
3312
     */
3313
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
3314
      __isset_bit_vector.clear();
3315
      __isset_bit_vector.or(other.__isset_bit_vector);
3316
      this.promotionId = other.promotionId;
3317
      if (other.isSetCouponCode()) {
3318
        this.couponCode = other.couponCode;
3319
      }
3320
    }
3321
 
3322
    public generateCouponsForPromotion_args deepCopy() {
3323
      return new generateCouponsForPromotion_args(this);
3324
    }
3325
 
3326
    @Deprecated
3327
    public generateCouponsForPromotion_args clone() {
3328
      return new generateCouponsForPromotion_args(this);
3329
    }
3330
 
3331
    public long getPromotionId() {
3332
      return this.promotionId;
3333
    }
3334
 
3335
    public generateCouponsForPromotion_args setPromotionId(long promotionId) {
3336
      this.promotionId = promotionId;
3337
      setPromotionIdIsSet(true);
3338
      return this;
3339
    }
3340
 
3341
    public void unsetPromotionId() {
3342
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3343
    }
3344
 
3345
    /** Returns true if field promotionId is set (has been asigned a value) and false otherwise */
3346
    public boolean isSetPromotionId() {
3347
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3348
    }
3349
 
3350
    public void setPromotionIdIsSet(boolean value) {
3351
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3352
    }
3353
 
3354
    public String getCouponCode() {
3355
      return this.couponCode;
3356
    }
3357
 
3358
    public generateCouponsForPromotion_args setCouponCode(String couponCode) {
3359
      this.couponCode = couponCode;
3360
      return this;
3361
    }
3362
 
3363
    public void unsetCouponCode() {
3364
      this.couponCode = null;
3365
    }
3366
 
3367
    /** Returns true if field couponCode is set (has been asigned a value) and false otherwise */
3368
    public boolean isSetCouponCode() {
3369
      return this.couponCode != null;
3370
    }
3371
 
3372
    public void setCouponCodeIsSet(boolean value) {
3373
      if (!value) {
3374
        this.couponCode = null;
3375
      }
3376
    }
3377
 
3378
    public void setFieldValue(_Fields field, Object value) {
3379
      switch (field) {
3380
      case PROMOTION_ID:
3381
        if (value == null) {
3382
          unsetPromotionId();
3383
        } else {
3384
          setPromotionId((Long)value);
3385
        }
3386
        break;
3387
 
3388
      case COUPON_CODE:
3389
        if (value == null) {
3390
          unsetCouponCode();
3391
        } else {
3392
          setCouponCode((String)value);
3393
        }
3394
        break;
3395
 
3396
      }
3397
    }
3398
 
3399
    public void setFieldValue(int fieldID, Object value) {
3400
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3401
    }
3402
 
3403
    public Object getFieldValue(_Fields field) {
3404
      switch (field) {
3405
      case PROMOTION_ID:
3406
        return new Long(getPromotionId());
3407
 
3408
      case COUPON_CODE:
3409
        return getCouponCode();
3410
 
3411
      }
3412
      throw new IllegalStateException();
3413
    }
3414
 
3415
    public Object getFieldValue(int fieldId) {
3416
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3417
    }
3418
 
3419
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3420
    public boolean isSet(_Fields field) {
3421
      switch (field) {
3422
      case PROMOTION_ID:
3423
        return isSetPromotionId();
3424
      case COUPON_CODE:
3425
        return isSetCouponCode();
3426
      }
3427
      throw new IllegalStateException();
3428
    }
3429
 
3430
    public boolean isSet(int fieldID) {
3431
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3432
    }
3433
 
3434
    @Override
3435
    public boolean equals(Object that) {
3436
      if (that == null)
3437
        return false;
3438
      if (that instanceof generateCouponsForPromotion_args)
3439
        return this.equals((generateCouponsForPromotion_args)that);
3440
      return false;
3441
    }
3442
 
3443
    public boolean equals(generateCouponsForPromotion_args that) {
3444
      if (that == null)
3445
        return false;
3446
 
3447
      boolean this_present_promotionId = true;
3448
      boolean that_present_promotionId = true;
3449
      if (this_present_promotionId || that_present_promotionId) {
3450
        if (!(this_present_promotionId && that_present_promotionId))
3451
          return false;
3452
        if (this.promotionId != that.promotionId)
3453
          return false;
3454
      }
3455
 
3456
      boolean this_present_couponCode = true && this.isSetCouponCode();
3457
      boolean that_present_couponCode = true && that.isSetCouponCode();
3458
      if (this_present_couponCode || that_present_couponCode) {
3459
        if (!(this_present_couponCode && that_present_couponCode))
3460
          return false;
3461
        if (!this.couponCode.equals(that.couponCode))
3462
          return false;
3463
      }
3464
 
3465
      return true;
3466
    }
3467
 
3468
    @Override
3469
    public int hashCode() {
3470
      return 0;
3471
    }
3472
 
3473
    public int compareTo(generateCouponsForPromotion_args other) {
3474
      if (!getClass().equals(other.getClass())) {
3475
        return getClass().getName().compareTo(other.getClass().getName());
3476
      }
3477
 
3478
      int lastComparison = 0;
3479
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
3480
 
3481
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(isSetPromotionId());
3482
      if (lastComparison != 0) {
3483
        return lastComparison;
3484
      }
3485
      lastComparison = TBaseHelper.compareTo(promotionId, typedOther.promotionId);
3486
      if (lastComparison != 0) {
3487
        return lastComparison;
3488
      }
3489
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(isSetCouponCode());
3490
      if (lastComparison != 0) {
3491
        return lastComparison;
3492
      }
3493
      lastComparison = TBaseHelper.compareTo(couponCode, typedOther.couponCode);
3494
      if (lastComparison != 0) {
3495
        return lastComparison;
3496
      }
3497
      return 0;
3498
    }
3499
 
3500
    public void read(TProtocol iprot) throws TException {
3501
      TField field;
3502
      iprot.readStructBegin();
3503
      while (true)
3504
      {
3505
        field = iprot.readFieldBegin();
3506
        if (field.type == TType.STOP) { 
3507
          break;
3508
        }
3509
        _Fields fieldId = _Fields.findByThriftId(field.id);
3510
        if (fieldId == null) {
3511
          TProtocolUtil.skip(iprot, field.type);
3512
        } else {
3513
          switch (fieldId) {
3514
            case PROMOTION_ID:
3515
              if (field.type == TType.I64) {
3516
                this.promotionId = iprot.readI64();
3517
                setPromotionIdIsSet(true);
3518
              } else { 
3519
                TProtocolUtil.skip(iprot, field.type);
3520
              }
3521
              break;
3522
            case COUPON_CODE:
3523
              if (field.type == TType.STRING) {
3524
                this.couponCode = iprot.readString();
3525
              } else { 
3526
                TProtocolUtil.skip(iprot, field.type);
3527
              }
3528
              break;
3529
          }
3530
          iprot.readFieldEnd();
3531
        }
3532
      }
3533
      iprot.readStructEnd();
3534
      validate();
3535
    }
3536
 
3537
    public void write(TProtocol oprot) throws TException {
3538
      validate();
3539
 
3540
      oprot.writeStructBegin(STRUCT_DESC);
3541
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3542
      oprot.writeI64(this.promotionId);
3543
      oprot.writeFieldEnd();
3544
      if (this.couponCode != null) {
3545
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3546
        oprot.writeString(this.couponCode);
3547
        oprot.writeFieldEnd();
3548
      }
3549
      oprot.writeFieldStop();
3550
      oprot.writeStructEnd();
3551
    }
3552
 
3553
    @Override
3554
    public String toString() {
3555
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
3556
      boolean first = true;
3557
 
3558
      sb.append("promotionId:");
3559
      sb.append(this.promotionId);
3560
      first = false;
3561
      if (!first) sb.append(", ");
3562
      sb.append("couponCode:");
3563
      if (this.couponCode == null) {
3564
        sb.append("null");
3565
      } else {
3566
        sb.append(this.couponCode);
3567
      }
3568
      first = false;
3569
      sb.append(")");
3570
      return sb.toString();
3571
    }
3572
 
3573
    public void validate() throws TException {
3574
      // check for required fields
3575
    }
3576
 
3577
  }
3578
 
3579
  public static class generateCouponsForPromotion_result implements TBase<generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable, Comparable<generateCouponsForPromotion_result>   {
3580
    private static final TStruct STRUCT_DESC = new TStruct("generateCouponsForPromotion_result");
3581
 
3582
    private static final TField PEX_FIELD_DESC = new TField("pex", TType.STRUCT, (short)1);
3583
 
3584
    private PromotionException pex;
3585
 
3586
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3587
    public enum _Fields implements TFieldIdEnum {
3588
      PEX((short)1, "pex");
3589
 
3590
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3591
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3592
 
3593
      static {
3594
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3595
          byId.put((int)field._thriftId, field);
3596
          byName.put(field.getFieldName(), field);
3597
        }
3598
      }
3599
 
3600
      /**
3601
       * Find the _Fields constant that matches fieldId, or null if its not found.
3602
       */
3603
      public static _Fields findByThriftId(int fieldId) {
3604
        return byId.get(fieldId);
3605
      }
3606
 
3607
      /**
3608
       * Find the _Fields constant that matches fieldId, throwing an exception
3609
       * if it is not found.
3610
       */
3611
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3612
        _Fields fields = findByThriftId(fieldId);
3613
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3614
        return fields;
3615
      }
3616
 
3617
      /**
3618
       * Find the _Fields constant that matches name, or null if its not found.
3619
       */
3620
      public static _Fields findByName(String name) {
3621
        return byName.get(name);
3622
      }
3623
 
3624
      private final short _thriftId;
3625
      private final String _fieldName;
3626
 
3627
      _Fields(short thriftId, String fieldName) {
3628
        _thriftId = thriftId;
3629
        _fieldName = fieldName;
3630
      }
3631
 
3632
      public short getThriftFieldId() {
3633
        return _thriftId;
3634
      }
3635
 
3636
      public String getFieldName() {
3637
        return _fieldName;
3638
      }
3639
    }
3640
 
3641
    // isset id assignments
3642
 
3643
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3644
      put(_Fields.PEX, new FieldMetaData("pex", TFieldRequirementType.DEFAULT, 
3645
          new FieldValueMetaData(TType.STRUCT)));
3646
    }});
3647
 
3648
    static {
3649
      FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
3650
    }
3651
 
3652
    public generateCouponsForPromotion_result() {
3653
    }
3654
 
3655
    public generateCouponsForPromotion_result(
3656
      PromotionException pex)
3657
    {
3658
      this();
3659
      this.pex = pex;
3660
    }
3661
 
3662
    /**
3663
     * Performs a deep copy on <i>other</i>.
3664
     */
3665
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
3666
      if (other.isSetPex()) {
3667
        this.pex = new PromotionException(other.pex);
3668
      }
3669
    }
3670
 
3671
    public generateCouponsForPromotion_result deepCopy() {
3672
      return new generateCouponsForPromotion_result(this);
3673
    }
3674
 
3675
    @Deprecated
3676
    public generateCouponsForPromotion_result clone() {
3677
      return new generateCouponsForPromotion_result(this);
3678
    }
3679
 
3680
    public PromotionException getPex() {
3681
      return this.pex;
3682
    }
3683
 
3684
    public generateCouponsForPromotion_result setPex(PromotionException pex) {
3685
      this.pex = pex;
3686
      return this;
3687
    }
3688
 
3689
    public void unsetPex() {
3690
      this.pex = null;
3691
    }
3692
 
3693
    /** Returns true if field pex is set (has been asigned a value) and false otherwise */
3694
    public boolean isSetPex() {
3695
      return this.pex != null;
3696
    }
3697
 
3698
    public void setPexIsSet(boolean value) {
3699
      if (!value) {
3700
        this.pex = null;
3701
      }
3702
    }
3703
 
3704
    public void setFieldValue(_Fields field, Object value) {
3705
      switch (field) {
3706
      case PEX:
3707
        if (value == null) {
3708
          unsetPex();
3709
        } else {
3710
          setPex((PromotionException)value);
3711
        }
3712
        break;
3713
 
3714
      }
3715
    }
3716
 
3717
    public void setFieldValue(int fieldID, Object value) {
3718
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3719
    }
3720
 
3721
    public Object getFieldValue(_Fields field) {
3722
      switch (field) {
3723
      case PEX:
3724
        return getPex();
3725
 
3726
      }
3727
      throw new IllegalStateException();
3728
    }
3729
 
3730
    public Object getFieldValue(int fieldId) {
3731
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3732
    }
3733
 
3734
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3735
    public boolean isSet(_Fields field) {
3736
      switch (field) {
3737
      case PEX:
3738
        return isSetPex();
3739
      }
3740
      throw new IllegalStateException();
3741
    }
3742
 
3743
    public boolean isSet(int fieldID) {
3744
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3745
    }
3746
 
3747
    @Override
3748
    public boolean equals(Object that) {
3749
      if (that == null)
3750
        return false;
3751
      if (that instanceof generateCouponsForPromotion_result)
3752
        return this.equals((generateCouponsForPromotion_result)that);
3753
      return false;
3754
    }
3755
 
3756
    public boolean equals(generateCouponsForPromotion_result that) {
3757
      if (that == null)
3758
        return false;
3759
 
3760
      boolean this_present_pex = true && this.isSetPex();
3761
      boolean that_present_pex = true && that.isSetPex();
3762
      if (this_present_pex || that_present_pex) {
3763
        if (!(this_present_pex && that_present_pex))
3764
          return false;
3765
        if (!this.pex.equals(that.pex))
3766
          return false;
3767
      }
3768
 
3769
      return true;
3770
    }
3771
 
3772
    @Override
3773
    public int hashCode() {
3774
      return 0;
3775
    }
3776
 
3777
    public int compareTo(generateCouponsForPromotion_result other) {
3778
      if (!getClass().equals(other.getClass())) {
3779
        return getClass().getName().compareTo(other.getClass().getName());
3780
      }
3781
 
3782
      int lastComparison = 0;
3783
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
3784
 
3785
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(isSetPex());
3786
      if (lastComparison != 0) {
3787
        return lastComparison;
3788
      }
3789
      lastComparison = TBaseHelper.compareTo(pex, typedOther.pex);
3790
      if (lastComparison != 0) {
3791
        return lastComparison;
3792
      }
3793
      return 0;
3794
    }
3795
 
3796
    public void read(TProtocol iprot) throws TException {
3797
      TField field;
3798
      iprot.readStructBegin();
3799
      while (true)
3800
      {
3801
        field = iprot.readFieldBegin();
3802
        if (field.type == TType.STOP) { 
3803
          break;
3804
        }
3805
        _Fields fieldId = _Fields.findByThriftId(field.id);
3806
        if (fieldId == null) {
3807
          TProtocolUtil.skip(iprot, field.type);
3808
        } else {
3809
          switch (fieldId) {
3810
            case PEX:
3811
              if (field.type == TType.STRUCT) {
3812
                this.pex = new PromotionException();
3813
                this.pex.read(iprot);
3814
              } else { 
3815
                TProtocolUtil.skip(iprot, field.type);
3816
              }
3817
              break;
3818
          }
3819
          iprot.readFieldEnd();
3820
        }
3821
      }
3822
      iprot.readStructEnd();
3823
      validate();
3824
    }
3825
 
3826
    public void write(TProtocol oprot) throws TException {
3827
      oprot.writeStructBegin(STRUCT_DESC);
3828
 
3829
      if (this.isSetPex()) {
3830
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3831
        this.pex.write(oprot);
3832
        oprot.writeFieldEnd();
3833
      }
3834
      oprot.writeFieldStop();
3835
      oprot.writeStructEnd();
3836
    }
3837
 
3838
    @Override
3839
    public String toString() {
3840
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
3841
      boolean first = true;
3842
 
3843
      sb.append("pex:");
3844
      if (this.pex == null) {
3845
        sb.append("null");
3846
      } else {
3847
        sb.append(this.pex);
3848
      }
3849
      first = false;
3850
      sb.append(")");
3851
      return sb.toString();
3852
    }
3853
 
3854
    public void validate() throws TException {
3855
      // check for required fields
3856
    }
3857
 
3858
  }
3859
 
3860
  public static class applyCoupon_args implements TBase<applyCoupon_args._Fields>, java.io.Serializable, Cloneable, Comparable<applyCoupon_args>   {
3861
    private static final TStruct STRUCT_DESC = new TStruct("applyCoupon_args");
3862
 
3863
    private static final TField COUPON_CODE_FIELD_DESC = new TField("couponCode", TType.STRING, (short)1);
3864
    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)2);
3865
 
3866
    private String couponCode;
3867
    private long cartId;
3868
 
3869
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3870
    public enum _Fields implements TFieldIdEnum {
3871
      COUPON_CODE((short)1, "couponCode"),
3872
      CART_ID((short)2, "cartId");
3873
 
3874
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3875
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3876
 
3877
      static {
3878
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3879
          byId.put((int)field._thriftId, field);
3880
          byName.put(field.getFieldName(), field);
3881
        }
3882
      }
3883
 
3884
      /**
3885
       * Find the _Fields constant that matches fieldId, or null if its not found.
3886
       */
3887
      public static _Fields findByThriftId(int fieldId) {
3888
        return byId.get(fieldId);
3889
      }
3890
 
3891
      /**
3892
       * Find the _Fields constant that matches fieldId, throwing an exception
3893
       * if it is not found.
3894
       */
3895
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3896
        _Fields fields = findByThriftId(fieldId);
3897
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3898
        return fields;
3899
      }
3900
 
3901
      /**
3902
       * Find the _Fields constant that matches name, or null if its not found.
3903
       */
3904
      public static _Fields findByName(String name) {
3905
        return byName.get(name);
3906
      }
3907
 
3908
      private final short _thriftId;
3909
      private final String _fieldName;
3910
 
3911
      _Fields(short thriftId, String fieldName) {
3912
        _thriftId = thriftId;
3913
        _fieldName = fieldName;
3914
      }
3915
 
3916
      public short getThriftFieldId() {
3917
        return _thriftId;
3918
      }
3919
 
3920
      public String getFieldName() {
3921
        return _fieldName;
3922
      }
3923
    }
3924
 
3925
    // isset id assignments
3926
    private static final int __CARTID_ISSET_ID = 0;
3927
    private BitSet __isset_bit_vector = new BitSet(1);
3928
 
3929
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3930
      put(_Fields.COUPON_CODE, new FieldMetaData("couponCode", TFieldRequirementType.DEFAULT, 
3931
          new FieldValueMetaData(TType.STRING)));
3932
      put(_Fields.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
3933
          new FieldValueMetaData(TType.I64)));
3934
    }});
3935
 
3936
    static {
3937
      FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
3938
    }
3939
 
3940
    public applyCoupon_args() {
3941
    }
3942
 
3943
    public applyCoupon_args(
3944
      String couponCode,
3945
      long cartId)
3946
    {
3947
      this();
3948
      this.couponCode = couponCode;
3949
      this.cartId = cartId;
3950
      setCartIdIsSet(true);
3951
    }
3952
 
3953
    /**
3954
     * Performs a deep copy on <i>other</i>.
3955
     */
3956
    public applyCoupon_args(applyCoupon_args other) {
3957
      __isset_bit_vector.clear();
3958
      __isset_bit_vector.or(other.__isset_bit_vector);
3959
      if (other.isSetCouponCode()) {
3960
        this.couponCode = other.couponCode;
3961
      }
3962
      this.cartId = other.cartId;
3963
    }
3964
 
3965
    public applyCoupon_args deepCopy() {
3966
      return new applyCoupon_args(this);
3967
    }
3968
 
3969
    @Deprecated
3970
    public applyCoupon_args clone() {
3971
      return new applyCoupon_args(this);
3972
    }
3973
 
3974
    public String getCouponCode() {
3975
      return this.couponCode;
3976
    }
3977
 
3978
    public applyCoupon_args setCouponCode(String couponCode) {
3979
      this.couponCode = couponCode;
3980
      return this;
3981
    }
3982
 
3983
    public void unsetCouponCode() {
3984
      this.couponCode = null;
3985
    }
3986
 
3987
    /** Returns true if field couponCode is set (has been asigned a value) and false otherwise */
3988
    public boolean isSetCouponCode() {
3989
      return this.couponCode != null;
3990
    }
3991
 
3992
    public void setCouponCodeIsSet(boolean value) {
3993
      if (!value) {
3994
        this.couponCode = null;
3995
      }
3996
    }
3997
 
3998
    public long getCartId() {
3999
      return this.cartId;
4000
    }
4001
 
4002
    public applyCoupon_args setCartId(long cartId) {
4003
      this.cartId = cartId;
4004
      setCartIdIsSet(true);
4005
      return this;
4006
    }
4007
 
4008
    public void unsetCartId() {
4009
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
4010
    }
4011
 
4012
    /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
4013
    public boolean isSetCartId() {
4014
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
4015
    }
4016
 
4017
    public void setCartIdIsSet(boolean value) {
4018
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
4019
    }
4020
 
4021
    public void setFieldValue(_Fields field, Object value) {
4022
      switch (field) {
4023
      case COUPON_CODE:
4024
        if (value == null) {
4025
          unsetCouponCode();
4026
        } else {
4027
          setCouponCode((String)value);
4028
        }
4029
        break;
4030
 
4031
      case CART_ID:
4032
        if (value == null) {
4033
          unsetCartId();
4034
        } else {
4035
          setCartId((Long)value);
4036
        }
4037
        break;
4038
 
4039
      }
4040
    }
4041
 
4042
    public void setFieldValue(int fieldID, Object value) {
4043
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4044
    }
4045
 
4046
    public Object getFieldValue(_Fields field) {
4047
      switch (field) {
4048
      case COUPON_CODE:
4049
        return getCouponCode();
4050
 
4051
      case CART_ID:
4052
        return new Long(getCartId());
4053
 
4054
      }
4055
      throw new IllegalStateException();
4056
    }
4057
 
4058
    public Object getFieldValue(int fieldId) {
4059
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4060
    }
4061
 
4062
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4063
    public boolean isSet(_Fields field) {
4064
      switch (field) {
4065
      case COUPON_CODE:
4066
        return isSetCouponCode();
4067
      case CART_ID:
4068
        return isSetCartId();
4069
      }
4070
      throw new IllegalStateException();
4071
    }
4072
 
4073
    public boolean isSet(int fieldID) {
4074
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4075
    }
4076
 
4077
    @Override
4078
    public boolean equals(Object that) {
4079
      if (that == null)
4080
        return false;
4081
      if (that instanceof applyCoupon_args)
4082
        return this.equals((applyCoupon_args)that);
4083
      return false;
4084
    }
4085
 
4086
    public boolean equals(applyCoupon_args that) {
4087
      if (that == null)
4088
        return false;
4089
 
4090
      boolean this_present_couponCode = true && this.isSetCouponCode();
4091
      boolean that_present_couponCode = true && that.isSetCouponCode();
4092
      if (this_present_couponCode || that_present_couponCode) {
4093
        if (!(this_present_couponCode && that_present_couponCode))
4094
          return false;
4095
        if (!this.couponCode.equals(that.couponCode))
4096
          return false;
4097
      }
4098
 
4099
      boolean this_present_cartId = true;
4100
      boolean that_present_cartId = true;
4101
      if (this_present_cartId || that_present_cartId) {
4102
        if (!(this_present_cartId && that_present_cartId))
4103
          return false;
4104
        if (this.cartId != that.cartId)
4105
          return false;
4106
      }
4107
 
4108
      return true;
4109
    }
4110
 
4111
    @Override
4112
    public int hashCode() {
4113
      return 0;
4114
    }
4115
 
4116
    public int compareTo(applyCoupon_args other) {
4117
      if (!getClass().equals(other.getClass())) {
4118
        return getClass().getName().compareTo(other.getClass().getName());
4119
      }
4120
 
4121
      int lastComparison = 0;
4122
      applyCoupon_args typedOther = (applyCoupon_args)other;
4123
 
4124
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(isSetCouponCode());
4125
      if (lastComparison != 0) {
4126
        return lastComparison;
4127
      }
4128
      lastComparison = TBaseHelper.compareTo(couponCode, typedOther.couponCode);
4129
      if (lastComparison != 0) {
4130
        return lastComparison;
4131
      }
4132
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
4133
      if (lastComparison != 0) {
4134
        return lastComparison;
4135
      }
4136
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
4137
      if (lastComparison != 0) {
4138
        return lastComparison;
4139
      }
4140
      return 0;
4141
    }
4142
 
4143
    public void read(TProtocol iprot) throws TException {
4144
      TField field;
4145
      iprot.readStructBegin();
4146
      while (true)
4147
      {
4148
        field = iprot.readFieldBegin();
4149
        if (field.type == TType.STOP) { 
4150
          break;
4151
        }
4152
        _Fields fieldId = _Fields.findByThriftId(field.id);
4153
        if (fieldId == null) {
4154
          TProtocolUtil.skip(iprot, field.type);
4155
        } else {
4156
          switch (fieldId) {
4157
            case COUPON_CODE:
4158
              if (field.type == TType.STRING) {
4159
                this.couponCode = iprot.readString();
4160
              } else { 
4161
                TProtocolUtil.skip(iprot, field.type);
4162
              }
4163
              break;
4164
            case CART_ID:
4165
              if (field.type == TType.I64) {
4166
                this.cartId = iprot.readI64();
4167
                setCartIdIsSet(true);
4168
              } else { 
4169
                TProtocolUtil.skip(iprot, field.type);
4170
              }
4171
              break;
4172
          }
4173
          iprot.readFieldEnd();
4174
        }
4175
      }
4176
      iprot.readStructEnd();
4177
      validate();
4178
    }
4179
 
4180
    public void write(TProtocol oprot) throws TException {
4181
      validate();
4182
 
4183
      oprot.writeStructBegin(STRUCT_DESC);
4184
      if (this.couponCode != null) {
4185
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4186
        oprot.writeString(this.couponCode);
4187
        oprot.writeFieldEnd();
4188
      }
4189
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
4190
      oprot.writeI64(this.cartId);
4191
      oprot.writeFieldEnd();
4192
      oprot.writeFieldStop();
4193
      oprot.writeStructEnd();
4194
    }
4195
 
4196
    @Override
4197
    public String toString() {
4198
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
4199
      boolean first = true;
4200
 
4201
      sb.append("couponCode:");
4202
      if (this.couponCode == null) {
4203
        sb.append("null");
4204
      } else {
4205
        sb.append(this.couponCode);
4206
      }
4207
      first = false;
4208
      if (!first) sb.append(", ");
4209
      sb.append("cartId:");
4210
      sb.append(this.cartId);
4211
      first = false;
4212
      sb.append(")");
4213
      return sb.toString();
4214
    }
4215
 
4216
    public void validate() throws TException {
4217
      // check for required fields
4218
    }
4219
 
4220
  }
4221
 
4222
  public static class applyCoupon_result implements TBase<applyCoupon_result._Fields>, java.io.Serializable, Cloneable, Comparable<applyCoupon_result>   {
4223
    private static final TStruct STRUCT_DESC = new TStruct("applyCoupon_result");
4224
 
4225
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
4226
    private static final TField PEX_FIELD_DESC = new TField("pex", TType.STRUCT, (short)1);
4227
 
4228
    private Cart success;
4229
    private PromotionException pex;
4230
 
4231
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4232
    public enum _Fields implements TFieldIdEnum {
4233
      SUCCESS((short)0, "success"),
4234
      PEX((short)1, "pex");
4235
 
4236
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4237
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4238
 
4239
      static {
4240
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4241
          byId.put((int)field._thriftId, field);
4242
          byName.put(field.getFieldName(), field);
4243
        }
4244
      }
4245
 
4246
      /**
4247
       * Find the _Fields constant that matches fieldId, or null if its not found.
4248
       */
4249
      public static _Fields findByThriftId(int fieldId) {
4250
        return byId.get(fieldId);
4251
      }
4252
 
4253
      /**
4254
       * Find the _Fields constant that matches fieldId, throwing an exception
4255
       * if it is not found.
4256
       */
4257
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4258
        _Fields fields = findByThriftId(fieldId);
4259
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4260
        return fields;
4261
      }
4262
 
4263
      /**
4264
       * Find the _Fields constant that matches name, or null if its not found.
4265
       */
4266
      public static _Fields findByName(String name) {
4267
        return byName.get(name);
4268
      }
4269
 
4270
      private final short _thriftId;
4271
      private final String _fieldName;
4272
 
4273
      _Fields(short thriftId, String fieldName) {
4274
        _thriftId = thriftId;
4275
        _fieldName = fieldName;
4276
      }
4277
 
4278
      public short getThriftFieldId() {
4279
        return _thriftId;
4280
      }
4281
 
4282
      public String getFieldName() {
4283
        return _fieldName;
4284
      }
4285
    }
4286
 
4287
    // isset id assignments
4288
 
4289
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4290
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
4291
          new StructMetaData(TType.STRUCT, Cart.class)));
4292
      put(_Fields.PEX, new FieldMetaData("pex", TFieldRequirementType.DEFAULT, 
4293
          new FieldValueMetaData(TType.STRUCT)));
4294
    }});
4295
 
4296
    static {
4297
      FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
4298
    }
4299
 
4300
    public applyCoupon_result() {
4301
    }
4302
 
4303
    public applyCoupon_result(
4304
      Cart success,
4305
      PromotionException pex)
4306
    {
4307
      this();
4308
      this.success = success;
4309
      this.pex = pex;
4310
    }
4311
 
4312
    /**
4313
     * Performs a deep copy on <i>other</i>.
4314
     */
4315
    public applyCoupon_result(applyCoupon_result other) {
4316
      if (other.isSetSuccess()) {
4317
        this.success = new Cart(other.success);
4318
      }
4319
      if (other.isSetPex()) {
4320
        this.pex = new PromotionException(other.pex);
4321
      }
4322
    }
4323
 
4324
    public applyCoupon_result deepCopy() {
4325
      return new applyCoupon_result(this);
4326
    }
4327
 
4328
    @Deprecated
4329
    public applyCoupon_result clone() {
4330
      return new applyCoupon_result(this);
4331
    }
4332
 
4333
    public Cart getSuccess() {
4334
      return this.success;
4335
    }
4336
 
4337
    public applyCoupon_result setSuccess(Cart success) {
4338
      this.success = success;
4339
      return this;
4340
    }
4341
 
4342
    public void unsetSuccess() {
4343
      this.success = null;
4344
    }
4345
 
4346
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
4347
    public boolean isSetSuccess() {
4348
      return this.success != null;
4349
    }
4350
 
4351
    public void setSuccessIsSet(boolean value) {
4352
      if (!value) {
4353
        this.success = null;
4354
      }
4355
    }
4356
 
4357
    public PromotionException getPex() {
4358
      return this.pex;
4359
    }
4360
 
4361
    public applyCoupon_result setPex(PromotionException pex) {
4362
      this.pex = pex;
4363
      return this;
4364
    }
4365
 
4366
    public void unsetPex() {
4367
      this.pex = null;
4368
    }
4369
 
4370
    /** Returns true if field pex is set (has been asigned a value) and false otherwise */
4371
    public boolean isSetPex() {
4372
      return this.pex != null;
4373
    }
4374
 
4375
    public void setPexIsSet(boolean value) {
4376
      if (!value) {
4377
        this.pex = null;
4378
      }
4379
    }
4380
 
4381
    public void setFieldValue(_Fields field, Object value) {
4382
      switch (field) {
4383
      case SUCCESS:
4384
        if (value == null) {
4385
          unsetSuccess();
4386
        } else {
4387
          setSuccess((Cart)value);
4388
        }
4389
        break;
4390
 
4391
      case PEX:
4392
        if (value == null) {
4393
          unsetPex();
4394
        } else {
4395
          setPex((PromotionException)value);
4396
        }
4397
        break;
4398
 
4399
      }
4400
    }
4401
 
4402
    public void setFieldValue(int fieldID, Object value) {
4403
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4404
    }
4405
 
4406
    public Object getFieldValue(_Fields field) {
4407
      switch (field) {
4408
      case SUCCESS:
4409
        return getSuccess();
4410
 
4411
      case PEX:
4412
        return getPex();
4413
 
4414
      }
4415
      throw new IllegalStateException();
4416
    }
4417
 
4418
    public Object getFieldValue(int fieldId) {
4419
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4420
    }
4421
 
4422
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4423
    public boolean isSet(_Fields field) {
4424
      switch (field) {
4425
      case SUCCESS:
4426
        return isSetSuccess();
4427
      case PEX:
4428
        return isSetPex();
4429
      }
4430
      throw new IllegalStateException();
4431
    }
4432
 
4433
    public boolean isSet(int fieldID) {
4434
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4435
    }
4436
 
4437
    @Override
4438
    public boolean equals(Object that) {
4439
      if (that == null)
4440
        return false;
4441
      if (that instanceof applyCoupon_result)
4442
        return this.equals((applyCoupon_result)that);
4443
      return false;
4444
    }
4445
 
4446
    public boolean equals(applyCoupon_result that) {
4447
      if (that == null)
4448
        return false;
4449
 
4450
      boolean this_present_success = true && this.isSetSuccess();
4451
      boolean that_present_success = true && that.isSetSuccess();
4452
      if (this_present_success || that_present_success) {
4453
        if (!(this_present_success && that_present_success))
4454
          return false;
4455
        if (!this.success.equals(that.success))
4456
          return false;
4457
      }
4458
 
4459
      boolean this_present_pex = true && this.isSetPex();
4460
      boolean that_present_pex = true && that.isSetPex();
4461
      if (this_present_pex || that_present_pex) {
4462
        if (!(this_present_pex && that_present_pex))
4463
          return false;
4464
        if (!this.pex.equals(that.pex))
4465
          return false;
4466
      }
4467
 
4468
      return true;
4469
    }
4470
 
4471
    @Override
4472
    public int hashCode() {
4473
      return 0;
4474
    }
4475
 
4476
    public int compareTo(applyCoupon_result other) {
4477
      if (!getClass().equals(other.getClass())) {
4478
        return getClass().getName().compareTo(other.getClass().getName());
4479
      }
4480
 
4481
      int lastComparison = 0;
4482
      applyCoupon_result typedOther = (applyCoupon_result)other;
4483
 
4484
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
4485
      if (lastComparison != 0) {
4486
        return lastComparison;
4487
      }
4488
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
4489
      if (lastComparison != 0) {
4490
        return lastComparison;
4491
      }
4492
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(isSetPex());
4493
      if (lastComparison != 0) {
4494
        return lastComparison;
4495
      }
4496
      lastComparison = TBaseHelper.compareTo(pex, typedOther.pex);
4497
      if (lastComparison != 0) {
4498
        return lastComparison;
4499
      }
4500
      return 0;
4501
    }
4502
 
4503
    public void read(TProtocol iprot) throws TException {
4504
      TField field;
4505
      iprot.readStructBegin();
4506
      while (true)
4507
      {
4508
        field = iprot.readFieldBegin();
4509
        if (field.type == TType.STOP) { 
4510
          break;
4511
        }
4512
        _Fields fieldId = _Fields.findByThriftId(field.id);
4513
        if (fieldId == null) {
4514
          TProtocolUtil.skip(iprot, field.type);
4515
        } else {
4516
          switch (fieldId) {
4517
            case SUCCESS:
4518
              if (field.type == TType.STRUCT) {
4519
                this.success = new Cart();
4520
                this.success.read(iprot);
4521
              } else { 
4522
                TProtocolUtil.skip(iprot, field.type);
4523
              }
4524
              break;
4525
            case PEX:
4526
              if (field.type == TType.STRUCT) {
4527
                this.pex = new PromotionException();
4528
                this.pex.read(iprot);
4529
              } else { 
4530
                TProtocolUtil.skip(iprot, field.type);
4531
              }
4532
              break;
4533
          }
4534
          iprot.readFieldEnd();
4535
        }
4536
      }
4537
      iprot.readStructEnd();
4538
      validate();
4539
    }
4540
 
4541
    public void write(TProtocol oprot) throws TException {
4542
      oprot.writeStructBegin(STRUCT_DESC);
4543
 
4544
      if (this.isSetSuccess()) {
4545
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4546
        this.success.write(oprot);
4547
        oprot.writeFieldEnd();
4548
      } else if (this.isSetPex()) {
4549
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4550
        this.pex.write(oprot);
4551
        oprot.writeFieldEnd();
4552
      }
4553
      oprot.writeFieldStop();
4554
      oprot.writeStructEnd();
4555
    }
4556
 
4557
    @Override
4558
    public String toString() {
4559
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
4560
      boolean first = true;
4561
 
4562
      sb.append("success:");
4563
      if (this.success == null) {
4564
        sb.append("null");
4565
      } else {
4566
        sb.append(this.success);
4567
      }
4568
      first = false;
4569
      if (!first) sb.append(", ");
4570
      sb.append("pex:");
4571
      if (this.pex == null) {
4572
        sb.append("null");
4573
      } else {
4574
        sb.append(this.pex);
4575
      }
4576
      first = false;
4577
      sb.append(")");
4578
      return sb.toString();
4579
    }
4580
 
4581
    public void validate() throws TException {
4582
      // check for required fields
4583
    }
4584
 
4585
  }
4586
 
4587
  public static class trackCouponUsage_args implements TBase<trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable, Comparable<trackCouponUsage_args>   {
4588
    private static final TStruct STRUCT_DESC = new TStruct("trackCouponUsage_args");
4589
 
4590
    private static final TField COUPON_CODE_FIELD_DESC = new TField("couponCode", TType.STRING, (short)1);
4591
    private static final TField TRANSACTION_ID_FIELD_DESC = new TField("transactionId", TType.I64, (short)2);
4592
    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)3);
4593
 
4594
    private String couponCode;
4595
    private long transactionId;
4596
    private long userId;
4597
 
4598
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4599
    public enum _Fields implements TFieldIdEnum {
4600
      COUPON_CODE((short)1, "couponCode"),
4601
      TRANSACTION_ID((short)2, "transactionId"),
4602
      USER_ID((short)3, "userId");
4603
 
4604
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4605
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4606
 
4607
      static {
4608
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4609
          byId.put((int)field._thriftId, field);
4610
          byName.put(field.getFieldName(), field);
4611
        }
4612
      }
4613
 
4614
      /**
4615
       * Find the _Fields constant that matches fieldId, or null if its not found.
4616
       */
4617
      public static _Fields findByThriftId(int fieldId) {
4618
        return byId.get(fieldId);
4619
      }
4620
 
4621
      /**
4622
       * Find the _Fields constant that matches fieldId, throwing an exception
4623
       * if it is not found.
4624
       */
4625
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4626
        _Fields fields = findByThriftId(fieldId);
4627
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4628
        return fields;
4629
      }
4630
 
4631
      /**
4632
       * Find the _Fields constant that matches name, or null if its not found.
4633
       */
4634
      public static _Fields findByName(String name) {
4635
        return byName.get(name);
4636
      }
4637
 
4638
      private final short _thriftId;
4639
      private final String _fieldName;
4640
 
4641
      _Fields(short thriftId, String fieldName) {
4642
        _thriftId = thriftId;
4643
        _fieldName = fieldName;
4644
      }
4645
 
4646
      public short getThriftFieldId() {
4647
        return _thriftId;
4648
      }
4649
 
4650
      public String getFieldName() {
4651
        return _fieldName;
4652
      }
4653
    }
4654
 
4655
    // isset id assignments
4656
    private static final int __TRANSACTIONID_ISSET_ID = 0;
4657
    private static final int __USERID_ISSET_ID = 1;
4658
    private BitSet __isset_bit_vector = new BitSet(2);
4659
 
4660
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4661
      put(_Fields.COUPON_CODE, new FieldMetaData("couponCode", TFieldRequirementType.DEFAULT, 
4662
          new FieldValueMetaData(TType.STRING)));
4663
      put(_Fields.TRANSACTION_ID, new FieldMetaData("transactionId", TFieldRequirementType.DEFAULT, 
4664
          new FieldValueMetaData(TType.I64)));
4665
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
4666
          new FieldValueMetaData(TType.I64)));
4667
    }});
4668
 
4669
    static {
4670
      FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
4671
    }
4672
 
4673
    public trackCouponUsage_args() {
4674
    }
4675
 
4676
    public trackCouponUsage_args(
4677
      String couponCode,
4678
      long transactionId,
4679
      long userId)
4680
    {
4681
      this();
4682
      this.couponCode = couponCode;
4683
      this.transactionId = transactionId;
4684
      setTransactionIdIsSet(true);
4685
      this.userId = userId;
4686
      setUserIdIsSet(true);
4687
    }
4688
 
4689
    /**
4690
     * Performs a deep copy on <i>other</i>.
4691
     */
4692
    public trackCouponUsage_args(trackCouponUsage_args other) {
4693
      __isset_bit_vector.clear();
4694
      __isset_bit_vector.or(other.__isset_bit_vector);
4695
      if (other.isSetCouponCode()) {
4696
        this.couponCode = other.couponCode;
4697
      }
4698
      this.transactionId = other.transactionId;
4699
      this.userId = other.userId;
4700
    }
4701
 
4702
    public trackCouponUsage_args deepCopy() {
4703
      return new trackCouponUsage_args(this);
4704
    }
4705
 
4706
    @Deprecated
4707
    public trackCouponUsage_args clone() {
4708
      return new trackCouponUsage_args(this);
4709
    }
4710
 
4711
    public String getCouponCode() {
4712
      return this.couponCode;
4713
    }
4714
 
4715
    public trackCouponUsage_args setCouponCode(String couponCode) {
4716
      this.couponCode = couponCode;
4717
      return this;
4718
    }
4719
 
4720
    public void unsetCouponCode() {
4721
      this.couponCode = null;
4722
    }
4723
 
4724
    /** Returns true if field couponCode is set (has been asigned a value) and false otherwise */
4725
    public boolean isSetCouponCode() {
4726
      return this.couponCode != null;
4727
    }
4728
 
4729
    public void setCouponCodeIsSet(boolean value) {
4730
      if (!value) {
4731
        this.couponCode = null;
4732
      }
4733
    }
4734
 
4735
    public long getTransactionId() {
4736
      return this.transactionId;
4737
    }
4738
 
4739
    public trackCouponUsage_args setTransactionId(long transactionId) {
4740
      this.transactionId = transactionId;
4741
      setTransactionIdIsSet(true);
4742
      return this;
4743
    }
4744
 
4745
    public void unsetTransactionId() {
4746
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
4747
    }
4748
 
4749
    /** Returns true if field transactionId is set (has been asigned a value) and false otherwise */
4750
    public boolean isSetTransactionId() {
4751
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
4752
    }
4753
 
4754
    public void setTransactionIdIsSet(boolean value) {
4755
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
4756
    }
4757
 
4758
    public long getUserId() {
4759
      return this.userId;
4760
    }
4761
 
4762
    public trackCouponUsage_args setUserId(long userId) {
4763
      this.userId = userId;
4764
      setUserIdIsSet(true);
4765
      return this;
4766
    }
4767
 
4768
    public void unsetUserId() {
4769
      __isset_bit_vector.clear(__USERID_ISSET_ID);
4770
    }
4771
 
4772
    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
4773
    public boolean isSetUserId() {
4774
      return __isset_bit_vector.get(__USERID_ISSET_ID);
4775
    }
4776
 
4777
    public void setUserIdIsSet(boolean value) {
4778
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
4779
    }
4780
 
4781
    public void setFieldValue(_Fields field, Object value) {
4782
      switch (field) {
4783
      case COUPON_CODE:
4784
        if (value == null) {
4785
          unsetCouponCode();
4786
        } else {
4787
          setCouponCode((String)value);
4788
        }
4789
        break;
4790
 
4791
      case TRANSACTION_ID:
4792
        if (value == null) {
4793
          unsetTransactionId();
4794
        } else {
4795
          setTransactionId((Long)value);
4796
        }
4797
        break;
4798
 
4799
      case USER_ID:
4800
        if (value == null) {
4801
          unsetUserId();
4802
        } else {
4803
          setUserId((Long)value);
4804
        }
4805
        break;
4806
 
4807
      }
4808
    }
4809
 
4810
    public void setFieldValue(int fieldID, Object value) {
4811
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4812
    }
4813
 
4814
    public Object getFieldValue(_Fields field) {
4815
      switch (field) {
4816
      case COUPON_CODE:
4817
        return getCouponCode();
4818
 
4819
      case TRANSACTION_ID:
4820
        return new Long(getTransactionId());
4821
 
4822
      case USER_ID:
4823
        return new Long(getUserId());
4824
 
4825
      }
4826
      throw new IllegalStateException();
4827
    }
4828
 
4829
    public Object getFieldValue(int fieldId) {
4830
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4831
    }
4832
 
4833
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4834
    public boolean isSet(_Fields field) {
4835
      switch (field) {
4836
      case COUPON_CODE:
4837
        return isSetCouponCode();
4838
      case TRANSACTION_ID:
4839
        return isSetTransactionId();
4840
      case USER_ID:
4841
        return isSetUserId();
4842
      }
4843
      throw new IllegalStateException();
4844
    }
4845
 
4846
    public boolean isSet(int fieldID) {
4847
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4848
    }
4849
 
4850
    @Override
4851
    public boolean equals(Object that) {
4852
      if (that == null)
4853
        return false;
4854
      if (that instanceof trackCouponUsage_args)
4855
        return this.equals((trackCouponUsage_args)that);
4856
      return false;
4857
    }
4858
 
4859
    public boolean equals(trackCouponUsage_args that) {
4860
      if (that == null)
4861
        return false;
4862
 
4863
      boolean this_present_couponCode = true && this.isSetCouponCode();
4864
      boolean that_present_couponCode = true && that.isSetCouponCode();
4865
      if (this_present_couponCode || that_present_couponCode) {
4866
        if (!(this_present_couponCode && that_present_couponCode))
4867
          return false;
4868
        if (!this.couponCode.equals(that.couponCode))
4869
          return false;
4870
      }
4871
 
4872
      boolean this_present_transactionId = true;
4873
      boolean that_present_transactionId = true;
4874
      if (this_present_transactionId || that_present_transactionId) {
4875
        if (!(this_present_transactionId && that_present_transactionId))
4876
          return false;
4877
        if (this.transactionId != that.transactionId)
4878
          return false;
4879
      }
4880
 
4881
      boolean this_present_userId = true;
4882
      boolean that_present_userId = true;
4883
      if (this_present_userId || that_present_userId) {
4884
        if (!(this_present_userId && that_present_userId))
4885
          return false;
4886
        if (this.userId != that.userId)
4887
          return false;
4888
      }
4889
 
4890
      return true;
4891
    }
4892
 
4893
    @Override
4894
    public int hashCode() {
4895
      return 0;
4896
    }
4897
 
4898
    public int compareTo(trackCouponUsage_args other) {
4899
      if (!getClass().equals(other.getClass())) {
4900
        return getClass().getName().compareTo(other.getClass().getName());
4901
      }
4902
 
4903
      int lastComparison = 0;
4904
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
4905
 
4906
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(isSetCouponCode());
4907
      if (lastComparison != 0) {
4908
        return lastComparison;
4909
      }
4910
      lastComparison = TBaseHelper.compareTo(couponCode, typedOther.couponCode);
4911
      if (lastComparison != 0) {
4912
        return lastComparison;
4913
      }
4914
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(isSetTransactionId());
4915
      if (lastComparison != 0) {
4916
        return lastComparison;
4917
      }
4918
      lastComparison = TBaseHelper.compareTo(transactionId, typedOther.transactionId);
4919
      if (lastComparison != 0) {
4920
        return lastComparison;
4921
      }
4922
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
4923
      if (lastComparison != 0) {
4924
        return lastComparison;
4925
      }
4926
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
4927
      if (lastComparison != 0) {
4928
        return lastComparison;
4929
      }
4930
      return 0;
4931
    }
4932
 
4933
    public void read(TProtocol iprot) throws TException {
4934
      TField field;
4935
      iprot.readStructBegin();
4936
      while (true)
4937
      {
4938
        field = iprot.readFieldBegin();
4939
        if (field.type == TType.STOP) { 
4940
          break;
4941
        }
4942
        _Fields fieldId = _Fields.findByThriftId(field.id);
4943
        if (fieldId == null) {
4944
          TProtocolUtil.skip(iprot, field.type);
4945
        } else {
4946
          switch (fieldId) {
4947
            case COUPON_CODE:
4948
              if (field.type == TType.STRING) {
4949
                this.couponCode = iprot.readString();
4950
              } else { 
4951
                TProtocolUtil.skip(iprot, field.type);
4952
              }
4953
              break;
4954
            case TRANSACTION_ID:
4955
              if (field.type == TType.I64) {
4956
                this.transactionId = iprot.readI64();
4957
                setTransactionIdIsSet(true);
4958
              } else { 
4959
                TProtocolUtil.skip(iprot, field.type);
4960
              }
4961
              break;
4962
            case USER_ID:
4963
              if (field.type == TType.I64) {
4964
                this.userId = iprot.readI64();
4965
                setUserIdIsSet(true);
4966
              } else { 
4967
                TProtocolUtil.skip(iprot, field.type);
4968
              }
4969
              break;
4970
          }
4971
          iprot.readFieldEnd();
4972
        }
4973
      }
4974
      iprot.readStructEnd();
4975
      validate();
4976
    }
4977
 
4978
    public void write(TProtocol oprot) throws TException {
4979
      validate();
4980
 
4981
      oprot.writeStructBegin(STRUCT_DESC);
4982
      if (this.couponCode != null) {
4983
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4984
        oprot.writeString(this.couponCode);
4985
        oprot.writeFieldEnd();
4986
      }
4987
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
4988
      oprot.writeI64(this.transactionId);
4989
      oprot.writeFieldEnd();
4990
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
4991
      oprot.writeI64(this.userId);
4992
      oprot.writeFieldEnd();
4993
      oprot.writeFieldStop();
4994
      oprot.writeStructEnd();
4995
    }
4996
 
4997
    @Override
4998
    public String toString() {
4999
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
5000
      boolean first = true;
5001
 
5002
      sb.append("couponCode:");
5003
      if (this.couponCode == null) {
5004
        sb.append("null");
5005
      } else {
5006
        sb.append(this.couponCode);
5007
      }
5008
      first = false;
5009
      if (!first) sb.append(", ");
5010
      sb.append("transactionId:");
5011
      sb.append(this.transactionId);
5012
      first = false;
5013
      if (!first) sb.append(", ");
5014
      sb.append("userId:");
5015
      sb.append(this.userId);
5016
      first = false;
5017
      sb.append(")");
5018
      return sb.toString();
5019
    }
5020
 
5021
    public void validate() throws TException {
5022
      // check for required fields
5023
    }
5024
 
5025
  }
5026
 
5027
  public static class trackCouponUsage_result implements TBase<trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable, Comparable<trackCouponUsage_result>   {
5028
    private static final TStruct STRUCT_DESC = new TStruct("trackCouponUsage_result");
5029
 
5030
    private static final TField PEX_FIELD_DESC = new TField("pex", TType.STRUCT, (short)1);
5031
 
5032
    private PromotionException pex;
5033
 
5034
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5035
    public enum _Fields implements TFieldIdEnum {
5036
      PEX((short)1, "pex");
5037
 
5038
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5039
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5040
 
5041
      static {
5042
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5043
          byId.put((int)field._thriftId, field);
5044
          byName.put(field.getFieldName(), field);
5045
        }
5046
      }
5047
 
5048
      /**
5049
       * Find the _Fields constant that matches fieldId, or null if its not found.
5050
       */
5051
      public static _Fields findByThriftId(int fieldId) {
5052
        return byId.get(fieldId);
5053
      }
5054
 
5055
      /**
5056
       * Find the _Fields constant that matches fieldId, throwing an exception
5057
       * if it is not found.
5058
       */
5059
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5060
        _Fields fields = findByThriftId(fieldId);
5061
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5062
        return fields;
5063
      }
5064
 
5065
      /**
5066
       * Find the _Fields constant that matches name, or null if its not found.
5067
       */
5068
      public static _Fields findByName(String name) {
5069
        return byName.get(name);
5070
      }
5071
 
5072
      private final short _thriftId;
5073
      private final String _fieldName;
5074
 
5075
      _Fields(short thriftId, String fieldName) {
5076
        _thriftId = thriftId;
5077
        _fieldName = fieldName;
5078
      }
5079
 
5080
      public short getThriftFieldId() {
5081
        return _thriftId;
5082
      }
5083
 
5084
      public String getFieldName() {
5085
        return _fieldName;
5086
      }
5087
    }
5088
 
5089
    // isset id assignments
5090
 
5091
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5092
      put(_Fields.PEX, new FieldMetaData("pex", TFieldRequirementType.DEFAULT, 
5093
          new FieldValueMetaData(TType.STRUCT)));
5094
    }});
5095
 
5096
    static {
5097
      FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
5098
    }
5099
 
5100
    public trackCouponUsage_result() {
5101
    }
5102
 
5103
    public trackCouponUsage_result(
5104
      PromotionException pex)
5105
    {
5106
      this();
5107
      this.pex = pex;
5108
    }
5109
 
5110
    /**
5111
     * Performs a deep copy on <i>other</i>.
5112
     */
5113
    public trackCouponUsage_result(trackCouponUsage_result other) {
5114
      if (other.isSetPex()) {
5115
        this.pex = new PromotionException(other.pex);
5116
      }
5117
    }
5118
 
5119
    public trackCouponUsage_result deepCopy() {
5120
      return new trackCouponUsage_result(this);
5121
    }
5122
 
5123
    @Deprecated
5124
    public trackCouponUsage_result clone() {
5125
      return new trackCouponUsage_result(this);
5126
    }
5127
 
5128
    public PromotionException getPex() {
5129
      return this.pex;
5130
    }
5131
 
5132
    public trackCouponUsage_result setPex(PromotionException pex) {
5133
      this.pex = pex;
5134
      return this;
5135
    }
5136
 
5137
    public void unsetPex() {
5138
      this.pex = null;
5139
    }
5140
 
5141
    /** Returns true if field pex is set (has been asigned a value) and false otherwise */
5142
    public boolean isSetPex() {
5143
      return this.pex != null;
5144
    }
5145
 
5146
    public void setPexIsSet(boolean value) {
5147
      if (!value) {
5148
        this.pex = null;
5149
      }
5150
    }
5151
 
5152
    public void setFieldValue(_Fields field, Object value) {
5153
      switch (field) {
5154
      case PEX:
5155
        if (value == null) {
5156
          unsetPex();
5157
        } else {
5158
          setPex((PromotionException)value);
5159
        }
5160
        break;
5161
 
5162
      }
5163
    }
5164
 
5165
    public void setFieldValue(int fieldID, Object value) {
5166
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5167
    }
5168
 
5169
    public Object getFieldValue(_Fields field) {
5170
      switch (field) {
5171
      case PEX:
5172
        return getPex();
5173
 
5174
      }
5175
      throw new IllegalStateException();
5176
    }
5177
 
5178
    public Object getFieldValue(int fieldId) {
5179
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5180
    }
5181
 
5182
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5183
    public boolean isSet(_Fields field) {
5184
      switch (field) {
5185
      case PEX:
5186
        return isSetPex();
5187
      }
5188
      throw new IllegalStateException();
5189
    }
5190
 
5191
    public boolean isSet(int fieldID) {
5192
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5193
    }
5194
 
5195
    @Override
5196
    public boolean equals(Object that) {
5197
      if (that == null)
5198
        return false;
5199
      if (that instanceof trackCouponUsage_result)
5200
        return this.equals((trackCouponUsage_result)that);
5201
      return false;
5202
    }
5203
 
5204
    public boolean equals(trackCouponUsage_result that) {
5205
      if (that == null)
5206
        return false;
5207
 
5208
      boolean this_present_pex = true && this.isSetPex();
5209
      boolean that_present_pex = true && that.isSetPex();
5210
      if (this_present_pex || that_present_pex) {
5211
        if (!(this_present_pex && that_present_pex))
5212
          return false;
5213
        if (!this.pex.equals(that.pex))
5214
          return false;
5215
      }
5216
 
5217
      return true;
5218
    }
5219
 
5220
    @Override
5221
    public int hashCode() {
5222
      return 0;
5223
    }
5224
 
5225
    public int compareTo(trackCouponUsage_result other) {
5226
      if (!getClass().equals(other.getClass())) {
5227
        return getClass().getName().compareTo(other.getClass().getName());
5228
      }
5229
 
5230
      int lastComparison = 0;
5231
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
5232
 
5233
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(isSetPex());
5234
      if (lastComparison != 0) {
5235
        return lastComparison;
5236
      }
5237
      lastComparison = TBaseHelper.compareTo(pex, typedOther.pex);
5238
      if (lastComparison != 0) {
5239
        return lastComparison;
5240
      }
5241
      return 0;
5242
    }
5243
 
5244
    public void read(TProtocol iprot) throws TException {
5245
      TField field;
5246
      iprot.readStructBegin();
5247
      while (true)
5248
      {
5249
        field = iprot.readFieldBegin();
5250
        if (field.type == TType.STOP) { 
5251
          break;
5252
        }
5253
        _Fields fieldId = _Fields.findByThriftId(field.id);
5254
        if (fieldId == null) {
5255
          TProtocolUtil.skip(iprot, field.type);
5256
        } else {
5257
          switch (fieldId) {
5258
            case PEX:
5259
              if (field.type == TType.STRUCT) {
5260
                this.pex = new PromotionException();
5261
                this.pex.read(iprot);
5262
              } else { 
5263
                TProtocolUtil.skip(iprot, field.type);
5264
              }
5265
              break;
5266
          }
5267
          iprot.readFieldEnd();
5268
        }
5269
      }
5270
      iprot.readStructEnd();
5271
      validate();
5272
    }
5273
 
5274
    public void write(TProtocol oprot) throws TException {
5275
      oprot.writeStructBegin(STRUCT_DESC);
5276
 
5277
      if (this.isSetPex()) {
5278
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5279
        this.pex.write(oprot);
5280
        oprot.writeFieldEnd();
5281
      }
5282
      oprot.writeFieldStop();
5283
      oprot.writeStructEnd();
5284
    }
5285
 
5286
    @Override
5287
    public String toString() {
5288
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
5289
      boolean first = true;
5290
 
5291
      sb.append("pex:");
5292
      if (this.pex == null) {
5293
        sb.append("null");
5294
      } else {
5295
        sb.append(this.pex);
5296
      }
5297
      first = false;
5298
      sb.append(")");
5299
      return sb.toString();
5300
    }
5301
 
5302
    public void validate() throws TException {
5303
      // check for required fields
5304
    }
5305
 
5306
  }
5307
 
5308
  public static class getCouponUsageCountByUser_args implements TBase<getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCouponUsageCountByUser_args>   {
5309
    private static final TStruct STRUCT_DESC = new TStruct("getCouponUsageCountByUser_args");
5310
 
5311
    private static final TField COUPON_CODE_FIELD_DESC = new TField("couponCode", TType.STRING, (short)1);
5312
    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)2);
5313
 
5314
    private String couponCode;
5315
    private long userId;
5316
 
5317
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5318
    public enum _Fields implements TFieldIdEnum {
5319
      COUPON_CODE((short)1, "couponCode"),
5320
      USER_ID((short)2, "userId");
5321
 
5322
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5323
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5324
 
5325
      static {
5326
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5327
          byId.put((int)field._thriftId, field);
5328
          byName.put(field.getFieldName(), field);
5329
        }
5330
      }
5331
 
5332
      /**
5333
       * Find the _Fields constant that matches fieldId, or null if its not found.
5334
       */
5335
      public static _Fields findByThriftId(int fieldId) {
5336
        return byId.get(fieldId);
5337
      }
5338
 
5339
      /**
5340
       * Find the _Fields constant that matches fieldId, throwing an exception
5341
       * if it is not found.
5342
       */
5343
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5344
        _Fields fields = findByThriftId(fieldId);
5345
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5346
        return fields;
5347
      }
5348
 
5349
      /**
5350
       * Find the _Fields constant that matches name, or null if its not found.
5351
       */
5352
      public static _Fields findByName(String name) {
5353
        return byName.get(name);
5354
      }
5355
 
5356
      private final short _thriftId;
5357
      private final String _fieldName;
5358
 
5359
      _Fields(short thriftId, String fieldName) {
5360
        _thriftId = thriftId;
5361
        _fieldName = fieldName;
5362
      }
5363
 
5364
      public short getThriftFieldId() {
5365
        return _thriftId;
5366
      }
5367
 
5368
      public String getFieldName() {
5369
        return _fieldName;
5370
      }
5371
    }
5372
 
5373
    // isset id assignments
5374
    private static final int __USERID_ISSET_ID = 0;
5375
    private BitSet __isset_bit_vector = new BitSet(1);
5376
 
5377
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5378
      put(_Fields.COUPON_CODE, new FieldMetaData("couponCode", TFieldRequirementType.DEFAULT, 
5379
          new FieldValueMetaData(TType.STRING)));
5380
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
5381
          new FieldValueMetaData(TType.I64)));
5382
    }});
5383
 
5384
    static {
5385
      FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
5386
    }
5387
 
5388
    public getCouponUsageCountByUser_args() {
5389
    }
5390
 
5391
    public getCouponUsageCountByUser_args(
5392
      String couponCode,
5393
      long userId)
5394
    {
5395
      this();
5396
      this.couponCode = couponCode;
5397
      this.userId = userId;
5398
      setUserIdIsSet(true);
5399
    }
5400
 
5401
    /**
5402
     * Performs a deep copy on <i>other</i>.
5403
     */
5404
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
5405
      __isset_bit_vector.clear();
5406
      __isset_bit_vector.or(other.__isset_bit_vector);
5407
      if (other.isSetCouponCode()) {
5408
        this.couponCode = other.couponCode;
5409
      }
5410
      this.userId = other.userId;
5411
    }
5412
 
5413
    public getCouponUsageCountByUser_args deepCopy() {
5414
      return new getCouponUsageCountByUser_args(this);
5415
    }
5416
 
5417
    @Deprecated
5418
    public getCouponUsageCountByUser_args clone() {
5419
      return new getCouponUsageCountByUser_args(this);
5420
    }
5421
 
5422
    public String getCouponCode() {
5423
      return this.couponCode;
5424
    }
5425
 
5426
    public getCouponUsageCountByUser_args setCouponCode(String couponCode) {
5427
      this.couponCode = couponCode;
5428
      return this;
5429
    }
5430
 
5431
    public void unsetCouponCode() {
5432
      this.couponCode = null;
5433
    }
5434
 
5435
    /** Returns true if field couponCode is set (has been asigned a value) and false otherwise */
5436
    public boolean isSetCouponCode() {
5437
      return this.couponCode != null;
5438
    }
5439
 
5440
    public void setCouponCodeIsSet(boolean value) {
5441
      if (!value) {
5442
        this.couponCode = null;
5443
      }
5444
    }
5445
 
5446
    public long getUserId() {
5447
      return this.userId;
5448
    }
5449
 
5450
    public getCouponUsageCountByUser_args setUserId(long userId) {
5451
      this.userId = userId;
5452
      setUserIdIsSet(true);
5453
      return this;
5454
    }
5455
 
5456
    public void unsetUserId() {
5457
      __isset_bit_vector.clear(__USERID_ISSET_ID);
5458
    }
5459
 
5460
    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
5461
    public boolean isSetUserId() {
5462
      return __isset_bit_vector.get(__USERID_ISSET_ID);
5463
    }
5464
 
5465
    public void setUserIdIsSet(boolean value) {
5466
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
5467
    }
5468
 
5469
    public void setFieldValue(_Fields field, Object value) {
5470
      switch (field) {
5471
      case COUPON_CODE:
5472
        if (value == null) {
5473
          unsetCouponCode();
5474
        } else {
5475
          setCouponCode((String)value);
5476
        }
5477
        break;
5478
 
5479
      case USER_ID:
5480
        if (value == null) {
5481
          unsetUserId();
5482
        } else {
5483
          setUserId((Long)value);
5484
        }
5485
        break;
5486
 
5487
      }
5488
    }
5489
 
5490
    public void setFieldValue(int fieldID, Object value) {
5491
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5492
    }
5493
 
5494
    public Object getFieldValue(_Fields field) {
5495
      switch (field) {
5496
      case COUPON_CODE:
5497
        return getCouponCode();
5498
 
5499
      case USER_ID:
5500
        return new Long(getUserId());
5501
 
5502
      }
5503
      throw new IllegalStateException();
5504
    }
5505
 
5506
    public Object getFieldValue(int fieldId) {
5507
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5508
    }
5509
 
5510
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5511
    public boolean isSet(_Fields field) {
5512
      switch (field) {
5513
      case COUPON_CODE:
5514
        return isSetCouponCode();
5515
      case USER_ID:
5516
        return isSetUserId();
5517
      }
5518
      throw new IllegalStateException();
5519
    }
5520
 
5521
    public boolean isSet(int fieldID) {
5522
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5523
    }
5524
 
5525
    @Override
5526
    public boolean equals(Object that) {
5527
      if (that == null)
5528
        return false;
5529
      if (that instanceof getCouponUsageCountByUser_args)
5530
        return this.equals((getCouponUsageCountByUser_args)that);
5531
      return false;
5532
    }
5533
 
5534
    public boolean equals(getCouponUsageCountByUser_args that) {
5535
      if (that == null)
5536
        return false;
5537
 
5538
      boolean this_present_couponCode = true && this.isSetCouponCode();
5539
      boolean that_present_couponCode = true && that.isSetCouponCode();
5540
      if (this_present_couponCode || that_present_couponCode) {
5541
        if (!(this_present_couponCode && that_present_couponCode))
5542
          return false;
5543
        if (!this.couponCode.equals(that.couponCode))
5544
          return false;
5545
      }
5546
 
5547
      boolean this_present_userId = true;
5548
      boolean that_present_userId = true;
5549
      if (this_present_userId || that_present_userId) {
5550
        if (!(this_present_userId && that_present_userId))
5551
          return false;
5552
        if (this.userId != that.userId)
5553
          return false;
5554
      }
5555
 
5556
      return true;
5557
    }
5558
 
5559
    @Override
5560
    public int hashCode() {
5561
      return 0;
5562
    }
5563
 
5564
    public int compareTo(getCouponUsageCountByUser_args other) {
5565
      if (!getClass().equals(other.getClass())) {
5566
        return getClass().getName().compareTo(other.getClass().getName());
5567
      }
5568
 
5569
      int lastComparison = 0;
5570
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
5571
 
5572
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(isSetCouponCode());
5573
      if (lastComparison != 0) {
5574
        return lastComparison;
5575
      }
5576
      lastComparison = TBaseHelper.compareTo(couponCode, typedOther.couponCode);
5577
      if (lastComparison != 0) {
5578
        return lastComparison;
5579
      }
5580
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
5581
      if (lastComparison != 0) {
5582
        return lastComparison;
5583
      }
5584
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
5585
      if (lastComparison != 0) {
5586
        return lastComparison;
5587
      }
5588
      return 0;
5589
    }
5590
 
5591
    public void read(TProtocol iprot) throws TException {
5592
      TField field;
5593
      iprot.readStructBegin();
5594
      while (true)
5595
      {
5596
        field = iprot.readFieldBegin();
5597
        if (field.type == TType.STOP) { 
5598
          break;
5599
        }
5600
        _Fields fieldId = _Fields.findByThriftId(field.id);
5601
        if (fieldId == null) {
5602
          TProtocolUtil.skip(iprot, field.type);
5603
        } else {
5604
          switch (fieldId) {
5605
            case COUPON_CODE:
5606
              if (field.type == TType.STRING) {
5607
                this.couponCode = iprot.readString();
5608
              } else { 
5609
                TProtocolUtil.skip(iprot, field.type);
5610
              }
5611
              break;
5612
            case USER_ID:
5613
              if (field.type == TType.I64) {
5614
                this.userId = iprot.readI64();
5615
                setUserIdIsSet(true);
5616
              } else { 
5617
                TProtocolUtil.skip(iprot, field.type);
5618
              }
5619
              break;
5620
          }
5621
          iprot.readFieldEnd();
5622
        }
5623
      }
5624
      iprot.readStructEnd();
5625
      validate();
5626
    }
5627
 
5628
    public void write(TProtocol oprot) throws TException {
5629
      validate();
5630
 
5631
      oprot.writeStructBegin(STRUCT_DESC);
5632
      if (this.couponCode != null) {
5633
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5634
        oprot.writeString(this.couponCode);
5635
        oprot.writeFieldEnd();
5636
      }
5637
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
5638
      oprot.writeI64(this.userId);
5639
      oprot.writeFieldEnd();
5640
      oprot.writeFieldStop();
5641
      oprot.writeStructEnd();
5642
    }
5643
 
5644
    @Override
5645
    public String toString() {
5646
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
5647
      boolean first = true;
5648
 
5649
      sb.append("couponCode:");
5650
      if (this.couponCode == null) {
5651
        sb.append("null");
5652
      } else {
5653
        sb.append(this.couponCode);
5654
      }
5655
      first = false;
5656
      if (!first) sb.append(", ");
5657
      sb.append("userId:");
5658
      sb.append(this.userId);
5659
      first = false;
5660
      sb.append(")");
5661
      return sb.toString();
5662
    }
5663
 
5664
    public void validate() throws TException {
5665
      // check for required fields
5666
    }
5667
 
5668
  }
5669
 
5670
  public static class getCouponUsageCountByUser_result implements TBase<getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCouponUsageCountByUser_result>   {
5671
    private static final TStruct STRUCT_DESC = new TStruct("getCouponUsageCountByUser_result");
5672
 
5673
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
5674
    private static final TField PEX_FIELD_DESC = new TField("pex", TType.STRUCT, (short)1);
5675
 
5676
    private long success;
5677
    private PromotionException pex;
5678
 
5679
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5680
    public enum _Fields implements TFieldIdEnum {
5681
      SUCCESS((short)0, "success"),
5682
      PEX((short)1, "pex");
5683
 
5684
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5685
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5686
 
5687
      static {
5688
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5689
          byId.put((int)field._thriftId, field);
5690
          byName.put(field.getFieldName(), field);
5691
        }
5692
      }
5693
 
5694
      /**
5695
       * Find the _Fields constant that matches fieldId, or null if its not found.
5696
       */
5697
      public static _Fields findByThriftId(int fieldId) {
5698
        return byId.get(fieldId);
5699
      }
5700
 
5701
      /**
5702
       * Find the _Fields constant that matches fieldId, throwing an exception
5703
       * if it is not found.
5704
       */
5705
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5706
        _Fields fields = findByThriftId(fieldId);
5707
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5708
        return fields;
5709
      }
5710
 
5711
      /**
5712
       * Find the _Fields constant that matches name, or null if its not found.
5713
       */
5714
      public static _Fields findByName(String name) {
5715
        return byName.get(name);
5716
      }
5717
 
5718
      private final short _thriftId;
5719
      private final String _fieldName;
5720
 
5721
      _Fields(short thriftId, String fieldName) {
5722
        _thriftId = thriftId;
5723
        _fieldName = fieldName;
5724
      }
5725
 
5726
      public short getThriftFieldId() {
5727
        return _thriftId;
5728
      }
5729
 
5730
      public String getFieldName() {
5731
        return _fieldName;
5732
      }
5733
    }
5734
 
5735
    // isset id assignments
5736
    private static final int __SUCCESS_ISSET_ID = 0;
5737
    private BitSet __isset_bit_vector = new BitSet(1);
5738
 
5739
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5740
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
5741
          new FieldValueMetaData(TType.I64)));
5742
      put(_Fields.PEX, new FieldMetaData("pex", TFieldRequirementType.DEFAULT, 
5743
          new FieldValueMetaData(TType.STRUCT)));
5744
    }});
5745
 
5746
    static {
5747
      FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
5748
    }
5749
 
5750
    public getCouponUsageCountByUser_result() {
5751
    }
5752
 
5753
    public getCouponUsageCountByUser_result(
5754
      long success,
5755
      PromotionException pex)
5756
    {
5757
      this();
5758
      this.success = success;
5759
      setSuccessIsSet(true);
5760
      this.pex = pex;
5761
    }
5762
 
5763
    /**
5764
     * Performs a deep copy on <i>other</i>.
5765
     */
5766
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
5767
      __isset_bit_vector.clear();
5768
      __isset_bit_vector.or(other.__isset_bit_vector);
5769
      this.success = other.success;
5770
      if (other.isSetPex()) {
5771
        this.pex = new PromotionException(other.pex);
5772
      }
5773
    }
5774
 
5775
    public getCouponUsageCountByUser_result deepCopy() {
5776
      return new getCouponUsageCountByUser_result(this);
5777
    }
5778
 
5779
    @Deprecated
5780
    public getCouponUsageCountByUser_result clone() {
5781
      return new getCouponUsageCountByUser_result(this);
5782
    }
5783
 
5784
    public long getSuccess() {
5785
      return this.success;
5786
    }
5787
 
5788
    public getCouponUsageCountByUser_result setSuccess(long success) {
5789
      this.success = success;
5790
      setSuccessIsSet(true);
5791
      return this;
5792
    }
5793
 
5794
    public void unsetSuccess() {
5795
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5796
    }
5797
 
5798
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
5799
    public boolean isSetSuccess() {
5800
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5801
    }
5802
 
5803
    public void setSuccessIsSet(boolean value) {
5804
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5805
    }
5806
 
5807
    public PromotionException getPex() {
5808
      return this.pex;
5809
    }
5810
 
5811
    public getCouponUsageCountByUser_result setPex(PromotionException pex) {
5812
      this.pex = pex;
5813
      return this;
5814
    }
5815
 
5816
    public void unsetPex() {
5817
      this.pex = null;
5818
    }
5819
 
5820
    /** Returns true if field pex is set (has been asigned a value) and false otherwise */
5821
    public boolean isSetPex() {
5822
      return this.pex != null;
5823
    }
5824
 
5825
    public void setPexIsSet(boolean value) {
5826
      if (!value) {
5827
        this.pex = null;
5828
      }
5829
    }
5830
 
5831
    public void setFieldValue(_Fields field, Object value) {
5832
      switch (field) {
5833
      case SUCCESS:
5834
        if (value == null) {
5835
          unsetSuccess();
5836
        } else {
5837
          setSuccess((Long)value);
5838
        }
5839
        break;
5840
 
5841
      case PEX:
5842
        if (value == null) {
5843
          unsetPex();
5844
        } else {
5845
          setPex((PromotionException)value);
5846
        }
5847
        break;
5848
 
5849
      }
5850
    }
5851
 
5852
    public void setFieldValue(int fieldID, Object value) {
5853
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5854
    }
5855
 
5856
    public Object getFieldValue(_Fields field) {
5857
      switch (field) {
5858
      case SUCCESS:
5859
        return new Long(getSuccess());
5860
 
5861
      case PEX:
5862
        return getPex();
5863
 
5864
      }
5865
      throw new IllegalStateException();
5866
    }
5867
 
5868
    public Object getFieldValue(int fieldId) {
5869
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5870
    }
5871
 
5872
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5873
    public boolean isSet(_Fields field) {
5874
      switch (field) {
5875
      case SUCCESS:
5876
        return isSetSuccess();
5877
      case PEX:
5878
        return isSetPex();
5879
      }
5880
      throw new IllegalStateException();
5881
    }
5882
 
5883
    public boolean isSet(int fieldID) {
5884
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5885
    }
5886
 
5887
    @Override
5888
    public boolean equals(Object that) {
5889
      if (that == null)
5890
        return false;
5891
      if (that instanceof getCouponUsageCountByUser_result)
5892
        return this.equals((getCouponUsageCountByUser_result)that);
5893
      return false;
5894
    }
5895
 
5896
    public boolean equals(getCouponUsageCountByUser_result that) {
5897
      if (that == null)
5898
        return false;
5899
 
5900
      boolean this_present_success = true;
5901
      boolean that_present_success = true;
5902
      if (this_present_success || that_present_success) {
5903
        if (!(this_present_success && that_present_success))
5904
          return false;
5905
        if (this.success != that.success)
5906
          return false;
5907
      }
5908
 
5909
      boolean this_present_pex = true && this.isSetPex();
5910
      boolean that_present_pex = true && that.isSetPex();
5911
      if (this_present_pex || that_present_pex) {
5912
        if (!(this_present_pex && that_present_pex))
5913
          return false;
5914
        if (!this.pex.equals(that.pex))
5915
          return false;
5916
      }
5917
 
5918
      return true;
5919
    }
5920
 
5921
    @Override
5922
    public int hashCode() {
5923
      return 0;
5924
    }
5925
 
5926
    public int compareTo(getCouponUsageCountByUser_result other) {
5927
      if (!getClass().equals(other.getClass())) {
5928
        return getClass().getName().compareTo(other.getClass().getName());
5929
      }
5930
 
5931
      int lastComparison = 0;
5932
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
5933
 
5934
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
5935
      if (lastComparison != 0) {
5936
        return lastComparison;
5937
      }
5938
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
5939
      if (lastComparison != 0) {
5940
        return lastComparison;
5941
      }
5942
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(isSetPex());
5943
      if (lastComparison != 0) {
5944
        return lastComparison;
5945
      }
5946
      lastComparison = TBaseHelper.compareTo(pex, typedOther.pex);
5947
      if (lastComparison != 0) {
5948
        return lastComparison;
5949
      }
5950
      return 0;
5951
    }
5952
 
5953
    public void read(TProtocol iprot) throws TException {
5954
      TField field;
5955
      iprot.readStructBegin();
5956
      while (true)
5957
      {
5958
        field = iprot.readFieldBegin();
5959
        if (field.type == TType.STOP) { 
5960
          break;
5961
        }
5962
        _Fields fieldId = _Fields.findByThriftId(field.id);
5963
        if (fieldId == null) {
5964
          TProtocolUtil.skip(iprot, field.type);
5965
        } else {
5966
          switch (fieldId) {
5967
            case SUCCESS:
5968
              if (field.type == TType.I64) {
5969
                this.success = iprot.readI64();
5970
                setSuccessIsSet(true);
5971
              } else { 
5972
                TProtocolUtil.skip(iprot, field.type);
5973
              }
5974
              break;
5975
            case PEX:
5976
              if (field.type == TType.STRUCT) {
5977
                this.pex = new PromotionException();
5978
                this.pex.read(iprot);
5979
              } else { 
5980
                TProtocolUtil.skip(iprot, field.type);
5981
              }
5982
              break;
5983
          }
5984
          iprot.readFieldEnd();
5985
        }
5986
      }
5987
      iprot.readStructEnd();
5988
      validate();
5989
    }
5990
 
5991
    public void write(TProtocol oprot) throws TException {
5992
      oprot.writeStructBegin(STRUCT_DESC);
5993
 
5994
      if (this.isSetSuccess()) {
5995
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5996
        oprot.writeI64(this.success);
5997
        oprot.writeFieldEnd();
5998
      } else if (this.isSetPex()) {
5999
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6000
        this.pex.write(oprot);
6001
        oprot.writeFieldEnd();
6002
      }
6003
      oprot.writeFieldStop();
6004
      oprot.writeStructEnd();
6005
    }
6006
 
6007
    @Override
6008
    public String toString() {
6009
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
6010
      boolean first = true;
6011
 
6012
      sb.append("success:");
6013
      sb.append(this.success);
6014
      first = false;
6015
      if (!first) sb.append(", ");
6016
      sb.append("pex:");
6017
      if (this.pex == null) {
6018
        sb.append("null");
6019
      } else {
6020
        sb.append(this.pex);
6021
      }
6022
      first = false;
6023
      sb.append(")");
6024
      return sb.toString();
6025
    }
6026
 
6027
    public void validate() throws TException {
6028
      // check for required fields
6029
    }
6030
 
6031
  }
6032
 
3385 varun.gupt 6033
  public static class getActiveCoupons_args implements TBase<getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable, Comparable<getActiveCoupons_args>   {
6034
    private static final TStruct STRUCT_DESC = new TStruct("getActiveCoupons_args");
6035
 
6036
 
6037
 
6038
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6039
    public enum _Fields implements TFieldIdEnum {
6040
;
6041
 
6042
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6043
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6044
 
6045
      static {
6046
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6047
          byId.put((int)field._thriftId, field);
6048
          byName.put(field.getFieldName(), field);
6049
        }
6050
      }
6051
 
6052
      /**
6053
       * Find the _Fields constant that matches fieldId, or null if its not found.
6054
       */
6055
      public static _Fields findByThriftId(int fieldId) {
6056
        return byId.get(fieldId);
6057
      }
6058
 
6059
      /**
6060
       * Find the _Fields constant that matches fieldId, throwing an exception
6061
       * if it is not found.
6062
       */
6063
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6064
        _Fields fields = findByThriftId(fieldId);
6065
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6066
        return fields;
6067
      }
6068
 
6069
      /**
6070
       * Find the _Fields constant that matches name, or null if its not found.
6071
       */
6072
      public static _Fields findByName(String name) {
6073
        return byName.get(name);
6074
      }
6075
 
6076
      private final short _thriftId;
6077
      private final String _fieldName;
6078
 
6079
      _Fields(short thriftId, String fieldName) {
6080
        _thriftId = thriftId;
6081
        _fieldName = fieldName;
6082
      }
6083
 
6084
      public short getThriftFieldId() {
6085
        return _thriftId;
6086
      }
6087
 
6088
      public String getFieldName() {
6089
        return _fieldName;
6090
      }
6091
    }
6092
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6093
    }});
6094
 
6095
    static {
6096
      FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
6097
    }
6098
 
6099
    public getActiveCoupons_args() {
6100
    }
6101
 
6102
    /**
6103
     * Performs a deep copy on <i>other</i>.
6104
     */
6105
    public getActiveCoupons_args(getActiveCoupons_args other) {
6106
    }
6107
 
6108
    public getActiveCoupons_args deepCopy() {
6109
      return new getActiveCoupons_args(this);
6110
    }
6111
 
6112
    @Deprecated
6113
    public getActiveCoupons_args clone() {
6114
      return new getActiveCoupons_args(this);
6115
    }
6116
 
6117
    public void setFieldValue(_Fields field, Object value) {
6118
      switch (field) {
6119
      }
6120
    }
6121
 
6122
    public void setFieldValue(int fieldID, Object value) {
6123
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6124
    }
6125
 
6126
    public Object getFieldValue(_Fields field) {
6127
      switch (field) {
6128
      }
6129
      throw new IllegalStateException();
6130
    }
6131
 
6132
    public Object getFieldValue(int fieldId) {
6133
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6134
    }
6135
 
6136
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6137
    public boolean isSet(_Fields field) {
6138
      switch (field) {
6139
      }
6140
      throw new IllegalStateException();
6141
    }
6142
 
6143
    public boolean isSet(int fieldID) {
6144
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6145
    }
6146
 
6147
    @Override
6148
    public boolean equals(Object that) {
6149
      if (that == null)
6150
        return false;
6151
      if (that instanceof getActiveCoupons_args)
6152
        return this.equals((getActiveCoupons_args)that);
6153
      return false;
6154
    }
6155
 
6156
    public boolean equals(getActiveCoupons_args that) {
6157
      if (that == null)
6158
        return false;
6159
 
6160
      return true;
6161
    }
6162
 
6163
    @Override
6164
    public int hashCode() {
6165
      return 0;
6166
    }
6167
 
6168
    public int compareTo(getActiveCoupons_args other) {
6169
      if (!getClass().equals(other.getClass())) {
6170
        return getClass().getName().compareTo(other.getClass().getName());
6171
      }
6172
 
6173
      int lastComparison = 0;
6174
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
6175
 
6176
      return 0;
6177
    }
6178
 
6179
    public void read(TProtocol iprot) throws TException {
6180
      TField field;
6181
      iprot.readStructBegin();
6182
      while (true)
6183
      {
6184
        field = iprot.readFieldBegin();
6185
        if (field.type == TType.STOP) { 
6186
          break;
6187
        }
6188
        _Fields fieldId = _Fields.findByThriftId(field.id);
6189
        if (fieldId == null) {
6190
          TProtocolUtil.skip(iprot, field.type);
6191
        } else {
6192
          switch (fieldId) {
6193
          }
6194
          iprot.readFieldEnd();
6195
        }
6196
      }
6197
      iprot.readStructEnd();
6198
      validate();
6199
    }
6200
 
6201
    public void write(TProtocol oprot) throws TException {
6202
      validate();
6203
 
6204
      oprot.writeStructBegin(STRUCT_DESC);
6205
      oprot.writeFieldStop();
6206
      oprot.writeStructEnd();
6207
    }
6208
 
6209
    @Override
6210
    public String toString() {
6211
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
6212
      boolean first = true;
6213
 
6214
      sb.append(")");
6215
      return sb.toString();
6216
    }
6217
 
6218
    public void validate() throws TException {
6219
      // check for required fields
6220
    }
6221
 
6222
  }
6223
 
6224
  public static class getActiveCoupons_result implements TBase<getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable, Comparable<getActiveCoupons_result>   {
6225
    private static final TStruct STRUCT_DESC = new TStruct("getActiveCoupons_result");
6226
 
6227
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
6228
    private static final TField PEX_FIELD_DESC = new TField("pex", TType.STRUCT, (short)1);
6229
 
6230
    private List<Coupon> success;
6231
    private PromotionException pex;
6232
 
6233
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6234
    public enum _Fields implements TFieldIdEnum {
6235
      SUCCESS((short)0, "success"),
6236
      PEX((short)1, "pex");
6237
 
6238
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6239
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6240
 
6241
      static {
6242
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6243
          byId.put((int)field._thriftId, field);
6244
          byName.put(field.getFieldName(), field);
6245
        }
6246
      }
6247
 
6248
      /**
6249
       * Find the _Fields constant that matches fieldId, or null if its not found.
6250
       */
6251
      public static _Fields findByThriftId(int fieldId) {
6252
        return byId.get(fieldId);
6253
      }
6254
 
6255
      /**
6256
       * Find the _Fields constant that matches fieldId, throwing an exception
6257
       * if it is not found.
6258
       */
6259
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6260
        _Fields fields = findByThriftId(fieldId);
6261
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6262
        return fields;
6263
      }
6264
 
6265
      /**
6266
       * Find the _Fields constant that matches name, or null if its not found.
6267
       */
6268
      public static _Fields findByName(String name) {
6269
        return byName.get(name);
6270
      }
6271
 
6272
      private final short _thriftId;
6273
      private final String _fieldName;
6274
 
6275
      _Fields(short thriftId, String fieldName) {
6276
        _thriftId = thriftId;
6277
        _fieldName = fieldName;
6278
      }
6279
 
6280
      public short getThriftFieldId() {
6281
        return _thriftId;
6282
      }
6283
 
6284
      public String getFieldName() {
6285
        return _fieldName;
6286
      }
6287
    }
6288
 
6289
    // isset id assignments
6290
 
6291
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6292
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
6293
          new ListMetaData(TType.LIST, 
6294
              new StructMetaData(TType.STRUCT, Coupon.class))));
6295
      put(_Fields.PEX, new FieldMetaData("pex", TFieldRequirementType.DEFAULT, 
6296
          new FieldValueMetaData(TType.STRUCT)));
6297
    }});
6298
 
6299
    static {
6300
      FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
6301
    }
6302
 
6303
    public getActiveCoupons_result() {
6304
    }
6305
 
6306
    public getActiveCoupons_result(
6307
      List<Coupon> success,
6308
      PromotionException pex)
6309
    {
6310
      this();
6311
      this.success = success;
6312
      this.pex = pex;
6313
    }
6314
 
6315
    /**
6316
     * Performs a deep copy on <i>other</i>.
6317
     */
6318
    public getActiveCoupons_result(getActiveCoupons_result other) {
6319
      if (other.isSetSuccess()) {
6320
        List<Coupon> __this__success = new ArrayList<Coupon>();
6321
        for (Coupon other_element : other.success) {
6322
          __this__success.add(new Coupon(other_element));
6323
        }
6324
        this.success = __this__success;
6325
      }
6326
      if (other.isSetPex()) {
6327
        this.pex = new PromotionException(other.pex);
6328
      }
6329
    }
6330
 
6331
    public getActiveCoupons_result deepCopy() {
6332
      return new getActiveCoupons_result(this);
6333
    }
6334
 
6335
    @Deprecated
6336
    public getActiveCoupons_result clone() {
6337
      return new getActiveCoupons_result(this);
6338
    }
6339
 
6340
    public int getSuccessSize() {
6341
      return (this.success == null) ? 0 : this.success.size();
6342
    }
6343
 
6344
    public java.util.Iterator<Coupon> getSuccessIterator() {
6345
      return (this.success == null) ? null : this.success.iterator();
6346
    }
6347
 
6348
    public void addToSuccess(Coupon elem) {
6349
      if (this.success == null) {
6350
        this.success = new ArrayList<Coupon>();
6351
      }
6352
      this.success.add(elem);
6353
    }
6354
 
6355
    public List<Coupon> getSuccess() {
6356
      return this.success;
6357
    }
6358
 
6359
    public getActiveCoupons_result setSuccess(List<Coupon> success) {
6360
      this.success = success;
6361
      return this;
6362
    }
6363
 
6364
    public void unsetSuccess() {
6365
      this.success = null;
6366
    }
6367
 
6368
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
6369
    public boolean isSetSuccess() {
6370
      return this.success != null;
6371
    }
6372
 
6373
    public void setSuccessIsSet(boolean value) {
6374
      if (!value) {
6375
        this.success = null;
6376
      }
6377
    }
6378
 
6379
    public PromotionException getPex() {
6380
      return this.pex;
6381
    }
6382
 
6383
    public getActiveCoupons_result setPex(PromotionException pex) {
6384
      this.pex = pex;
6385
      return this;
6386
    }
6387
 
6388
    public void unsetPex() {
6389
      this.pex = null;
6390
    }
6391
 
6392
    /** Returns true if field pex is set (has been asigned a value) and false otherwise */
6393
    public boolean isSetPex() {
6394
      return this.pex != null;
6395
    }
6396
 
6397
    public void setPexIsSet(boolean value) {
6398
      if (!value) {
6399
        this.pex = null;
6400
      }
6401
    }
6402
 
6403
    public void setFieldValue(_Fields field, Object value) {
6404
      switch (field) {
6405
      case SUCCESS:
6406
        if (value == null) {
6407
          unsetSuccess();
6408
        } else {
6409
          setSuccess((List<Coupon>)value);
6410
        }
6411
        break;
6412
 
6413
      case PEX:
6414
        if (value == null) {
6415
          unsetPex();
6416
        } else {
6417
          setPex((PromotionException)value);
6418
        }
6419
        break;
6420
 
6421
      }
6422
    }
6423
 
6424
    public void setFieldValue(int fieldID, Object value) {
6425
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6426
    }
6427
 
6428
    public Object getFieldValue(_Fields field) {
6429
      switch (field) {
6430
      case SUCCESS:
6431
        return getSuccess();
6432
 
6433
      case PEX:
6434
        return getPex();
6435
 
6436
      }
6437
      throw new IllegalStateException();
6438
    }
6439
 
6440
    public Object getFieldValue(int fieldId) {
6441
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6442
    }
6443
 
6444
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6445
    public boolean isSet(_Fields field) {
6446
      switch (field) {
6447
      case SUCCESS:
6448
        return isSetSuccess();
6449
      case PEX:
6450
        return isSetPex();
6451
      }
6452
      throw new IllegalStateException();
6453
    }
6454
 
6455
    public boolean isSet(int fieldID) {
6456
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6457
    }
6458
 
6459
    @Override
6460
    public boolean equals(Object that) {
6461
      if (that == null)
6462
        return false;
6463
      if (that instanceof getActiveCoupons_result)
6464
        return this.equals((getActiveCoupons_result)that);
6465
      return false;
6466
    }
6467
 
6468
    public boolean equals(getActiveCoupons_result that) {
6469
      if (that == null)
6470
        return false;
6471
 
6472
      boolean this_present_success = true && this.isSetSuccess();
6473
      boolean that_present_success = true && that.isSetSuccess();
6474
      if (this_present_success || that_present_success) {
6475
        if (!(this_present_success && that_present_success))
6476
          return false;
6477
        if (!this.success.equals(that.success))
6478
          return false;
6479
      }
6480
 
6481
      boolean this_present_pex = true && this.isSetPex();
6482
      boolean that_present_pex = true && that.isSetPex();
6483
      if (this_present_pex || that_present_pex) {
6484
        if (!(this_present_pex && that_present_pex))
6485
          return false;
6486
        if (!this.pex.equals(that.pex))
6487
          return false;
6488
      }
6489
 
6490
      return true;
6491
    }
6492
 
6493
    @Override
6494
    public int hashCode() {
6495
      return 0;
6496
    }
6497
 
6498
    public int compareTo(getActiveCoupons_result other) {
6499
      if (!getClass().equals(other.getClass())) {
6500
        return getClass().getName().compareTo(other.getClass().getName());
6501
      }
6502
 
6503
      int lastComparison = 0;
6504
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
6505
 
6506
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
6507
      if (lastComparison != 0) {
6508
        return lastComparison;
6509
      }
6510
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
6511
      if (lastComparison != 0) {
6512
        return lastComparison;
6513
      }
6514
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(isSetPex());
6515
      if (lastComparison != 0) {
6516
        return lastComparison;
6517
      }
6518
      lastComparison = TBaseHelper.compareTo(pex, typedOther.pex);
6519
      if (lastComparison != 0) {
6520
        return lastComparison;
6521
      }
6522
      return 0;
6523
    }
6524
 
6525
    public void read(TProtocol iprot) throws TException {
6526
      TField field;
6527
      iprot.readStructBegin();
6528
      while (true)
6529
      {
6530
        field = iprot.readFieldBegin();
6531
        if (field.type == TType.STOP) { 
6532
          break;
6533
        }
6534
        _Fields fieldId = _Fields.findByThriftId(field.id);
6535
        if (fieldId == null) {
6536
          TProtocolUtil.skip(iprot, field.type);
6537
        } else {
6538
          switch (fieldId) {
6539
            case SUCCESS:
6540
              if (field.type == TType.LIST) {
6541
                {
6542
                  TList _list16 = iprot.readListBegin();
6543
                  this.success = new ArrayList<Coupon>(_list16.size);
6544
                  for (int _i17 = 0; _i17 < _list16.size; ++_i17)
6545
                  {
6546
                    Coupon _elem18;
6547
                    _elem18 = new Coupon();
6548
                    _elem18.read(iprot);
6549
                    this.success.add(_elem18);
6550
                  }
6551
                  iprot.readListEnd();
6552
                }
6553
              } else { 
6554
                TProtocolUtil.skip(iprot, field.type);
6555
              }
6556
              break;
6557
            case PEX:
6558
              if (field.type == TType.STRUCT) {
6559
                this.pex = new PromotionException();
6560
                this.pex.read(iprot);
6561
              } else { 
6562
                TProtocolUtil.skip(iprot, field.type);
6563
              }
6564
              break;
6565
          }
6566
          iprot.readFieldEnd();
6567
        }
6568
      }
6569
      iprot.readStructEnd();
6570
      validate();
6571
    }
6572
 
6573
    public void write(TProtocol oprot) throws TException {
6574
      oprot.writeStructBegin(STRUCT_DESC);
6575
 
6576
      if (this.isSetSuccess()) {
6577
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6578
        {
6579
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
6580
          for (Coupon _iter19 : this.success)
6581
          {
6582
            _iter19.write(oprot);
6583
          }
6584
          oprot.writeListEnd();
6585
        }
6586
        oprot.writeFieldEnd();
6587
      } else if (this.isSetPex()) {
6588
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6589
        this.pex.write(oprot);
6590
        oprot.writeFieldEnd();
6591
      }
6592
      oprot.writeFieldStop();
6593
      oprot.writeStructEnd();
6594
    }
6595
 
6596
    @Override
6597
    public String toString() {
6598
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
6599
      boolean first = true;
6600
 
6601
      sb.append("success:");
6602
      if (this.success == null) {
6603
        sb.append("null");
6604
      } else {
6605
        sb.append(this.success);
6606
      }
6607
      first = false;
6608
      if (!first) sb.append(", ");
6609
      sb.append("pex:");
6610
      if (this.pex == null) {
6611
        sb.append("null");
6612
      } else {
6613
        sb.append(this.pex);
6614
      }
6615
      first = false;
6616
      sb.append(")");
6617
      return sb.toString();
6618
    }
6619
 
6620
    public void validate() throws TException {
6621
      // check for required fields
6622
    }
6623
 
6624
  }
6625
 
6626
  public static class getSuccessfulPaymentCountForCoupon_args implements TBase<getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable, Comparable<getSuccessfulPaymentCountForCoupon_args>   {
6627
    private static final TStruct STRUCT_DESC = new TStruct("getSuccessfulPaymentCountForCoupon_args");
6628
 
6629
    private static final TField COUPON_CODE_FIELD_DESC = new TField("couponCode", TType.STRING, (short)1);
6630
 
6631
    private String couponCode;
6632
 
6633
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6634
    public enum _Fields implements TFieldIdEnum {
6635
      COUPON_CODE((short)1, "couponCode");
6636
 
6637
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6638
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6639
 
6640
      static {
6641
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6642
          byId.put((int)field._thriftId, field);
6643
          byName.put(field.getFieldName(), field);
6644
        }
6645
      }
6646
 
6647
      /**
6648
       * Find the _Fields constant that matches fieldId, or null if its not found.
6649
       */
6650
      public static _Fields findByThriftId(int fieldId) {
6651
        return byId.get(fieldId);
6652
      }
6653
 
6654
      /**
6655
       * Find the _Fields constant that matches fieldId, throwing an exception
6656
       * if it is not found.
6657
       */
6658
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6659
        _Fields fields = findByThriftId(fieldId);
6660
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6661
        return fields;
6662
      }
6663
 
6664
      /**
6665
       * Find the _Fields constant that matches name, or null if its not found.
6666
       */
6667
      public static _Fields findByName(String name) {
6668
        return byName.get(name);
6669
      }
6670
 
6671
      private final short _thriftId;
6672
      private final String _fieldName;
6673
 
6674
      _Fields(short thriftId, String fieldName) {
6675
        _thriftId = thriftId;
6676
        _fieldName = fieldName;
6677
      }
6678
 
6679
      public short getThriftFieldId() {
6680
        return _thriftId;
6681
      }
6682
 
6683
      public String getFieldName() {
6684
        return _fieldName;
6685
      }
6686
    }
6687
 
6688
    // isset id assignments
6689
 
6690
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6691
      put(_Fields.COUPON_CODE, new FieldMetaData("couponCode", TFieldRequirementType.DEFAULT, 
6692
          new FieldValueMetaData(TType.STRING)));
6693
    }});
6694
 
6695
    static {
6696
      FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
6697
    }
6698
 
6699
    public getSuccessfulPaymentCountForCoupon_args() {
6700
    }
6701
 
6702
    public getSuccessfulPaymentCountForCoupon_args(
6703
      String couponCode)
6704
    {
6705
      this();
6706
      this.couponCode = couponCode;
6707
    }
6708
 
6709
    /**
6710
     * Performs a deep copy on <i>other</i>.
6711
     */
6712
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
6713
      if (other.isSetCouponCode()) {
6714
        this.couponCode = other.couponCode;
6715
      }
6716
    }
6717
 
6718
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
6719
      return new getSuccessfulPaymentCountForCoupon_args(this);
6720
    }
6721
 
6722
    @Deprecated
6723
    public getSuccessfulPaymentCountForCoupon_args clone() {
6724
      return new getSuccessfulPaymentCountForCoupon_args(this);
6725
    }
6726
 
6727
    public String getCouponCode() {
6728
      return this.couponCode;
6729
    }
6730
 
6731
    public getSuccessfulPaymentCountForCoupon_args setCouponCode(String couponCode) {
6732
      this.couponCode = couponCode;
6733
      return this;
6734
    }
6735
 
6736
    public void unsetCouponCode() {
6737
      this.couponCode = null;
6738
    }
6739
 
6740
    /** Returns true if field couponCode is set (has been asigned a value) and false otherwise */
6741
    public boolean isSetCouponCode() {
6742
      return this.couponCode != null;
6743
    }
6744
 
6745
    public void setCouponCodeIsSet(boolean value) {
6746
      if (!value) {
6747
        this.couponCode = null;
6748
      }
6749
    }
6750
 
6751
    public void setFieldValue(_Fields field, Object value) {
6752
      switch (field) {
6753
      case COUPON_CODE:
6754
        if (value == null) {
6755
          unsetCouponCode();
6756
        } else {
6757
          setCouponCode((String)value);
6758
        }
6759
        break;
6760
 
6761
      }
6762
    }
6763
 
6764
    public void setFieldValue(int fieldID, Object value) {
6765
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6766
    }
6767
 
6768
    public Object getFieldValue(_Fields field) {
6769
      switch (field) {
6770
      case COUPON_CODE:
6771
        return getCouponCode();
6772
 
6773
      }
6774
      throw new IllegalStateException();
6775
    }
6776
 
6777
    public Object getFieldValue(int fieldId) {
6778
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6779
    }
6780
 
6781
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6782
    public boolean isSet(_Fields field) {
6783
      switch (field) {
6784
      case COUPON_CODE:
6785
        return isSetCouponCode();
6786
      }
6787
      throw new IllegalStateException();
6788
    }
6789
 
6790
    public boolean isSet(int fieldID) {
6791
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6792
    }
6793
 
6794
    @Override
6795
    public boolean equals(Object that) {
6796
      if (that == null)
6797
        return false;
6798
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
6799
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
6800
      return false;
6801
    }
6802
 
6803
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
6804
      if (that == null)
6805
        return false;
6806
 
6807
      boolean this_present_couponCode = true && this.isSetCouponCode();
6808
      boolean that_present_couponCode = true && that.isSetCouponCode();
6809
      if (this_present_couponCode || that_present_couponCode) {
6810
        if (!(this_present_couponCode && that_present_couponCode))
6811
          return false;
6812
        if (!this.couponCode.equals(that.couponCode))
6813
          return false;
6814
      }
6815
 
6816
      return true;
6817
    }
6818
 
6819
    @Override
6820
    public int hashCode() {
6821
      return 0;
6822
    }
6823
 
6824
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
6825
      if (!getClass().equals(other.getClass())) {
6826
        return getClass().getName().compareTo(other.getClass().getName());
6827
      }
6828
 
6829
      int lastComparison = 0;
6830
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
6831
 
6832
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(isSetCouponCode());
6833
      if (lastComparison != 0) {
6834
        return lastComparison;
6835
      }
6836
      lastComparison = TBaseHelper.compareTo(couponCode, typedOther.couponCode);
6837
      if (lastComparison != 0) {
6838
        return lastComparison;
6839
      }
6840
      return 0;
6841
    }
6842
 
6843
    public void read(TProtocol iprot) throws TException {
6844
      TField field;
6845
      iprot.readStructBegin();
6846
      while (true)
6847
      {
6848
        field = iprot.readFieldBegin();
6849
        if (field.type == TType.STOP) { 
6850
          break;
6851
        }
6852
        _Fields fieldId = _Fields.findByThriftId(field.id);
6853
        if (fieldId == null) {
6854
          TProtocolUtil.skip(iprot, field.type);
6855
        } else {
6856
          switch (fieldId) {
6857
            case COUPON_CODE:
6858
              if (field.type == TType.STRING) {
6859
                this.couponCode = iprot.readString();
6860
              } else { 
6861
                TProtocolUtil.skip(iprot, field.type);
6862
              }
6863
              break;
6864
          }
6865
          iprot.readFieldEnd();
6866
        }
6867
      }
6868
      iprot.readStructEnd();
6869
      validate();
6870
    }
6871
 
6872
    public void write(TProtocol oprot) throws TException {
6873
      validate();
6874
 
6875
      oprot.writeStructBegin(STRUCT_DESC);
6876
      if (this.couponCode != null) {
6877
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6878
        oprot.writeString(this.couponCode);
6879
        oprot.writeFieldEnd();
6880
      }
6881
      oprot.writeFieldStop();
6882
      oprot.writeStructEnd();
6883
    }
6884
 
6885
    @Override
6886
    public String toString() {
6887
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
6888
      boolean first = true;
6889
 
6890
      sb.append("couponCode:");
6891
      if (this.couponCode == null) {
6892
        sb.append("null");
6893
      } else {
6894
        sb.append(this.couponCode);
6895
      }
6896
      first = false;
6897
      sb.append(")");
6898
      return sb.toString();
6899
    }
6900
 
6901
    public void validate() throws TException {
6902
      // check for required fields
6903
    }
6904
 
6905
  }
6906
 
6907
  public static class getSuccessfulPaymentCountForCoupon_result implements TBase<getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSuccessfulPaymentCountForCoupon_result>   {
6908
    private static final TStruct STRUCT_DESC = new TStruct("getSuccessfulPaymentCountForCoupon_result");
6909
 
6910
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
6911
    private static final TField PEX_FIELD_DESC = new TField("pex", TType.STRUCT, (short)1);
6912
 
6913
    private long success;
6914
    private PromotionException pex;
6915
 
6916
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6917
    public enum _Fields implements TFieldIdEnum {
6918
      SUCCESS((short)0, "success"),
6919
      PEX((short)1, "pex");
6920
 
6921
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6922
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6923
 
6924
      static {
6925
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6926
          byId.put((int)field._thriftId, field);
6927
          byName.put(field.getFieldName(), field);
6928
        }
6929
      }
6930
 
6931
      /**
6932
       * Find the _Fields constant that matches fieldId, or null if its not found.
6933
       */
6934
      public static _Fields findByThriftId(int fieldId) {
6935
        return byId.get(fieldId);
6936
      }
6937
 
6938
      /**
6939
       * Find the _Fields constant that matches fieldId, throwing an exception
6940
       * if it is not found.
6941
       */
6942
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6943
        _Fields fields = findByThriftId(fieldId);
6944
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6945
        return fields;
6946
      }
6947
 
6948
      /**
6949
       * Find the _Fields constant that matches name, or null if its not found.
6950
       */
6951
      public static _Fields findByName(String name) {
6952
        return byName.get(name);
6953
      }
6954
 
6955
      private final short _thriftId;
6956
      private final String _fieldName;
6957
 
6958
      _Fields(short thriftId, String fieldName) {
6959
        _thriftId = thriftId;
6960
        _fieldName = fieldName;
6961
      }
6962
 
6963
      public short getThriftFieldId() {
6964
        return _thriftId;
6965
      }
6966
 
6967
      public String getFieldName() {
6968
        return _fieldName;
6969
      }
6970
    }
6971
 
6972
    // isset id assignments
6973
    private static final int __SUCCESS_ISSET_ID = 0;
6974
    private BitSet __isset_bit_vector = new BitSet(1);
6975
 
6976
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6977
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
6978
          new FieldValueMetaData(TType.I64)));
6979
      put(_Fields.PEX, new FieldMetaData("pex", TFieldRequirementType.DEFAULT, 
6980
          new FieldValueMetaData(TType.STRUCT)));
6981
    }});
6982
 
6983
    static {
6984
      FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
6985
    }
6986
 
6987
    public getSuccessfulPaymentCountForCoupon_result() {
6988
    }
6989
 
6990
    public getSuccessfulPaymentCountForCoupon_result(
6991
      long success,
6992
      PromotionException pex)
6993
    {
6994
      this();
6995
      this.success = success;
6996
      setSuccessIsSet(true);
6997
      this.pex = pex;
6998
    }
6999
 
7000
    /**
7001
     * Performs a deep copy on <i>other</i>.
7002
     */
7003
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
7004
      __isset_bit_vector.clear();
7005
      __isset_bit_vector.or(other.__isset_bit_vector);
7006
      this.success = other.success;
7007
      if (other.isSetPex()) {
7008
        this.pex = new PromotionException(other.pex);
7009
      }
7010
    }
7011
 
7012
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
7013
      return new getSuccessfulPaymentCountForCoupon_result(this);
7014
    }
7015
 
7016
    @Deprecated
7017
    public getSuccessfulPaymentCountForCoupon_result clone() {
7018
      return new getSuccessfulPaymentCountForCoupon_result(this);
7019
    }
7020
 
7021
    public long getSuccess() {
7022
      return this.success;
7023
    }
7024
 
7025
    public getSuccessfulPaymentCountForCoupon_result setSuccess(long success) {
7026
      this.success = success;
7027
      setSuccessIsSet(true);
7028
      return this;
7029
    }
7030
 
7031
    public void unsetSuccess() {
7032
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
7033
    }
7034
 
7035
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
7036
    public boolean isSetSuccess() {
7037
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
7038
    }
7039
 
7040
    public void setSuccessIsSet(boolean value) {
7041
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
7042
    }
7043
 
7044
    public PromotionException getPex() {
7045
      return this.pex;
7046
    }
7047
 
7048
    public getSuccessfulPaymentCountForCoupon_result setPex(PromotionException pex) {
7049
      this.pex = pex;
7050
      return this;
7051
    }
7052
 
7053
    public void unsetPex() {
7054
      this.pex = null;
7055
    }
7056
 
7057
    /** Returns true if field pex is set (has been asigned a value) and false otherwise */
7058
    public boolean isSetPex() {
7059
      return this.pex != null;
7060
    }
7061
 
7062
    public void setPexIsSet(boolean value) {
7063
      if (!value) {
7064
        this.pex = null;
7065
      }
7066
    }
7067
 
7068
    public void setFieldValue(_Fields field, Object value) {
7069
      switch (field) {
7070
      case SUCCESS:
7071
        if (value == null) {
7072
          unsetSuccess();
7073
        } else {
7074
          setSuccess((Long)value);
7075
        }
7076
        break;
7077
 
7078
      case PEX:
7079
        if (value == null) {
7080
          unsetPex();
7081
        } else {
7082
          setPex((PromotionException)value);
7083
        }
7084
        break;
7085
 
7086
      }
7087
    }
7088
 
7089
    public void setFieldValue(int fieldID, Object value) {
7090
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7091
    }
7092
 
7093
    public Object getFieldValue(_Fields field) {
7094
      switch (field) {
7095
      case SUCCESS:
7096
        return new Long(getSuccess());
7097
 
7098
      case PEX:
7099
        return getPex();
7100
 
7101
      }
7102
      throw new IllegalStateException();
7103
    }
7104
 
7105
    public Object getFieldValue(int fieldId) {
7106
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7107
    }
7108
 
7109
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7110
    public boolean isSet(_Fields field) {
7111
      switch (field) {
7112
      case SUCCESS:
7113
        return isSetSuccess();
7114
      case PEX:
7115
        return isSetPex();
7116
      }
7117
      throw new IllegalStateException();
7118
    }
7119
 
7120
    public boolean isSet(int fieldID) {
7121
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7122
    }
7123
 
7124
    @Override
7125
    public boolean equals(Object that) {
7126
      if (that == null)
7127
        return false;
7128
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
7129
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
7130
      return false;
7131
    }
7132
 
7133
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
7134
      if (that == null)
7135
        return false;
7136
 
7137
      boolean this_present_success = true;
7138
      boolean that_present_success = true;
7139
      if (this_present_success || that_present_success) {
7140
        if (!(this_present_success && that_present_success))
7141
          return false;
7142
        if (this.success != that.success)
7143
          return false;
7144
      }
7145
 
7146
      boolean this_present_pex = true && this.isSetPex();
7147
      boolean that_present_pex = true && that.isSetPex();
7148
      if (this_present_pex || that_present_pex) {
7149
        if (!(this_present_pex && that_present_pex))
7150
          return false;
7151
        if (!this.pex.equals(that.pex))
7152
          return false;
7153
      }
7154
 
7155
      return true;
7156
    }
7157
 
7158
    @Override
7159
    public int hashCode() {
7160
      return 0;
7161
    }
7162
 
7163
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
7164
      if (!getClass().equals(other.getClass())) {
7165
        return getClass().getName().compareTo(other.getClass().getName());
7166
      }
7167
 
7168
      int lastComparison = 0;
7169
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
7170
 
7171
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
7172
      if (lastComparison != 0) {
7173
        return lastComparison;
7174
      }
7175
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
7176
      if (lastComparison != 0) {
7177
        return lastComparison;
7178
      }
7179
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(isSetPex());
7180
      if (lastComparison != 0) {
7181
        return lastComparison;
7182
      }
7183
      lastComparison = TBaseHelper.compareTo(pex, typedOther.pex);
7184
      if (lastComparison != 0) {
7185
        return lastComparison;
7186
      }
7187
      return 0;
7188
    }
7189
 
7190
    public void read(TProtocol iprot) throws TException {
7191
      TField field;
7192
      iprot.readStructBegin();
7193
      while (true)
7194
      {
7195
        field = iprot.readFieldBegin();
7196
        if (field.type == TType.STOP) { 
7197
          break;
7198
        }
7199
        _Fields fieldId = _Fields.findByThriftId(field.id);
7200
        if (fieldId == null) {
7201
          TProtocolUtil.skip(iprot, field.type);
7202
        } else {
7203
          switch (fieldId) {
7204
            case SUCCESS:
7205
              if (field.type == TType.I64) {
7206
                this.success = iprot.readI64();
7207
                setSuccessIsSet(true);
7208
              } else { 
7209
                TProtocolUtil.skip(iprot, field.type);
7210
              }
7211
              break;
7212
            case PEX:
7213
              if (field.type == TType.STRUCT) {
7214
                this.pex = new PromotionException();
7215
                this.pex.read(iprot);
7216
              } else { 
7217
                TProtocolUtil.skip(iprot, field.type);
7218
              }
7219
              break;
7220
          }
7221
          iprot.readFieldEnd();
7222
        }
7223
      }
7224
      iprot.readStructEnd();
7225
      validate();
7226
    }
7227
 
7228
    public void write(TProtocol oprot) throws TException {
7229
      oprot.writeStructBegin(STRUCT_DESC);
7230
 
7231
      if (this.isSetSuccess()) {
7232
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7233
        oprot.writeI64(this.success);
7234
        oprot.writeFieldEnd();
7235
      } else if (this.isSetPex()) {
7236
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7237
        this.pex.write(oprot);
7238
        oprot.writeFieldEnd();
7239
      }
7240
      oprot.writeFieldStop();
7241
      oprot.writeStructEnd();
7242
    }
7243
 
7244
    @Override
7245
    public String toString() {
7246
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
7247
      boolean first = true;
7248
 
7249
      sb.append("success:");
7250
      sb.append(this.success);
7251
      first = false;
7252
      if (!first) sb.append(", ");
7253
      sb.append("pex:");
7254
      if (this.pex == null) {
7255
        sb.append("null");
7256
      } else {
7257
        sb.append(this.pex);
7258
      }
7259
      first = false;
7260
      sb.append(")");
7261
      return sb.toString();
7262
    }
7263
 
7264
    public void validate() throws TException {
7265
      // check for required fields
7266
    }
7267
 
7268
  }
7269
 
7270
  public static class getRuleDocString_args implements TBase<getRuleDocString_args._Fields>, java.io.Serializable, Cloneable, Comparable<getRuleDocString_args>   {
7271
    private static final TStruct STRUCT_DESC = new TStruct("getRuleDocString_args");
7272
 
7273
    private static final TField RULE_NAME_FIELD_DESC = new TField("ruleName", TType.STRING, (short)1);
7274
 
7275
    private String ruleName;
7276
 
7277
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7278
    public enum _Fields implements TFieldIdEnum {
7279
      RULE_NAME((short)1, "ruleName");
7280
 
7281
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7282
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7283
 
7284
      static {
7285
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7286
          byId.put((int)field._thriftId, field);
7287
          byName.put(field.getFieldName(), field);
7288
        }
7289
      }
7290
 
7291
      /**
7292
       * Find the _Fields constant that matches fieldId, or null if its not found.
7293
       */
7294
      public static _Fields findByThriftId(int fieldId) {
7295
        return byId.get(fieldId);
7296
      }
7297
 
7298
      /**
7299
       * Find the _Fields constant that matches fieldId, throwing an exception
7300
       * if it is not found.
7301
       */
7302
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7303
        _Fields fields = findByThriftId(fieldId);
7304
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7305
        return fields;
7306
      }
7307
 
7308
      /**
7309
       * Find the _Fields constant that matches name, or null if its not found.
7310
       */
7311
      public static _Fields findByName(String name) {
7312
        return byName.get(name);
7313
      }
7314
 
7315
      private final short _thriftId;
7316
      private final String _fieldName;
7317
 
7318
      _Fields(short thriftId, String fieldName) {
7319
        _thriftId = thriftId;
7320
        _fieldName = fieldName;
7321
      }
7322
 
7323
      public short getThriftFieldId() {
7324
        return _thriftId;
7325
      }
7326
 
7327
      public String getFieldName() {
7328
        return _fieldName;
7329
      }
7330
    }
7331
 
7332
    // isset id assignments
7333
 
7334
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
7335
      put(_Fields.RULE_NAME, new FieldMetaData("ruleName", TFieldRequirementType.DEFAULT, 
7336
          new FieldValueMetaData(TType.STRING)));
7337
    }});
7338
 
7339
    static {
7340
      FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
7341
    }
7342
 
7343
    public getRuleDocString_args() {
7344
    }
7345
 
7346
    public getRuleDocString_args(
7347
      String ruleName)
7348
    {
7349
      this();
7350
      this.ruleName = ruleName;
7351
    }
7352
 
7353
    /**
7354
     * Performs a deep copy on <i>other</i>.
7355
     */
7356
    public getRuleDocString_args(getRuleDocString_args other) {
7357
      if (other.isSetRuleName()) {
7358
        this.ruleName = other.ruleName;
7359
      }
7360
    }
7361
 
7362
    public getRuleDocString_args deepCopy() {
7363
      return new getRuleDocString_args(this);
7364
    }
7365
 
7366
    @Deprecated
7367
    public getRuleDocString_args clone() {
7368
      return new getRuleDocString_args(this);
7369
    }
7370
 
7371
    public String getRuleName() {
7372
      return this.ruleName;
7373
    }
7374
 
7375
    public getRuleDocString_args setRuleName(String ruleName) {
7376
      this.ruleName = ruleName;
7377
      return this;
7378
    }
7379
 
7380
    public void unsetRuleName() {
7381
      this.ruleName = null;
7382
    }
7383
 
7384
    /** Returns true if field ruleName is set (has been asigned a value) and false otherwise */
7385
    public boolean isSetRuleName() {
7386
      return this.ruleName != null;
7387
    }
7388
 
7389
    public void setRuleNameIsSet(boolean value) {
7390
      if (!value) {
7391
        this.ruleName = null;
7392
      }
7393
    }
7394
 
7395
    public void setFieldValue(_Fields field, Object value) {
7396
      switch (field) {
7397
      case RULE_NAME:
7398
        if (value == null) {
7399
          unsetRuleName();
7400
        } else {
7401
          setRuleName((String)value);
7402
        }
7403
        break;
7404
 
7405
      }
7406
    }
7407
 
7408
    public void setFieldValue(int fieldID, Object value) {
7409
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7410
    }
7411
 
7412
    public Object getFieldValue(_Fields field) {
7413
      switch (field) {
7414
      case RULE_NAME:
7415
        return getRuleName();
7416
 
7417
      }
7418
      throw new IllegalStateException();
7419
    }
7420
 
7421
    public Object getFieldValue(int fieldId) {
7422
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7423
    }
7424
 
7425
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7426
    public boolean isSet(_Fields field) {
7427
      switch (field) {
7428
      case RULE_NAME:
7429
        return isSetRuleName();
7430
      }
7431
      throw new IllegalStateException();
7432
    }
7433
 
7434
    public boolean isSet(int fieldID) {
7435
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7436
    }
7437
 
7438
    @Override
7439
    public boolean equals(Object that) {
7440
      if (that == null)
7441
        return false;
7442
      if (that instanceof getRuleDocString_args)
7443
        return this.equals((getRuleDocString_args)that);
7444
      return false;
7445
    }
7446
 
7447
    public boolean equals(getRuleDocString_args that) {
7448
      if (that == null)
7449
        return false;
7450
 
7451
      boolean this_present_ruleName = true && this.isSetRuleName();
7452
      boolean that_present_ruleName = true && that.isSetRuleName();
7453
      if (this_present_ruleName || that_present_ruleName) {
7454
        if (!(this_present_ruleName && that_present_ruleName))
7455
          return false;
7456
        if (!this.ruleName.equals(that.ruleName))
7457
          return false;
7458
      }
7459
 
7460
      return true;
7461
    }
7462
 
7463
    @Override
7464
    public int hashCode() {
7465
      return 0;
7466
    }
7467
 
7468
    public int compareTo(getRuleDocString_args other) {
7469
      if (!getClass().equals(other.getClass())) {
7470
        return getClass().getName().compareTo(other.getClass().getName());
7471
      }
7472
 
7473
      int lastComparison = 0;
7474
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
7475
 
7476
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(isSetRuleName());
7477
      if (lastComparison != 0) {
7478
        return lastComparison;
7479
      }
7480
      lastComparison = TBaseHelper.compareTo(ruleName, typedOther.ruleName);
7481
      if (lastComparison != 0) {
7482
        return lastComparison;
7483
      }
7484
      return 0;
7485
    }
7486
 
7487
    public void read(TProtocol iprot) throws TException {
7488
      TField field;
7489
      iprot.readStructBegin();
7490
      while (true)
7491
      {
7492
        field = iprot.readFieldBegin();
7493
        if (field.type == TType.STOP) { 
7494
          break;
7495
        }
7496
        _Fields fieldId = _Fields.findByThriftId(field.id);
7497
        if (fieldId == null) {
7498
          TProtocolUtil.skip(iprot, field.type);
7499
        } else {
7500
          switch (fieldId) {
7501
            case RULE_NAME:
7502
              if (field.type == TType.STRING) {
7503
                this.ruleName = iprot.readString();
7504
              } else { 
7505
                TProtocolUtil.skip(iprot, field.type);
7506
              }
7507
              break;
7508
          }
7509
          iprot.readFieldEnd();
7510
        }
7511
      }
7512
      iprot.readStructEnd();
7513
      validate();
7514
    }
7515
 
7516
    public void write(TProtocol oprot) throws TException {
7517
      validate();
7518
 
7519
      oprot.writeStructBegin(STRUCT_DESC);
7520
      if (this.ruleName != null) {
7521
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
7522
        oprot.writeString(this.ruleName);
7523
        oprot.writeFieldEnd();
7524
      }
7525
      oprot.writeFieldStop();
7526
      oprot.writeStructEnd();
7527
    }
7528
 
7529
    @Override
7530
    public String toString() {
7531
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
7532
      boolean first = true;
7533
 
7534
      sb.append("ruleName:");
7535
      if (this.ruleName == null) {
7536
        sb.append("null");
7537
      } else {
7538
        sb.append(this.ruleName);
7539
      }
7540
      first = false;
7541
      sb.append(")");
7542
      return sb.toString();
7543
    }
7544
 
7545
    public void validate() throws TException {
7546
      // check for required fields
7547
    }
7548
 
7549
  }
7550
 
7551
  public static class getRuleDocString_result implements TBase<getRuleDocString_result._Fields>, java.io.Serializable, Cloneable, Comparable<getRuleDocString_result>   {
7552
    private static final TStruct STRUCT_DESC = new TStruct("getRuleDocString_result");
7553
 
7554
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0);
7555
 
7556
    private String success;
7557
 
7558
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7559
    public enum _Fields implements TFieldIdEnum {
7560
      SUCCESS((short)0, "success");
7561
 
7562
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7563
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7564
 
7565
      static {
7566
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7567
          byId.put((int)field._thriftId, field);
7568
          byName.put(field.getFieldName(), field);
7569
        }
7570
      }
7571
 
7572
      /**
7573
       * Find the _Fields constant that matches fieldId, or null if its not found.
7574
       */
7575
      public static _Fields findByThriftId(int fieldId) {
7576
        return byId.get(fieldId);
7577
      }
7578
 
7579
      /**
7580
       * Find the _Fields constant that matches fieldId, throwing an exception
7581
       * if it is not found.
7582
       */
7583
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7584
        _Fields fields = findByThriftId(fieldId);
7585
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7586
        return fields;
7587
      }
7588
 
7589
      /**
7590
       * Find the _Fields constant that matches name, or null if its not found.
7591
       */
7592
      public static _Fields findByName(String name) {
7593
        return byName.get(name);
7594
      }
7595
 
7596
      private final short _thriftId;
7597
      private final String _fieldName;
7598
 
7599
      _Fields(short thriftId, String fieldName) {
7600
        _thriftId = thriftId;
7601
        _fieldName = fieldName;
7602
      }
7603
 
7604
      public short getThriftFieldId() {
7605
        return _thriftId;
7606
      }
7607
 
7608
      public String getFieldName() {
7609
        return _fieldName;
7610
      }
7611
    }
7612
 
7613
    // isset id assignments
7614
 
7615
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
7616
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
7617
          new FieldValueMetaData(TType.STRING)));
7618
    }});
7619
 
7620
    static {
7621
      FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
7622
    }
7623
 
7624
    public getRuleDocString_result() {
7625
    }
7626
 
7627
    public getRuleDocString_result(
7628
      String success)
7629
    {
7630
      this();
7631
      this.success = success;
7632
    }
7633
 
7634
    /**
7635
     * Performs a deep copy on <i>other</i>.
7636
     */
7637
    public getRuleDocString_result(getRuleDocString_result other) {
7638
      if (other.isSetSuccess()) {
7639
        this.success = other.success;
7640
      }
7641
    }
7642
 
7643
    public getRuleDocString_result deepCopy() {
7644
      return new getRuleDocString_result(this);
7645
    }
7646
 
7647
    @Deprecated
7648
    public getRuleDocString_result clone() {
7649
      return new getRuleDocString_result(this);
7650
    }
7651
 
7652
    public String getSuccess() {
7653
      return this.success;
7654
    }
7655
 
7656
    public getRuleDocString_result setSuccess(String success) {
7657
      this.success = success;
7658
      return this;
7659
    }
7660
 
7661
    public void unsetSuccess() {
7662
      this.success = null;
7663
    }
7664
 
7665
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
7666
    public boolean isSetSuccess() {
7667
      return this.success != null;
7668
    }
7669
 
7670
    public void setSuccessIsSet(boolean value) {
7671
      if (!value) {
7672
        this.success = null;
7673
      }
7674
    }
7675
 
7676
    public void setFieldValue(_Fields field, Object value) {
7677
      switch (field) {
7678
      case SUCCESS:
7679
        if (value == null) {
7680
          unsetSuccess();
7681
        } else {
7682
          setSuccess((String)value);
7683
        }
7684
        break;
7685
 
7686
      }
7687
    }
7688
 
7689
    public void setFieldValue(int fieldID, Object value) {
7690
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7691
    }
7692
 
7693
    public Object getFieldValue(_Fields field) {
7694
      switch (field) {
7695
      case SUCCESS:
7696
        return getSuccess();
7697
 
7698
      }
7699
      throw new IllegalStateException();
7700
    }
7701
 
7702
    public Object getFieldValue(int fieldId) {
7703
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7704
    }
7705
 
7706
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7707
    public boolean isSet(_Fields field) {
7708
      switch (field) {
7709
      case SUCCESS:
7710
        return isSetSuccess();
7711
      }
7712
      throw new IllegalStateException();
7713
    }
7714
 
7715
    public boolean isSet(int fieldID) {
7716
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7717
    }
7718
 
7719
    @Override
7720
    public boolean equals(Object that) {
7721
      if (that == null)
7722
        return false;
7723
      if (that instanceof getRuleDocString_result)
7724
        return this.equals((getRuleDocString_result)that);
7725
      return false;
7726
    }
7727
 
7728
    public boolean equals(getRuleDocString_result that) {
7729
      if (that == null)
7730
        return false;
7731
 
7732
      boolean this_present_success = true && this.isSetSuccess();
7733
      boolean that_present_success = true && that.isSetSuccess();
7734
      if (this_present_success || that_present_success) {
7735
        if (!(this_present_success && that_present_success))
7736
          return false;
7737
        if (!this.success.equals(that.success))
7738
          return false;
7739
      }
7740
 
7741
      return true;
7742
    }
7743
 
7744
    @Override
7745
    public int hashCode() {
7746
      return 0;
7747
    }
7748
 
7749
    public int compareTo(getRuleDocString_result other) {
7750
      if (!getClass().equals(other.getClass())) {
7751
        return getClass().getName().compareTo(other.getClass().getName());
7752
      }
7753
 
7754
      int lastComparison = 0;
7755
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
7756
 
7757
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
7758
      if (lastComparison != 0) {
7759
        return lastComparison;
7760
      }
7761
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
7762
      if (lastComparison != 0) {
7763
        return lastComparison;
7764
      }
7765
      return 0;
7766
    }
7767
 
7768
    public void read(TProtocol iprot) throws TException {
7769
      TField field;
7770
      iprot.readStructBegin();
7771
      while (true)
7772
      {
7773
        field = iprot.readFieldBegin();
7774
        if (field.type == TType.STOP) { 
7775
          break;
7776
        }
7777
        _Fields fieldId = _Fields.findByThriftId(field.id);
7778
        if (fieldId == null) {
7779
          TProtocolUtil.skip(iprot, field.type);
7780
        } else {
7781
          switch (fieldId) {
7782
            case SUCCESS:
7783
              if (field.type == TType.STRING) {
7784
                this.success = iprot.readString();
7785
              } else { 
7786
                TProtocolUtil.skip(iprot, field.type);
7787
              }
7788
              break;
7789
          }
7790
          iprot.readFieldEnd();
7791
        }
7792
      }
7793
      iprot.readStructEnd();
7794
      validate();
7795
    }
7796
 
7797
    public void write(TProtocol oprot) throws TException {
7798
      oprot.writeStructBegin(STRUCT_DESC);
7799
 
7800
      if (this.isSetSuccess()) {
7801
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7802
        oprot.writeString(this.success);
7803
        oprot.writeFieldEnd();
7804
      }
7805
      oprot.writeFieldStop();
7806
      oprot.writeStructEnd();
7807
    }
7808
 
7809
    @Override
7810
    public String toString() {
7811
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
7812
      boolean first = true;
7813
 
7814
      sb.append("success:");
7815
      if (this.success == null) {
7816
        sb.append("null");
7817
      } else {
7818
        sb.append(this.success);
7819
      }
7820
      first = false;
7821
      sb.append(")");
7822
      return sb.toString();
7823
    }
7824
 
7825
    public void validate() throws TException {
7826
      // check for required fields
7827
    }
7828
 
7829
  }
7830
 
1982 varun.gupt 7831
}