Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1982 varun.gupt 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1982 varun.gupt 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;
3430 rajveer 18
import java.nio.ByteBuffer;
1982 varun.gupt 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PromotionService {
24
 
25
  /**
26
   * Promotion Service
27
   */
3374 rajveer 28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
1982 varun.gupt 29
 
3430 rajveer 30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 31
 
6301 amit.gupta 32
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
33
 
34
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
35
 
6356 amit.gupta 36
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException;
37
 
3430 rajveer 38
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 39
 
3430 rajveer 40
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3430 rajveer 44
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 45
 
3430 rajveer 46
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 47
 
3430 rajveer 48
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 49
 
3385 varun.gupt 50
    /**
51
     * Returns a list of active coupons
52
     */
3430 rajveer 53
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 54
 
55
    /**
6250 amit.gupta 56
     * Creates a coupon and returns couponcode if successfully created
57
     * 
58
     * @param promotionId
59
     * @param endOn
60
     * @param email
61
     * @param amount
6356 amit.gupta 62
     * @param isCod
6250 amit.gupta 63
     * @param usage
64
     */
6356 amit.gupta 65
    public String createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 66
 
67
    /**
3385 varun.gupt 68
     * Returns the count of successful payments done using a given coupon
69
     * 
70
     * @param couponCode
71
     */
3430 rajveer 72
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 73
 
74
    /**
75
     * Returns the doc string of the rule module
76
     * 
77
     * @param ruleName
78
     */
3430 rajveer 79
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 80
 
4189 varun.gupt 81
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
82
 
4494 varun.gupt 83
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
84
 
5469 rajveer 85
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
86
 
87
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
88
 
89
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
90
 
1982 varun.gupt 91
  }
92
 
3430 rajveer 93
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 94
 
3430 rajveer 95
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPromotion_call> resultHandler) throws org.apache.thrift.TException;
1982 varun.gupt 96
 
6301 amit.gupta 97
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
98
 
99
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
100
 
6356 amit.gupta 101
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
102
 
3430 rajveer 103
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
104
 
105
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
106
 
107
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
108
 
109
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
110
 
111
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
112
 
113
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
114
 
115
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
116
 
6356 amit.gupta 117
    public void createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 118
 
3430 rajveer 119
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
120
 
121
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
122
 
4189 varun.gupt 123
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
124
 
4494 varun.gupt 125
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
126
 
5469 rajveer 127
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
128
 
129
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.assignVoucher_call> resultHandler) throws org.apache.thrift.TException;
130
 
131
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
132
 
3430 rajveer 133
  }
134
 
135
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
136
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
137
      public Factory() {}
138
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
139
        return new Client(prot);
140
      }
141
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
142
        return new Client(iprot, oprot);
143
      }
1982 varun.gupt 144
    }
145
 
3430 rajveer 146
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 147
    {
3430 rajveer 148
      super(prot, prot);
1982 varun.gupt 149
    }
150
 
3430 rajveer 151
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
152
      super(iprot, oprot);
1982 varun.gupt 153
    }
154
 
3430 rajveer 155
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 156
    {
157
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
158
      recv_createPromotion();
159
    }
160
 
3430 rajveer 161
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 162
    {
163
      createPromotion_args args = new createPromotion_args();
3430 rajveer 164
      args.setName(name);
165
      args.setRuleExecutionSrc(ruleExecutionSrc);
166
      args.setStartOn(startOn);
167
      args.setEndOn(endOn);
168
      sendBase("createPromotion", args);
1982 varun.gupt 169
    }
170
 
3430 rajveer 171
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 172
    {
173
      createPromotion_result result = new createPromotion_result();
3430 rajveer 174
      receiveBase(result, "createPromotion");
1982 varun.gupt 175
      if (result.pex != null) {
176
        throw result.pex;
177
      }
178
      return;
179
    }
180
 
6301 amit.gupta 181
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
182
    {
183
      send_getCoupon(couponCode);
184
      return recv_getCoupon();
185
    }
186
 
187
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
188
    {
189
      getCoupon_args args = new getCoupon_args();
190
      args.setCouponCode(couponCode);
191
      sendBase("getCoupon", args);
192
    }
193
 
194
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
195
    {
196
      getCoupon_result result = new getCoupon_result();
197
      receiveBase(result, "getCoupon");
198
      if (result.isSetSuccess()) {
199
        return result.success;
200
      }
201
      if (result.pex != null) {
202
        throw result.pex;
203
      }
204
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
205
    }
206
 
207
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
208
    {
209
      send_isGiftVoucher(couponCode);
210
      return recv_isGiftVoucher();
211
    }
212
 
213
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
214
    {
215
      isGiftVoucher_args args = new isGiftVoucher_args();
216
      args.setCouponCode(couponCode);
217
      sendBase("isGiftVoucher", args);
218
    }
219
 
220
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
221
    {
222
      isGiftVoucher_result result = new isGiftVoucher_result();
223
      receiveBase(result, "isGiftVoucher");
224
      if (result.isSetSuccess()) {
225
        return result.success;
226
      }
227
      if (result.pex != null) {
228
        throw result.pex;
229
      }
230
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
231
    }
232
 
6356 amit.gupta 233
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
234
    {
235
      send_isCodApplicable(couponCode);
236
      return recv_isCodApplicable();
237
    }
238
 
239
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
240
    {
241
      isCodApplicable_args args = new isCodApplicable_args();
242
      args.setCouponCode(couponCode);
243
      sendBase("isCodApplicable", args);
244
    }
245
 
246
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
247
    {
248
      isCodApplicable_result result = new isCodApplicable_result();
249
      receiveBase(result, "isCodApplicable");
250
      if (result.isSetSuccess()) {
251
        return result.success;
252
      }
253
      if (result.pex != null) {
254
        throw result.pex;
255
      }
256
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
257
    }
258
 
3430 rajveer 259
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 260
    {
261
      send_getAllPromotions();
262
      return recv_getAllPromotions();
263
    }
264
 
3430 rajveer 265
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 266
    {
267
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 268
      sendBase("getAllPromotions", args);
1982 varun.gupt 269
    }
270
 
3430 rajveer 271
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 272
    {
273
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 274
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 275
      if (result.isSetSuccess()) {
276
        return result.success;
277
      }
278
      if (result.pex != null) {
279
        throw result.pex;
280
      }
3430 rajveer 281
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 282
    }
283
 
3430 rajveer 284
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 285
    {
286
      send_getPromotionById(promotionId);
287
      return recv_getPromotionById();
288
    }
289
 
3430 rajveer 290
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 291
    {
292
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 293
      args.setPromotionId(promotionId);
294
      sendBase("getPromotionById", args);
1982 varun.gupt 295
    }
296
 
3430 rajveer 297
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 298
    {
299
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 300
      receiveBase(result, "getPromotionById");
1982 varun.gupt 301
      if (result.isSetSuccess()) {
302
        return result.success;
303
      }
304
      if (result.pex != null) {
305
        throw result.pex;
306
      }
3430 rajveer 307
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 308
    }
309
 
3430 rajveer 310
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 311
    {
312
      send_generateCouponsForPromotion(promotionId, couponCode);
313
      recv_generateCouponsForPromotion();
314
    }
315
 
3430 rajveer 316
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 317
    {
318
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 319
      args.setPromotionId(promotionId);
320
      args.setCouponCode(couponCode);
321
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 322
    }
323
 
3430 rajveer 324
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 325
    {
326
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 327
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 328
      if (result.pex != null) {
329
        throw result.pex;
330
      }
331
      return;
332
    }
333
 
3430 rajveer 334
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 335
    {
336
      send_applyCoupon(couponCode, cartId);
337
      return recv_applyCoupon();
338
    }
339
 
3430 rajveer 340
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 341
    {
342
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 343
      args.setCouponCode(couponCode);
344
      args.setCartId(cartId);
345
      sendBase("applyCoupon", args);
1982 varun.gupt 346
    }
347
 
3430 rajveer 348
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 349
    {
350
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 351
      receiveBase(result, "applyCoupon");
1982 varun.gupt 352
      if (result.isSetSuccess()) {
353
        return result.success;
354
      }
355
      if (result.pex != null) {
356
        throw result.pex;
357
      }
3430 rajveer 358
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 359
    }
360
 
3430 rajveer 361
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 362
    {
363
      send_trackCouponUsage(couponCode, transactionId, userId);
364
      recv_trackCouponUsage();
365
    }
366
 
3430 rajveer 367
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 368
    {
369
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 370
      args.setCouponCode(couponCode);
371
      args.setTransactionId(transactionId);
372
      args.setUserId(userId);
373
      sendBase("trackCouponUsage", args);
1982 varun.gupt 374
    }
375
 
3430 rajveer 376
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 377
    {
378
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 379
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 380
      if (result.pex != null) {
381
        throw result.pex;
382
      }
383
      return;
384
    }
385
 
3430 rajveer 386
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 387
    {
388
      send_getCouponUsageCountByUser(couponCode, userId);
389
      return recv_getCouponUsageCountByUser();
390
    }
391
 
3430 rajveer 392
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 393
    {
394
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 395
      args.setCouponCode(couponCode);
396
      args.setUserId(userId);
397
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 398
    }
399
 
3430 rajveer 400
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 401
    {
402
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 403
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 404
      if (result.isSetSuccess()) {
405
        return result.success;
406
      }
407
      if (result.pex != null) {
408
        throw result.pex;
409
      }
3430 rajveer 410
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 411
    }
412
 
3430 rajveer 413
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 414
    {
415
      send_getActiveCoupons();
416
      return recv_getActiveCoupons();
417
    }
418
 
3430 rajveer 419
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 420
    {
421
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 422
      sendBase("getActiveCoupons", args);
3385 varun.gupt 423
    }
424
 
3430 rajveer 425
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 426
    {
427
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 428
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 429
      if (result.isSetSuccess()) {
430
        return result.success;
431
      }
432
      if (result.pex != null) {
433
        throw result.pex;
434
      }
3430 rajveer 435
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 436
    }
437
 
6356 amit.gupta 438
    public String createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 439
    {
6356 amit.gupta 440
      send_createCoupon(promotionId, endOn, email, amount, isCod, usage);
6250 amit.gupta 441
      return recv_createCoupon();
442
    }
443
 
6356 amit.gupta 444
    public void send_createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage) throws org.apache.thrift.TException
6250 amit.gupta 445
    {
446
      createCoupon_args args = new createCoupon_args();
447
      args.setPromotionId(promotionId);
448
      args.setEndOn(endOn);
449
      args.setEmail(email);
450
      args.setAmount(amount);
6356 amit.gupta 451
      args.setIsCod(isCod);
6250 amit.gupta 452
      args.setUsage(usage);
453
      sendBase("createCoupon", args);
454
    }
455
 
456
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
457
    {
458
      createCoupon_result result = new createCoupon_result();
459
      receiveBase(result, "createCoupon");
460
      if (result.isSetSuccess()) {
461
        return result.success;
462
      }
463
      if (result.pex != null) {
464
        throw result.pex;
465
      }
466
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
467
    }
468
 
3430 rajveer 469
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 470
    {
471
      send_getSuccessfulPaymentCountForCoupon(couponCode);
472
      return recv_getSuccessfulPaymentCountForCoupon();
473
    }
474
 
3430 rajveer 475
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 476
    {
477
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 478
      args.setCouponCode(couponCode);
479
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 480
    }
481
 
3430 rajveer 482
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 483
    {
484
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 485
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 486
      if (result.isSetSuccess()) {
487
        return result.success;
488
      }
489
      if (result.pex != null) {
490
        throw result.pex;
491
      }
3430 rajveer 492
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 493
    }
494
 
3430 rajveer 495
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 496
    {
497
      send_getRuleDocString(ruleName);
498
      return recv_getRuleDocString();
499
    }
500
 
3430 rajveer 501
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 502
    {
503
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 504
      args.setRuleName(ruleName);
505
      sendBase("getRuleDocString", args);
3385 varun.gupt 506
    }
507
 
3430 rajveer 508
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 509
    {
510
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 511
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 512
      if (result.isSetSuccess()) {
513
        return result.success;
514
      }
3430 rajveer 515
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 516
    }
517
 
4189 varun.gupt 518
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
519
    {
520
      send_getItemDiscountMap(itemIds);
521
      return recv_getItemDiscountMap();
522
    }
523
 
524
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
525
    {
526
      getItemDiscountMap_args args = new getItemDiscountMap_args();
527
      args.setItemIds(itemIds);
528
      sendBase("getItemDiscountMap", args);
529
    }
530
 
531
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
532
    {
533
      getItemDiscountMap_result result = new getItemDiscountMap_result();
534
      receiveBase(result, "getItemDiscountMap");
535
      if (result.isSetSuccess()) {
536
        return result.success;
537
      }
538
      if (result.pex != null) {
539
        throw result.pex;
540
      }
541
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
542
    }
543
 
4494 varun.gupt 544
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
545
    {
546
      send_getDiscountsForEntity(entityId);
547
      return recv_getDiscountsForEntity();
548
    }
549
 
550
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
551
    {
552
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
553
      args.setEntityId(entityId);
554
      sendBase("getDiscountsForEntity", args);
555
    }
556
 
557
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
558
    {
559
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
560
      receiveBase(result, "getDiscountsForEntity");
561
      if (result.isSetSuccess()) {
562
        return result.success;
563
      }
564
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
565
    }
566
 
5469 rajveer 567
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
568
    {
569
      send_addVoucher(voucher);
570
      recv_addVoucher();
571
    }
572
 
573
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
574
    {
575
      addVoucher_args args = new addVoucher_args();
576
      args.setVoucher(voucher);
577
      sendBase("addVoucher", args);
578
    }
579
 
580
    public void recv_addVoucher() throws org.apache.thrift.TException
581
    {
582
      addVoucher_result result = new addVoucher_result();
583
      receiveBase(result, "addVoucher");
584
      return;
585
    }
586
 
587
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
588
    {
589
      send_assignVoucher(userId, userEmail, voucherType, amount);
590
      return recv_assignVoucher();
591
    }
592
 
593
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
594
    {
595
      assignVoucher_args args = new assignVoucher_args();
596
      args.setUserId(userId);
597
      args.setUserEmail(userEmail);
598
      args.setVoucherType(voucherType);
599
      args.setAmount(amount);
600
      sendBase("assignVoucher", args);
601
    }
602
 
603
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
604
    {
605
      assignVoucher_result result = new assignVoucher_result();
606
      receiveBase(result, "assignVoucher");
607
      if (result.isSetSuccess()) {
608
        return result.success;
609
      }
610
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
611
    }
612
 
613
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
614
    {
615
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
616
      return recv_markVoucherAsRedeemed();
617
    }
618
 
619
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
620
    {
621
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
622
      args.setVoucherCode(voucherCode);
623
      args.setRedeemedOn(redeemedOn);
624
      sendBase("markVoucherAsRedeemed", args);
625
    }
626
 
627
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
628
    {
629
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
630
      receiveBase(result, "markVoucherAsRedeemed");
631
      if (result.isSetSuccess()) {
632
        return result.success;
633
      }
634
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
635
    }
636
 
1982 varun.gupt 637
  }
3430 rajveer 638
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
639
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
640
      private org.apache.thrift.async.TAsyncClientManager clientManager;
641
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
642
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
643
        this.clientManager = clientManager;
644
        this.protocolFactory = protocolFactory;
645
      }
646
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
647
        return new AsyncClient(protocolFactory, clientManager, transport);
648
      }
1982 varun.gupt 649
    }
650
 
3430 rajveer 651
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
652
      super(protocolFactory, clientManager, transport);
653
    }
1982 varun.gupt 654
 
3430 rajveer 655
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
656
      checkReady();
657
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
658
      this.___currentMethod = method_call;
659
      ___manager.call(method_call);
1982 varun.gupt 660
    }
661
 
3430 rajveer 662
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
663
      private String name;
664
      private String ruleExecutionSrc;
665
      private long startOn;
666
      private long endOn;
667
      public createPromotion_call(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
668
        super(client, protocolFactory, transport, resultHandler, false);
669
        this.name = name;
670
        this.ruleExecutionSrc = ruleExecutionSrc;
671
        this.startOn = startOn;
672
        this.endOn = endOn;
1982 varun.gupt 673
      }
674
 
3430 rajveer 675
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
676
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 677
        createPromotion_args args = new createPromotion_args();
3430 rajveer 678
        args.setName(name);
679
        args.setRuleExecutionSrc(ruleExecutionSrc);
680
        args.setStartOn(startOn);
681
        args.setEndOn(endOn);
682
        args.write(prot);
683
        prot.writeMessageEnd();
1982 varun.gupt 684
      }
685
 
3430 rajveer 686
      public void getResult() throws PromotionException, org.apache.thrift.TException {
687
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
688
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 689
        }
3430 rajveer 690
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
691
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
692
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 693
      }
3430 rajveer 694
    }
1982 varun.gupt 695
 
6301 amit.gupta 696
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
697
      checkReady();
698
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
699
      this.___currentMethod = method_call;
700
      ___manager.call(method_call);
701
    }
702
 
703
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
704
      private String couponCode;
705
      public getCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
706
        super(client, protocolFactory, transport, resultHandler, false);
707
        this.couponCode = couponCode;
708
      }
709
 
710
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
711
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
712
        getCoupon_args args = new getCoupon_args();
713
        args.setCouponCode(couponCode);
714
        args.write(prot);
715
        prot.writeMessageEnd();
716
      }
717
 
718
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
719
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
720
          throw new IllegalStateException("Method call not finished!");
721
        }
722
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
723
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
724
        return (new Client(prot)).recv_getCoupon();
725
      }
726
    }
727
 
728
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
729
      checkReady();
730
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
731
      this.___currentMethod = method_call;
732
      ___manager.call(method_call);
733
    }
734
 
735
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
736
      private String couponCode;
737
      public isGiftVoucher_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
738
        super(client, protocolFactory, transport, resultHandler, false);
739
        this.couponCode = couponCode;
740
      }
741
 
742
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
743
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
744
        isGiftVoucher_args args = new isGiftVoucher_args();
745
        args.setCouponCode(couponCode);
746
        args.write(prot);
747
        prot.writeMessageEnd();
748
      }
749
 
750
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
751
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
752
          throw new IllegalStateException("Method call not finished!");
753
        }
754
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
755
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
756
        return (new Client(prot)).recv_isGiftVoucher();
757
      }
758
    }
759
 
6356 amit.gupta 760
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
761
      checkReady();
762
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
763
      this.___currentMethod = method_call;
764
      ___manager.call(method_call);
765
    }
766
 
767
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
768
      private String couponCode;
769
      public isCodApplicable_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
770
        super(client, protocolFactory, transport, resultHandler, false);
771
        this.couponCode = couponCode;
772
      }
773
 
774
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
775
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
776
        isCodApplicable_args args = new isCodApplicable_args();
777
        args.setCouponCode(couponCode);
778
        args.write(prot);
779
        prot.writeMessageEnd();
780
      }
781
 
782
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
783
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
784
          throw new IllegalStateException("Method call not finished!");
785
        }
786
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
787
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
788
        return (new Client(prot)).recv_isCodApplicable();
789
      }
790
    }
791
 
3430 rajveer 792
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
793
      checkReady();
794
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
795
      this.___currentMethod = method_call;
796
      ___manager.call(method_call);
1982 varun.gupt 797
    }
798
 
3430 rajveer 799
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
800
      public getAllPromotions_call(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
801
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 802
      }
803
 
3430 rajveer 804
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
805
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
806
        getAllPromotions_args args = new getAllPromotions_args();
807
        args.write(prot);
808
        prot.writeMessageEnd();
809
      }
1982 varun.gupt 810
 
3430 rajveer 811
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
812
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
813
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 814
        }
3430 rajveer 815
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
816
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
817
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 818
      }
3430 rajveer 819
    }
1982 varun.gupt 820
 
3430 rajveer 821
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
822
      checkReady();
823
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
824
      this.___currentMethod = method_call;
825
      ___manager.call(method_call);
1982 varun.gupt 826
    }
827
 
3430 rajveer 828
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
829
      private long promotionId;
830
      public getPromotionById_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
831
        super(client, protocolFactory, transport, resultHandler, false);
832
        this.promotionId = promotionId;
1982 varun.gupt 833
      }
834
 
3430 rajveer 835
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
836
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
837
        getPromotionById_args args = new getPromotionById_args();
838
        args.setPromotionId(promotionId);
839
        args.write(prot);
840
        prot.writeMessageEnd();
841
      }
1982 varun.gupt 842
 
3430 rajveer 843
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
844
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
845
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 846
        }
3430 rajveer 847
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
848
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
849
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 850
      }
3430 rajveer 851
    }
1982 varun.gupt 852
 
3430 rajveer 853
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
854
      checkReady();
855
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
856
      this.___currentMethod = method_call;
857
      ___manager.call(method_call);
1982 varun.gupt 858
    }
859
 
3430 rajveer 860
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
861
      private long promotionId;
862
      private String couponCode;
863
      public generateCouponsForPromotion_call(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
864
        super(client, protocolFactory, transport, resultHandler, false);
865
        this.promotionId = promotionId;
866
        this.couponCode = couponCode;
1982 varun.gupt 867
      }
868
 
3430 rajveer 869
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
870
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
871
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
872
        args.setPromotionId(promotionId);
873
        args.setCouponCode(couponCode);
874
        args.write(prot);
875
        prot.writeMessageEnd();
3385 varun.gupt 876
      }
877
 
3430 rajveer 878
      public void getResult() throws PromotionException, org.apache.thrift.TException {
879
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
880
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 881
        }
3430 rajveer 882
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
883
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
884
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 885
      }
886
    }
887
 
3430 rajveer 888
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
889
      checkReady();
890
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
891
      this.___currentMethod = method_call;
892
      ___manager.call(method_call);
3385 varun.gupt 893
    }
894
 
3430 rajveer 895
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
896
      private String couponCode;
897
      private long cartId;
898
      public applyCoupon_call(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
899
        super(client, protocolFactory, transport, resultHandler, false);
900
        this.couponCode = couponCode;
901
        this.cartId = cartId;
1982 varun.gupt 902
      }
903
 
3430 rajveer 904
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
905
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
906
        applyCoupon_args args = new applyCoupon_args();
907
        args.setCouponCode(couponCode);
908
        args.setCartId(cartId);
909
        args.write(prot);
910
        prot.writeMessageEnd();
1982 varun.gupt 911
      }
912
 
3430 rajveer 913
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
914
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
915
          throw new IllegalStateException("Method call not finished!");
916
        }
917
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
918
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
919
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 920
      }
3430 rajveer 921
    }
1982 varun.gupt 922
 
3430 rajveer 923
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
924
      checkReady();
925
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
926
      this.___currentMethod = method_call;
927
      ___manager.call(method_call);
928
    }
1982 varun.gupt 929
 
3430 rajveer 930
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
931
      private String couponCode;
932
      private long transactionId;
933
      private long userId;
934
      public trackCouponUsage_call(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
935
        super(client, protocolFactory, transport, resultHandler, false);
936
        this.couponCode = couponCode;
937
        this.transactionId = transactionId;
938
        this.userId = userId;
1982 varun.gupt 939
      }
940
 
3430 rajveer 941
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
942
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
943
        trackCouponUsage_args args = new trackCouponUsage_args();
944
        args.setCouponCode(couponCode);
945
        args.setTransactionId(transactionId);
946
        args.setUserId(userId);
947
        args.write(prot);
948
        prot.writeMessageEnd();
1982 varun.gupt 949
      }
950
 
3430 rajveer 951
      public void getResult() throws PromotionException, org.apache.thrift.TException {
952
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
953
          throw new IllegalStateException("Method call not finished!");
954
        }
955
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
956
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
957
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 958
      }
959
    }
960
 
3430 rajveer 961
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
962
      checkReady();
963
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
964
      this.___currentMethod = method_call;
965
      ___manager.call(method_call);
1982 varun.gupt 966
    }
967
 
3430 rajveer 968
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
969
      private String couponCode;
970
      private long userId;
971
      public getCouponUsageCountByUser_call(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
972
        super(client, protocolFactory, transport, resultHandler, false);
973
        this.couponCode = couponCode;
974
        this.userId = userId;
975
      }
1982 varun.gupt 976
 
3430 rajveer 977
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
978
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
979
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
980
        args.setCouponCode(couponCode);
981
        args.setUserId(userId);
982
        args.write(prot);
983
        prot.writeMessageEnd();
984
      }
1982 varun.gupt 985
 
3430 rajveer 986
      public long getResult() throws PromotionException, org.apache.thrift.TException {
987
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
988
          throw new IllegalStateException("Method call not finished!");
989
        }
990
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
991
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
992
        return (new Client(prot)).recv_getCouponUsageCountByUser();
993
      }
1982 varun.gupt 994
    }
995
 
3430 rajveer 996
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
997
      checkReady();
998
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
999
      this.___currentMethod = method_call;
1000
      ___manager.call(method_call);
1982 varun.gupt 1001
    }
1002
 
3430 rajveer 1003
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1004
      public getActiveCoupons_call(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1005
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1006
      }
1007
 
3430 rajveer 1008
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1009
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1010
        getActiveCoupons_args args = new getActiveCoupons_args();
1011
        args.write(prot);
1012
        prot.writeMessageEnd();
1013
      }
1982 varun.gupt 1014
 
3430 rajveer 1015
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1016
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1017
          throw new IllegalStateException("Method call not finished!");
1018
        }
1019
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1020
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1021
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1022
      }
1023
    }
1024
 
6356 amit.gupta 1025
    public void createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1026
      checkReady();
6356 amit.gupta 1027
      createCoupon_call method_call = new createCoupon_call(promotionId, endOn, email, amount, isCod, usage, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1028
      this.___currentMethod = method_call;
1029
      ___manager.call(method_call);
1030
    }
1031
 
1032
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1033
      private long promotionId;
1034
      private long endOn;
1035
      private String email;
1036
      private long amount;
6356 amit.gupta 1037
      private boolean isCod;
6250 amit.gupta 1038
      private long usage;
6356 amit.gupta 1039
      public createCoupon_call(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
6250 amit.gupta 1040
        super(client, protocolFactory, transport, resultHandler, false);
1041
        this.promotionId = promotionId;
1042
        this.endOn = endOn;
1043
        this.email = email;
1044
        this.amount = amount;
6356 amit.gupta 1045
        this.isCod = isCod;
6250 amit.gupta 1046
        this.usage = usage;
1047
      }
1048
 
1049
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1050
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1051
        createCoupon_args args = new createCoupon_args();
1052
        args.setPromotionId(promotionId);
1053
        args.setEndOn(endOn);
1054
        args.setEmail(email);
1055
        args.setAmount(amount);
6356 amit.gupta 1056
        args.setIsCod(isCod);
6250 amit.gupta 1057
        args.setUsage(usage);
1058
        args.write(prot);
1059
        prot.writeMessageEnd();
1060
      }
1061
 
1062
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1063
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1064
          throw new IllegalStateException("Method call not finished!");
1065
        }
1066
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1067
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1068
        return (new Client(prot)).recv_createCoupon();
1069
      }
1070
    }
1071
 
3430 rajveer 1072
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1073
      checkReady();
1074
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1075
      this.___currentMethod = method_call;
1076
      ___manager.call(method_call);
1982 varun.gupt 1077
    }
1078
 
3430 rajveer 1079
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1080
      private String couponCode;
1081
      public getSuccessfulPaymentCountForCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1082
        super(client, protocolFactory, transport, resultHandler, false);
1083
        this.couponCode = couponCode;
1982 varun.gupt 1084
      }
1085
 
3430 rajveer 1086
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1087
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1088
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1089
        args.setCouponCode(couponCode);
1090
        args.write(prot);
1091
        prot.writeMessageEnd();
1092
      }
1982 varun.gupt 1093
 
3430 rajveer 1094
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1095
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1096
          throw new IllegalStateException("Method call not finished!");
1097
        }
1098
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1099
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1100
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1101
      }
1982 varun.gupt 1102
    }
1103
 
3430 rajveer 1104
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1105
      checkReady();
1106
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1107
      this.___currentMethod = method_call;
1108
      ___manager.call(method_call);
1982 varun.gupt 1109
    }
1110
 
3430 rajveer 1111
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1112
      private String ruleName;
1113
      public getRuleDocString_call(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1114
        super(client, protocolFactory, transport, resultHandler, false);
1115
        this.ruleName = ruleName;
1116
      }
1982 varun.gupt 1117
 
3430 rajveer 1118
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1119
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1120
        getRuleDocString_args args = new getRuleDocString_args();
1121
        args.setRuleName(ruleName);
1122
        args.write(prot);
1123
        prot.writeMessageEnd();
1982 varun.gupt 1124
      }
1125
 
3430 rajveer 1126
      public String getResult() throws org.apache.thrift.TException {
1127
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1128
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1129
        }
3430 rajveer 1130
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1131
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1132
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1133
      }
1134
    }
1135
 
4189 varun.gupt 1136
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1137
      checkReady();
1138
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1139
      this.___currentMethod = method_call;
1140
      ___manager.call(method_call);
1141
    }
1142
 
1143
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1144
      private List<Long> itemIds;
1145
      public getItemDiscountMap_call(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1146
        super(client, protocolFactory, transport, resultHandler, false);
1147
        this.itemIds = itemIds;
1148
      }
1149
 
1150
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1151
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1152
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1153
        args.setItemIds(itemIds);
1154
        args.write(prot);
1155
        prot.writeMessageEnd();
1156
      }
1157
 
1158
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1159
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1160
          throw new IllegalStateException("Method call not finished!");
1161
        }
1162
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1163
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1164
        return (new Client(prot)).recv_getItemDiscountMap();
1165
      }
1166
    }
1167
 
4494 varun.gupt 1168
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1169
      checkReady();
1170
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1171
      this.___currentMethod = method_call;
1172
      ___manager.call(method_call);
1173
    }
1174
 
1175
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1176
      private long entityId;
1177
      public getDiscountsForEntity_call(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1178
        super(client, protocolFactory, transport, resultHandler, false);
1179
        this.entityId = entityId;
1180
      }
1181
 
1182
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1183
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1184
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1185
        args.setEntityId(entityId);
1186
        args.write(prot);
1187
        prot.writeMessageEnd();
1188
      }
1189
 
1190
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1191
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1192
          throw new IllegalStateException("Method call not finished!");
1193
        }
1194
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1195
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1196
        return (new Client(prot)).recv_getDiscountsForEntity();
1197
      }
1198
    }
1199
 
5469 rajveer 1200
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1201
      checkReady();
1202
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1203
      this.___currentMethod = method_call;
1204
      ___manager.call(method_call);
1205
    }
1206
 
1207
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1208
      private Voucher voucher;
1209
      public addVoucher_call(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1210
        super(client, protocolFactory, transport, resultHandler, false);
1211
        this.voucher = voucher;
1212
      }
1213
 
1214
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1215
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1216
        addVoucher_args args = new addVoucher_args();
1217
        args.setVoucher(voucher);
1218
        args.write(prot);
1219
        prot.writeMessageEnd();
1220
      }
1221
 
1222
      public void getResult() throws org.apache.thrift.TException {
1223
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1224
          throw new IllegalStateException("Method call not finished!");
1225
        }
1226
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1227
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1228
        (new Client(prot)).recv_addVoucher();
1229
      }
1230
    }
1231
 
1232
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1233
      checkReady();
1234
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1235
      this.___currentMethod = method_call;
1236
      ___manager.call(method_call);
1237
    }
1238
 
1239
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1240
      private long userId;
1241
      private String userEmail;
1242
      private VoucherType voucherType;
1243
      private long amount;
1244
      public assignVoucher_call(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1245
        super(client, protocolFactory, transport, resultHandler, false);
1246
        this.userId = userId;
1247
        this.userEmail = userEmail;
1248
        this.voucherType = voucherType;
1249
        this.amount = amount;
1250
      }
1251
 
1252
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1253
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1254
        assignVoucher_args args = new assignVoucher_args();
1255
        args.setUserId(userId);
1256
        args.setUserEmail(userEmail);
1257
        args.setVoucherType(voucherType);
1258
        args.setAmount(amount);
1259
        args.write(prot);
1260
        prot.writeMessageEnd();
1261
      }
1262
 
1263
      public Voucher getResult() throws org.apache.thrift.TException {
1264
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1265
          throw new IllegalStateException("Method call not finished!");
1266
        }
1267
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1268
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1269
        return (new Client(prot)).recv_assignVoucher();
1270
      }
1271
    }
1272
 
1273
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1274
      checkReady();
1275
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1276
      this.___currentMethod = method_call;
1277
      ___manager.call(method_call);
1278
    }
1279
 
1280
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1281
      private String voucherCode;
1282
      private long redeemedOn;
1283
      public markVoucherAsRedeemed_call(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1284
        super(client, protocolFactory, transport, resultHandler, false);
1285
        this.voucherCode = voucherCode;
1286
        this.redeemedOn = redeemedOn;
1287
      }
1288
 
1289
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1290
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1291
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1292
        args.setVoucherCode(voucherCode);
1293
        args.setRedeemedOn(redeemedOn);
1294
        args.write(prot);
1295
        prot.writeMessageEnd();
1296
      }
1297
 
1298
      public boolean getResult() throws org.apache.thrift.TException {
1299
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1300
          throw new IllegalStateException("Method call not finished!");
1301
        }
1302
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1303
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1304
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1305
      }
1306
    }
1307
 
3430 rajveer 1308
  }
1982 varun.gupt 1309
 
3430 rajveer 1310
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1311
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1312
    public Processor(I iface) {
1313
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1314
    }
1315
 
3430 rajveer 1316
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1317
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1318
    }
1319
 
3430 rajveer 1320
    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1321
      processMap.put("createPromotion", new createPromotion());
6301 amit.gupta 1322
      processMap.put("getCoupon", new getCoupon());
1323
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1324
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1325
      processMap.put("getAllPromotions", new getAllPromotions());
1326
      processMap.put("getPromotionById", new getPromotionById());
1327
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1328
      processMap.put("applyCoupon", new applyCoupon());
1329
      processMap.put("trackCouponUsage", new trackCouponUsage());
1330
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
1331
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1332
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1333
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1334
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1335
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1336
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1337
      processMap.put("addVoucher", new addVoucher());
1338
      processMap.put("assignVoucher", new assignVoucher());
1339
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1340
      return processMap;
1982 varun.gupt 1341
    }
1342
 
3430 rajveer 1343
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1344
      public createPromotion() {
1345
        super("createPromotion");
1346
      }
1982 varun.gupt 1347
 
3430 rajveer 1348
      protected createPromotion_args getEmptyArgsInstance() {
1349
        return new createPromotion_args();
1350
      }
1982 varun.gupt 1351
 
3430 rajveer 1352
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1353
        createPromotion_result result = new createPromotion_result();
1354
        try {
1355
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1356
        } catch (PromotionException pex) {
1357
          result.pex = pex;
1982 varun.gupt 1358
        }
3430 rajveer 1359
        return result;
1982 varun.gupt 1360
      }
3430 rajveer 1361
    }
1982 varun.gupt 1362
 
6301 amit.gupta 1363
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1364
      public getCoupon() {
1365
        super("getCoupon");
1366
      }
1367
 
1368
      protected getCoupon_args getEmptyArgsInstance() {
1369
        return new getCoupon_args();
1370
      }
1371
 
1372
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1373
        getCoupon_result result = new getCoupon_result();
1374
        try {
1375
          result.success = iface.getCoupon(args.couponCode);
1376
        } catch (PromotionException pex) {
1377
          result.pex = pex;
1378
        }
1379
        return result;
1380
      }
1381
    }
1382
 
1383
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1384
      public isGiftVoucher() {
1385
        super("isGiftVoucher");
1386
      }
1387
 
1388
      protected isGiftVoucher_args getEmptyArgsInstance() {
1389
        return new isGiftVoucher_args();
1390
      }
1391
 
1392
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1393
        isGiftVoucher_result result = new isGiftVoucher_result();
1394
        try {
1395
          result.success = iface.isGiftVoucher(args.couponCode);
1396
          result.setSuccessIsSet(true);
1397
        } catch (PromotionException pex) {
1398
          result.pex = pex;
1399
        }
1400
        return result;
1401
      }
1402
    }
1403
 
6356 amit.gupta 1404
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1405
      public isCodApplicable() {
1406
        super("isCodApplicable");
1407
      }
1408
 
1409
      protected isCodApplicable_args getEmptyArgsInstance() {
1410
        return new isCodApplicable_args();
1411
      }
1412
 
1413
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1414
        isCodApplicable_result result = new isCodApplicable_result();
1415
        try {
1416
          result.success = iface.isCodApplicable(args.couponCode);
1417
          result.setSuccessIsSet(true);
1418
        } catch (PromotionException pex) {
1419
          result.pex = pex;
1420
        }
1421
        return result;
1422
      }
1423
    }
1424
 
3430 rajveer 1425
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1426
      public getAllPromotions() {
1427
        super("getAllPromotions");
1982 varun.gupt 1428
      }
1429
 
3430 rajveer 1430
      protected getAllPromotions_args getEmptyArgsInstance() {
1431
        return new getAllPromotions_args();
1982 varun.gupt 1432
      }
1433
 
3430 rajveer 1434
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1435
        getAllPromotions_result result = new getAllPromotions_result();
1436
        try {
1437
          result.success = iface.getAllPromotions();
1438
        } catch (PromotionException pex) {
1439
          result.pex = pex;
1440
        }
1441
        return result;
1982 varun.gupt 1442
      }
3430 rajveer 1443
    }
1982 varun.gupt 1444
 
3430 rajveer 1445
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1446
      public getPromotionById() {
1447
        super("getPromotionById");
1982 varun.gupt 1448
      }
1449
 
3430 rajveer 1450
      protected getPromotionById_args getEmptyArgsInstance() {
1451
        return new getPromotionById_args();
1982 varun.gupt 1452
      }
1453
 
3430 rajveer 1454
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1455
        getPromotionById_result result = new getPromotionById_result();
1456
        try {
1457
          result.success = iface.getPromotionById(args.promotionId);
1458
        } catch (PromotionException pex) {
1459
          result.pex = pex;
1460
        }
1461
        return result;
1982 varun.gupt 1462
      }
1463
    }
1464
 
3430 rajveer 1465
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1466
      public generateCouponsForPromotion() {
1467
        super("generateCouponsForPromotion");
1468
      }
1982 varun.gupt 1469
 
3430 rajveer 1470
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1471
        return new generateCouponsForPromotion_args();
1472
      }
1982 varun.gupt 1473
 
3430 rajveer 1474
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1475
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1476
        try {
1477
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1478
        } catch (PromotionException pex) {
1479
          result.pex = pex;
1480
        }
1481
        return result;
1482
      }
1982 varun.gupt 1483
    }
1484
 
3430 rajveer 1485
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1486
      public applyCoupon() {
1487
        super("applyCoupon");
1488
      }
1982 varun.gupt 1489
 
3430 rajveer 1490
      protected applyCoupon_args getEmptyArgsInstance() {
1491
        return new applyCoupon_args();
1492
      }
1982 varun.gupt 1493
 
3430 rajveer 1494
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1495
        applyCoupon_result result = new applyCoupon_result();
1496
        try {
1497
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1498
        } catch (PromotionException pex) {
1499
          result.pex = pex;
1500
        }
1501
        return result;
1982 varun.gupt 1502
      }
1503
    }
1504
 
3430 rajveer 1505
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1506
      public trackCouponUsage() {
1507
        super("trackCouponUsage");
1508
      }
1982 varun.gupt 1509
 
3430 rajveer 1510
      protected trackCouponUsage_args getEmptyArgsInstance() {
1511
        return new trackCouponUsage_args();
1982 varun.gupt 1512
      }
1513
 
3430 rajveer 1514
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1515
        trackCouponUsage_result result = new trackCouponUsage_result();
1516
        try {
1517
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1518
        } catch (PromotionException pex) {
1519
          result.pex = pex;
1520
        }
1521
        return result;
1522
      }
1982 varun.gupt 1523
    }
1524
 
3430 rajveer 1525
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1526
      public getCouponUsageCountByUser() {
1527
        super("getCouponUsageCountByUser");
1982 varun.gupt 1528
      }
1529
 
3430 rajveer 1530
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1531
        return new getCouponUsageCountByUser_args();
1532
      }
1982 varun.gupt 1533
 
3430 rajveer 1534
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1535
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1536
        try {
1537
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1538
          result.setSuccessIsSet(true);
1539
        } catch (PromotionException pex) {
1540
          result.pex = pex;
1541
        }
1542
        return result;
1543
      }
1982 varun.gupt 1544
    }
1545
 
3430 rajveer 1546
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1547
      public getActiveCoupons() {
1548
        super("getActiveCoupons");
1549
      }
1982 varun.gupt 1550
 
3430 rajveer 1551
      protected getActiveCoupons_args getEmptyArgsInstance() {
1552
        return new getActiveCoupons_args();
1553
      }
1982 varun.gupt 1554
 
3430 rajveer 1555
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1556
        getActiveCoupons_result result = new getActiveCoupons_result();
1557
        try {
1558
          result.success = iface.getActiveCoupons();
1559
        } catch (PromotionException pex) {
1560
          result.pex = pex;
1561
        }
1562
        return result;
1563
      }
1982 varun.gupt 1564
    }
1565
 
6250 amit.gupta 1566
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
1567
      public createCoupon() {
1568
        super("createCoupon");
1569
      }
1570
 
1571
      protected createCoupon_args getEmptyArgsInstance() {
1572
        return new createCoupon_args();
1573
      }
1574
 
1575
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
1576
        createCoupon_result result = new createCoupon_result();
1577
        try {
6356 amit.gupta 1578
          result.success = iface.createCoupon(args.promotionId, args.endOn, args.email, args.amount, args.isCod, args.usage);
6250 amit.gupta 1579
        } catch (PromotionException pex) {
1580
          result.pex = pex;
1581
        }
1582
        return result;
1583
      }
1584
    }
1585
 
3430 rajveer 1586
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1587
      public getSuccessfulPaymentCountForCoupon() {
1588
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1589
      }
1590
 
3430 rajveer 1591
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1592
        return new getSuccessfulPaymentCountForCoupon_args();
1593
      }
1982 varun.gupt 1594
 
3430 rajveer 1595
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1596
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1597
        try {
1598
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1599
          result.setSuccessIsSet(true);
1600
        } catch (PromotionException pex) {
1601
          result.pex = pex;
1982 varun.gupt 1602
        }
3430 rajveer 1603
        return result;
1982 varun.gupt 1604
      }
1605
    }
1606
 
3430 rajveer 1607
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1608
      public getRuleDocString() {
1609
        super("getRuleDocString");
1610
      }
1982 varun.gupt 1611
 
3430 rajveer 1612
      protected getRuleDocString_args getEmptyArgsInstance() {
1613
        return new getRuleDocString_args();
1614
      }
1982 varun.gupt 1615
 
3430 rajveer 1616
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1617
        getRuleDocString_result result = new getRuleDocString_result();
1618
        result.success = iface.getRuleDocString(args.ruleName);
1619
        return result;
1620
      }
1982 varun.gupt 1621
    }
1622
 
4189 varun.gupt 1623
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1624
      public getItemDiscountMap() {
1625
        super("getItemDiscountMap");
1626
      }
1627
 
1628
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1629
        return new getItemDiscountMap_args();
1630
      }
1631
 
1632
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1633
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1634
        try {
1635
          result.success = iface.getItemDiscountMap(args.itemIds);
1636
        } catch (PromotionException pex) {
1637
          result.pex = pex;
1638
        }
1639
        return result;
1640
      }
1641
    }
1642
 
4494 varun.gupt 1643
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1644
      public getDiscountsForEntity() {
1645
        super("getDiscountsForEntity");
1646
      }
1647
 
1648
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1649
        return new getDiscountsForEntity_args();
1650
      }
1651
 
1652
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1653
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1654
        result.success = iface.getDiscountsForEntity(args.entityId);
1655
        return result;
1656
      }
1657
    }
1658
 
5469 rajveer 1659
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
1660
      public addVoucher() {
1661
        super("addVoucher");
1662
      }
1663
 
1664
      protected addVoucher_args getEmptyArgsInstance() {
1665
        return new addVoucher_args();
1666
      }
1667
 
1668
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
1669
        addVoucher_result result = new addVoucher_result();
1670
        iface.addVoucher(args.voucher);
1671
        return result;
1672
      }
1673
    }
1674
 
1675
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
1676
      public assignVoucher() {
1677
        super("assignVoucher");
1678
      }
1679
 
1680
      protected assignVoucher_args getEmptyArgsInstance() {
1681
        return new assignVoucher_args();
1682
      }
1683
 
1684
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
1685
        assignVoucher_result result = new assignVoucher_result();
1686
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
1687
        return result;
1688
      }
1689
    }
1690
 
1691
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
1692
      public markVoucherAsRedeemed() {
1693
        super("markVoucherAsRedeemed");
1694
      }
1695
 
1696
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
1697
        return new markVoucherAsRedeemed_args();
1698
      }
1699
 
1700
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
1701
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
1702
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
1703
        result.setSuccessIsSet(true);
1704
        return result;
1705
      }
1706
    }
1707
 
1982 varun.gupt 1708
  }
1709
 
3430 rajveer 1710
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1711
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1712
 
3430 rajveer 1713
    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
1714
    private static final org.apache.thrift.protocol.TField RULE_EXECUTION_SRC_FIELD_DESC = new org.apache.thrift.protocol.TField("ruleExecutionSrc", org.apache.thrift.protocol.TType.STRING, (short)2);
1715
    private static final org.apache.thrift.protocol.TField START_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("startOn", org.apache.thrift.protocol.TType.I64, (short)3);
1716
    private static final org.apache.thrift.protocol.TField END_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("endOn", org.apache.thrift.protocol.TType.I64, (short)4);
1982 varun.gupt 1717
 
3430 rajveer 1718
    private String name; // required
1719
    private String ruleExecutionSrc; // required
1720
    private long startOn; // required
1721
    private long endOn; // required
1982 varun.gupt 1722
 
1723
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1724
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1725
      NAME((short)1, "name"),
1726
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1727
      START_ON((short)3, "startOn"),
1728
      END_ON((short)4, "endOn");
1729
 
1730
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1731
 
1732
      static {
1733
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1734
          byName.put(field.getFieldName(), field);
1735
        }
1736
      }
1737
 
1738
      /**
1739
       * Find the _Fields constant that matches fieldId, or null if its not found.
1740
       */
1741
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1742
        switch(fieldId) {
1743
          case 1: // NAME
1744
            return NAME;
1745
          case 2: // RULE_EXECUTION_SRC
1746
            return RULE_EXECUTION_SRC;
1747
          case 3: // START_ON
1748
            return START_ON;
1749
          case 4: // END_ON
1750
            return END_ON;
1751
          default:
1752
            return null;
1753
        }
1982 varun.gupt 1754
      }
1755
 
1756
      /**
1757
       * Find the _Fields constant that matches fieldId, throwing an exception
1758
       * if it is not found.
1759
       */
1760
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1761
        _Fields fields = findByThriftId(fieldId);
1762
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1763
        return fields;
1764
      }
1765
 
1766
      /**
1767
       * Find the _Fields constant that matches name, or null if its not found.
1768
       */
1769
      public static _Fields findByName(String name) {
1770
        return byName.get(name);
1771
      }
1772
 
1773
      private final short _thriftId;
1774
      private final String _fieldName;
1775
 
1776
      _Fields(short thriftId, String fieldName) {
1777
        _thriftId = thriftId;
1778
        _fieldName = fieldName;
1779
      }
1780
 
1781
      public short getThriftFieldId() {
1782
        return _thriftId;
1783
      }
1784
 
1785
      public String getFieldName() {
1786
        return _fieldName;
1787
      }
1788
    }
1789
 
1790
    // isset id assignments
1791
    private static final int __STARTON_ISSET_ID = 0;
1792
    private static final int __ENDON_ISSET_ID = 1;
1793
    private BitSet __isset_bit_vector = new BitSet(2);
1794
 
3430 rajveer 1795
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1796
    static {
3430 rajveer 1797
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1798
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1799
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1800
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1801
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1802
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1803
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1804
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1805
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1806
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1807
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 1808
    }
1809
 
1810
    public createPromotion_args() {
1811
    }
1812
 
1813
    public createPromotion_args(
1814
      String name,
1815
      String ruleExecutionSrc,
1816
      long startOn,
1817
      long endOn)
1818
    {
1819
      this();
1820
      this.name = name;
1821
      this.ruleExecutionSrc = ruleExecutionSrc;
1822
      this.startOn = startOn;
1823
      setStartOnIsSet(true);
1824
      this.endOn = endOn;
1825
      setEndOnIsSet(true);
1826
    }
1827
 
1828
    /**
1829
     * Performs a deep copy on <i>other</i>.
1830
     */
1831
    public createPromotion_args(createPromotion_args other) {
1832
      __isset_bit_vector.clear();
1833
      __isset_bit_vector.or(other.__isset_bit_vector);
1834
      if (other.isSetName()) {
1835
        this.name = other.name;
1836
      }
1837
      if (other.isSetRuleExecutionSrc()) {
1838
        this.ruleExecutionSrc = other.ruleExecutionSrc;
1839
      }
1840
      this.startOn = other.startOn;
1841
      this.endOn = other.endOn;
1842
    }
1843
 
1844
    public createPromotion_args deepCopy() {
1845
      return new createPromotion_args(this);
1846
    }
1847
 
3430 rajveer 1848
    @Override
1849
    public void clear() {
1850
      this.name = null;
1851
      this.ruleExecutionSrc = null;
1852
      setStartOnIsSet(false);
1853
      this.startOn = 0;
1854
      setEndOnIsSet(false);
1855
      this.endOn = 0;
1982 varun.gupt 1856
    }
1857
 
1858
    public String getName() {
1859
      return this.name;
1860
    }
1861
 
3430 rajveer 1862
    public void setName(String name) {
1982 varun.gupt 1863
      this.name = name;
1864
    }
1865
 
1866
    public void unsetName() {
1867
      this.name = null;
1868
    }
1869
 
3430 rajveer 1870
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1871
    public boolean isSetName() {
1872
      return this.name != null;
1873
    }
1874
 
1875
    public void setNameIsSet(boolean value) {
1876
      if (!value) {
1877
        this.name = null;
1878
      }
1879
    }
1880
 
1881
    public String getRuleExecutionSrc() {
1882
      return this.ruleExecutionSrc;
1883
    }
1884
 
3430 rajveer 1885
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 1886
      this.ruleExecutionSrc = ruleExecutionSrc;
1887
    }
1888
 
1889
    public void unsetRuleExecutionSrc() {
1890
      this.ruleExecutionSrc = null;
1891
    }
1892
 
3430 rajveer 1893
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1894
    public boolean isSetRuleExecutionSrc() {
1895
      return this.ruleExecutionSrc != null;
1896
    }
1897
 
1898
    public void setRuleExecutionSrcIsSet(boolean value) {
1899
      if (!value) {
1900
        this.ruleExecutionSrc = null;
1901
      }
1902
    }
1903
 
1904
    public long getStartOn() {
1905
      return this.startOn;
1906
    }
1907
 
3430 rajveer 1908
    public void setStartOn(long startOn) {
1982 varun.gupt 1909
      this.startOn = startOn;
1910
      setStartOnIsSet(true);
1911
    }
1912
 
1913
    public void unsetStartOn() {
1914
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
1915
    }
1916
 
3430 rajveer 1917
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1918
    public boolean isSetStartOn() {
1919
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
1920
    }
1921
 
1922
    public void setStartOnIsSet(boolean value) {
1923
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
1924
    }
1925
 
1926
    public long getEndOn() {
1927
      return this.endOn;
1928
    }
1929
 
3430 rajveer 1930
    public void setEndOn(long endOn) {
1982 varun.gupt 1931
      this.endOn = endOn;
1932
      setEndOnIsSet(true);
1933
    }
1934
 
1935
    public void unsetEndOn() {
1936
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
1937
    }
1938
 
3430 rajveer 1939
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1940
    public boolean isSetEndOn() {
1941
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
1942
    }
1943
 
1944
    public void setEndOnIsSet(boolean value) {
1945
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
1946
    }
1947
 
1948
    public void setFieldValue(_Fields field, Object value) {
1949
      switch (field) {
1950
      case NAME:
1951
        if (value == null) {
1952
          unsetName();
1953
        } else {
1954
          setName((String)value);
1955
        }
1956
        break;
1957
 
1958
      case RULE_EXECUTION_SRC:
1959
        if (value == null) {
1960
          unsetRuleExecutionSrc();
1961
        } else {
1962
          setRuleExecutionSrc((String)value);
1963
        }
1964
        break;
1965
 
1966
      case START_ON:
1967
        if (value == null) {
1968
          unsetStartOn();
1969
        } else {
1970
          setStartOn((Long)value);
1971
        }
1972
        break;
1973
 
1974
      case END_ON:
1975
        if (value == null) {
1976
          unsetEndOn();
1977
        } else {
1978
          setEndOn((Long)value);
1979
        }
1980
        break;
1981
 
1982
      }
1983
    }
1984
 
1985
    public Object getFieldValue(_Fields field) {
1986
      switch (field) {
1987
      case NAME:
1988
        return getName();
1989
 
1990
      case RULE_EXECUTION_SRC:
1991
        return getRuleExecutionSrc();
1992
 
1993
      case START_ON:
3430 rajveer 1994
        return Long.valueOf(getStartOn());
1982 varun.gupt 1995
 
1996
      case END_ON:
3430 rajveer 1997
        return Long.valueOf(getEndOn());
1982 varun.gupt 1998
 
1999
      }
2000
      throw new IllegalStateException();
2001
    }
2002
 
3430 rajveer 2003
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2004
    public boolean isSet(_Fields field) {
2005
      if (field == null) {
2006
        throw new IllegalArgumentException();
2007
      }
1982 varun.gupt 2008
 
2009
      switch (field) {
2010
      case NAME:
2011
        return isSetName();
2012
      case RULE_EXECUTION_SRC:
2013
        return isSetRuleExecutionSrc();
2014
      case START_ON:
2015
        return isSetStartOn();
2016
      case END_ON:
2017
        return isSetEndOn();
2018
      }
2019
      throw new IllegalStateException();
2020
    }
2021
 
2022
    @Override
2023
    public boolean equals(Object that) {
2024
      if (that == null)
2025
        return false;
2026
      if (that instanceof createPromotion_args)
2027
        return this.equals((createPromotion_args)that);
2028
      return false;
2029
    }
2030
 
2031
    public boolean equals(createPromotion_args that) {
2032
      if (that == null)
2033
        return false;
2034
 
2035
      boolean this_present_name = true && this.isSetName();
2036
      boolean that_present_name = true && that.isSetName();
2037
      if (this_present_name || that_present_name) {
2038
        if (!(this_present_name && that_present_name))
2039
          return false;
2040
        if (!this.name.equals(that.name))
2041
          return false;
2042
      }
2043
 
2044
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2045
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2046
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2047
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2048
          return false;
2049
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2050
          return false;
2051
      }
2052
 
2053
      boolean this_present_startOn = true;
2054
      boolean that_present_startOn = true;
2055
      if (this_present_startOn || that_present_startOn) {
2056
        if (!(this_present_startOn && that_present_startOn))
2057
          return false;
2058
        if (this.startOn != that.startOn)
2059
          return false;
2060
      }
2061
 
2062
      boolean this_present_endOn = true;
2063
      boolean that_present_endOn = true;
2064
      if (this_present_endOn || that_present_endOn) {
2065
        if (!(this_present_endOn && that_present_endOn))
2066
          return false;
2067
        if (this.endOn != that.endOn)
2068
          return false;
2069
      }
2070
 
2071
      return true;
2072
    }
2073
 
2074
    @Override
2075
    public int hashCode() {
2076
      return 0;
2077
    }
2078
 
2079
    public int compareTo(createPromotion_args other) {
2080
      if (!getClass().equals(other.getClass())) {
2081
        return getClass().getName().compareTo(other.getClass().getName());
2082
      }
2083
 
2084
      int lastComparison = 0;
2085
      createPromotion_args typedOther = (createPromotion_args)other;
2086
 
3430 rajveer 2087
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2088
      if (lastComparison != 0) {
2089
        return lastComparison;
2090
      }
3430 rajveer 2091
      if (isSetName()) {
2092
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2093
        if (lastComparison != 0) {
2094
          return lastComparison;
2095
        }
1982 varun.gupt 2096
      }
3430 rajveer 2097
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2098
      if (lastComparison != 0) {
2099
        return lastComparison;
2100
      }
3430 rajveer 2101
      if (isSetRuleExecutionSrc()) {
2102
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2103
        if (lastComparison != 0) {
2104
          return lastComparison;
2105
        }
1982 varun.gupt 2106
      }
3430 rajveer 2107
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2108
      if (lastComparison != 0) {
2109
        return lastComparison;
2110
      }
3430 rajveer 2111
      if (isSetStartOn()) {
2112
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2113
        if (lastComparison != 0) {
2114
          return lastComparison;
2115
        }
1982 varun.gupt 2116
      }
3430 rajveer 2117
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2118
      if (lastComparison != 0) {
2119
        return lastComparison;
2120
      }
3430 rajveer 2121
      if (isSetEndOn()) {
2122
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2123
        if (lastComparison != 0) {
2124
          return lastComparison;
2125
        }
1982 varun.gupt 2126
      }
2127
      return 0;
2128
    }
2129
 
3430 rajveer 2130
    public _Fields fieldForId(int fieldId) {
2131
      return _Fields.findByThriftId(fieldId);
2132
    }
2133
 
2134
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2135
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2136
      iprot.readStructBegin();
2137
      while (true)
2138
      {
2139
        field = iprot.readFieldBegin();
3430 rajveer 2140
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2141
          break;
2142
        }
3430 rajveer 2143
        switch (field.id) {
2144
          case 1: // NAME
2145
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2146
              this.name = iprot.readString();
2147
            } else { 
2148
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2149
            }
2150
            break;
2151
          case 2: // RULE_EXECUTION_SRC
2152
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2153
              this.ruleExecutionSrc = iprot.readString();
2154
            } else { 
2155
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2156
            }
2157
            break;
2158
          case 3: // START_ON
2159
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2160
              this.startOn = iprot.readI64();
2161
              setStartOnIsSet(true);
2162
            } else { 
2163
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2164
            }
2165
            break;
2166
          case 4: // END_ON
2167
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2168
              this.endOn = iprot.readI64();
2169
              setEndOnIsSet(true);
2170
            } else { 
2171
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2172
            }
2173
            break;
2174
          default:
2175
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2176
        }
3430 rajveer 2177
        iprot.readFieldEnd();
1982 varun.gupt 2178
      }
2179
      iprot.readStructEnd();
2180
      validate();
2181
    }
2182
 
3430 rajveer 2183
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2184
      validate();
2185
 
2186
      oprot.writeStructBegin(STRUCT_DESC);
2187
      if (this.name != null) {
2188
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2189
        oprot.writeString(this.name);
2190
        oprot.writeFieldEnd();
2191
      }
2192
      if (this.ruleExecutionSrc != null) {
2193
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2194
        oprot.writeString(this.ruleExecutionSrc);
2195
        oprot.writeFieldEnd();
2196
      }
2197
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2198
      oprot.writeI64(this.startOn);
2199
      oprot.writeFieldEnd();
2200
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2201
      oprot.writeI64(this.endOn);
2202
      oprot.writeFieldEnd();
2203
      oprot.writeFieldStop();
2204
      oprot.writeStructEnd();
2205
    }
2206
 
2207
    @Override
2208
    public String toString() {
2209
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2210
      boolean first = true;
2211
 
2212
      sb.append("name:");
2213
      if (this.name == null) {
2214
        sb.append("null");
2215
      } else {
2216
        sb.append(this.name);
2217
      }
2218
      first = false;
2219
      if (!first) sb.append(", ");
2220
      sb.append("ruleExecutionSrc:");
2221
      if (this.ruleExecutionSrc == null) {
2222
        sb.append("null");
2223
      } else {
2224
        sb.append(this.ruleExecutionSrc);
2225
      }
2226
      first = false;
2227
      if (!first) sb.append(", ");
2228
      sb.append("startOn:");
2229
      sb.append(this.startOn);
2230
      first = false;
2231
      if (!first) sb.append(", ");
2232
      sb.append("endOn:");
2233
      sb.append(this.endOn);
2234
      first = false;
2235
      sb.append(")");
2236
      return sb.toString();
2237
    }
2238
 
3430 rajveer 2239
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2240
      // check for required fields
2241
    }
2242
 
3430 rajveer 2243
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2244
      try {
2245
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2246
      } catch (org.apache.thrift.TException te) {
2247
        throw new java.io.IOException(te);
2248
      }
2249
    }
2250
 
2251
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2252
      try {
2253
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2254
        __isset_bit_vector = new BitSet(1);
2255
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2256
      } catch (org.apache.thrift.TException te) {
2257
        throw new java.io.IOException(te);
2258
      }
2259
    }
2260
 
1982 varun.gupt 2261
  }
2262
 
3430 rajveer 2263
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2264
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2265
 
3430 rajveer 2266
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 2267
 
3430 rajveer 2268
    private PromotionException pex; // required
1982 varun.gupt 2269
 
2270
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2271
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2272
      PEX((short)1, "pex");
2273
 
2274
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2275
 
2276
      static {
2277
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2278
          byName.put(field.getFieldName(), field);
2279
        }
2280
      }
2281
 
2282
      /**
2283
       * Find the _Fields constant that matches fieldId, or null if its not found.
2284
       */
2285
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2286
        switch(fieldId) {
2287
          case 1: // PEX
2288
            return PEX;
2289
          default:
2290
            return null;
2291
        }
1982 varun.gupt 2292
      }
2293
 
2294
      /**
2295
       * Find the _Fields constant that matches fieldId, throwing an exception
2296
       * if it is not found.
2297
       */
2298
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2299
        _Fields fields = findByThriftId(fieldId);
2300
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2301
        return fields;
2302
      }
2303
 
2304
      /**
2305
       * Find the _Fields constant that matches name, or null if its not found.
2306
       */
2307
      public static _Fields findByName(String name) {
2308
        return byName.get(name);
2309
      }
2310
 
2311
      private final short _thriftId;
2312
      private final String _fieldName;
2313
 
2314
      _Fields(short thriftId, String fieldName) {
2315
        _thriftId = thriftId;
2316
        _fieldName = fieldName;
2317
      }
2318
 
2319
      public short getThriftFieldId() {
2320
        return _thriftId;
2321
      }
2322
 
2323
      public String getFieldName() {
2324
        return _fieldName;
2325
      }
2326
    }
2327
 
2328
    // isset id assignments
2329
 
3430 rajveer 2330
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2331
    static {
3430 rajveer 2332
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2333
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2334
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2335
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2336
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2337
    }
2338
 
2339
    public createPromotion_result() {
2340
    }
2341
 
2342
    public createPromotion_result(
2343
      PromotionException pex)
2344
    {
2345
      this();
2346
      this.pex = pex;
2347
    }
2348
 
2349
    /**
2350
     * Performs a deep copy on <i>other</i>.
2351
     */
2352
    public createPromotion_result(createPromotion_result other) {
2353
      if (other.isSetPex()) {
2354
        this.pex = new PromotionException(other.pex);
2355
      }
2356
    }
2357
 
2358
    public createPromotion_result deepCopy() {
2359
      return new createPromotion_result(this);
2360
    }
2361
 
3430 rajveer 2362
    @Override
2363
    public void clear() {
2364
      this.pex = null;
1982 varun.gupt 2365
    }
2366
 
2367
    public PromotionException getPex() {
2368
      return this.pex;
2369
    }
2370
 
3430 rajveer 2371
    public void setPex(PromotionException pex) {
1982 varun.gupt 2372
      this.pex = pex;
2373
    }
2374
 
2375
    public void unsetPex() {
2376
      this.pex = null;
2377
    }
2378
 
3430 rajveer 2379
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2380
    public boolean isSetPex() {
2381
      return this.pex != null;
2382
    }
2383
 
2384
    public void setPexIsSet(boolean value) {
2385
      if (!value) {
2386
        this.pex = null;
2387
      }
2388
    }
2389
 
2390
    public void setFieldValue(_Fields field, Object value) {
2391
      switch (field) {
2392
      case PEX:
2393
        if (value == null) {
2394
          unsetPex();
2395
        } else {
2396
          setPex((PromotionException)value);
2397
        }
2398
        break;
2399
 
2400
      }
2401
    }
2402
 
2403
    public Object getFieldValue(_Fields field) {
2404
      switch (field) {
2405
      case PEX:
2406
        return getPex();
2407
 
2408
      }
2409
      throw new IllegalStateException();
2410
    }
2411
 
3430 rajveer 2412
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2413
    public boolean isSet(_Fields field) {
2414
      if (field == null) {
2415
        throw new IllegalArgumentException();
2416
      }
1982 varun.gupt 2417
 
2418
      switch (field) {
2419
      case PEX:
2420
        return isSetPex();
2421
      }
2422
      throw new IllegalStateException();
2423
    }
2424
 
2425
    @Override
2426
    public boolean equals(Object that) {
2427
      if (that == null)
2428
        return false;
2429
      if (that instanceof createPromotion_result)
2430
        return this.equals((createPromotion_result)that);
2431
      return false;
2432
    }
2433
 
2434
    public boolean equals(createPromotion_result that) {
2435
      if (that == null)
2436
        return false;
2437
 
2438
      boolean this_present_pex = true && this.isSetPex();
2439
      boolean that_present_pex = true && that.isSetPex();
2440
      if (this_present_pex || that_present_pex) {
2441
        if (!(this_present_pex && that_present_pex))
2442
          return false;
2443
        if (!this.pex.equals(that.pex))
2444
          return false;
2445
      }
2446
 
2447
      return true;
2448
    }
2449
 
2450
    @Override
2451
    public int hashCode() {
2452
      return 0;
2453
    }
2454
 
2455
    public int compareTo(createPromotion_result other) {
2456
      if (!getClass().equals(other.getClass())) {
2457
        return getClass().getName().compareTo(other.getClass().getName());
2458
      }
2459
 
2460
      int lastComparison = 0;
2461
      createPromotion_result typedOther = (createPromotion_result)other;
2462
 
3430 rajveer 2463
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2464
      if (lastComparison != 0) {
2465
        return lastComparison;
2466
      }
3430 rajveer 2467
      if (isSetPex()) {
2468
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2469
        if (lastComparison != 0) {
2470
          return lastComparison;
2471
        }
1982 varun.gupt 2472
      }
2473
      return 0;
2474
    }
2475
 
3430 rajveer 2476
    public _Fields fieldForId(int fieldId) {
2477
      return _Fields.findByThriftId(fieldId);
2478
    }
2479
 
2480
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2481
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2482
      iprot.readStructBegin();
2483
      while (true)
2484
      {
2485
        field = iprot.readFieldBegin();
3430 rajveer 2486
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2487
          break;
2488
        }
3430 rajveer 2489
        switch (field.id) {
2490
          case 1: // PEX
2491
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2492
              this.pex = new PromotionException();
2493
              this.pex.read(iprot);
2494
            } else { 
2495
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2496
            }
2497
            break;
2498
          default:
2499
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2500
        }
3430 rajveer 2501
        iprot.readFieldEnd();
1982 varun.gupt 2502
      }
2503
      iprot.readStructEnd();
2504
      validate();
2505
    }
2506
 
3430 rajveer 2507
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2508
      oprot.writeStructBegin(STRUCT_DESC);
2509
 
2510
      if (this.isSetPex()) {
2511
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2512
        this.pex.write(oprot);
2513
        oprot.writeFieldEnd();
2514
      }
2515
      oprot.writeFieldStop();
2516
      oprot.writeStructEnd();
2517
    }
2518
 
2519
    @Override
2520
    public String toString() {
2521
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2522
      boolean first = true;
2523
 
2524
      sb.append("pex:");
2525
      if (this.pex == null) {
2526
        sb.append("null");
2527
      } else {
2528
        sb.append(this.pex);
2529
      }
2530
      first = false;
2531
      sb.append(")");
2532
      return sb.toString();
2533
    }
2534
 
3430 rajveer 2535
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2536
      // check for required fields
2537
    }
2538
 
3430 rajveer 2539
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2540
      try {
2541
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2542
      } catch (org.apache.thrift.TException te) {
2543
        throw new java.io.IOException(te);
2544
      }
2545
    }
2546
 
2547
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2548
      try {
2549
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2550
      } catch (org.apache.thrift.TException te) {
2551
        throw new java.io.IOException(te);
2552
      }
2553
    }
2554
 
1982 varun.gupt 2555
  }
2556
 
6301 amit.gupta 2557
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
2558
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
2559
 
2560
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
2561
 
2562
    private String couponCode; // required
2563
 
2564
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2565
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2566
      COUPON_CODE((short)1, "couponCode");
2567
 
2568
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2569
 
2570
      static {
2571
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2572
          byName.put(field.getFieldName(), field);
2573
        }
2574
      }
2575
 
2576
      /**
2577
       * Find the _Fields constant that matches fieldId, or null if its not found.
2578
       */
2579
      public static _Fields findByThriftId(int fieldId) {
2580
        switch(fieldId) {
2581
          case 1: // COUPON_CODE
2582
            return COUPON_CODE;
2583
          default:
2584
            return null;
2585
        }
2586
      }
2587
 
2588
      /**
2589
       * Find the _Fields constant that matches fieldId, throwing an exception
2590
       * if it is not found.
2591
       */
2592
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2593
        _Fields fields = findByThriftId(fieldId);
2594
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2595
        return fields;
2596
      }
2597
 
2598
      /**
2599
       * Find the _Fields constant that matches name, or null if its not found.
2600
       */
2601
      public static _Fields findByName(String name) {
2602
        return byName.get(name);
2603
      }
2604
 
2605
      private final short _thriftId;
2606
      private final String _fieldName;
2607
 
2608
      _Fields(short thriftId, String fieldName) {
2609
        _thriftId = thriftId;
2610
        _fieldName = fieldName;
2611
      }
2612
 
2613
      public short getThriftFieldId() {
2614
        return _thriftId;
2615
      }
2616
 
2617
      public String getFieldName() {
2618
        return _fieldName;
2619
      }
2620
    }
2621
 
2622
    // isset id assignments
2623
 
2624
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2625
    static {
2626
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2627
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2628
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2629
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2630
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
2631
    }
2632
 
2633
    public getCoupon_args() {
2634
    }
2635
 
2636
    public getCoupon_args(
2637
      String couponCode)
2638
    {
2639
      this();
2640
      this.couponCode = couponCode;
2641
    }
2642
 
2643
    /**
2644
     * Performs a deep copy on <i>other</i>.
2645
     */
2646
    public getCoupon_args(getCoupon_args other) {
2647
      if (other.isSetCouponCode()) {
2648
        this.couponCode = other.couponCode;
2649
      }
2650
    }
2651
 
2652
    public getCoupon_args deepCopy() {
2653
      return new getCoupon_args(this);
2654
    }
2655
 
2656
    @Override
2657
    public void clear() {
2658
      this.couponCode = null;
2659
    }
2660
 
2661
    public String getCouponCode() {
2662
      return this.couponCode;
2663
    }
2664
 
2665
    public void setCouponCode(String couponCode) {
2666
      this.couponCode = couponCode;
2667
    }
2668
 
2669
    public void unsetCouponCode() {
2670
      this.couponCode = null;
2671
    }
2672
 
2673
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
2674
    public boolean isSetCouponCode() {
2675
      return this.couponCode != null;
2676
    }
2677
 
2678
    public void setCouponCodeIsSet(boolean value) {
2679
      if (!value) {
2680
        this.couponCode = null;
2681
      }
2682
    }
2683
 
2684
    public void setFieldValue(_Fields field, Object value) {
2685
      switch (field) {
2686
      case COUPON_CODE:
2687
        if (value == null) {
2688
          unsetCouponCode();
2689
        } else {
2690
          setCouponCode((String)value);
2691
        }
2692
        break;
2693
 
2694
      }
2695
    }
2696
 
2697
    public Object getFieldValue(_Fields field) {
2698
      switch (field) {
2699
      case COUPON_CODE:
2700
        return getCouponCode();
2701
 
2702
      }
2703
      throw new IllegalStateException();
2704
    }
2705
 
2706
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2707
    public boolean isSet(_Fields field) {
2708
      if (field == null) {
2709
        throw new IllegalArgumentException();
2710
      }
2711
 
2712
      switch (field) {
2713
      case COUPON_CODE:
2714
        return isSetCouponCode();
2715
      }
2716
      throw new IllegalStateException();
2717
    }
2718
 
2719
    @Override
2720
    public boolean equals(Object that) {
2721
      if (that == null)
2722
        return false;
2723
      if (that instanceof getCoupon_args)
2724
        return this.equals((getCoupon_args)that);
2725
      return false;
2726
    }
2727
 
2728
    public boolean equals(getCoupon_args that) {
2729
      if (that == null)
2730
        return false;
2731
 
2732
      boolean this_present_couponCode = true && this.isSetCouponCode();
2733
      boolean that_present_couponCode = true && that.isSetCouponCode();
2734
      if (this_present_couponCode || that_present_couponCode) {
2735
        if (!(this_present_couponCode && that_present_couponCode))
2736
          return false;
2737
        if (!this.couponCode.equals(that.couponCode))
2738
          return false;
2739
      }
2740
 
2741
      return true;
2742
    }
2743
 
2744
    @Override
2745
    public int hashCode() {
2746
      return 0;
2747
    }
2748
 
2749
    public int compareTo(getCoupon_args other) {
2750
      if (!getClass().equals(other.getClass())) {
2751
        return getClass().getName().compareTo(other.getClass().getName());
2752
      }
2753
 
2754
      int lastComparison = 0;
2755
      getCoupon_args typedOther = (getCoupon_args)other;
2756
 
2757
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
2758
      if (lastComparison != 0) {
2759
        return lastComparison;
2760
      }
2761
      if (isSetCouponCode()) {
2762
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
2763
        if (lastComparison != 0) {
2764
          return lastComparison;
2765
        }
2766
      }
2767
      return 0;
2768
    }
2769
 
2770
    public _Fields fieldForId(int fieldId) {
2771
      return _Fields.findByThriftId(fieldId);
2772
    }
2773
 
2774
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2775
      org.apache.thrift.protocol.TField field;
2776
      iprot.readStructBegin();
2777
      while (true)
2778
      {
2779
        field = iprot.readFieldBegin();
2780
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2781
          break;
2782
        }
2783
        switch (field.id) {
2784
          case 1: // COUPON_CODE
2785
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2786
              this.couponCode = iprot.readString();
2787
            } else { 
2788
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2789
            }
2790
            break;
2791
          default:
2792
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2793
        }
2794
        iprot.readFieldEnd();
2795
      }
2796
      iprot.readStructEnd();
2797
      validate();
2798
    }
2799
 
2800
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2801
      validate();
2802
 
2803
      oprot.writeStructBegin(STRUCT_DESC);
2804
      if (this.couponCode != null) {
2805
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
2806
        oprot.writeString(this.couponCode);
2807
        oprot.writeFieldEnd();
2808
      }
2809
      oprot.writeFieldStop();
2810
      oprot.writeStructEnd();
2811
    }
2812
 
2813
    @Override
2814
    public String toString() {
2815
      StringBuilder sb = new StringBuilder("getCoupon_args(");
2816
      boolean first = true;
2817
 
2818
      sb.append("couponCode:");
2819
      if (this.couponCode == null) {
2820
        sb.append("null");
2821
      } else {
2822
        sb.append(this.couponCode);
2823
      }
2824
      first = false;
2825
      sb.append(")");
2826
      return sb.toString();
2827
    }
2828
 
2829
    public void validate() throws org.apache.thrift.TException {
2830
      // check for required fields
2831
    }
2832
 
2833
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2834
      try {
2835
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2836
      } catch (org.apache.thrift.TException te) {
2837
        throw new java.io.IOException(te);
2838
      }
2839
    }
2840
 
2841
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2842
      try {
2843
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2844
      } catch (org.apache.thrift.TException te) {
2845
        throw new java.io.IOException(te);
2846
      }
2847
    }
2848
 
2849
  }
2850
 
2851
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
2852
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
2853
 
2854
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
2855
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
2856
 
2857
    private Coupon success; // required
2858
    private PromotionException pex; // required
2859
 
2860
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2861
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2862
      SUCCESS((short)0, "success"),
2863
      PEX((short)1, "pex");
2864
 
2865
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2866
 
2867
      static {
2868
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2869
          byName.put(field.getFieldName(), field);
2870
        }
2871
      }
2872
 
2873
      /**
2874
       * Find the _Fields constant that matches fieldId, or null if its not found.
2875
       */
2876
      public static _Fields findByThriftId(int fieldId) {
2877
        switch(fieldId) {
2878
          case 0: // SUCCESS
2879
            return SUCCESS;
2880
          case 1: // PEX
2881
            return PEX;
2882
          default:
2883
            return null;
2884
        }
2885
      }
2886
 
2887
      /**
2888
       * Find the _Fields constant that matches fieldId, throwing an exception
2889
       * if it is not found.
2890
       */
2891
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2892
        _Fields fields = findByThriftId(fieldId);
2893
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2894
        return fields;
2895
      }
2896
 
2897
      /**
2898
       * Find the _Fields constant that matches name, or null if its not found.
2899
       */
2900
      public static _Fields findByName(String name) {
2901
        return byName.get(name);
2902
      }
2903
 
2904
      private final short _thriftId;
2905
      private final String _fieldName;
2906
 
2907
      _Fields(short thriftId, String fieldName) {
2908
        _thriftId = thriftId;
2909
        _fieldName = fieldName;
2910
      }
2911
 
2912
      public short getThriftFieldId() {
2913
        return _thriftId;
2914
      }
2915
 
2916
      public String getFieldName() {
2917
        return _fieldName;
2918
      }
2919
    }
2920
 
2921
    // isset id assignments
2922
 
2923
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2924
    static {
2925
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2926
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2927
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
2928
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2929
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2930
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2931
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
2932
    }
2933
 
2934
    public getCoupon_result() {
2935
    }
2936
 
2937
    public getCoupon_result(
2938
      Coupon success,
2939
      PromotionException pex)
2940
    {
2941
      this();
2942
      this.success = success;
2943
      this.pex = pex;
2944
    }
2945
 
2946
    /**
2947
     * Performs a deep copy on <i>other</i>.
2948
     */
2949
    public getCoupon_result(getCoupon_result other) {
2950
      if (other.isSetSuccess()) {
2951
        this.success = new Coupon(other.success);
2952
      }
2953
      if (other.isSetPex()) {
2954
        this.pex = new PromotionException(other.pex);
2955
      }
2956
    }
2957
 
2958
    public getCoupon_result deepCopy() {
2959
      return new getCoupon_result(this);
2960
    }
2961
 
2962
    @Override
2963
    public void clear() {
2964
      this.success = null;
2965
      this.pex = null;
2966
    }
2967
 
2968
    public Coupon getSuccess() {
2969
      return this.success;
2970
    }
2971
 
2972
    public void setSuccess(Coupon success) {
2973
      this.success = success;
2974
    }
2975
 
2976
    public void unsetSuccess() {
2977
      this.success = null;
2978
    }
2979
 
2980
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
2981
    public boolean isSetSuccess() {
2982
      return this.success != null;
2983
    }
2984
 
2985
    public void setSuccessIsSet(boolean value) {
2986
      if (!value) {
2987
        this.success = null;
2988
      }
2989
    }
2990
 
2991
    public PromotionException getPex() {
2992
      return this.pex;
2993
    }
2994
 
2995
    public void setPex(PromotionException pex) {
2996
      this.pex = pex;
2997
    }
2998
 
2999
    public void unsetPex() {
3000
      this.pex = null;
3001
    }
3002
 
3003
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3004
    public boolean isSetPex() {
3005
      return this.pex != null;
3006
    }
3007
 
3008
    public void setPexIsSet(boolean value) {
3009
      if (!value) {
3010
        this.pex = null;
3011
      }
3012
    }
3013
 
3014
    public void setFieldValue(_Fields field, Object value) {
3015
      switch (field) {
3016
      case SUCCESS:
3017
        if (value == null) {
3018
          unsetSuccess();
3019
        } else {
3020
          setSuccess((Coupon)value);
3021
        }
3022
        break;
3023
 
3024
      case PEX:
3025
        if (value == null) {
3026
          unsetPex();
3027
        } else {
3028
          setPex((PromotionException)value);
3029
        }
3030
        break;
3031
 
3032
      }
3033
    }
3034
 
3035
    public Object getFieldValue(_Fields field) {
3036
      switch (field) {
3037
      case SUCCESS:
3038
        return getSuccess();
3039
 
3040
      case PEX:
3041
        return getPex();
3042
 
3043
      }
3044
      throw new IllegalStateException();
3045
    }
3046
 
3047
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3048
    public boolean isSet(_Fields field) {
3049
      if (field == null) {
3050
        throw new IllegalArgumentException();
3051
      }
3052
 
3053
      switch (field) {
3054
      case SUCCESS:
3055
        return isSetSuccess();
3056
      case PEX:
3057
        return isSetPex();
3058
      }
3059
      throw new IllegalStateException();
3060
    }
3061
 
3062
    @Override
3063
    public boolean equals(Object that) {
3064
      if (that == null)
3065
        return false;
3066
      if (that instanceof getCoupon_result)
3067
        return this.equals((getCoupon_result)that);
3068
      return false;
3069
    }
3070
 
3071
    public boolean equals(getCoupon_result that) {
3072
      if (that == null)
3073
        return false;
3074
 
3075
      boolean this_present_success = true && this.isSetSuccess();
3076
      boolean that_present_success = true && that.isSetSuccess();
3077
      if (this_present_success || that_present_success) {
3078
        if (!(this_present_success && that_present_success))
3079
          return false;
3080
        if (!this.success.equals(that.success))
3081
          return false;
3082
      }
3083
 
3084
      boolean this_present_pex = true && this.isSetPex();
3085
      boolean that_present_pex = true && that.isSetPex();
3086
      if (this_present_pex || that_present_pex) {
3087
        if (!(this_present_pex && that_present_pex))
3088
          return false;
3089
        if (!this.pex.equals(that.pex))
3090
          return false;
3091
      }
3092
 
3093
      return true;
3094
    }
3095
 
3096
    @Override
3097
    public int hashCode() {
3098
      return 0;
3099
    }
3100
 
3101
    public int compareTo(getCoupon_result other) {
3102
      if (!getClass().equals(other.getClass())) {
3103
        return getClass().getName().compareTo(other.getClass().getName());
3104
      }
3105
 
3106
      int lastComparison = 0;
3107
      getCoupon_result typedOther = (getCoupon_result)other;
3108
 
3109
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3110
      if (lastComparison != 0) {
3111
        return lastComparison;
3112
      }
3113
      if (isSetSuccess()) {
3114
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3115
        if (lastComparison != 0) {
3116
          return lastComparison;
3117
        }
3118
      }
3119
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3120
      if (lastComparison != 0) {
3121
        return lastComparison;
3122
      }
3123
      if (isSetPex()) {
3124
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3125
        if (lastComparison != 0) {
3126
          return lastComparison;
3127
        }
3128
      }
3129
      return 0;
3130
    }
3131
 
3132
    public _Fields fieldForId(int fieldId) {
3133
      return _Fields.findByThriftId(fieldId);
3134
    }
3135
 
3136
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3137
      org.apache.thrift.protocol.TField field;
3138
      iprot.readStructBegin();
3139
      while (true)
3140
      {
3141
        field = iprot.readFieldBegin();
3142
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3143
          break;
3144
        }
3145
        switch (field.id) {
3146
          case 0: // SUCCESS
3147
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3148
              this.success = new Coupon();
3149
              this.success.read(iprot);
3150
            } else { 
3151
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3152
            }
3153
            break;
3154
          case 1: // PEX
3155
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3156
              this.pex = new PromotionException();
3157
              this.pex.read(iprot);
3158
            } else { 
3159
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3160
            }
3161
            break;
3162
          default:
3163
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3164
        }
3165
        iprot.readFieldEnd();
3166
      }
3167
      iprot.readStructEnd();
3168
      validate();
3169
    }
3170
 
3171
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.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("getCoupon_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 org.apache.thrift.TException {
3212
      // check for required fields
3213
    }
3214
 
3215
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3216
      try {
3217
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3218
      } catch (org.apache.thrift.TException te) {
3219
        throw new java.io.IOException(te);
3220
      }
3221
    }
3222
 
3223
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3224
      try {
3225
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3226
      } catch (org.apache.thrift.TException te) {
3227
        throw new java.io.IOException(te);
3228
      }
3229
    }
3230
 
3231
  }
3232
 
3233
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
3234
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
3235
 
3236
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
3237
 
3238
    private String couponCode; // required
3239
 
3240
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3241
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3242
      COUPON_CODE((short)1, "couponCode");
3243
 
3244
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3245
 
3246
      static {
3247
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3248
          byName.put(field.getFieldName(), field);
3249
        }
3250
      }
3251
 
3252
      /**
3253
       * Find the _Fields constant that matches fieldId, or null if its not found.
3254
       */
3255
      public static _Fields findByThriftId(int fieldId) {
3256
        switch(fieldId) {
3257
          case 1: // COUPON_CODE
3258
            return COUPON_CODE;
3259
          default:
3260
            return null;
3261
        }
3262
      }
3263
 
3264
      /**
3265
       * Find the _Fields constant that matches fieldId, throwing an exception
3266
       * if it is not found.
3267
       */
3268
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3269
        _Fields fields = findByThriftId(fieldId);
3270
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3271
        return fields;
3272
      }
3273
 
3274
      /**
3275
       * Find the _Fields constant that matches name, or null if its not found.
3276
       */
3277
      public static _Fields findByName(String name) {
3278
        return byName.get(name);
3279
      }
3280
 
3281
      private final short _thriftId;
3282
      private final String _fieldName;
3283
 
3284
      _Fields(short thriftId, String fieldName) {
3285
        _thriftId = thriftId;
3286
        _fieldName = fieldName;
3287
      }
3288
 
3289
      public short getThriftFieldId() {
3290
        return _thriftId;
3291
      }
3292
 
3293
      public String getFieldName() {
3294
        return _fieldName;
3295
      }
3296
    }
3297
 
3298
    // isset id assignments
3299
 
3300
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3301
    static {
3302
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3303
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3304
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3305
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3306
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
3307
    }
3308
 
3309
    public isGiftVoucher_args() {
3310
    }
3311
 
3312
    public isGiftVoucher_args(
3313
      String couponCode)
3314
    {
3315
      this();
3316
      this.couponCode = couponCode;
3317
    }
3318
 
3319
    /**
3320
     * Performs a deep copy on <i>other</i>.
3321
     */
3322
    public isGiftVoucher_args(isGiftVoucher_args other) {
3323
      if (other.isSetCouponCode()) {
3324
        this.couponCode = other.couponCode;
3325
      }
3326
    }
3327
 
3328
    public isGiftVoucher_args deepCopy() {
3329
      return new isGiftVoucher_args(this);
3330
    }
3331
 
3332
    @Override
3333
    public void clear() {
3334
      this.couponCode = null;
3335
    }
3336
 
3337
    public String getCouponCode() {
3338
      return this.couponCode;
3339
    }
3340
 
3341
    public void setCouponCode(String couponCode) {
3342
      this.couponCode = couponCode;
3343
    }
3344
 
3345
    public void unsetCouponCode() {
3346
      this.couponCode = null;
3347
    }
3348
 
3349
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3350
    public boolean isSetCouponCode() {
3351
      return this.couponCode != null;
3352
    }
3353
 
3354
    public void setCouponCodeIsSet(boolean value) {
3355
      if (!value) {
3356
        this.couponCode = null;
3357
      }
3358
    }
3359
 
3360
    public void setFieldValue(_Fields field, Object value) {
3361
      switch (field) {
3362
      case COUPON_CODE:
3363
        if (value == null) {
3364
          unsetCouponCode();
3365
        } else {
3366
          setCouponCode((String)value);
3367
        }
3368
        break;
3369
 
3370
      }
3371
    }
3372
 
3373
    public Object getFieldValue(_Fields field) {
3374
      switch (field) {
3375
      case COUPON_CODE:
3376
        return getCouponCode();
3377
 
3378
      }
3379
      throw new IllegalStateException();
3380
    }
3381
 
3382
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3383
    public boolean isSet(_Fields field) {
3384
      if (field == null) {
3385
        throw new IllegalArgumentException();
3386
      }
3387
 
3388
      switch (field) {
3389
      case COUPON_CODE:
3390
        return isSetCouponCode();
3391
      }
3392
      throw new IllegalStateException();
3393
    }
3394
 
3395
    @Override
3396
    public boolean equals(Object that) {
3397
      if (that == null)
3398
        return false;
3399
      if (that instanceof isGiftVoucher_args)
3400
        return this.equals((isGiftVoucher_args)that);
3401
      return false;
3402
    }
3403
 
3404
    public boolean equals(isGiftVoucher_args that) {
3405
      if (that == null)
3406
        return false;
3407
 
3408
      boolean this_present_couponCode = true && this.isSetCouponCode();
3409
      boolean that_present_couponCode = true && that.isSetCouponCode();
3410
      if (this_present_couponCode || that_present_couponCode) {
3411
        if (!(this_present_couponCode && that_present_couponCode))
3412
          return false;
3413
        if (!this.couponCode.equals(that.couponCode))
3414
          return false;
3415
      }
3416
 
3417
      return true;
3418
    }
3419
 
3420
    @Override
3421
    public int hashCode() {
3422
      return 0;
3423
    }
3424
 
3425
    public int compareTo(isGiftVoucher_args other) {
3426
      if (!getClass().equals(other.getClass())) {
3427
        return getClass().getName().compareTo(other.getClass().getName());
3428
      }
3429
 
3430
      int lastComparison = 0;
3431
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
3432
 
3433
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3434
      if (lastComparison != 0) {
3435
        return lastComparison;
3436
      }
3437
      if (isSetCouponCode()) {
3438
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3439
        if (lastComparison != 0) {
3440
          return lastComparison;
3441
        }
3442
      }
3443
      return 0;
3444
    }
3445
 
3446
    public _Fields fieldForId(int fieldId) {
3447
      return _Fields.findByThriftId(fieldId);
3448
    }
3449
 
3450
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3451
      org.apache.thrift.protocol.TField field;
3452
      iprot.readStructBegin();
3453
      while (true)
3454
      {
3455
        field = iprot.readFieldBegin();
3456
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3457
          break;
3458
        }
3459
        switch (field.id) {
3460
          case 1: // COUPON_CODE
3461
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3462
              this.couponCode = iprot.readString();
3463
            } else { 
3464
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3465
            }
3466
            break;
3467
          default:
3468
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3469
        }
3470
        iprot.readFieldEnd();
3471
      }
3472
      iprot.readStructEnd();
3473
      validate();
3474
    }
3475
 
3476
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3477
      validate();
3478
 
3479
      oprot.writeStructBegin(STRUCT_DESC);
3480
      if (this.couponCode != null) {
3481
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3482
        oprot.writeString(this.couponCode);
3483
        oprot.writeFieldEnd();
3484
      }
3485
      oprot.writeFieldStop();
3486
      oprot.writeStructEnd();
3487
    }
3488
 
3489
    @Override
3490
    public String toString() {
3491
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
3492
      boolean first = true;
3493
 
3494
      sb.append("couponCode:");
3495
      if (this.couponCode == null) {
3496
        sb.append("null");
3497
      } else {
3498
        sb.append(this.couponCode);
3499
      }
3500
      first = false;
3501
      sb.append(")");
3502
      return sb.toString();
3503
    }
3504
 
3505
    public void validate() throws org.apache.thrift.TException {
3506
      // check for required fields
3507
    }
3508
 
3509
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3510
      try {
3511
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3512
      } catch (org.apache.thrift.TException te) {
3513
        throw new java.io.IOException(te);
3514
      }
3515
    }
3516
 
3517
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3518
      try {
3519
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3520
      } catch (org.apache.thrift.TException te) {
3521
        throw new java.io.IOException(te);
3522
      }
3523
    }
3524
 
3525
  }
3526
 
3527
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
3528
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
3529
 
3530
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
3531
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3532
 
3533
    private boolean success; // required
3534
    private PromotionException pex; // required
3535
 
3536
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3537
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3538
      SUCCESS((short)0, "success"),
3539
      PEX((short)1, "pex");
3540
 
3541
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3542
 
3543
      static {
3544
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3545
          byName.put(field.getFieldName(), field);
3546
        }
3547
      }
3548
 
3549
      /**
3550
       * Find the _Fields constant that matches fieldId, or null if its not found.
3551
       */
3552
      public static _Fields findByThriftId(int fieldId) {
3553
        switch(fieldId) {
3554
          case 0: // SUCCESS
3555
            return SUCCESS;
3556
          case 1: // PEX
3557
            return PEX;
3558
          default:
3559
            return null;
3560
        }
3561
      }
3562
 
3563
      /**
3564
       * Find the _Fields constant that matches fieldId, throwing an exception
3565
       * if it is not found.
3566
       */
3567
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3568
        _Fields fields = findByThriftId(fieldId);
3569
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3570
        return fields;
3571
      }
3572
 
3573
      /**
3574
       * Find the _Fields constant that matches name, or null if its not found.
3575
       */
3576
      public static _Fields findByName(String name) {
3577
        return byName.get(name);
3578
      }
3579
 
3580
      private final short _thriftId;
3581
      private final String _fieldName;
3582
 
3583
      _Fields(short thriftId, String fieldName) {
3584
        _thriftId = thriftId;
3585
        _fieldName = fieldName;
3586
      }
3587
 
3588
      public short getThriftFieldId() {
3589
        return _thriftId;
3590
      }
3591
 
3592
      public String getFieldName() {
3593
        return _fieldName;
3594
      }
3595
    }
3596
 
3597
    // isset id assignments
3598
    private static final int __SUCCESS_ISSET_ID = 0;
3599
    private BitSet __isset_bit_vector = new BitSet(1);
3600
 
3601
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3602
    static {
3603
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3604
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3605
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
3606
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3607
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3608
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3609
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
3610
    }
3611
 
3612
    public isGiftVoucher_result() {
3613
    }
3614
 
3615
    public isGiftVoucher_result(
3616
      boolean success,
3617
      PromotionException pex)
3618
    {
3619
      this();
3620
      this.success = success;
3621
      setSuccessIsSet(true);
3622
      this.pex = pex;
3623
    }
3624
 
3625
    /**
3626
     * Performs a deep copy on <i>other</i>.
3627
     */
3628
    public isGiftVoucher_result(isGiftVoucher_result other) {
3629
      __isset_bit_vector.clear();
3630
      __isset_bit_vector.or(other.__isset_bit_vector);
3631
      this.success = other.success;
3632
      if (other.isSetPex()) {
3633
        this.pex = new PromotionException(other.pex);
3634
      }
3635
    }
3636
 
3637
    public isGiftVoucher_result deepCopy() {
3638
      return new isGiftVoucher_result(this);
3639
    }
3640
 
3641
    @Override
3642
    public void clear() {
3643
      setSuccessIsSet(false);
3644
      this.success = false;
3645
      this.pex = null;
3646
    }
3647
 
3648
    public boolean isSuccess() {
3649
      return this.success;
3650
    }
3651
 
3652
    public void setSuccess(boolean success) {
3653
      this.success = success;
3654
      setSuccessIsSet(true);
3655
    }
3656
 
3657
    public void unsetSuccess() {
3658
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3659
    }
3660
 
3661
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3662
    public boolean isSetSuccess() {
3663
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3664
    }
3665
 
3666
    public void setSuccessIsSet(boolean value) {
3667
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3668
    }
3669
 
3670
    public PromotionException getPex() {
3671
      return this.pex;
3672
    }
3673
 
3674
    public void setPex(PromotionException pex) {
3675
      this.pex = pex;
3676
    }
3677
 
3678
    public void unsetPex() {
3679
      this.pex = null;
3680
    }
3681
 
3682
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3683
    public boolean isSetPex() {
3684
      return this.pex != null;
3685
    }
3686
 
3687
    public void setPexIsSet(boolean value) {
3688
      if (!value) {
3689
        this.pex = null;
3690
      }
3691
    }
3692
 
3693
    public void setFieldValue(_Fields field, Object value) {
3694
      switch (field) {
3695
      case SUCCESS:
3696
        if (value == null) {
3697
          unsetSuccess();
3698
        } else {
3699
          setSuccess((Boolean)value);
3700
        }
3701
        break;
3702
 
3703
      case PEX:
3704
        if (value == null) {
3705
          unsetPex();
3706
        } else {
3707
          setPex((PromotionException)value);
3708
        }
3709
        break;
3710
 
3711
      }
3712
    }
3713
 
3714
    public Object getFieldValue(_Fields field) {
3715
      switch (field) {
3716
      case SUCCESS:
3717
        return Boolean.valueOf(isSuccess());
3718
 
3719
      case PEX:
3720
        return getPex();
3721
 
3722
      }
3723
      throw new IllegalStateException();
3724
    }
3725
 
3726
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3727
    public boolean isSet(_Fields field) {
3728
      if (field == null) {
3729
        throw new IllegalArgumentException();
3730
      }
3731
 
3732
      switch (field) {
3733
      case SUCCESS:
3734
        return isSetSuccess();
3735
      case PEX:
3736
        return isSetPex();
3737
      }
3738
      throw new IllegalStateException();
3739
    }
3740
 
3741
    @Override
3742
    public boolean equals(Object that) {
3743
      if (that == null)
3744
        return false;
3745
      if (that instanceof isGiftVoucher_result)
3746
        return this.equals((isGiftVoucher_result)that);
3747
      return false;
3748
    }
3749
 
3750
    public boolean equals(isGiftVoucher_result that) {
3751
      if (that == null)
3752
        return false;
3753
 
3754
      boolean this_present_success = true;
3755
      boolean that_present_success = true;
3756
      if (this_present_success || that_present_success) {
3757
        if (!(this_present_success && that_present_success))
3758
          return false;
3759
        if (this.success != that.success)
3760
          return false;
3761
      }
3762
 
3763
      boolean this_present_pex = true && this.isSetPex();
3764
      boolean that_present_pex = true && that.isSetPex();
3765
      if (this_present_pex || that_present_pex) {
3766
        if (!(this_present_pex && that_present_pex))
3767
          return false;
3768
        if (!this.pex.equals(that.pex))
3769
          return false;
3770
      }
3771
 
3772
      return true;
3773
    }
3774
 
3775
    @Override
3776
    public int hashCode() {
3777
      return 0;
3778
    }
3779
 
3780
    public int compareTo(isGiftVoucher_result other) {
3781
      if (!getClass().equals(other.getClass())) {
3782
        return getClass().getName().compareTo(other.getClass().getName());
3783
      }
3784
 
3785
      int lastComparison = 0;
3786
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
3787
 
3788
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3789
      if (lastComparison != 0) {
3790
        return lastComparison;
3791
      }
3792
      if (isSetSuccess()) {
3793
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3794
        if (lastComparison != 0) {
3795
          return lastComparison;
3796
        }
3797
      }
3798
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3799
      if (lastComparison != 0) {
3800
        return lastComparison;
3801
      }
3802
      if (isSetPex()) {
3803
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3804
        if (lastComparison != 0) {
3805
          return lastComparison;
3806
        }
3807
      }
3808
      return 0;
3809
    }
3810
 
3811
    public _Fields fieldForId(int fieldId) {
3812
      return _Fields.findByThriftId(fieldId);
3813
    }
3814
 
3815
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3816
      org.apache.thrift.protocol.TField field;
3817
      iprot.readStructBegin();
3818
      while (true)
3819
      {
3820
        field = iprot.readFieldBegin();
3821
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3822
          break;
3823
        }
3824
        switch (field.id) {
3825
          case 0: // SUCCESS
3826
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
3827
              this.success = iprot.readBool();
3828
              setSuccessIsSet(true);
3829
            } else { 
3830
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3831
            }
3832
            break;
3833
          case 1: // PEX
3834
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3835
              this.pex = new PromotionException();
3836
              this.pex.read(iprot);
3837
            } else { 
3838
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3839
            }
3840
            break;
3841
          default:
3842
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3843
        }
3844
        iprot.readFieldEnd();
3845
      }
3846
      iprot.readStructEnd();
3847
      validate();
3848
    }
3849
 
3850
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3851
      oprot.writeStructBegin(STRUCT_DESC);
3852
 
3853
      if (this.isSetSuccess()) {
3854
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3855
        oprot.writeBool(this.success);
3856
        oprot.writeFieldEnd();
3857
      } else if (this.isSetPex()) {
3858
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3859
        this.pex.write(oprot);
3860
        oprot.writeFieldEnd();
3861
      }
3862
      oprot.writeFieldStop();
3863
      oprot.writeStructEnd();
3864
    }
3865
 
3866
    @Override
3867
    public String toString() {
3868
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
3869
      boolean first = true;
3870
 
3871
      sb.append("success:");
3872
      sb.append(this.success);
3873
      first = false;
3874
      if (!first) sb.append(", ");
3875
      sb.append("pex:");
3876
      if (this.pex == null) {
3877
        sb.append("null");
3878
      } else {
3879
        sb.append(this.pex);
3880
      }
3881
      first = false;
3882
      sb.append(")");
3883
      return sb.toString();
3884
    }
3885
 
3886
    public void validate() throws org.apache.thrift.TException {
3887
      // check for required fields
3888
    }
3889
 
3890
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3891
      try {
3892
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3893
      } catch (org.apache.thrift.TException te) {
3894
        throw new java.io.IOException(te);
3895
      }
3896
    }
3897
 
3898
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3899
      try {
3900
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3901
      } catch (org.apache.thrift.TException te) {
3902
        throw new java.io.IOException(te);
3903
      }
3904
    }
3905
 
3906
  }
3907
 
6356 amit.gupta 3908
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
3909
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
3910
 
3911
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
3912
 
3913
    private String couponCode; // required
3914
 
3915
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3916
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3917
      COUPON_CODE((short)1, "couponCode");
3918
 
3919
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3920
 
3921
      static {
3922
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3923
          byName.put(field.getFieldName(), field);
3924
        }
3925
      }
3926
 
3927
      /**
3928
       * Find the _Fields constant that matches fieldId, or null if its not found.
3929
       */
3930
      public static _Fields findByThriftId(int fieldId) {
3931
        switch(fieldId) {
3932
          case 1: // COUPON_CODE
3933
            return COUPON_CODE;
3934
          default:
3935
            return null;
3936
        }
3937
      }
3938
 
3939
      /**
3940
       * Find the _Fields constant that matches fieldId, throwing an exception
3941
       * if it is not found.
3942
       */
3943
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3944
        _Fields fields = findByThriftId(fieldId);
3945
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3946
        return fields;
3947
      }
3948
 
3949
      /**
3950
       * Find the _Fields constant that matches name, or null if its not found.
3951
       */
3952
      public static _Fields findByName(String name) {
3953
        return byName.get(name);
3954
      }
3955
 
3956
      private final short _thriftId;
3957
      private final String _fieldName;
3958
 
3959
      _Fields(short thriftId, String fieldName) {
3960
        _thriftId = thriftId;
3961
        _fieldName = fieldName;
3962
      }
3963
 
3964
      public short getThriftFieldId() {
3965
        return _thriftId;
3966
      }
3967
 
3968
      public String getFieldName() {
3969
        return _fieldName;
3970
      }
3971
    }
3972
 
3973
    // isset id assignments
3974
 
3975
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3976
    static {
3977
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3978
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3979
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3980
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3981
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
3982
    }
3983
 
3984
    public isCodApplicable_args() {
3985
    }
3986
 
3987
    public isCodApplicable_args(
3988
      String couponCode)
3989
    {
3990
      this();
3991
      this.couponCode = couponCode;
3992
    }
3993
 
3994
    /**
3995
     * Performs a deep copy on <i>other</i>.
3996
     */
3997
    public isCodApplicable_args(isCodApplicable_args other) {
3998
      if (other.isSetCouponCode()) {
3999
        this.couponCode = other.couponCode;
4000
      }
4001
    }
4002
 
4003
    public isCodApplicable_args deepCopy() {
4004
      return new isCodApplicable_args(this);
4005
    }
4006
 
4007
    @Override
4008
    public void clear() {
4009
      this.couponCode = null;
4010
    }
4011
 
4012
    public String getCouponCode() {
4013
      return this.couponCode;
4014
    }
4015
 
4016
    public void setCouponCode(String couponCode) {
4017
      this.couponCode = couponCode;
4018
    }
4019
 
4020
    public void unsetCouponCode() {
4021
      this.couponCode = null;
4022
    }
4023
 
4024
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4025
    public boolean isSetCouponCode() {
4026
      return this.couponCode != null;
4027
    }
4028
 
4029
    public void setCouponCodeIsSet(boolean value) {
4030
      if (!value) {
4031
        this.couponCode = null;
4032
      }
4033
    }
4034
 
4035
    public void setFieldValue(_Fields field, Object value) {
4036
      switch (field) {
4037
      case COUPON_CODE:
4038
        if (value == null) {
4039
          unsetCouponCode();
4040
        } else {
4041
          setCouponCode((String)value);
4042
        }
4043
        break;
4044
 
4045
      }
4046
    }
4047
 
4048
    public Object getFieldValue(_Fields field) {
4049
      switch (field) {
4050
      case COUPON_CODE:
4051
        return getCouponCode();
4052
 
4053
      }
4054
      throw new IllegalStateException();
4055
    }
4056
 
4057
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4058
    public boolean isSet(_Fields field) {
4059
      if (field == null) {
4060
        throw new IllegalArgumentException();
4061
      }
4062
 
4063
      switch (field) {
4064
      case COUPON_CODE:
4065
        return isSetCouponCode();
4066
      }
4067
      throw new IllegalStateException();
4068
    }
4069
 
4070
    @Override
4071
    public boolean equals(Object that) {
4072
      if (that == null)
4073
        return false;
4074
      if (that instanceof isCodApplicable_args)
4075
        return this.equals((isCodApplicable_args)that);
4076
      return false;
4077
    }
4078
 
4079
    public boolean equals(isCodApplicable_args that) {
4080
      if (that == null)
4081
        return false;
4082
 
4083
      boolean this_present_couponCode = true && this.isSetCouponCode();
4084
      boolean that_present_couponCode = true && that.isSetCouponCode();
4085
      if (this_present_couponCode || that_present_couponCode) {
4086
        if (!(this_present_couponCode && that_present_couponCode))
4087
          return false;
4088
        if (!this.couponCode.equals(that.couponCode))
4089
          return false;
4090
      }
4091
 
4092
      return true;
4093
    }
4094
 
4095
    @Override
4096
    public int hashCode() {
4097
      return 0;
4098
    }
4099
 
4100
    public int compareTo(isCodApplicable_args other) {
4101
      if (!getClass().equals(other.getClass())) {
4102
        return getClass().getName().compareTo(other.getClass().getName());
4103
      }
4104
 
4105
      int lastComparison = 0;
4106
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
4107
 
4108
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4109
      if (lastComparison != 0) {
4110
        return lastComparison;
4111
      }
4112
      if (isSetCouponCode()) {
4113
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4114
        if (lastComparison != 0) {
4115
          return lastComparison;
4116
        }
4117
      }
4118
      return 0;
4119
    }
4120
 
4121
    public _Fields fieldForId(int fieldId) {
4122
      return _Fields.findByThriftId(fieldId);
4123
    }
4124
 
4125
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4126
      org.apache.thrift.protocol.TField field;
4127
      iprot.readStructBegin();
4128
      while (true)
4129
      {
4130
        field = iprot.readFieldBegin();
4131
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4132
          break;
4133
        }
4134
        switch (field.id) {
4135
          case 1: // COUPON_CODE
4136
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4137
              this.couponCode = iprot.readString();
4138
            } else { 
4139
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4140
            }
4141
            break;
4142
          default:
4143
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4144
        }
4145
        iprot.readFieldEnd();
4146
      }
4147
      iprot.readStructEnd();
4148
      validate();
4149
    }
4150
 
4151
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4152
      validate();
4153
 
4154
      oprot.writeStructBegin(STRUCT_DESC);
4155
      if (this.couponCode != null) {
4156
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4157
        oprot.writeString(this.couponCode);
4158
        oprot.writeFieldEnd();
4159
      }
4160
      oprot.writeFieldStop();
4161
      oprot.writeStructEnd();
4162
    }
4163
 
4164
    @Override
4165
    public String toString() {
4166
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
4167
      boolean first = true;
4168
 
4169
      sb.append("couponCode:");
4170
      if (this.couponCode == null) {
4171
        sb.append("null");
4172
      } else {
4173
        sb.append(this.couponCode);
4174
      }
4175
      first = false;
4176
      sb.append(")");
4177
      return sb.toString();
4178
    }
4179
 
4180
    public void validate() throws org.apache.thrift.TException {
4181
      // check for required fields
4182
    }
4183
 
4184
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4185
      try {
4186
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4187
      } catch (org.apache.thrift.TException te) {
4188
        throw new java.io.IOException(te);
4189
      }
4190
    }
4191
 
4192
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4193
      try {
4194
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4195
      } catch (org.apache.thrift.TException te) {
4196
        throw new java.io.IOException(te);
4197
      }
4198
    }
4199
 
4200
  }
4201
 
4202
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
4203
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
4204
 
4205
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
4206
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
4207
 
4208
    private boolean success; // required
4209
    private PromotionException pex; // required
4210
 
4211
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4212
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4213
      SUCCESS((short)0, "success"),
4214
      PEX((short)1, "pex");
4215
 
4216
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4217
 
4218
      static {
4219
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4220
          byName.put(field.getFieldName(), field);
4221
        }
4222
      }
4223
 
4224
      /**
4225
       * Find the _Fields constant that matches fieldId, or null if its not found.
4226
       */
4227
      public static _Fields findByThriftId(int fieldId) {
4228
        switch(fieldId) {
4229
          case 0: // SUCCESS
4230
            return SUCCESS;
4231
          case 1: // PEX
4232
            return PEX;
4233
          default:
4234
            return null;
4235
        }
4236
      }
4237
 
4238
      /**
4239
       * Find the _Fields constant that matches fieldId, throwing an exception
4240
       * if it is not found.
4241
       */
4242
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4243
        _Fields fields = findByThriftId(fieldId);
4244
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4245
        return fields;
4246
      }
4247
 
4248
      /**
4249
       * Find the _Fields constant that matches name, or null if its not found.
4250
       */
4251
      public static _Fields findByName(String name) {
4252
        return byName.get(name);
4253
      }
4254
 
4255
      private final short _thriftId;
4256
      private final String _fieldName;
4257
 
4258
      _Fields(short thriftId, String fieldName) {
4259
        _thriftId = thriftId;
4260
        _fieldName = fieldName;
4261
      }
4262
 
4263
      public short getThriftFieldId() {
4264
        return _thriftId;
4265
      }
4266
 
4267
      public String getFieldName() {
4268
        return _fieldName;
4269
      }
4270
    }
4271
 
4272
    // isset id assignments
4273
    private static final int __SUCCESS_ISSET_ID = 0;
4274
    private BitSet __isset_bit_vector = new BitSet(1);
4275
 
4276
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4277
    static {
4278
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4279
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4280
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4281
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4282
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4283
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4284
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
4285
    }
4286
 
4287
    public isCodApplicable_result() {
4288
    }
4289
 
4290
    public isCodApplicable_result(
4291
      boolean success,
4292
      PromotionException pex)
4293
    {
4294
      this();
4295
      this.success = success;
4296
      setSuccessIsSet(true);
4297
      this.pex = pex;
4298
    }
4299
 
4300
    /**
4301
     * Performs a deep copy on <i>other</i>.
4302
     */
4303
    public isCodApplicable_result(isCodApplicable_result other) {
4304
      __isset_bit_vector.clear();
4305
      __isset_bit_vector.or(other.__isset_bit_vector);
4306
      this.success = other.success;
4307
      if (other.isSetPex()) {
4308
        this.pex = new PromotionException(other.pex);
4309
      }
4310
    }
4311
 
4312
    public isCodApplicable_result deepCopy() {
4313
      return new isCodApplicable_result(this);
4314
    }
4315
 
4316
    @Override
4317
    public void clear() {
4318
      setSuccessIsSet(false);
4319
      this.success = false;
4320
      this.pex = null;
4321
    }
4322
 
4323
    public boolean isSuccess() {
4324
      return this.success;
4325
    }
4326
 
4327
    public void setSuccess(boolean success) {
4328
      this.success = success;
4329
      setSuccessIsSet(true);
4330
    }
4331
 
4332
    public void unsetSuccess() {
4333
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4334
    }
4335
 
4336
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4337
    public boolean isSetSuccess() {
4338
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4339
    }
4340
 
4341
    public void setSuccessIsSet(boolean value) {
4342
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4343
    }
4344
 
4345
    public PromotionException getPex() {
4346
      return this.pex;
4347
    }
4348
 
4349
    public void setPex(PromotionException pex) {
4350
      this.pex = pex;
4351
    }
4352
 
4353
    public void unsetPex() {
4354
      this.pex = null;
4355
    }
4356
 
4357
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4358
    public boolean isSetPex() {
4359
      return this.pex != null;
4360
    }
4361
 
4362
    public void setPexIsSet(boolean value) {
4363
      if (!value) {
4364
        this.pex = null;
4365
      }
4366
    }
4367
 
4368
    public void setFieldValue(_Fields field, Object value) {
4369
      switch (field) {
4370
      case SUCCESS:
4371
        if (value == null) {
4372
          unsetSuccess();
4373
        } else {
4374
          setSuccess((Boolean)value);
4375
        }
4376
        break;
4377
 
4378
      case PEX:
4379
        if (value == null) {
4380
          unsetPex();
4381
        } else {
4382
          setPex((PromotionException)value);
4383
        }
4384
        break;
4385
 
4386
      }
4387
    }
4388
 
4389
    public Object getFieldValue(_Fields field) {
4390
      switch (field) {
4391
      case SUCCESS:
4392
        return Boolean.valueOf(isSuccess());
4393
 
4394
      case PEX:
4395
        return getPex();
4396
 
4397
      }
4398
      throw new IllegalStateException();
4399
    }
4400
 
4401
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4402
    public boolean isSet(_Fields field) {
4403
      if (field == null) {
4404
        throw new IllegalArgumentException();
4405
      }
4406
 
4407
      switch (field) {
4408
      case SUCCESS:
4409
        return isSetSuccess();
4410
      case PEX:
4411
        return isSetPex();
4412
      }
4413
      throw new IllegalStateException();
4414
    }
4415
 
4416
    @Override
4417
    public boolean equals(Object that) {
4418
      if (that == null)
4419
        return false;
4420
      if (that instanceof isCodApplicable_result)
4421
        return this.equals((isCodApplicable_result)that);
4422
      return false;
4423
    }
4424
 
4425
    public boolean equals(isCodApplicable_result that) {
4426
      if (that == null)
4427
        return false;
4428
 
4429
      boolean this_present_success = true;
4430
      boolean that_present_success = true;
4431
      if (this_present_success || that_present_success) {
4432
        if (!(this_present_success && that_present_success))
4433
          return false;
4434
        if (this.success != that.success)
4435
          return false;
4436
      }
4437
 
4438
      boolean this_present_pex = true && this.isSetPex();
4439
      boolean that_present_pex = true && that.isSetPex();
4440
      if (this_present_pex || that_present_pex) {
4441
        if (!(this_present_pex && that_present_pex))
4442
          return false;
4443
        if (!this.pex.equals(that.pex))
4444
          return false;
4445
      }
4446
 
4447
      return true;
4448
    }
4449
 
4450
    @Override
4451
    public int hashCode() {
4452
      return 0;
4453
    }
4454
 
4455
    public int compareTo(isCodApplicable_result other) {
4456
      if (!getClass().equals(other.getClass())) {
4457
        return getClass().getName().compareTo(other.getClass().getName());
4458
      }
4459
 
4460
      int lastComparison = 0;
4461
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
4462
 
4463
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4464
      if (lastComparison != 0) {
4465
        return lastComparison;
4466
      }
4467
      if (isSetSuccess()) {
4468
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4469
        if (lastComparison != 0) {
4470
          return lastComparison;
4471
        }
4472
      }
4473
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4474
      if (lastComparison != 0) {
4475
        return lastComparison;
4476
      }
4477
      if (isSetPex()) {
4478
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4479
        if (lastComparison != 0) {
4480
          return lastComparison;
4481
        }
4482
      }
4483
      return 0;
4484
    }
4485
 
4486
    public _Fields fieldForId(int fieldId) {
4487
      return _Fields.findByThriftId(fieldId);
4488
    }
4489
 
4490
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4491
      org.apache.thrift.protocol.TField field;
4492
      iprot.readStructBegin();
4493
      while (true)
4494
      {
4495
        field = iprot.readFieldBegin();
4496
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4497
          break;
4498
        }
4499
        switch (field.id) {
4500
          case 0: // SUCCESS
4501
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4502
              this.success = iprot.readBool();
4503
              setSuccessIsSet(true);
4504
            } else { 
4505
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4506
            }
4507
            break;
4508
          case 1: // PEX
4509
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4510
              this.pex = new PromotionException();
4511
              this.pex.read(iprot);
4512
            } else { 
4513
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4514
            }
4515
            break;
4516
          default:
4517
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4518
        }
4519
        iprot.readFieldEnd();
4520
      }
4521
      iprot.readStructEnd();
4522
      validate();
4523
    }
4524
 
4525
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4526
      oprot.writeStructBegin(STRUCT_DESC);
4527
 
4528
      if (this.isSetSuccess()) {
4529
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4530
        oprot.writeBool(this.success);
4531
        oprot.writeFieldEnd();
4532
      } else if (this.isSetPex()) {
4533
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4534
        this.pex.write(oprot);
4535
        oprot.writeFieldEnd();
4536
      }
4537
      oprot.writeFieldStop();
4538
      oprot.writeStructEnd();
4539
    }
4540
 
4541
    @Override
4542
    public String toString() {
4543
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
4544
      boolean first = true;
4545
 
4546
      sb.append("success:");
4547
      sb.append(this.success);
4548
      first = false;
4549
      if (!first) sb.append(", ");
4550
      sb.append("pex:");
4551
      if (this.pex == null) {
4552
        sb.append("null");
4553
      } else {
4554
        sb.append(this.pex);
4555
      }
4556
      first = false;
4557
      sb.append(")");
4558
      return sb.toString();
4559
    }
4560
 
4561
    public void validate() throws org.apache.thrift.TException {
4562
      // check for required fields
4563
    }
4564
 
4565
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4566
      try {
4567
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4568
      } catch (org.apache.thrift.TException te) {
4569
        throw new java.io.IOException(te);
4570
      }
4571
    }
4572
 
4573
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4574
      try {
4575
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4576
      } catch (org.apache.thrift.TException te) {
4577
        throw new java.io.IOException(te);
4578
      }
4579
    }
4580
 
4581
  }
4582
 
3430 rajveer 4583
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
4584
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 4585
 
4586
 
4587
 
4588
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4589
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4590
;
4591
 
4592
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4593
 
4594
      static {
4595
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4596
          byName.put(field.getFieldName(), field);
4597
        }
4598
      }
4599
 
4600
      /**
4601
       * Find the _Fields constant that matches fieldId, or null if its not found.
4602
       */
4603
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4604
        switch(fieldId) {
4605
          default:
4606
            return null;
4607
        }
1982 varun.gupt 4608
      }
4609
 
4610
      /**
4611
       * Find the _Fields constant that matches fieldId, throwing an exception
4612
       * if it is not found.
4613
       */
4614
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4615
        _Fields fields = findByThriftId(fieldId);
4616
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4617
        return fields;
4618
      }
4619
 
4620
      /**
4621
       * Find the _Fields constant that matches name, or null if its not found.
4622
       */
4623
      public static _Fields findByName(String name) {
4624
        return byName.get(name);
4625
      }
4626
 
4627
      private final short _thriftId;
4628
      private final String _fieldName;
4629
 
4630
      _Fields(short thriftId, String fieldName) {
4631
        _thriftId = thriftId;
4632
        _fieldName = fieldName;
4633
      }
4634
 
4635
      public short getThriftFieldId() {
4636
        return _thriftId;
4637
      }
4638
 
4639
      public String getFieldName() {
4640
        return _fieldName;
4641
      }
4642
    }
3430 rajveer 4643
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4644
    static {
3430 rajveer 4645
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4646
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4647
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 4648
    }
4649
 
4650
    public getAllPromotions_args() {
4651
    }
4652
 
4653
    /**
4654
     * Performs a deep copy on <i>other</i>.
4655
     */
4656
    public getAllPromotions_args(getAllPromotions_args other) {
4657
    }
4658
 
4659
    public getAllPromotions_args deepCopy() {
4660
      return new getAllPromotions_args(this);
4661
    }
4662
 
3430 rajveer 4663
    @Override
4664
    public void clear() {
1982 varun.gupt 4665
    }
4666
 
4667
    public void setFieldValue(_Fields field, Object value) {
4668
      switch (field) {
4669
      }
4670
    }
4671
 
4672
    public Object getFieldValue(_Fields field) {
4673
      switch (field) {
4674
      }
4675
      throw new IllegalStateException();
4676
    }
4677
 
3430 rajveer 4678
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4679
    public boolean isSet(_Fields field) {
4680
      if (field == null) {
4681
        throw new IllegalArgumentException();
4682
      }
1982 varun.gupt 4683
 
4684
      switch (field) {
4685
      }
4686
      throw new IllegalStateException();
4687
    }
4688
 
4689
    @Override
4690
    public boolean equals(Object that) {
4691
      if (that == null)
4692
        return false;
4693
      if (that instanceof getAllPromotions_args)
4694
        return this.equals((getAllPromotions_args)that);
4695
      return false;
4696
    }
4697
 
4698
    public boolean equals(getAllPromotions_args that) {
4699
      if (that == null)
4700
        return false;
4701
 
4702
      return true;
4703
    }
4704
 
4705
    @Override
4706
    public int hashCode() {
4707
      return 0;
4708
    }
4709
 
4710
    public int compareTo(getAllPromotions_args other) {
4711
      if (!getClass().equals(other.getClass())) {
4712
        return getClass().getName().compareTo(other.getClass().getName());
4713
      }
4714
 
4715
      int lastComparison = 0;
4716
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
4717
 
4718
      return 0;
4719
    }
4720
 
3430 rajveer 4721
    public _Fields fieldForId(int fieldId) {
4722
      return _Fields.findByThriftId(fieldId);
4723
    }
4724
 
4725
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4726
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4727
      iprot.readStructBegin();
4728
      while (true)
4729
      {
4730
        field = iprot.readFieldBegin();
3430 rajveer 4731
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4732
          break;
4733
        }
3430 rajveer 4734
        switch (field.id) {
4735
          default:
4736
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4737
        }
3430 rajveer 4738
        iprot.readFieldEnd();
1982 varun.gupt 4739
      }
4740
      iprot.readStructEnd();
4741
      validate();
4742
    }
4743
 
3430 rajveer 4744
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4745
      validate();
4746
 
4747
      oprot.writeStructBegin(STRUCT_DESC);
4748
      oprot.writeFieldStop();
4749
      oprot.writeStructEnd();
4750
    }
4751
 
4752
    @Override
4753
    public String toString() {
4754
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
4755
      boolean first = true;
4756
 
4757
      sb.append(")");
4758
      return sb.toString();
4759
    }
4760
 
3430 rajveer 4761
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4762
      // check for required fields
4763
    }
4764
 
3430 rajveer 4765
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4766
      try {
4767
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4768
      } catch (org.apache.thrift.TException te) {
4769
        throw new java.io.IOException(te);
4770
      }
4771
    }
4772
 
4773
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4774
      try {
4775
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4776
      } catch (org.apache.thrift.TException te) {
4777
        throw new java.io.IOException(te);
4778
      }
4779
    }
4780
 
1982 varun.gupt 4781
  }
4782
 
3430 rajveer 4783
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
4784
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 4785
 
3430 rajveer 4786
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
4787
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 4788
 
3430 rajveer 4789
    private List<Promotion> success; // required
4790
    private PromotionException pex; // required
1982 varun.gupt 4791
 
4792
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4793
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4794
      SUCCESS((short)0, "success"),
4795
      PEX((short)1, "pex");
4796
 
4797
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4798
 
4799
      static {
4800
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4801
          byName.put(field.getFieldName(), field);
4802
        }
4803
      }
4804
 
4805
      /**
4806
       * Find the _Fields constant that matches fieldId, or null if its not found.
4807
       */
4808
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4809
        switch(fieldId) {
4810
          case 0: // SUCCESS
4811
            return SUCCESS;
4812
          case 1: // PEX
4813
            return PEX;
4814
          default:
4815
            return null;
4816
        }
1982 varun.gupt 4817
      }
4818
 
4819
      /**
4820
       * Find the _Fields constant that matches fieldId, throwing an exception
4821
       * if it is not found.
4822
       */
4823
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4824
        _Fields fields = findByThriftId(fieldId);
4825
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4826
        return fields;
4827
      }
4828
 
4829
      /**
4830
       * Find the _Fields constant that matches name, or null if its not found.
4831
       */
4832
      public static _Fields findByName(String name) {
4833
        return byName.get(name);
4834
      }
4835
 
4836
      private final short _thriftId;
4837
      private final String _fieldName;
4838
 
4839
      _Fields(short thriftId, String fieldName) {
4840
        _thriftId = thriftId;
4841
        _fieldName = fieldName;
4842
      }
4843
 
4844
      public short getThriftFieldId() {
4845
        return _thriftId;
4846
      }
4847
 
4848
      public String getFieldName() {
4849
        return _fieldName;
4850
      }
4851
    }
4852
 
4853
    // isset id assignments
4854
 
3430 rajveer 4855
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4856
    static {
3430 rajveer 4857
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4858
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4859
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
4860
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
4861
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4862
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4863
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4864
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 4865
    }
4866
 
4867
    public getAllPromotions_result() {
4868
    }
4869
 
4870
    public getAllPromotions_result(
4871
      List<Promotion> success,
4872
      PromotionException pex)
4873
    {
4874
      this();
4875
      this.success = success;
4876
      this.pex = pex;
4877
    }
4878
 
4879
    /**
4880
     * Performs a deep copy on <i>other</i>.
4881
     */
4882
    public getAllPromotions_result(getAllPromotions_result other) {
4883
      if (other.isSetSuccess()) {
4884
        List<Promotion> __this__success = new ArrayList<Promotion>();
4885
        for (Promotion other_element : other.success) {
4886
          __this__success.add(new Promotion(other_element));
4887
        }
4888
        this.success = __this__success;
4889
      }
4890
      if (other.isSetPex()) {
4891
        this.pex = new PromotionException(other.pex);
4892
      }
4893
    }
4894
 
4895
    public getAllPromotions_result deepCopy() {
4896
      return new getAllPromotions_result(this);
4897
    }
4898
 
3430 rajveer 4899
    @Override
4900
    public void clear() {
4901
      this.success = null;
4902
      this.pex = null;
1982 varun.gupt 4903
    }
4904
 
4905
    public int getSuccessSize() {
4906
      return (this.success == null) ? 0 : this.success.size();
4907
    }
4908
 
4909
    public java.util.Iterator<Promotion> getSuccessIterator() {
4910
      return (this.success == null) ? null : this.success.iterator();
4911
    }
4912
 
4913
    public void addToSuccess(Promotion elem) {
4914
      if (this.success == null) {
4915
        this.success = new ArrayList<Promotion>();
4916
      }
4917
      this.success.add(elem);
4918
    }
4919
 
4920
    public List<Promotion> getSuccess() {
4921
      return this.success;
4922
    }
4923
 
3430 rajveer 4924
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 4925
      this.success = success;
4926
    }
4927
 
4928
    public void unsetSuccess() {
4929
      this.success = null;
4930
    }
4931
 
3430 rajveer 4932
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4933
    public boolean isSetSuccess() {
4934
      return this.success != null;
4935
    }
4936
 
4937
    public void setSuccessIsSet(boolean value) {
4938
      if (!value) {
4939
        this.success = null;
4940
      }
4941
    }
4942
 
4943
    public PromotionException getPex() {
4944
      return this.pex;
4945
    }
4946
 
3430 rajveer 4947
    public void setPex(PromotionException pex) {
1982 varun.gupt 4948
      this.pex = pex;
4949
    }
4950
 
4951
    public void unsetPex() {
4952
      this.pex = null;
4953
    }
4954
 
3430 rajveer 4955
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4956
    public boolean isSetPex() {
4957
      return this.pex != null;
4958
    }
4959
 
4960
    public void setPexIsSet(boolean value) {
4961
      if (!value) {
4962
        this.pex = null;
4963
      }
4964
    }
4965
 
4966
    public void setFieldValue(_Fields field, Object value) {
4967
      switch (field) {
4968
      case SUCCESS:
4969
        if (value == null) {
4970
          unsetSuccess();
4971
        } else {
4972
          setSuccess((List<Promotion>)value);
4973
        }
4974
        break;
4975
 
4976
      case PEX:
4977
        if (value == null) {
4978
          unsetPex();
4979
        } else {
4980
          setPex((PromotionException)value);
4981
        }
4982
        break;
4983
 
4984
      }
4985
    }
4986
 
4987
    public Object getFieldValue(_Fields field) {
4988
      switch (field) {
4989
      case SUCCESS:
4990
        return getSuccess();
4991
 
4992
      case PEX:
4993
        return getPex();
4994
 
4995
      }
4996
      throw new IllegalStateException();
4997
    }
4998
 
3430 rajveer 4999
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5000
    public boolean isSet(_Fields field) {
5001
      if (field == null) {
5002
        throw new IllegalArgumentException();
5003
      }
1982 varun.gupt 5004
 
5005
      switch (field) {
5006
      case SUCCESS:
5007
        return isSetSuccess();
5008
      case PEX:
5009
        return isSetPex();
5010
      }
5011
      throw new IllegalStateException();
5012
    }
5013
 
5014
    @Override
5015
    public boolean equals(Object that) {
5016
      if (that == null)
5017
        return false;
5018
      if (that instanceof getAllPromotions_result)
5019
        return this.equals((getAllPromotions_result)that);
5020
      return false;
5021
    }
5022
 
5023
    public boolean equals(getAllPromotions_result that) {
5024
      if (that == null)
5025
        return false;
5026
 
5027
      boolean this_present_success = true && this.isSetSuccess();
5028
      boolean that_present_success = true && that.isSetSuccess();
5029
      if (this_present_success || that_present_success) {
5030
        if (!(this_present_success && that_present_success))
5031
          return false;
5032
        if (!this.success.equals(that.success))
5033
          return false;
5034
      }
5035
 
5036
      boolean this_present_pex = true && this.isSetPex();
5037
      boolean that_present_pex = true && that.isSetPex();
5038
      if (this_present_pex || that_present_pex) {
5039
        if (!(this_present_pex && that_present_pex))
5040
          return false;
5041
        if (!this.pex.equals(that.pex))
5042
          return false;
5043
      }
5044
 
5045
      return true;
5046
    }
5047
 
5048
    @Override
5049
    public int hashCode() {
5050
      return 0;
5051
    }
5052
 
5053
    public int compareTo(getAllPromotions_result other) {
5054
      if (!getClass().equals(other.getClass())) {
5055
        return getClass().getName().compareTo(other.getClass().getName());
5056
      }
5057
 
5058
      int lastComparison = 0;
5059
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
5060
 
3430 rajveer 5061
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5062
      if (lastComparison != 0) {
5063
        return lastComparison;
5064
      }
3430 rajveer 5065
      if (isSetSuccess()) {
5066
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5067
        if (lastComparison != 0) {
5068
          return lastComparison;
5069
        }
1982 varun.gupt 5070
      }
3430 rajveer 5071
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5072
      if (lastComparison != 0) {
5073
        return lastComparison;
5074
      }
3430 rajveer 5075
      if (isSetPex()) {
5076
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5077
        if (lastComparison != 0) {
5078
          return lastComparison;
5079
        }
1982 varun.gupt 5080
      }
5081
      return 0;
5082
    }
5083
 
3430 rajveer 5084
    public _Fields fieldForId(int fieldId) {
5085
      return _Fields.findByThriftId(fieldId);
5086
    }
5087
 
5088
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5089
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5090
      iprot.readStructBegin();
5091
      while (true)
5092
      {
5093
        field = iprot.readFieldBegin();
3430 rajveer 5094
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5095
          break;
5096
        }
3430 rajveer 5097
        switch (field.id) {
5098
          case 0: // SUCCESS
5099
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
5100
              {
5327 rajveer 5101
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
5102
                this.success = new ArrayList<Promotion>(_list12.size);
5103
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 5104
                {
5327 rajveer 5105
                  Promotion _elem14; // required
5106
                  _elem14 = new Promotion();
5107
                  _elem14.read(iprot);
5108
                  this.success.add(_elem14);
1982 varun.gupt 5109
                }
3430 rajveer 5110
                iprot.readListEnd();
1982 varun.gupt 5111
              }
3430 rajveer 5112
            } else { 
5113
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5114
            }
5115
            break;
5116
          case 1: // PEX
5117
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5118
              this.pex = new PromotionException();
5119
              this.pex.read(iprot);
5120
            } else { 
5121
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5122
            }
5123
            break;
5124
          default:
5125
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5126
        }
3430 rajveer 5127
        iprot.readFieldEnd();
1982 varun.gupt 5128
      }
5129
      iprot.readStructEnd();
5130
      validate();
5131
    }
5132
 
3430 rajveer 5133
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5134
      oprot.writeStructBegin(STRUCT_DESC);
5135
 
5136
      if (this.isSetSuccess()) {
5137
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5138
        {
3430 rajveer 5139
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 5140
          for (Promotion _iter15 : this.success)
1982 varun.gupt 5141
          {
5327 rajveer 5142
            _iter15.write(oprot);
1982 varun.gupt 5143
          }
5144
          oprot.writeListEnd();
5145
        }
5146
        oprot.writeFieldEnd();
5147
      } else if (this.isSetPex()) {
5148
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5149
        this.pex.write(oprot);
5150
        oprot.writeFieldEnd();
5151
      }
5152
      oprot.writeFieldStop();
5153
      oprot.writeStructEnd();
5154
    }
5155
 
5156
    @Override
5157
    public String toString() {
5158
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
5159
      boolean first = true;
5160
 
5161
      sb.append("success:");
5162
      if (this.success == null) {
5163
        sb.append("null");
5164
      } else {
5165
        sb.append(this.success);
5166
      }
5167
      first = false;
5168
      if (!first) sb.append(", ");
5169
      sb.append("pex:");
5170
      if (this.pex == null) {
5171
        sb.append("null");
5172
      } else {
5173
        sb.append(this.pex);
5174
      }
5175
      first = false;
5176
      sb.append(")");
5177
      return sb.toString();
5178
    }
5179
 
3430 rajveer 5180
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5181
      // check for required fields
5182
    }
5183
 
3430 rajveer 5184
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5185
      try {
5186
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5187
      } catch (org.apache.thrift.TException te) {
5188
        throw new java.io.IOException(te);
5189
      }
5190
    }
5191
 
5192
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5193
      try {
5194
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5195
      } catch (org.apache.thrift.TException te) {
5196
        throw new java.io.IOException(te);
5197
      }
5198
    }
5199
 
1982 varun.gupt 5200
  }
5201
 
3430 rajveer 5202
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
5203
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 5204
 
3430 rajveer 5205
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
1982 varun.gupt 5206
 
3430 rajveer 5207
    private long promotionId; // required
1982 varun.gupt 5208
 
5209
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5210
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5211
      PROMOTION_ID((short)1, "promotionId");
5212
 
5213
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5214
 
5215
      static {
5216
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5217
          byName.put(field.getFieldName(), field);
5218
        }
5219
      }
5220
 
5221
      /**
5222
       * Find the _Fields constant that matches fieldId, or null if its not found.
5223
       */
5224
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5225
        switch(fieldId) {
5226
          case 1: // PROMOTION_ID
5227
            return PROMOTION_ID;
5228
          default:
5229
            return null;
5230
        }
1982 varun.gupt 5231
      }
5232
 
5233
      /**
5234
       * Find the _Fields constant that matches fieldId, throwing an exception
5235
       * if it is not found.
5236
       */
5237
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5238
        _Fields fields = findByThriftId(fieldId);
5239
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5240
        return fields;
5241
      }
5242
 
5243
      /**
5244
       * Find the _Fields constant that matches name, or null if its not found.
5245
       */
5246
      public static _Fields findByName(String name) {
5247
        return byName.get(name);
5248
      }
5249
 
5250
      private final short _thriftId;
5251
      private final String _fieldName;
5252
 
5253
      _Fields(short thriftId, String fieldName) {
5254
        _thriftId = thriftId;
5255
        _fieldName = fieldName;
5256
      }
5257
 
5258
      public short getThriftFieldId() {
5259
        return _thriftId;
5260
      }
5261
 
5262
      public String getFieldName() {
5263
        return _fieldName;
5264
      }
5265
    }
5266
 
5267
    // isset id assignments
5268
    private static final int __PROMOTIONID_ISSET_ID = 0;
5269
    private BitSet __isset_bit_vector = new BitSet(1);
5270
 
3430 rajveer 5271
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5272
    static {
3430 rajveer 5273
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5274
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5275
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5276
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5277
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 5278
    }
5279
 
5280
    public getPromotionById_args() {
5281
    }
5282
 
5283
    public getPromotionById_args(
5284
      long promotionId)
5285
    {
5286
      this();
5287
      this.promotionId = promotionId;
5288
      setPromotionIdIsSet(true);
5289
    }
5290
 
5291
    /**
5292
     * Performs a deep copy on <i>other</i>.
5293
     */
5294
    public getPromotionById_args(getPromotionById_args other) {
5295
      __isset_bit_vector.clear();
5296
      __isset_bit_vector.or(other.__isset_bit_vector);
5297
      this.promotionId = other.promotionId;
5298
    }
5299
 
5300
    public getPromotionById_args deepCopy() {
5301
      return new getPromotionById_args(this);
5302
    }
5303
 
3430 rajveer 5304
    @Override
5305
    public void clear() {
5306
      setPromotionIdIsSet(false);
5307
      this.promotionId = 0;
1982 varun.gupt 5308
    }
5309
 
5310
    public long getPromotionId() {
5311
      return this.promotionId;
5312
    }
5313
 
3430 rajveer 5314
    public void setPromotionId(long promotionId) {
1982 varun.gupt 5315
      this.promotionId = promotionId;
5316
      setPromotionIdIsSet(true);
5317
    }
5318
 
5319
    public void unsetPromotionId() {
5320
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
5321
    }
5322
 
3430 rajveer 5323
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5324
    public boolean isSetPromotionId() {
5325
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
5326
    }
5327
 
5328
    public void setPromotionIdIsSet(boolean value) {
5329
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
5330
    }
5331
 
5332
    public void setFieldValue(_Fields field, Object value) {
5333
      switch (field) {
5334
      case PROMOTION_ID:
5335
        if (value == null) {
5336
          unsetPromotionId();
5337
        } else {
5338
          setPromotionId((Long)value);
5339
        }
5340
        break;
5341
 
5342
      }
5343
    }
5344
 
5345
    public Object getFieldValue(_Fields field) {
5346
      switch (field) {
5347
      case PROMOTION_ID:
3430 rajveer 5348
        return Long.valueOf(getPromotionId());
1982 varun.gupt 5349
 
5350
      }
5351
      throw new IllegalStateException();
5352
    }
5353
 
3430 rajveer 5354
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5355
    public boolean isSet(_Fields field) {
5356
      if (field == null) {
5357
        throw new IllegalArgumentException();
5358
      }
1982 varun.gupt 5359
 
5360
      switch (field) {
5361
      case PROMOTION_ID:
5362
        return isSetPromotionId();
5363
      }
5364
      throw new IllegalStateException();
5365
    }
5366
 
5367
    @Override
5368
    public boolean equals(Object that) {
5369
      if (that == null)
5370
        return false;
5371
      if (that instanceof getPromotionById_args)
5372
        return this.equals((getPromotionById_args)that);
5373
      return false;
5374
    }
5375
 
5376
    public boolean equals(getPromotionById_args that) {
5377
      if (that == null)
5378
        return false;
5379
 
5380
      boolean this_present_promotionId = true;
5381
      boolean that_present_promotionId = true;
5382
      if (this_present_promotionId || that_present_promotionId) {
5383
        if (!(this_present_promotionId && that_present_promotionId))
5384
          return false;
5385
        if (this.promotionId != that.promotionId)
5386
          return false;
5387
      }
5388
 
5389
      return true;
5390
    }
5391
 
5392
    @Override
5393
    public int hashCode() {
5394
      return 0;
5395
    }
5396
 
5397
    public int compareTo(getPromotionById_args other) {
5398
      if (!getClass().equals(other.getClass())) {
5399
        return getClass().getName().compareTo(other.getClass().getName());
5400
      }
5401
 
5402
      int lastComparison = 0;
5403
      getPromotionById_args typedOther = (getPromotionById_args)other;
5404
 
3430 rajveer 5405
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 5406
      if (lastComparison != 0) {
5407
        return lastComparison;
5408
      }
3430 rajveer 5409
      if (isSetPromotionId()) {
5410
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
5411
        if (lastComparison != 0) {
5412
          return lastComparison;
5413
        }
1982 varun.gupt 5414
      }
5415
      return 0;
5416
    }
5417
 
3430 rajveer 5418
    public _Fields fieldForId(int fieldId) {
5419
      return _Fields.findByThriftId(fieldId);
5420
    }
5421
 
5422
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5423
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5424
      iprot.readStructBegin();
5425
      while (true)
5426
      {
5427
        field = iprot.readFieldBegin();
3430 rajveer 5428
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5429
          break;
5430
        }
3430 rajveer 5431
        switch (field.id) {
5432
          case 1: // PROMOTION_ID
5433
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5434
              this.promotionId = iprot.readI64();
5435
              setPromotionIdIsSet(true);
5436
            } else { 
5437
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5438
            }
5439
            break;
5440
          default:
5441
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5442
        }
3430 rajveer 5443
        iprot.readFieldEnd();
1982 varun.gupt 5444
      }
5445
      iprot.readStructEnd();
5446
      validate();
5447
    }
5448
 
3430 rajveer 5449
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5450
      validate();
5451
 
5452
      oprot.writeStructBegin(STRUCT_DESC);
5453
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
5454
      oprot.writeI64(this.promotionId);
5455
      oprot.writeFieldEnd();
5456
      oprot.writeFieldStop();
5457
      oprot.writeStructEnd();
5458
    }
5459
 
5460
    @Override
5461
    public String toString() {
5462
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
5463
      boolean first = true;
5464
 
5465
      sb.append("promotionId:");
5466
      sb.append(this.promotionId);
5467
      first = false;
5468
      sb.append(")");
5469
      return sb.toString();
5470
    }
5471
 
3430 rajveer 5472
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5473
      // check for required fields
5474
    }
5475
 
3430 rajveer 5476
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5477
      try {
5478
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5479
      } catch (org.apache.thrift.TException te) {
5480
        throw new java.io.IOException(te);
5481
      }
5482
    }
5483
 
5484
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5485
      try {
5486
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5487
        __isset_bit_vector = new BitSet(1);
5488
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5489
      } catch (org.apache.thrift.TException te) {
5490
        throw new java.io.IOException(te);
5491
      }
5492
    }
5493
 
1982 varun.gupt 5494
  }
5495
 
3430 rajveer 5496
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
5497
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 5498
 
3430 rajveer 5499
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
5500
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 5501
 
3430 rajveer 5502
    private Promotion success; // required
5503
    private PromotionException pex; // required
1982 varun.gupt 5504
 
5505
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5506
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5507
      SUCCESS((short)0, "success"),
5508
      PEX((short)1, "pex");
5509
 
5510
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5511
 
5512
      static {
5513
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5514
          byName.put(field.getFieldName(), field);
5515
        }
5516
      }
5517
 
5518
      /**
5519
       * Find the _Fields constant that matches fieldId, or null if its not found.
5520
       */
5521
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5522
        switch(fieldId) {
5523
          case 0: // SUCCESS
5524
            return SUCCESS;
5525
          case 1: // PEX
5526
            return PEX;
5527
          default:
5528
            return null;
5529
        }
1982 varun.gupt 5530
      }
5531
 
5532
      /**
5533
       * Find the _Fields constant that matches fieldId, throwing an exception
5534
       * if it is not found.
5535
       */
5536
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5537
        _Fields fields = findByThriftId(fieldId);
5538
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5539
        return fields;
5540
      }
5541
 
5542
      /**
5543
       * Find the _Fields constant that matches name, or null if its not found.
5544
       */
5545
      public static _Fields findByName(String name) {
5546
        return byName.get(name);
5547
      }
5548
 
5549
      private final short _thriftId;
5550
      private final String _fieldName;
5551
 
5552
      _Fields(short thriftId, String fieldName) {
5553
        _thriftId = thriftId;
5554
        _fieldName = fieldName;
5555
      }
5556
 
5557
      public short getThriftFieldId() {
5558
        return _thriftId;
5559
      }
5560
 
5561
      public String getFieldName() {
5562
        return _fieldName;
5563
      }
5564
    }
5565
 
5566
    // isset id assignments
5567
 
3430 rajveer 5568
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5569
    static {
3430 rajveer 5570
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5571
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5572
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
5573
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5574
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5575
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5576
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 5577
    }
5578
 
5579
    public getPromotionById_result() {
5580
    }
5581
 
5582
    public getPromotionById_result(
5583
      Promotion success,
5584
      PromotionException pex)
5585
    {
5586
      this();
5587
      this.success = success;
5588
      this.pex = pex;
5589
    }
5590
 
5591
    /**
5592
     * Performs a deep copy on <i>other</i>.
5593
     */
5594
    public getPromotionById_result(getPromotionById_result other) {
5595
      if (other.isSetSuccess()) {
5596
        this.success = new Promotion(other.success);
5597
      }
5598
      if (other.isSetPex()) {
5599
        this.pex = new PromotionException(other.pex);
5600
      }
5601
    }
5602
 
5603
    public getPromotionById_result deepCopy() {
5604
      return new getPromotionById_result(this);
5605
    }
5606
 
3430 rajveer 5607
    @Override
5608
    public void clear() {
5609
      this.success = null;
5610
      this.pex = null;
1982 varun.gupt 5611
    }
5612
 
5613
    public Promotion getSuccess() {
5614
      return this.success;
5615
    }
5616
 
3430 rajveer 5617
    public void setSuccess(Promotion success) {
1982 varun.gupt 5618
      this.success = success;
5619
    }
5620
 
5621
    public void unsetSuccess() {
5622
      this.success = null;
5623
    }
5624
 
3430 rajveer 5625
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5626
    public boolean isSetSuccess() {
5627
      return this.success != null;
5628
    }
5629
 
5630
    public void setSuccessIsSet(boolean value) {
5631
      if (!value) {
5632
        this.success = null;
5633
      }
5634
    }
5635
 
5636
    public PromotionException getPex() {
5637
      return this.pex;
5638
    }
5639
 
3430 rajveer 5640
    public void setPex(PromotionException pex) {
1982 varun.gupt 5641
      this.pex = pex;
5642
    }
5643
 
5644
    public void unsetPex() {
5645
      this.pex = null;
5646
    }
5647
 
3430 rajveer 5648
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5649
    public boolean isSetPex() {
5650
      return this.pex != null;
5651
    }
5652
 
5653
    public void setPexIsSet(boolean value) {
5654
      if (!value) {
5655
        this.pex = null;
5656
      }
5657
    }
5658
 
5659
    public void setFieldValue(_Fields field, Object value) {
5660
      switch (field) {
5661
      case SUCCESS:
5662
        if (value == null) {
5663
          unsetSuccess();
5664
        } else {
5665
          setSuccess((Promotion)value);
5666
        }
5667
        break;
5668
 
5669
      case PEX:
5670
        if (value == null) {
5671
          unsetPex();
5672
        } else {
5673
          setPex((PromotionException)value);
5674
        }
5675
        break;
5676
 
5677
      }
5678
    }
5679
 
5680
    public Object getFieldValue(_Fields field) {
5681
      switch (field) {
5682
      case SUCCESS:
5683
        return getSuccess();
5684
 
5685
      case PEX:
5686
        return getPex();
5687
 
5688
      }
5689
      throw new IllegalStateException();
5690
    }
5691
 
3430 rajveer 5692
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5693
    public boolean isSet(_Fields field) {
5694
      if (field == null) {
5695
        throw new IllegalArgumentException();
5696
      }
1982 varun.gupt 5697
 
5698
      switch (field) {
5699
      case SUCCESS:
5700
        return isSetSuccess();
5701
      case PEX:
5702
        return isSetPex();
5703
      }
5704
      throw new IllegalStateException();
5705
    }
5706
 
5707
    @Override
5708
    public boolean equals(Object that) {
5709
      if (that == null)
5710
        return false;
5711
      if (that instanceof getPromotionById_result)
5712
        return this.equals((getPromotionById_result)that);
5713
      return false;
5714
    }
5715
 
5716
    public boolean equals(getPromotionById_result that) {
5717
      if (that == null)
5718
        return false;
5719
 
5720
      boolean this_present_success = true && this.isSetSuccess();
5721
      boolean that_present_success = true && that.isSetSuccess();
5722
      if (this_present_success || that_present_success) {
5723
        if (!(this_present_success && that_present_success))
5724
          return false;
5725
        if (!this.success.equals(that.success))
5726
          return false;
5727
      }
5728
 
5729
      boolean this_present_pex = true && this.isSetPex();
5730
      boolean that_present_pex = true && that.isSetPex();
5731
      if (this_present_pex || that_present_pex) {
5732
        if (!(this_present_pex && that_present_pex))
5733
          return false;
5734
        if (!this.pex.equals(that.pex))
5735
          return false;
5736
      }
5737
 
5738
      return true;
5739
    }
5740
 
5741
    @Override
5742
    public int hashCode() {
5743
      return 0;
5744
    }
5745
 
5746
    public int compareTo(getPromotionById_result other) {
5747
      if (!getClass().equals(other.getClass())) {
5748
        return getClass().getName().compareTo(other.getClass().getName());
5749
      }
5750
 
5751
      int lastComparison = 0;
5752
      getPromotionById_result typedOther = (getPromotionById_result)other;
5753
 
3430 rajveer 5754
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5755
      if (lastComparison != 0) {
5756
        return lastComparison;
5757
      }
3430 rajveer 5758
      if (isSetSuccess()) {
5759
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5760
        if (lastComparison != 0) {
5761
          return lastComparison;
5762
        }
1982 varun.gupt 5763
      }
3430 rajveer 5764
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5765
      if (lastComparison != 0) {
5766
        return lastComparison;
5767
      }
3430 rajveer 5768
      if (isSetPex()) {
5769
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5770
        if (lastComparison != 0) {
5771
          return lastComparison;
5772
        }
1982 varun.gupt 5773
      }
5774
      return 0;
5775
    }
5776
 
3430 rajveer 5777
    public _Fields fieldForId(int fieldId) {
5778
      return _Fields.findByThriftId(fieldId);
5779
    }
5780
 
5781
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5782
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5783
      iprot.readStructBegin();
5784
      while (true)
5785
      {
5786
        field = iprot.readFieldBegin();
3430 rajveer 5787
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5788
          break;
5789
        }
3430 rajveer 5790
        switch (field.id) {
5791
          case 0: // SUCCESS
5792
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5793
              this.success = new Promotion();
5794
              this.success.read(iprot);
5795
            } else { 
5796
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5797
            }
5798
            break;
5799
          case 1: // PEX
5800
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5801
              this.pex = new PromotionException();
5802
              this.pex.read(iprot);
5803
            } else { 
5804
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5805
            }
5806
            break;
5807
          default:
5808
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5809
        }
3430 rajveer 5810
        iprot.readFieldEnd();
1982 varun.gupt 5811
      }
5812
      iprot.readStructEnd();
5813
      validate();
5814
    }
5815
 
3430 rajveer 5816
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5817
      oprot.writeStructBegin(STRUCT_DESC);
5818
 
5819
      if (this.isSetSuccess()) {
5820
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5821
        this.success.write(oprot);
5822
        oprot.writeFieldEnd();
5823
      } else if (this.isSetPex()) {
5824
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5825
        this.pex.write(oprot);
5826
        oprot.writeFieldEnd();
5827
      }
5828
      oprot.writeFieldStop();
5829
      oprot.writeStructEnd();
5830
    }
5831
 
5832
    @Override
5833
    public String toString() {
5834
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
5835
      boolean first = true;
5836
 
5837
      sb.append("success:");
5838
      if (this.success == null) {
5839
        sb.append("null");
5840
      } else {
5841
        sb.append(this.success);
5842
      }
5843
      first = false;
5844
      if (!first) sb.append(", ");
5845
      sb.append("pex:");
5846
      if (this.pex == null) {
5847
        sb.append("null");
5848
      } else {
5849
        sb.append(this.pex);
5850
      }
5851
      first = false;
5852
      sb.append(")");
5853
      return sb.toString();
5854
    }
5855
 
3430 rajveer 5856
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5857
      // check for required fields
5858
    }
5859
 
3430 rajveer 5860
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5861
      try {
5862
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5863
      } catch (org.apache.thrift.TException te) {
5864
        throw new java.io.IOException(te);
5865
      }
5866
    }
5867
 
5868
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5869
      try {
5870
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5871
      } catch (org.apache.thrift.TException te) {
5872
        throw new java.io.IOException(te);
5873
      }
5874
    }
5875
 
1982 varun.gupt 5876
  }
5877
 
3430 rajveer 5878
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
5879
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 5880
 
3430 rajveer 5881
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
5882
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)2);
1982 varun.gupt 5883
 
3430 rajveer 5884
    private long promotionId; // required
5885
    private String couponCode; // required
1982 varun.gupt 5886
 
5887
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5888
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5889
      PROMOTION_ID((short)1, "promotionId"),
5890
      COUPON_CODE((short)2, "couponCode");
5891
 
5892
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5893
 
5894
      static {
5895
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5896
          byName.put(field.getFieldName(), field);
5897
        }
5898
      }
5899
 
5900
      /**
5901
       * Find the _Fields constant that matches fieldId, or null if its not found.
5902
       */
5903
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5904
        switch(fieldId) {
5905
          case 1: // PROMOTION_ID
5906
            return PROMOTION_ID;
5907
          case 2: // COUPON_CODE
5908
            return COUPON_CODE;
5909
          default:
5910
            return null;
5911
        }
1982 varun.gupt 5912
      }
5913
 
5914
      /**
5915
       * Find the _Fields constant that matches fieldId, throwing an exception
5916
       * if it is not found.
5917
       */
5918
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5919
        _Fields fields = findByThriftId(fieldId);
5920
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5921
        return fields;
5922
      }
5923
 
5924
      /**
5925
       * Find the _Fields constant that matches name, or null if its not found.
5926
       */
5927
      public static _Fields findByName(String name) {
5928
        return byName.get(name);
5929
      }
5930
 
5931
      private final short _thriftId;
5932
      private final String _fieldName;
5933
 
5934
      _Fields(short thriftId, String fieldName) {
5935
        _thriftId = thriftId;
5936
        _fieldName = fieldName;
5937
      }
5938
 
5939
      public short getThriftFieldId() {
5940
        return _thriftId;
5941
      }
5942
 
5943
      public String getFieldName() {
5944
        return _fieldName;
5945
      }
5946
    }
5947
 
5948
    // isset id assignments
5949
    private static final int __PROMOTIONID_ISSET_ID = 0;
5950
    private BitSet __isset_bit_vector = new BitSet(1);
5951
 
3430 rajveer 5952
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5953
    static {
3430 rajveer 5954
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5955
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5956
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5957
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5958
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5959
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5960
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 5961
    }
5962
 
5963
    public generateCouponsForPromotion_args() {
5964
    }
5965
 
5966
    public generateCouponsForPromotion_args(
5967
      long promotionId,
5968
      String couponCode)
5969
    {
5970
      this();
5971
      this.promotionId = promotionId;
5972
      setPromotionIdIsSet(true);
5973
      this.couponCode = couponCode;
5974
    }
5975
 
5976
    /**
5977
     * Performs a deep copy on <i>other</i>.
5978
     */
5979
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
5980
      __isset_bit_vector.clear();
5981
      __isset_bit_vector.or(other.__isset_bit_vector);
5982
      this.promotionId = other.promotionId;
5983
      if (other.isSetCouponCode()) {
5984
        this.couponCode = other.couponCode;
5985
      }
5986
    }
5987
 
5988
    public generateCouponsForPromotion_args deepCopy() {
5989
      return new generateCouponsForPromotion_args(this);
5990
    }
5991
 
3430 rajveer 5992
    @Override
5993
    public void clear() {
5994
      setPromotionIdIsSet(false);
5995
      this.promotionId = 0;
5996
      this.couponCode = null;
1982 varun.gupt 5997
    }
5998
 
5999
    public long getPromotionId() {
6000
      return this.promotionId;
6001
    }
6002
 
3430 rajveer 6003
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6004
      this.promotionId = promotionId;
6005
      setPromotionIdIsSet(true);
6006
    }
6007
 
6008
    public void unsetPromotionId() {
6009
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6010
    }
6011
 
3430 rajveer 6012
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6013
    public boolean isSetPromotionId() {
6014
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6015
    }
6016
 
6017
    public void setPromotionIdIsSet(boolean value) {
6018
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6019
    }
6020
 
6021
    public String getCouponCode() {
6022
      return this.couponCode;
6023
    }
6024
 
3430 rajveer 6025
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6026
      this.couponCode = couponCode;
6027
    }
6028
 
6029
    public void unsetCouponCode() {
6030
      this.couponCode = null;
6031
    }
6032
 
3430 rajveer 6033
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6034
    public boolean isSetCouponCode() {
6035
      return this.couponCode != null;
6036
    }
6037
 
6038
    public void setCouponCodeIsSet(boolean value) {
6039
      if (!value) {
6040
        this.couponCode = null;
6041
      }
6042
    }
6043
 
6044
    public void setFieldValue(_Fields field, Object value) {
6045
      switch (field) {
6046
      case PROMOTION_ID:
6047
        if (value == null) {
6048
          unsetPromotionId();
6049
        } else {
6050
          setPromotionId((Long)value);
6051
        }
6052
        break;
6053
 
6054
      case COUPON_CODE:
6055
        if (value == null) {
6056
          unsetCouponCode();
6057
        } else {
6058
          setCouponCode((String)value);
6059
        }
6060
        break;
6061
 
6062
      }
6063
    }
6064
 
6065
    public Object getFieldValue(_Fields field) {
6066
      switch (field) {
6067
      case PROMOTION_ID:
3430 rajveer 6068
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6069
 
6070
      case COUPON_CODE:
6071
        return getCouponCode();
6072
 
6073
      }
6074
      throw new IllegalStateException();
6075
    }
6076
 
3430 rajveer 6077
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6078
    public boolean isSet(_Fields field) {
6079
      if (field == null) {
6080
        throw new IllegalArgumentException();
6081
      }
1982 varun.gupt 6082
 
6083
      switch (field) {
6084
      case PROMOTION_ID:
6085
        return isSetPromotionId();
6086
      case COUPON_CODE:
6087
        return isSetCouponCode();
6088
      }
6089
      throw new IllegalStateException();
6090
    }
6091
 
6092
    @Override
6093
    public boolean equals(Object that) {
6094
      if (that == null)
6095
        return false;
6096
      if (that instanceof generateCouponsForPromotion_args)
6097
        return this.equals((generateCouponsForPromotion_args)that);
6098
      return false;
6099
    }
6100
 
6101
    public boolean equals(generateCouponsForPromotion_args that) {
6102
      if (that == null)
6103
        return false;
6104
 
6105
      boolean this_present_promotionId = true;
6106
      boolean that_present_promotionId = true;
6107
      if (this_present_promotionId || that_present_promotionId) {
6108
        if (!(this_present_promotionId && that_present_promotionId))
6109
          return false;
6110
        if (this.promotionId != that.promotionId)
6111
          return false;
6112
      }
6113
 
6114
      boolean this_present_couponCode = true && this.isSetCouponCode();
6115
      boolean that_present_couponCode = true && that.isSetCouponCode();
6116
      if (this_present_couponCode || that_present_couponCode) {
6117
        if (!(this_present_couponCode && that_present_couponCode))
6118
          return false;
6119
        if (!this.couponCode.equals(that.couponCode))
6120
          return false;
6121
      }
6122
 
6123
      return true;
6124
    }
6125
 
6126
    @Override
6127
    public int hashCode() {
6128
      return 0;
6129
    }
6130
 
6131
    public int compareTo(generateCouponsForPromotion_args other) {
6132
      if (!getClass().equals(other.getClass())) {
6133
        return getClass().getName().compareTo(other.getClass().getName());
6134
      }
6135
 
6136
      int lastComparison = 0;
6137
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
6138
 
3430 rajveer 6139
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6140
      if (lastComparison != 0) {
6141
        return lastComparison;
6142
      }
3430 rajveer 6143
      if (isSetPromotionId()) {
6144
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6145
        if (lastComparison != 0) {
6146
          return lastComparison;
6147
        }
1982 varun.gupt 6148
      }
3430 rajveer 6149
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6150
      if (lastComparison != 0) {
6151
        return lastComparison;
6152
      }
3430 rajveer 6153
      if (isSetCouponCode()) {
6154
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6155
        if (lastComparison != 0) {
6156
          return lastComparison;
6157
        }
1982 varun.gupt 6158
      }
6159
      return 0;
6160
    }
6161
 
3430 rajveer 6162
    public _Fields fieldForId(int fieldId) {
6163
      return _Fields.findByThriftId(fieldId);
6164
    }
6165
 
6166
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6167
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6168
      iprot.readStructBegin();
6169
      while (true)
6170
      {
6171
        field = iprot.readFieldBegin();
3430 rajveer 6172
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6173
          break;
6174
        }
3430 rajveer 6175
        switch (field.id) {
6176
          case 1: // PROMOTION_ID
6177
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6178
              this.promotionId = iprot.readI64();
6179
              setPromotionIdIsSet(true);
6180
            } else { 
6181
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6182
            }
6183
            break;
6184
          case 2: // COUPON_CODE
6185
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6186
              this.couponCode = iprot.readString();
6187
            } else { 
6188
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6189
            }
6190
            break;
6191
          default:
6192
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6193
        }
3430 rajveer 6194
        iprot.readFieldEnd();
1982 varun.gupt 6195
      }
6196
      iprot.readStructEnd();
6197
      validate();
6198
    }
6199
 
3430 rajveer 6200
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6201
      validate();
6202
 
6203
      oprot.writeStructBegin(STRUCT_DESC);
6204
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6205
      oprot.writeI64(this.promotionId);
6206
      oprot.writeFieldEnd();
6207
      if (this.couponCode != null) {
6208
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6209
        oprot.writeString(this.couponCode);
6210
        oprot.writeFieldEnd();
6211
      }
6212
      oprot.writeFieldStop();
6213
      oprot.writeStructEnd();
6214
    }
6215
 
6216
    @Override
6217
    public String toString() {
6218
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
6219
      boolean first = true;
6220
 
6221
      sb.append("promotionId:");
6222
      sb.append(this.promotionId);
6223
      first = false;
6224
      if (!first) sb.append(", ");
6225
      sb.append("couponCode:");
6226
      if (this.couponCode == null) {
6227
        sb.append("null");
6228
      } else {
6229
        sb.append(this.couponCode);
6230
      }
6231
      first = false;
6232
      sb.append(")");
6233
      return sb.toString();
6234
    }
6235
 
3430 rajveer 6236
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6237
      // check for required fields
6238
    }
6239
 
3430 rajveer 6240
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6241
      try {
6242
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6243
      } catch (org.apache.thrift.TException te) {
6244
        throw new java.io.IOException(te);
6245
      }
6246
    }
6247
 
6248
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6249
      try {
6250
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6251
        __isset_bit_vector = new BitSet(1);
6252
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6253
      } catch (org.apache.thrift.TException te) {
6254
        throw new java.io.IOException(te);
6255
      }
6256
    }
6257
 
1982 varun.gupt 6258
  }
6259
 
3430 rajveer 6260
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
6261
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 6262
 
3430 rajveer 6263
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 6264
 
3430 rajveer 6265
    private PromotionException pex; // required
1982 varun.gupt 6266
 
6267
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6268
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6269
      PEX((short)1, "pex");
6270
 
6271
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6272
 
6273
      static {
6274
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6275
          byName.put(field.getFieldName(), field);
6276
        }
6277
      }
6278
 
6279
      /**
6280
       * Find the _Fields constant that matches fieldId, or null if its not found.
6281
       */
6282
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6283
        switch(fieldId) {
6284
          case 1: // PEX
6285
            return PEX;
6286
          default:
6287
            return null;
6288
        }
1982 varun.gupt 6289
      }
6290
 
6291
      /**
6292
       * Find the _Fields constant that matches fieldId, throwing an exception
6293
       * if it is not found.
6294
       */
6295
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6296
        _Fields fields = findByThriftId(fieldId);
6297
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6298
        return fields;
6299
      }
6300
 
6301
      /**
6302
       * Find the _Fields constant that matches name, or null if its not found.
6303
       */
6304
      public static _Fields findByName(String name) {
6305
        return byName.get(name);
6306
      }
6307
 
6308
      private final short _thriftId;
6309
      private final String _fieldName;
6310
 
6311
      _Fields(short thriftId, String fieldName) {
6312
        _thriftId = thriftId;
6313
        _fieldName = fieldName;
6314
      }
6315
 
6316
      public short getThriftFieldId() {
6317
        return _thriftId;
6318
      }
6319
 
6320
      public String getFieldName() {
6321
        return _fieldName;
6322
      }
6323
    }
6324
 
6325
    // isset id assignments
6326
 
3430 rajveer 6327
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6328
    static {
3430 rajveer 6329
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6330
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6331
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6332
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6333
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 6334
    }
6335
 
6336
    public generateCouponsForPromotion_result() {
6337
    }
6338
 
6339
    public generateCouponsForPromotion_result(
6340
      PromotionException pex)
6341
    {
6342
      this();
6343
      this.pex = pex;
6344
    }
6345
 
6346
    /**
6347
     * Performs a deep copy on <i>other</i>.
6348
     */
6349
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
6350
      if (other.isSetPex()) {
6351
        this.pex = new PromotionException(other.pex);
6352
      }
6353
    }
6354
 
6355
    public generateCouponsForPromotion_result deepCopy() {
6356
      return new generateCouponsForPromotion_result(this);
6357
    }
6358
 
3430 rajveer 6359
    @Override
6360
    public void clear() {
6361
      this.pex = null;
1982 varun.gupt 6362
    }
6363
 
6364
    public PromotionException getPex() {
6365
      return this.pex;
6366
    }
6367
 
3430 rajveer 6368
    public void setPex(PromotionException pex) {
1982 varun.gupt 6369
      this.pex = pex;
6370
    }
6371
 
6372
    public void unsetPex() {
6373
      this.pex = null;
6374
    }
6375
 
3430 rajveer 6376
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6377
    public boolean isSetPex() {
6378
      return this.pex != null;
6379
    }
6380
 
6381
    public void setPexIsSet(boolean value) {
6382
      if (!value) {
6383
        this.pex = null;
6384
      }
6385
    }
6386
 
6387
    public void setFieldValue(_Fields field, Object value) {
6388
      switch (field) {
6389
      case PEX:
6390
        if (value == null) {
6391
          unsetPex();
6392
        } else {
6393
          setPex((PromotionException)value);
6394
        }
6395
        break;
6396
 
6397
      }
6398
    }
6399
 
6400
    public Object getFieldValue(_Fields field) {
6401
      switch (field) {
6402
      case PEX:
6403
        return getPex();
6404
 
6405
      }
6406
      throw new IllegalStateException();
6407
    }
6408
 
3430 rajveer 6409
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6410
    public boolean isSet(_Fields field) {
6411
      if (field == null) {
6412
        throw new IllegalArgumentException();
6413
      }
1982 varun.gupt 6414
 
6415
      switch (field) {
6416
      case PEX:
6417
        return isSetPex();
6418
      }
6419
      throw new IllegalStateException();
6420
    }
6421
 
6422
    @Override
6423
    public boolean equals(Object that) {
6424
      if (that == null)
6425
        return false;
6426
      if (that instanceof generateCouponsForPromotion_result)
6427
        return this.equals((generateCouponsForPromotion_result)that);
6428
      return false;
6429
    }
6430
 
6431
    public boolean equals(generateCouponsForPromotion_result that) {
6432
      if (that == null)
6433
        return false;
6434
 
6435
      boolean this_present_pex = true && this.isSetPex();
6436
      boolean that_present_pex = true && that.isSetPex();
6437
      if (this_present_pex || that_present_pex) {
6438
        if (!(this_present_pex && that_present_pex))
6439
          return false;
6440
        if (!this.pex.equals(that.pex))
6441
          return false;
6442
      }
6443
 
6444
      return true;
6445
    }
6446
 
6447
    @Override
6448
    public int hashCode() {
6449
      return 0;
6450
    }
6451
 
6452
    public int compareTo(generateCouponsForPromotion_result other) {
6453
      if (!getClass().equals(other.getClass())) {
6454
        return getClass().getName().compareTo(other.getClass().getName());
6455
      }
6456
 
6457
      int lastComparison = 0;
6458
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
6459
 
3430 rajveer 6460
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6461
      if (lastComparison != 0) {
6462
        return lastComparison;
6463
      }
3430 rajveer 6464
      if (isSetPex()) {
6465
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6466
        if (lastComparison != 0) {
6467
          return lastComparison;
6468
        }
1982 varun.gupt 6469
      }
6470
      return 0;
6471
    }
6472
 
3430 rajveer 6473
    public _Fields fieldForId(int fieldId) {
6474
      return _Fields.findByThriftId(fieldId);
6475
    }
6476
 
6477
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6478
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6479
      iprot.readStructBegin();
6480
      while (true)
6481
      {
6482
        field = iprot.readFieldBegin();
3430 rajveer 6483
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6484
          break;
6485
        }
3430 rajveer 6486
        switch (field.id) {
6487
          case 1: // PEX
6488
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6489
              this.pex = new PromotionException();
6490
              this.pex.read(iprot);
6491
            } else { 
6492
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6493
            }
6494
            break;
6495
          default:
6496
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6497
        }
3430 rajveer 6498
        iprot.readFieldEnd();
1982 varun.gupt 6499
      }
6500
      iprot.readStructEnd();
6501
      validate();
6502
    }
6503
 
3430 rajveer 6504
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6505
      oprot.writeStructBegin(STRUCT_DESC);
6506
 
6507
      if (this.isSetPex()) {
6508
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6509
        this.pex.write(oprot);
6510
        oprot.writeFieldEnd();
6511
      }
6512
      oprot.writeFieldStop();
6513
      oprot.writeStructEnd();
6514
    }
6515
 
6516
    @Override
6517
    public String toString() {
6518
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
6519
      boolean first = true;
6520
 
6521
      sb.append("pex:");
6522
      if (this.pex == null) {
6523
        sb.append("null");
6524
      } else {
6525
        sb.append(this.pex);
6526
      }
6527
      first = false;
6528
      sb.append(")");
6529
      return sb.toString();
6530
    }
6531
 
3430 rajveer 6532
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6533
      // check for required fields
6534
    }
6535
 
3430 rajveer 6536
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6537
      try {
6538
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6539
      } catch (org.apache.thrift.TException te) {
6540
        throw new java.io.IOException(te);
6541
      }
6542
    }
6543
 
6544
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6545
      try {
6546
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6547
      } catch (org.apache.thrift.TException te) {
6548
        throw new java.io.IOException(te);
6549
      }
6550
    }
6551
 
1982 varun.gupt 6552
  }
6553
 
3430 rajveer 6554
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
6555
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 6556
 
3430 rajveer 6557
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
6558
    private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", org.apache.thrift.protocol.TType.I64, (short)2);
1982 varun.gupt 6559
 
3430 rajveer 6560
    private String couponCode; // required
6561
    private long cartId; // required
1982 varun.gupt 6562
 
6563
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6564
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6565
      COUPON_CODE((short)1, "couponCode"),
6566
      CART_ID((short)2, "cartId");
6567
 
6568
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6569
 
6570
      static {
6571
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6572
          byName.put(field.getFieldName(), field);
6573
        }
6574
      }
6575
 
6576
      /**
6577
       * Find the _Fields constant that matches fieldId, or null if its not found.
6578
       */
6579
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6580
        switch(fieldId) {
6581
          case 1: // COUPON_CODE
6582
            return COUPON_CODE;
6583
          case 2: // CART_ID
6584
            return CART_ID;
6585
          default:
6586
            return null;
6587
        }
1982 varun.gupt 6588
      }
6589
 
6590
      /**
6591
       * Find the _Fields constant that matches fieldId, throwing an exception
6592
       * if it is not found.
6593
       */
6594
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6595
        _Fields fields = findByThriftId(fieldId);
6596
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6597
        return fields;
6598
      }
6599
 
6600
      /**
6601
       * Find the _Fields constant that matches name, or null if its not found.
6602
       */
6603
      public static _Fields findByName(String name) {
6604
        return byName.get(name);
6605
      }
6606
 
6607
      private final short _thriftId;
6608
      private final String _fieldName;
6609
 
6610
      _Fields(short thriftId, String fieldName) {
6611
        _thriftId = thriftId;
6612
        _fieldName = fieldName;
6613
      }
6614
 
6615
      public short getThriftFieldId() {
6616
        return _thriftId;
6617
      }
6618
 
6619
      public String getFieldName() {
6620
        return _fieldName;
6621
      }
6622
    }
6623
 
6624
    // isset id assignments
6625
    private static final int __CARTID_ISSET_ID = 0;
6626
    private BitSet __isset_bit_vector = new BitSet(1);
6627
 
3430 rajveer 6628
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6629
    static {
3430 rajveer 6630
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6631
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6632
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6633
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6634
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6635
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6636
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 6637
    }
6638
 
6639
    public applyCoupon_args() {
6640
    }
6641
 
6642
    public applyCoupon_args(
6643
      String couponCode,
6644
      long cartId)
6645
    {
6646
      this();
6647
      this.couponCode = couponCode;
6648
      this.cartId = cartId;
6649
      setCartIdIsSet(true);
6650
    }
6651
 
6652
    /**
6653
     * Performs a deep copy on <i>other</i>.
6654
     */
6655
    public applyCoupon_args(applyCoupon_args other) {
6656
      __isset_bit_vector.clear();
6657
      __isset_bit_vector.or(other.__isset_bit_vector);
6658
      if (other.isSetCouponCode()) {
6659
        this.couponCode = other.couponCode;
6660
      }
6661
      this.cartId = other.cartId;
6662
    }
6663
 
6664
    public applyCoupon_args deepCopy() {
6665
      return new applyCoupon_args(this);
6666
    }
6667
 
3430 rajveer 6668
    @Override
6669
    public void clear() {
6670
      this.couponCode = null;
6671
      setCartIdIsSet(false);
6672
      this.cartId = 0;
1982 varun.gupt 6673
    }
6674
 
6675
    public String getCouponCode() {
6676
      return this.couponCode;
6677
    }
6678
 
3430 rajveer 6679
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6680
      this.couponCode = couponCode;
6681
    }
6682
 
6683
    public void unsetCouponCode() {
6684
      this.couponCode = null;
6685
    }
6686
 
3430 rajveer 6687
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6688
    public boolean isSetCouponCode() {
6689
      return this.couponCode != null;
6690
    }
6691
 
6692
    public void setCouponCodeIsSet(boolean value) {
6693
      if (!value) {
6694
        this.couponCode = null;
6695
      }
6696
    }
6697
 
6698
    public long getCartId() {
6699
      return this.cartId;
6700
    }
6701
 
3430 rajveer 6702
    public void setCartId(long cartId) {
1982 varun.gupt 6703
      this.cartId = cartId;
6704
      setCartIdIsSet(true);
6705
    }
6706
 
6707
    public void unsetCartId() {
6708
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
6709
    }
6710
 
3430 rajveer 6711
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6712
    public boolean isSetCartId() {
6713
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
6714
    }
6715
 
6716
    public void setCartIdIsSet(boolean value) {
6717
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
6718
    }
6719
 
6720
    public void setFieldValue(_Fields field, Object value) {
6721
      switch (field) {
6722
      case COUPON_CODE:
6723
        if (value == null) {
6724
          unsetCouponCode();
6725
        } else {
6726
          setCouponCode((String)value);
6727
        }
6728
        break;
6729
 
6730
      case CART_ID:
6731
        if (value == null) {
6732
          unsetCartId();
6733
        } else {
6734
          setCartId((Long)value);
6735
        }
6736
        break;
6737
 
6738
      }
6739
    }
6740
 
6741
    public Object getFieldValue(_Fields field) {
6742
      switch (field) {
6743
      case COUPON_CODE:
6744
        return getCouponCode();
6745
 
6746
      case CART_ID:
3430 rajveer 6747
        return Long.valueOf(getCartId());
1982 varun.gupt 6748
 
6749
      }
6750
      throw new IllegalStateException();
6751
    }
6752
 
3430 rajveer 6753
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6754
    public boolean isSet(_Fields field) {
6755
      if (field == null) {
6756
        throw new IllegalArgumentException();
6757
      }
1982 varun.gupt 6758
 
6759
      switch (field) {
6760
      case COUPON_CODE:
6761
        return isSetCouponCode();
6762
      case CART_ID:
6763
        return isSetCartId();
6764
      }
6765
      throw new IllegalStateException();
6766
    }
6767
 
6768
    @Override
6769
    public boolean equals(Object that) {
6770
      if (that == null)
6771
        return false;
6772
      if (that instanceof applyCoupon_args)
6773
        return this.equals((applyCoupon_args)that);
6774
      return false;
6775
    }
6776
 
6777
    public boolean equals(applyCoupon_args that) {
6778
      if (that == null)
6779
        return false;
6780
 
6781
      boolean this_present_couponCode = true && this.isSetCouponCode();
6782
      boolean that_present_couponCode = true && that.isSetCouponCode();
6783
      if (this_present_couponCode || that_present_couponCode) {
6784
        if (!(this_present_couponCode && that_present_couponCode))
6785
          return false;
6786
        if (!this.couponCode.equals(that.couponCode))
6787
          return false;
6788
      }
6789
 
6790
      boolean this_present_cartId = true;
6791
      boolean that_present_cartId = true;
6792
      if (this_present_cartId || that_present_cartId) {
6793
        if (!(this_present_cartId && that_present_cartId))
6794
          return false;
6795
        if (this.cartId != that.cartId)
6796
          return false;
6797
      }
6798
 
6799
      return true;
6800
    }
6801
 
6802
    @Override
6803
    public int hashCode() {
6804
      return 0;
6805
    }
6806
 
6807
    public int compareTo(applyCoupon_args other) {
6808
      if (!getClass().equals(other.getClass())) {
6809
        return getClass().getName().compareTo(other.getClass().getName());
6810
      }
6811
 
6812
      int lastComparison = 0;
6813
      applyCoupon_args typedOther = (applyCoupon_args)other;
6814
 
3430 rajveer 6815
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6816
      if (lastComparison != 0) {
6817
        return lastComparison;
6818
      }
3430 rajveer 6819
      if (isSetCouponCode()) {
6820
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6821
        if (lastComparison != 0) {
6822
          return lastComparison;
6823
        }
1982 varun.gupt 6824
      }
3430 rajveer 6825
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 6826
      if (lastComparison != 0) {
6827
        return lastComparison;
6828
      }
3430 rajveer 6829
      if (isSetCartId()) {
6830
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
6831
        if (lastComparison != 0) {
6832
          return lastComparison;
6833
        }
1982 varun.gupt 6834
      }
6835
      return 0;
6836
    }
6837
 
3430 rajveer 6838
    public _Fields fieldForId(int fieldId) {
6839
      return _Fields.findByThriftId(fieldId);
6840
    }
6841
 
6842
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6843
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6844
      iprot.readStructBegin();
6845
      while (true)
6846
      {
6847
        field = iprot.readFieldBegin();
3430 rajveer 6848
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6849
          break;
6850
        }
3430 rajveer 6851
        switch (field.id) {
6852
          case 1: // COUPON_CODE
6853
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6854
              this.couponCode = iprot.readString();
6855
            } else { 
6856
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6857
            }
6858
            break;
6859
          case 2: // CART_ID
6860
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6861
              this.cartId = iprot.readI64();
6862
              setCartIdIsSet(true);
6863
            } else { 
6864
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6865
            }
6866
            break;
6867
          default:
6868
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6869
        }
3430 rajveer 6870
        iprot.readFieldEnd();
1982 varun.gupt 6871
      }
6872
      iprot.readStructEnd();
6873
      validate();
6874
    }
6875
 
3430 rajveer 6876
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6877
      validate();
6878
 
6879
      oprot.writeStructBegin(STRUCT_DESC);
6880
      if (this.couponCode != null) {
6881
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6882
        oprot.writeString(this.couponCode);
6883
        oprot.writeFieldEnd();
6884
      }
6885
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
6886
      oprot.writeI64(this.cartId);
6887
      oprot.writeFieldEnd();
6888
      oprot.writeFieldStop();
6889
      oprot.writeStructEnd();
6890
    }
6891
 
6892
    @Override
6893
    public String toString() {
6894
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
6895
      boolean first = true;
6896
 
6897
      sb.append("couponCode:");
6898
      if (this.couponCode == null) {
6899
        sb.append("null");
6900
      } else {
6901
        sb.append(this.couponCode);
6902
      }
6903
      first = false;
6904
      if (!first) sb.append(", ");
6905
      sb.append("cartId:");
6906
      sb.append(this.cartId);
6907
      first = false;
6908
      sb.append(")");
6909
      return sb.toString();
6910
    }
6911
 
3430 rajveer 6912
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6913
      // check for required fields
6914
    }
6915
 
3430 rajveer 6916
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6917
      try {
6918
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6919
      } catch (org.apache.thrift.TException te) {
6920
        throw new java.io.IOException(te);
6921
      }
6922
    }
6923
 
6924
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6925
      try {
6926
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6927
        __isset_bit_vector = new BitSet(1);
6928
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6929
      } catch (org.apache.thrift.TException te) {
6930
        throw new java.io.IOException(te);
6931
      }
6932
    }
6933
 
1982 varun.gupt 6934
  }
6935
 
3430 rajveer 6936
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
6937
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 6938
 
3430 rajveer 6939
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
6940
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 6941
 
3430 rajveer 6942
    private Cart success; // required
6943
    private PromotionException pex; // required
1982 varun.gupt 6944
 
6945
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6946
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6947
      SUCCESS((short)0, "success"),
6948
      PEX((short)1, "pex");
6949
 
6950
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6951
 
6952
      static {
6953
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6954
          byName.put(field.getFieldName(), field);
6955
        }
6956
      }
6957
 
6958
      /**
6959
       * Find the _Fields constant that matches fieldId, or null if its not found.
6960
       */
6961
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6962
        switch(fieldId) {
6963
          case 0: // SUCCESS
6964
            return SUCCESS;
6965
          case 1: // PEX
6966
            return PEX;
6967
          default:
6968
            return null;
6969
        }
1982 varun.gupt 6970
      }
6971
 
6972
      /**
6973
       * Find the _Fields constant that matches fieldId, throwing an exception
6974
       * if it is not found.
6975
       */
6976
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6977
        _Fields fields = findByThriftId(fieldId);
6978
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6979
        return fields;
6980
      }
6981
 
6982
      /**
6983
       * Find the _Fields constant that matches name, or null if its not found.
6984
       */
6985
      public static _Fields findByName(String name) {
6986
        return byName.get(name);
6987
      }
6988
 
6989
      private final short _thriftId;
6990
      private final String _fieldName;
6991
 
6992
      _Fields(short thriftId, String fieldName) {
6993
        _thriftId = thriftId;
6994
        _fieldName = fieldName;
6995
      }
6996
 
6997
      public short getThriftFieldId() {
6998
        return _thriftId;
6999
      }
7000
 
7001
      public String getFieldName() {
7002
        return _fieldName;
7003
      }
7004
    }
7005
 
7006
    // isset id assignments
7007
 
3430 rajveer 7008
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7009
    static {
3430 rajveer 7010
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7011
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7012
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
7013
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7014
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7015
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7016
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 7017
    }
7018
 
7019
    public applyCoupon_result() {
7020
    }
7021
 
7022
    public applyCoupon_result(
7023
      Cart success,
7024
      PromotionException pex)
7025
    {
7026
      this();
7027
      this.success = success;
7028
      this.pex = pex;
7029
    }
7030
 
7031
    /**
7032
     * Performs a deep copy on <i>other</i>.
7033
     */
7034
    public applyCoupon_result(applyCoupon_result other) {
7035
      if (other.isSetSuccess()) {
7036
        this.success = new Cart(other.success);
7037
      }
7038
      if (other.isSetPex()) {
7039
        this.pex = new PromotionException(other.pex);
7040
      }
7041
    }
7042
 
7043
    public applyCoupon_result deepCopy() {
7044
      return new applyCoupon_result(this);
7045
    }
7046
 
3430 rajveer 7047
    @Override
7048
    public void clear() {
7049
      this.success = null;
7050
      this.pex = null;
1982 varun.gupt 7051
    }
7052
 
7053
    public Cart getSuccess() {
7054
      return this.success;
7055
    }
7056
 
3430 rajveer 7057
    public void setSuccess(Cart success) {
1982 varun.gupt 7058
      this.success = success;
7059
    }
7060
 
7061
    public void unsetSuccess() {
7062
      this.success = null;
7063
    }
7064
 
3430 rajveer 7065
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7066
    public boolean isSetSuccess() {
7067
      return this.success != null;
7068
    }
7069
 
7070
    public void setSuccessIsSet(boolean value) {
7071
      if (!value) {
7072
        this.success = null;
7073
      }
7074
    }
7075
 
7076
    public PromotionException getPex() {
7077
      return this.pex;
7078
    }
7079
 
3430 rajveer 7080
    public void setPex(PromotionException pex) {
1982 varun.gupt 7081
      this.pex = pex;
7082
    }
7083
 
7084
    public void unsetPex() {
7085
      this.pex = null;
7086
    }
7087
 
3430 rajveer 7088
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7089
    public boolean isSetPex() {
7090
      return this.pex != null;
7091
    }
7092
 
7093
    public void setPexIsSet(boolean value) {
7094
      if (!value) {
7095
        this.pex = null;
7096
      }
7097
    }
7098
 
7099
    public void setFieldValue(_Fields field, Object value) {
7100
      switch (field) {
7101
      case SUCCESS:
7102
        if (value == null) {
7103
          unsetSuccess();
7104
        } else {
7105
          setSuccess((Cart)value);
7106
        }
7107
        break;
7108
 
7109
      case PEX:
7110
        if (value == null) {
7111
          unsetPex();
7112
        } else {
7113
          setPex((PromotionException)value);
7114
        }
7115
        break;
7116
 
7117
      }
7118
    }
7119
 
7120
    public Object getFieldValue(_Fields field) {
7121
      switch (field) {
7122
      case SUCCESS:
7123
        return getSuccess();
7124
 
7125
      case PEX:
7126
        return getPex();
7127
 
7128
      }
7129
      throw new IllegalStateException();
7130
    }
7131
 
3430 rajveer 7132
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7133
    public boolean isSet(_Fields field) {
7134
      if (field == null) {
7135
        throw new IllegalArgumentException();
7136
      }
1982 varun.gupt 7137
 
7138
      switch (field) {
7139
      case SUCCESS:
7140
        return isSetSuccess();
7141
      case PEX:
7142
        return isSetPex();
7143
      }
7144
      throw new IllegalStateException();
7145
    }
7146
 
7147
    @Override
7148
    public boolean equals(Object that) {
7149
      if (that == null)
7150
        return false;
7151
      if (that instanceof applyCoupon_result)
7152
        return this.equals((applyCoupon_result)that);
7153
      return false;
7154
    }
7155
 
7156
    public boolean equals(applyCoupon_result that) {
7157
      if (that == null)
7158
        return false;
7159
 
7160
      boolean this_present_success = true && this.isSetSuccess();
7161
      boolean that_present_success = true && that.isSetSuccess();
7162
      if (this_present_success || that_present_success) {
7163
        if (!(this_present_success && that_present_success))
7164
          return false;
7165
        if (!this.success.equals(that.success))
7166
          return false;
7167
      }
7168
 
7169
      boolean this_present_pex = true && this.isSetPex();
7170
      boolean that_present_pex = true && that.isSetPex();
7171
      if (this_present_pex || that_present_pex) {
7172
        if (!(this_present_pex && that_present_pex))
7173
          return false;
7174
        if (!this.pex.equals(that.pex))
7175
          return false;
7176
      }
7177
 
7178
      return true;
7179
    }
7180
 
7181
    @Override
7182
    public int hashCode() {
7183
      return 0;
7184
    }
7185
 
7186
    public int compareTo(applyCoupon_result other) {
7187
      if (!getClass().equals(other.getClass())) {
7188
        return getClass().getName().compareTo(other.getClass().getName());
7189
      }
7190
 
7191
      int lastComparison = 0;
7192
      applyCoupon_result typedOther = (applyCoupon_result)other;
7193
 
3430 rajveer 7194
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 7195
      if (lastComparison != 0) {
7196
        return lastComparison;
7197
      }
3430 rajveer 7198
      if (isSetSuccess()) {
7199
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7200
        if (lastComparison != 0) {
7201
          return lastComparison;
7202
        }
1982 varun.gupt 7203
      }
3430 rajveer 7204
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7205
      if (lastComparison != 0) {
7206
        return lastComparison;
7207
      }
3430 rajveer 7208
      if (isSetPex()) {
7209
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7210
        if (lastComparison != 0) {
7211
          return lastComparison;
7212
        }
1982 varun.gupt 7213
      }
7214
      return 0;
7215
    }
7216
 
3430 rajveer 7217
    public _Fields fieldForId(int fieldId) {
7218
      return _Fields.findByThriftId(fieldId);
7219
    }
7220
 
7221
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7222
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7223
      iprot.readStructBegin();
7224
      while (true)
7225
      {
7226
        field = iprot.readFieldBegin();
3430 rajveer 7227
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7228
          break;
7229
        }
3430 rajveer 7230
        switch (field.id) {
7231
          case 0: // SUCCESS
7232
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7233
              this.success = new Cart();
7234
              this.success.read(iprot);
7235
            } else { 
7236
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7237
            }
7238
            break;
7239
          case 1: // PEX
7240
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7241
              this.pex = new PromotionException();
7242
              this.pex.read(iprot);
7243
            } else { 
7244
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7245
            }
7246
            break;
7247
          default:
7248
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7249
        }
3430 rajveer 7250
        iprot.readFieldEnd();
1982 varun.gupt 7251
      }
7252
      iprot.readStructEnd();
7253
      validate();
7254
    }
7255
 
3430 rajveer 7256
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7257
      oprot.writeStructBegin(STRUCT_DESC);
7258
 
7259
      if (this.isSetSuccess()) {
7260
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7261
        this.success.write(oprot);
7262
        oprot.writeFieldEnd();
7263
      } else if (this.isSetPex()) {
7264
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7265
        this.pex.write(oprot);
7266
        oprot.writeFieldEnd();
7267
      }
7268
      oprot.writeFieldStop();
7269
      oprot.writeStructEnd();
7270
    }
7271
 
7272
    @Override
7273
    public String toString() {
7274
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
7275
      boolean first = true;
7276
 
7277
      sb.append("success:");
7278
      if (this.success == null) {
7279
        sb.append("null");
7280
      } else {
7281
        sb.append(this.success);
7282
      }
7283
      first = false;
7284
      if (!first) sb.append(", ");
7285
      sb.append("pex:");
7286
      if (this.pex == null) {
7287
        sb.append("null");
7288
      } else {
7289
        sb.append(this.pex);
7290
      }
7291
      first = false;
7292
      sb.append(")");
7293
      return sb.toString();
7294
    }
7295
 
3430 rajveer 7296
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7297
      // check for required fields
7298
    }
7299
 
3430 rajveer 7300
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7301
      try {
7302
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7303
      } catch (org.apache.thrift.TException te) {
7304
        throw new java.io.IOException(te);
7305
      }
7306
    }
7307
 
7308
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7309
      try {
7310
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7311
      } catch (org.apache.thrift.TException te) {
7312
        throw new java.io.IOException(te);
7313
      }
7314
    }
7315
 
1982 varun.gupt 7316
  }
7317
 
3430 rajveer 7318
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
7319
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 7320
 
3430 rajveer 7321
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
7322
    private static final org.apache.thrift.protocol.TField TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionId", org.apache.thrift.protocol.TType.I64, (short)2);
7323
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
1982 varun.gupt 7324
 
3430 rajveer 7325
    private String couponCode; // required
7326
    private long transactionId; // required
7327
    private long userId; // required
1982 varun.gupt 7328
 
7329
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7330
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7331
      COUPON_CODE((short)1, "couponCode"),
7332
      TRANSACTION_ID((short)2, "transactionId"),
7333
      USER_ID((short)3, "userId");
7334
 
7335
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7336
 
7337
      static {
7338
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7339
          byName.put(field.getFieldName(), field);
7340
        }
7341
      }
7342
 
7343
      /**
7344
       * Find the _Fields constant that matches fieldId, or null if its not found.
7345
       */
7346
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7347
        switch(fieldId) {
7348
          case 1: // COUPON_CODE
7349
            return COUPON_CODE;
7350
          case 2: // TRANSACTION_ID
7351
            return TRANSACTION_ID;
7352
          case 3: // USER_ID
7353
            return USER_ID;
7354
          default:
7355
            return null;
7356
        }
1982 varun.gupt 7357
      }
7358
 
7359
      /**
7360
       * Find the _Fields constant that matches fieldId, throwing an exception
7361
       * if it is not found.
7362
       */
7363
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7364
        _Fields fields = findByThriftId(fieldId);
7365
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7366
        return fields;
7367
      }
7368
 
7369
      /**
7370
       * Find the _Fields constant that matches name, or null if its not found.
7371
       */
7372
      public static _Fields findByName(String name) {
7373
        return byName.get(name);
7374
      }
7375
 
7376
      private final short _thriftId;
7377
      private final String _fieldName;
7378
 
7379
      _Fields(short thriftId, String fieldName) {
7380
        _thriftId = thriftId;
7381
        _fieldName = fieldName;
7382
      }
7383
 
7384
      public short getThriftFieldId() {
7385
        return _thriftId;
7386
      }
7387
 
7388
      public String getFieldName() {
7389
        return _fieldName;
7390
      }
7391
    }
7392
 
7393
    // isset id assignments
7394
    private static final int __TRANSACTIONID_ISSET_ID = 0;
7395
    private static final int __USERID_ISSET_ID = 1;
7396
    private BitSet __isset_bit_vector = new BitSet(2);
7397
 
3430 rajveer 7398
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7399
    static {
3430 rajveer 7400
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7401
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7402
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7403
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7404
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7405
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7406
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7407
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7408
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 7409
    }
7410
 
7411
    public trackCouponUsage_args() {
7412
    }
7413
 
7414
    public trackCouponUsage_args(
7415
      String couponCode,
7416
      long transactionId,
7417
      long userId)
7418
    {
7419
      this();
7420
      this.couponCode = couponCode;
7421
      this.transactionId = transactionId;
7422
      setTransactionIdIsSet(true);
7423
      this.userId = userId;
7424
      setUserIdIsSet(true);
7425
    }
7426
 
7427
    /**
7428
     * Performs a deep copy on <i>other</i>.
7429
     */
7430
    public trackCouponUsage_args(trackCouponUsage_args other) {
7431
      __isset_bit_vector.clear();
7432
      __isset_bit_vector.or(other.__isset_bit_vector);
7433
      if (other.isSetCouponCode()) {
7434
        this.couponCode = other.couponCode;
7435
      }
7436
      this.transactionId = other.transactionId;
7437
      this.userId = other.userId;
7438
    }
7439
 
7440
    public trackCouponUsage_args deepCopy() {
7441
      return new trackCouponUsage_args(this);
7442
    }
7443
 
3430 rajveer 7444
    @Override
7445
    public void clear() {
7446
      this.couponCode = null;
7447
      setTransactionIdIsSet(false);
7448
      this.transactionId = 0;
7449
      setUserIdIsSet(false);
7450
      this.userId = 0;
1982 varun.gupt 7451
    }
7452
 
7453
    public String getCouponCode() {
7454
      return this.couponCode;
7455
    }
7456
 
3430 rajveer 7457
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7458
      this.couponCode = couponCode;
7459
    }
7460
 
7461
    public void unsetCouponCode() {
7462
      this.couponCode = null;
7463
    }
7464
 
3430 rajveer 7465
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7466
    public boolean isSetCouponCode() {
7467
      return this.couponCode != null;
7468
    }
7469
 
7470
    public void setCouponCodeIsSet(boolean value) {
7471
      if (!value) {
7472
        this.couponCode = null;
7473
      }
7474
    }
7475
 
7476
    public long getTransactionId() {
7477
      return this.transactionId;
7478
    }
7479
 
3430 rajveer 7480
    public void setTransactionId(long transactionId) {
1982 varun.gupt 7481
      this.transactionId = transactionId;
7482
      setTransactionIdIsSet(true);
7483
    }
7484
 
7485
    public void unsetTransactionId() {
7486
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
7487
    }
7488
 
3430 rajveer 7489
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7490
    public boolean isSetTransactionId() {
7491
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
7492
    }
7493
 
7494
    public void setTransactionIdIsSet(boolean value) {
7495
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
7496
    }
7497
 
7498
    public long getUserId() {
7499
      return this.userId;
7500
    }
7501
 
3430 rajveer 7502
    public void setUserId(long userId) {
1982 varun.gupt 7503
      this.userId = userId;
7504
      setUserIdIsSet(true);
7505
    }
7506
 
7507
    public void unsetUserId() {
7508
      __isset_bit_vector.clear(__USERID_ISSET_ID);
7509
    }
7510
 
3430 rajveer 7511
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7512
    public boolean isSetUserId() {
7513
      return __isset_bit_vector.get(__USERID_ISSET_ID);
7514
    }
7515
 
7516
    public void setUserIdIsSet(boolean value) {
7517
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
7518
    }
7519
 
7520
    public void setFieldValue(_Fields field, Object value) {
7521
      switch (field) {
7522
      case COUPON_CODE:
7523
        if (value == null) {
7524
          unsetCouponCode();
7525
        } else {
7526
          setCouponCode((String)value);
7527
        }
7528
        break;
7529
 
7530
      case TRANSACTION_ID:
7531
        if (value == null) {
7532
          unsetTransactionId();
7533
        } else {
7534
          setTransactionId((Long)value);
7535
        }
7536
        break;
7537
 
7538
      case USER_ID:
7539
        if (value == null) {
7540
          unsetUserId();
7541
        } else {
7542
          setUserId((Long)value);
7543
        }
7544
        break;
7545
 
7546
      }
7547
    }
7548
 
7549
    public Object getFieldValue(_Fields field) {
7550
      switch (field) {
7551
      case COUPON_CODE:
7552
        return getCouponCode();
7553
 
7554
      case TRANSACTION_ID:
3430 rajveer 7555
        return Long.valueOf(getTransactionId());
1982 varun.gupt 7556
 
7557
      case USER_ID:
3430 rajveer 7558
        return Long.valueOf(getUserId());
1982 varun.gupt 7559
 
7560
      }
7561
      throw new IllegalStateException();
7562
    }
7563
 
3430 rajveer 7564
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7565
    public boolean isSet(_Fields field) {
7566
      if (field == null) {
7567
        throw new IllegalArgumentException();
7568
      }
1982 varun.gupt 7569
 
7570
      switch (field) {
7571
      case COUPON_CODE:
7572
        return isSetCouponCode();
7573
      case TRANSACTION_ID:
7574
        return isSetTransactionId();
7575
      case USER_ID:
7576
        return isSetUserId();
7577
      }
7578
      throw new IllegalStateException();
7579
    }
7580
 
7581
    @Override
7582
    public boolean equals(Object that) {
7583
      if (that == null)
7584
        return false;
7585
      if (that instanceof trackCouponUsage_args)
7586
        return this.equals((trackCouponUsage_args)that);
7587
      return false;
7588
    }
7589
 
7590
    public boolean equals(trackCouponUsage_args that) {
7591
      if (that == null)
7592
        return false;
7593
 
7594
      boolean this_present_couponCode = true && this.isSetCouponCode();
7595
      boolean that_present_couponCode = true && that.isSetCouponCode();
7596
      if (this_present_couponCode || that_present_couponCode) {
7597
        if (!(this_present_couponCode && that_present_couponCode))
7598
          return false;
7599
        if (!this.couponCode.equals(that.couponCode))
7600
          return false;
7601
      }
7602
 
7603
      boolean this_present_transactionId = true;
7604
      boolean that_present_transactionId = true;
7605
      if (this_present_transactionId || that_present_transactionId) {
7606
        if (!(this_present_transactionId && that_present_transactionId))
7607
          return false;
7608
        if (this.transactionId != that.transactionId)
7609
          return false;
7610
      }
7611
 
7612
      boolean this_present_userId = true;
7613
      boolean that_present_userId = true;
7614
      if (this_present_userId || that_present_userId) {
7615
        if (!(this_present_userId && that_present_userId))
7616
          return false;
7617
        if (this.userId != that.userId)
7618
          return false;
7619
      }
7620
 
7621
      return true;
7622
    }
7623
 
7624
    @Override
7625
    public int hashCode() {
7626
      return 0;
7627
    }
7628
 
7629
    public int compareTo(trackCouponUsage_args other) {
7630
      if (!getClass().equals(other.getClass())) {
7631
        return getClass().getName().compareTo(other.getClass().getName());
7632
      }
7633
 
7634
      int lastComparison = 0;
7635
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
7636
 
3430 rajveer 7637
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7638
      if (lastComparison != 0) {
7639
        return lastComparison;
7640
      }
3430 rajveer 7641
      if (isSetCouponCode()) {
7642
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7643
        if (lastComparison != 0) {
7644
          return lastComparison;
7645
        }
1982 varun.gupt 7646
      }
3430 rajveer 7647
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 7648
      if (lastComparison != 0) {
7649
        return lastComparison;
7650
      }
3430 rajveer 7651
      if (isSetTransactionId()) {
7652
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
7653
        if (lastComparison != 0) {
7654
          return lastComparison;
7655
        }
1982 varun.gupt 7656
      }
3430 rajveer 7657
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 7658
      if (lastComparison != 0) {
7659
        return lastComparison;
7660
      }
3430 rajveer 7661
      if (isSetUserId()) {
7662
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
7663
        if (lastComparison != 0) {
7664
          return lastComparison;
7665
        }
1982 varun.gupt 7666
      }
7667
      return 0;
7668
    }
7669
 
3430 rajveer 7670
    public _Fields fieldForId(int fieldId) {
7671
      return _Fields.findByThriftId(fieldId);
7672
    }
7673
 
7674
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7675
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7676
      iprot.readStructBegin();
7677
      while (true)
7678
      {
7679
        field = iprot.readFieldBegin();
3430 rajveer 7680
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7681
          break;
7682
        }
3430 rajveer 7683
        switch (field.id) {
7684
          case 1: // COUPON_CODE
7685
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7686
              this.couponCode = iprot.readString();
7687
            } else { 
7688
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7689
            }
7690
            break;
7691
          case 2: // TRANSACTION_ID
7692
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7693
              this.transactionId = iprot.readI64();
7694
              setTransactionIdIsSet(true);
7695
            } else { 
7696
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7697
            }
7698
            break;
7699
          case 3: // USER_ID
7700
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7701
              this.userId = iprot.readI64();
7702
              setUserIdIsSet(true);
7703
            } else { 
7704
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7705
            }
7706
            break;
7707
          default:
7708
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7709
        }
3430 rajveer 7710
        iprot.readFieldEnd();
1982 varun.gupt 7711
      }
7712
      iprot.readStructEnd();
7713
      validate();
7714
    }
7715
 
3430 rajveer 7716
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7717
      validate();
7718
 
7719
      oprot.writeStructBegin(STRUCT_DESC);
7720
      if (this.couponCode != null) {
7721
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7722
        oprot.writeString(this.couponCode);
7723
        oprot.writeFieldEnd();
7724
      }
7725
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
7726
      oprot.writeI64(this.transactionId);
7727
      oprot.writeFieldEnd();
7728
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
7729
      oprot.writeI64(this.userId);
7730
      oprot.writeFieldEnd();
7731
      oprot.writeFieldStop();
7732
      oprot.writeStructEnd();
7733
    }
7734
 
7735
    @Override
7736
    public String toString() {
7737
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
7738
      boolean first = true;
7739
 
7740
      sb.append("couponCode:");
7741
      if (this.couponCode == null) {
7742
        sb.append("null");
7743
      } else {
7744
        sb.append(this.couponCode);
7745
      }
7746
      first = false;
7747
      if (!first) sb.append(", ");
7748
      sb.append("transactionId:");
7749
      sb.append(this.transactionId);
7750
      first = false;
7751
      if (!first) sb.append(", ");
7752
      sb.append("userId:");
7753
      sb.append(this.userId);
7754
      first = false;
7755
      sb.append(")");
7756
      return sb.toString();
7757
    }
7758
 
3430 rajveer 7759
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7760
      // check for required fields
7761
    }
7762
 
3430 rajveer 7763
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7764
      try {
7765
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7766
      } catch (org.apache.thrift.TException te) {
7767
        throw new java.io.IOException(te);
7768
      }
7769
    }
7770
 
7771
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7772
      try {
7773
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7774
        __isset_bit_vector = new BitSet(1);
7775
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7776
      } catch (org.apache.thrift.TException te) {
7777
        throw new java.io.IOException(te);
7778
      }
7779
    }
7780
 
1982 varun.gupt 7781
  }
7782
 
3430 rajveer 7783
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
7784
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 7785
 
3430 rajveer 7786
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 7787
 
3430 rajveer 7788
    private PromotionException pex; // required
1982 varun.gupt 7789
 
7790
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7791
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7792
      PEX((short)1, "pex");
7793
 
7794
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7795
 
7796
      static {
7797
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7798
          byName.put(field.getFieldName(), field);
7799
        }
7800
      }
7801
 
7802
      /**
7803
       * Find the _Fields constant that matches fieldId, or null if its not found.
7804
       */
7805
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7806
        switch(fieldId) {
7807
          case 1: // PEX
7808
            return PEX;
7809
          default:
7810
            return null;
7811
        }
1982 varun.gupt 7812
      }
7813
 
7814
      /**
7815
       * Find the _Fields constant that matches fieldId, throwing an exception
7816
       * if it is not found.
7817
       */
7818
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7819
        _Fields fields = findByThriftId(fieldId);
7820
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7821
        return fields;
7822
      }
7823
 
7824
      /**
7825
       * Find the _Fields constant that matches name, or null if its not found.
7826
       */
7827
      public static _Fields findByName(String name) {
7828
        return byName.get(name);
7829
      }
7830
 
7831
      private final short _thriftId;
7832
      private final String _fieldName;
7833
 
7834
      _Fields(short thriftId, String fieldName) {
7835
        _thriftId = thriftId;
7836
        _fieldName = fieldName;
7837
      }
7838
 
7839
      public short getThriftFieldId() {
7840
        return _thriftId;
7841
      }
7842
 
7843
      public String getFieldName() {
7844
        return _fieldName;
7845
      }
7846
    }
7847
 
7848
    // isset id assignments
7849
 
3430 rajveer 7850
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7851
    static {
3430 rajveer 7852
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7853
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7854
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7855
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7856
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 7857
    }
7858
 
7859
    public trackCouponUsage_result() {
7860
    }
7861
 
7862
    public trackCouponUsage_result(
7863
      PromotionException pex)
7864
    {
7865
      this();
7866
      this.pex = pex;
7867
    }
7868
 
7869
    /**
7870
     * Performs a deep copy on <i>other</i>.
7871
     */
7872
    public trackCouponUsage_result(trackCouponUsage_result other) {
7873
      if (other.isSetPex()) {
7874
        this.pex = new PromotionException(other.pex);
7875
      }
7876
    }
7877
 
7878
    public trackCouponUsage_result deepCopy() {
7879
      return new trackCouponUsage_result(this);
7880
    }
7881
 
3430 rajveer 7882
    @Override
7883
    public void clear() {
7884
      this.pex = null;
1982 varun.gupt 7885
    }
7886
 
7887
    public PromotionException getPex() {
7888
      return this.pex;
7889
    }
7890
 
3430 rajveer 7891
    public void setPex(PromotionException pex) {
1982 varun.gupt 7892
      this.pex = pex;
7893
    }
7894
 
7895
    public void unsetPex() {
7896
      this.pex = null;
7897
    }
7898
 
3430 rajveer 7899
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7900
    public boolean isSetPex() {
7901
      return this.pex != null;
7902
    }
7903
 
7904
    public void setPexIsSet(boolean value) {
7905
      if (!value) {
7906
        this.pex = null;
7907
      }
7908
    }
7909
 
7910
    public void setFieldValue(_Fields field, Object value) {
7911
      switch (field) {
7912
      case PEX:
7913
        if (value == null) {
7914
          unsetPex();
7915
        } else {
7916
          setPex((PromotionException)value);
7917
        }
7918
        break;
7919
 
7920
      }
7921
    }
7922
 
7923
    public Object getFieldValue(_Fields field) {
7924
      switch (field) {
7925
      case PEX:
7926
        return getPex();
7927
 
7928
      }
7929
      throw new IllegalStateException();
7930
    }
7931
 
3430 rajveer 7932
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7933
    public boolean isSet(_Fields field) {
7934
      if (field == null) {
7935
        throw new IllegalArgumentException();
7936
      }
1982 varun.gupt 7937
 
7938
      switch (field) {
7939
      case PEX:
7940
        return isSetPex();
7941
      }
7942
      throw new IllegalStateException();
7943
    }
7944
 
7945
    @Override
7946
    public boolean equals(Object that) {
7947
      if (that == null)
7948
        return false;
7949
      if (that instanceof trackCouponUsage_result)
7950
        return this.equals((trackCouponUsage_result)that);
7951
      return false;
7952
    }
7953
 
7954
    public boolean equals(trackCouponUsage_result that) {
7955
      if (that == null)
7956
        return false;
7957
 
7958
      boolean this_present_pex = true && this.isSetPex();
7959
      boolean that_present_pex = true && that.isSetPex();
7960
      if (this_present_pex || that_present_pex) {
7961
        if (!(this_present_pex && that_present_pex))
7962
          return false;
7963
        if (!this.pex.equals(that.pex))
7964
          return false;
7965
      }
7966
 
7967
      return true;
7968
    }
7969
 
7970
    @Override
7971
    public int hashCode() {
7972
      return 0;
7973
    }
7974
 
7975
    public int compareTo(trackCouponUsage_result other) {
7976
      if (!getClass().equals(other.getClass())) {
7977
        return getClass().getName().compareTo(other.getClass().getName());
7978
      }
7979
 
7980
      int lastComparison = 0;
7981
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
7982
 
3430 rajveer 7983
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7984
      if (lastComparison != 0) {
7985
        return lastComparison;
7986
      }
3430 rajveer 7987
      if (isSetPex()) {
7988
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7989
        if (lastComparison != 0) {
7990
          return lastComparison;
7991
        }
1982 varun.gupt 7992
      }
7993
      return 0;
7994
    }
7995
 
3430 rajveer 7996
    public _Fields fieldForId(int fieldId) {
7997
      return _Fields.findByThriftId(fieldId);
7998
    }
7999
 
8000
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8001
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8002
      iprot.readStructBegin();
8003
      while (true)
8004
      {
8005
        field = iprot.readFieldBegin();
3430 rajveer 8006
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8007
          break;
8008
        }
3430 rajveer 8009
        switch (field.id) {
8010
          case 1: // PEX
8011
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8012
              this.pex = new PromotionException();
8013
              this.pex.read(iprot);
8014
            } else { 
8015
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8016
            }
8017
            break;
8018
          default:
8019
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8020
        }
3430 rajveer 8021
        iprot.readFieldEnd();
1982 varun.gupt 8022
      }
8023
      iprot.readStructEnd();
8024
      validate();
8025
    }
8026
 
3430 rajveer 8027
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8028
      oprot.writeStructBegin(STRUCT_DESC);
8029
 
8030
      if (this.isSetPex()) {
8031
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8032
        this.pex.write(oprot);
8033
        oprot.writeFieldEnd();
8034
      }
8035
      oprot.writeFieldStop();
8036
      oprot.writeStructEnd();
8037
    }
8038
 
8039
    @Override
8040
    public String toString() {
8041
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
8042
      boolean first = true;
8043
 
8044
      sb.append("pex:");
8045
      if (this.pex == null) {
8046
        sb.append("null");
8047
      } else {
8048
        sb.append(this.pex);
8049
      }
8050
      first = false;
8051
      sb.append(")");
8052
      return sb.toString();
8053
    }
8054
 
3430 rajveer 8055
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8056
      // check for required fields
8057
    }
8058
 
3430 rajveer 8059
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8060
      try {
8061
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8062
      } catch (org.apache.thrift.TException te) {
8063
        throw new java.io.IOException(te);
8064
      }
8065
    }
8066
 
8067
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8068
      try {
8069
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8070
      } catch (org.apache.thrift.TException te) {
8071
        throw new java.io.IOException(te);
8072
      }
8073
    }
8074
 
1982 varun.gupt 8075
  }
8076
 
3430 rajveer 8077
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
8078
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 8079
 
3430 rajveer 8080
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
8081
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)2);
1982 varun.gupt 8082
 
3430 rajveer 8083
    private String couponCode; // required
8084
    private long userId; // required
1982 varun.gupt 8085
 
8086
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8087
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8088
      COUPON_CODE((short)1, "couponCode"),
8089
      USER_ID((short)2, "userId");
8090
 
8091
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8092
 
8093
      static {
8094
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8095
          byName.put(field.getFieldName(), field);
8096
        }
8097
      }
8098
 
8099
      /**
8100
       * Find the _Fields constant that matches fieldId, or null if its not found.
8101
       */
8102
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8103
        switch(fieldId) {
8104
          case 1: // COUPON_CODE
8105
            return COUPON_CODE;
8106
          case 2: // USER_ID
8107
            return USER_ID;
8108
          default:
8109
            return null;
8110
        }
1982 varun.gupt 8111
      }
8112
 
8113
      /**
8114
       * Find the _Fields constant that matches fieldId, throwing an exception
8115
       * if it is not found.
8116
       */
8117
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8118
        _Fields fields = findByThriftId(fieldId);
8119
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8120
        return fields;
8121
      }
8122
 
8123
      /**
8124
       * Find the _Fields constant that matches name, or null if its not found.
8125
       */
8126
      public static _Fields findByName(String name) {
8127
        return byName.get(name);
8128
      }
8129
 
8130
      private final short _thriftId;
8131
      private final String _fieldName;
8132
 
8133
      _Fields(short thriftId, String fieldName) {
8134
        _thriftId = thriftId;
8135
        _fieldName = fieldName;
8136
      }
8137
 
8138
      public short getThriftFieldId() {
8139
        return _thriftId;
8140
      }
8141
 
8142
      public String getFieldName() {
8143
        return _fieldName;
8144
      }
8145
    }
8146
 
8147
    // isset id assignments
8148
    private static final int __USERID_ISSET_ID = 0;
8149
    private BitSet __isset_bit_vector = new BitSet(1);
8150
 
3430 rajveer 8151
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8152
    static {
3430 rajveer 8153
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8154
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8155
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8156
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8157
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8158
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8159
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 8160
    }
8161
 
8162
    public getCouponUsageCountByUser_args() {
8163
    }
8164
 
8165
    public getCouponUsageCountByUser_args(
8166
      String couponCode,
8167
      long userId)
8168
    {
8169
      this();
8170
      this.couponCode = couponCode;
8171
      this.userId = userId;
8172
      setUserIdIsSet(true);
8173
    }
8174
 
8175
    /**
8176
     * Performs a deep copy on <i>other</i>.
8177
     */
8178
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
8179
      __isset_bit_vector.clear();
8180
      __isset_bit_vector.or(other.__isset_bit_vector);
8181
      if (other.isSetCouponCode()) {
8182
        this.couponCode = other.couponCode;
8183
      }
8184
      this.userId = other.userId;
8185
    }
8186
 
8187
    public getCouponUsageCountByUser_args deepCopy() {
8188
      return new getCouponUsageCountByUser_args(this);
8189
    }
8190
 
3430 rajveer 8191
    @Override
8192
    public void clear() {
8193
      this.couponCode = null;
8194
      setUserIdIsSet(false);
8195
      this.userId = 0;
1982 varun.gupt 8196
    }
8197
 
8198
    public String getCouponCode() {
8199
      return this.couponCode;
8200
    }
8201
 
3430 rajveer 8202
    public void setCouponCode(String couponCode) {
1982 varun.gupt 8203
      this.couponCode = couponCode;
8204
    }
8205
 
8206
    public void unsetCouponCode() {
8207
      this.couponCode = null;
8208
    }
8209
 
3430 rajveer 8210
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8211
    public boolean isSetCouponCode() {
8212
      return this.couponCode != null;
8213
    }
8214
 
8215
    public void setCouponCodeIsSet(boolean value) {
8216
      if (!value) {
8217
        this.couponCode = null;
8218
      }
8219
    }
8220
 
8221
    public long getUserId() {
8222
      return this.userId;
8223
    }
8224
 
3430 rajveer 8225
    public void setUserId(long userId) {
1982 varun.gupt 8226
      this.userId = userId;
8227
      setUserIdIsSet(true);
8228
    }
8229
 
8230
    public void unsetUserId() {
8231
      __isset_bit_vector.clear(__USERID_ISSET_ID);
8232
    }
8233
 
3430 rajveer 8234
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8235
    public boolean isSetUserId() {
8236
      return __isset_bit_vector.get(__USERID_ISSET_ID);
8237
    }
8238
 
8239
    public void setUserIdIsSet(boolean value) {
8240
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
8241
    }
8242
 
8243
    public void setFieldValue(_Fields field, Object value) {
8244
      switch (field) {
8245
      case COUPON_CODE:
8246
        if (value == null) {
8247
          unsetCouponCode();
8248
        } else {
8249
          setCouponCode((String)value);
8250
        }
8251
        break;
8252
 
8253
      case USER_ID:
8254
        if (value == null) {
8255
          unsetUserId();
8256
        } else {
8257
          setUserId((Long)value);
8258
        }
8259
        break;
8260
 
8261
      }
8262
    }
8263
 
8264
    public Object getFieldValue(_Fields field) {
8265
      switch (field) {
8266
      case COUPON_CODE:
8267
        return getCouponCode();
8268
 
8269
      case USER_ID:
3430 rajveer 8270
        return Long.valueOf(getUserId());
1982 varun.gupt 8271
 
8272
      }
8273
      throw new IllegalStateException();
8274
    }
8275
 
3430 rajveer 8276
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8277
    public boolean isSet(_Fields field) {
8278
      if (field == null) {
8279
        throw new IllegalArgumentException();
8280
      }
1982 varun.gupt 8281
 
8282
      switch (field) {
8283
      case COUPON_CODE:
8284
        return isSetCouponCode();
8285
      case USER_ID:
8286
        return isSetUserId();
8287
      }
8288
      throw new IllegalStateException();
8289
    }
8290
 
8291
    @Override
8292
    public boolean equals(Object that) {
8293
      if (that == null)
8294
        return false;
8295
      if (that instanceof getCouponUsageCountByUser_args)
8296
        return this.equals((getCouponUsageCountByUser_args)that);
8297
      return false;
8298
    }
8299
 
8300
    public boolean equals(getCouponUsageCountByUser_args that) {
8301
      if (that == null)
8302
        return false;
8303
 
8304
      boolean this_present_couponCode = true && this.isSetCouponCode();
8305
      boolean that_present_couponCode = true && that.isSetCouponCode();
8306
      if (this_present_couponCode || that_present_couponCode) {
8307
        if (!(this_present_couponCode && that_present_couponCode))
8308
          return false;
8309
        if (!this.couponCode.equals(that.couponCode))
8310
          return false;
8311
      }
8312
 
8313
      boolean this_present_userId = true;
8314
      boolean that_present_userId = true;
8315
      if (this_present_userId || that_present_userId) {
8316
        if (!(this_present_userId && that_present_userId))
8317
          return false;
8318
        if (this.userId != that.userId)
8319
          return false;
8320
      }
8321
 
8322
      return true;
8323
    }
8324
 
8325
    @Override
8326
    public int hashCode() {
8327
      return 0;
8328
    }
8329
 
8330
    public int compareTo(getCouponUsageCountByUser_args other) {
8331
      if (!getClass().equals(other.getClass())) {
8332
        return getClass().getName().compareTo(other.getClass().getName());
8333
      }
8334
 
8335
      int lastComparison = 0;
8336
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
8337
 
3430 rajveer 8338
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 8339
      if (lastComparison != 0) {
8340
        return lastComparison;
8341
      }
3430 rajveer 8342
      if (isSetCouponCode()) {
8343
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8344
        if (lastComparison != 0) {
8345
          return lastComparison;
8346
        }
1982 varun.gupt 8347
      }
3430 rajveer 8348
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 8349
      if (lastComparison != 0) {
8350
        return lastComparison;
8351
      }
3430 rajveer 8352
      if (isSetUserId()) {
8353
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
8354
        if (lastComparison != 0) {
8355
          return lastComparison;
8356
        }
1982 varun.gupt 8357
      }
8358
      return 0;
8359
    }
8360
 
3430 rajveer 8361
    public _Fields fieldForId(int fieldId) {
8362
      return _Fields.findByThriftId(fieldId);
8363
    }
8364
 
8365
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8366
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8367
      iprot.readStructBegin();
8368
      while (true)
8369
      {
8370
        field = iprot.readFieldBegin();
3430 rajveer 8371
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8372
          break;
8373
        }
3430 rajveer 8374
        switch (field.id) {
8375
          case 1: // COUPON_CODE
8376
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8377
              this.couponCode = iprot.readString();
8378
            } else { 
8379
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8380
            }
8381
            break;
8382
          case 2: // USER_ID
8383
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8384
              this.userId = iprot.readI64();
8385
              setUserIdIsSet(true);
8386
            } else { 
8387
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8388
            }
8389
            break;
8390
          default:
8391
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8392
        }
3430 rajveer 8393
        iprot.readFieldEnd();
1982 varun.gupt 8394
      }
8395
      iprot.readStructEnd();
8396
      validate();
8397
    }
8398
 
3430 rajveer 8399
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8400
      validate();
8401
 
8402
      oprot.writeStructBegin(STRUCT_DESC);
8403
      if (this.couponCode != null) {
8404
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8405
        oprot.writeString(this.couponCode);
8406
        oprot.writeFieldEnd();
8407
      }
8408
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
8409
      oprot.writeI64(this.userId);
8410
      oprot.writeFieldEnd();
8411
      oprot.writeFieldStop();
8412
      oprot.writeStructEnd();
8413
    }
8414
 
8415
    @Override
8416
    public String toString() {
8417
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
8418
      boolean first = true;
8419
 
8420
      sb.append("couponCode:");
8421
      if (this.couponCode == null) {
8422
        sb.append("null");
8423
      } else {
8424
        sb.append(this.couponCode);
8425
      }
8426
      first = false;
8427
      if (!first) sb.append(", ");
8428
      sb.append("userId:");
8429
      sb.append(this.userId);
8430
      first = false;
8431
      sb.append(")");
8432
      return sb.toString();
8433
    }
8434
 
3430 rajveer 8435
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8436
      // check for required fields
8437
    }
8438
 
3430 rajveer 8439
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8440
      try {
8441
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8442
      } catch (org.apache.thrift.TException te) {
8443
        throw new java.io.IOException(te);
8444
      }
8445
    }
8446
 
8447
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8448
      try {
8449
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8450
        __isset_bit_vector = new BitSet(1);
8451
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8452
      } catch (org.apache.thrift.TException te) {
8453
        throw new java.io.IOException(te);
8454
      }
8455
    }
8456
 
1982 varun.gupt 8457
  }
8458
 
3430 rajveer 8459
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
8460
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 8461
 
3430 rajveer 8462
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
8463
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 8464
 
3430 rajveer 8465
    private long success; // required
8466
    private PromotionException pex; // required
1982 varun.gupt 8467
 
8468
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8469
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8470
      SUCCESS((short)0, "success"),
8471
      PEX((short)1, "pex");
8472
 
8473
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8474
 
8475
      static {
8476
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8477
          byName.put(field.getFieldName(), field);
8478
        }
8479
      }
8480
 
8481
      /**
8482
       * Find the _Fields constant that matches fieldId, or null if its not found.
8483
       */
8484
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8485
        switch(fieldId) {
8486
          case 0: // SUCCESS
8487
            return SUCCESS;
8488
          case 1: // PEX
8489
            return PEX;
8490
          default:
8491
            return null;
8492
        }
1982 varun.gupt 8493
      }
8494
 
8495
      /**
8496
       * Find the _Fields constant that matches fieldId, throwing an exception
8497
       * if it is not found.
8498
       */
8499
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8500
        _Fields fields = findByThriftId(fieldId);
8501
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8502
        return fields;
8503
      }
8504
 
8505
      /**
8506
       * Find the _Fields constant that matches name, or null if its not found.
8507
       */
8508
      public static _Fields findByName(String name) {
8509
        return byName.get(name);
8510
      }
8511
 
8512
      private final short _thriftId;
8513
      private final String _fieldName;
8514
 
8515
      _Fields(short thriftId, String fieldName) {
8516
        _thriftId = thriftId;
8517
        _fieldName = fieldName;
8518
      }
8519
 
8520
      public short getThriftFieldId() {
8521
        return _thriftId;
8522
      }
8523
 
8524
      public String getFieldName() {
8525
        return _fieldName;
8526
      }
8527
    }
8528
 
8529
    // isset id assignments
8530
    private static final int __SUCCESS_ISSET_ID = 0;
8531
    private BitSet __isset_bit_vector = new BitSet(1);
8532
 
3430 rajveer 8533
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8534
    static {
3430 rajveer 8535
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8536
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8537
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8538
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8539
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8540
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8541
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 8542
    }
8543
 
8544
    public getCouponUsageCountByUser_result() {
8545
    }
8546
 
8547
    public getCouponUsageCountByUser_result(
8548
      long success,
8549
      PromotionException pex)
8550
    {
8551
      this();
8552
      this.success = success;
8553
      setSuccessIsSet(true);
8554
      this.pex = pex;
8555
    }
8556
 
8557
    /**
8558
     * Performs a deep copy on <i>other</i>.
8559
     */
8560
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
8561
      __isset_bit_vector.clear();
8562
      __isset_bit_vector.or(other.__isset_bit_vector);
8563
      this.success = other.success;
8564
      if (other.isSetPex()) {
8565
        this.pex = new PromotionException(other.pex);
8566
      }
8567
    }
8568
 
8569
    public getCouponUsageCountByUser_result deepCopy() {
8570
      return new getCouponUsageCountByUser_result(this);
8571
    }
8572
 
3430 rajveer 8573
    @Override
8574
    public void clear() {
8575
      setSuccessIsSet(false);
8576
      this.success = 0;
8577
      this.pex = null;
1982 varun.gupt 8578
    }
8579
 
8580
    public long getSuccess() {
8581
      return this.success;
8582
    }
8583
 
3430 rajveer 8584
    public void setSuccess(long success) {
1982 varun.gupt 8585
      this.success = success;
8586
      setSuccessIsSet(true);
8587
    }
8588
 
8589
    public void unsetSuccess() {
8590
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
8591
    }
8592
 
3430 rajveer 8593
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8594
    public boolean isSetSuccess() {
8595
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
8596
    }
8597
 
8598
    public void setSuccessIsSet(boolean value) {
8599
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
8600
    }
8601
 
8602
    public PromotionException getPex() {
8603
      return this.pex;
8604
    }
8605
 
3430 rajveer 8606
    public void setPex(PromotionException pex) {
1982 varun.gupt 8607
      this.pex = pex;
8608
    }
8609
 
8610
    public void unsetPex() {
8611
      this.pex = null;
8612
    }
8613
 
3430 rajveer 8614
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8615
    public boolean isSetPex() {
8616
      return this.pex != null;
8617
    }
8618
 
8619
    public void setPexIsSet(boolean value) {
8620
      if (!value) {
8621
        this.pex = null;
8622
      }
8623
    }
8624
 
8625
    public void setFieldValue(_Fields field, Object value) {
8626
      switch (field) {
8627
      case SUCCESS:
8628
        if (value == null) {
8629
          unsetSuccess();
8630
        } else {
8631
          setSuccess((Long)value);
8632
        }
8633
        break;
8634
 
8635
      case PEX:
8636
        if (value == null) {
8637
          unsetPex();
8638
        } else {
8639
          setPex((PromotionException)value);
8640
        }
8641
        break;
8642
 
8643
      }
8644
    }
8645
 
8646
    public Object getFieldValue(_Fields field) {
8647
      switch (field) {
8648
      case SUCCESS:
3430 rajveer 8649
        return Long.valueOf(getSuccess());
1982 varun.gupt 8650
 
8651
      case PEX:
8652
        return getPex();
8653
 
8654
      }
8655
      throw new IllegalStateException();
8656
    }
8657
 
3430 rajveer 8658
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8659
    public boolean isSet(_Fields field) {
8660
      if (field == null) {
8661
        throw new IllegalArgumentException();
8662
      }
1982 varun.gupt 8663
 
8664
      switch (field) {
8665
      case SUCCESS:
8666
        return isSetSuccess();
8667
      case PEX:
8668
        return isSetPex();
8669
      }
8670
      throw new IllegalStateException();
8671
    }
8672
 
8673
    @Override
8674
    public boolean equals(Object that) {
8675
      if (that == null)
8676
        return false;
8677
      if (that instanceof getCouponUsageCountByUser_result)
8678
        return this.equals((getCouponUsageCountByUser_result)that);
8679
      return false;
8680
    }
8681
 
8682
    public boolean equals(getCouponUsageCountByUser_result that) {
8683
      if (that == null)
8684
        return false;
8685
 
8686
      boolean this_present_success = true;
8687
      boolean that_present_success = true;
8688
      if (this_present_success || that_present_success) {
8689
        if (!(this_present_success && that_present_success))
8690
          return false;
8691
        if (this.success != that.success)
8692
          return false;
8693
      }
8694
 
8695
      boolean this_present_pex = true && this.isSetPex();
8696
      boolean that_present_pex = true && that.isSetPex();
8697
      if (this_present_pex || that_present_pex) {
8698
        if (!(this_present_pex && that_present_pex))
8699
          return false;
8700
        if (!this.pex.equals(that.pex))
8701
          return false;
8702
      }
8703
 
8704
      return true;
8705
    }
8706
 
8707
    @Override
8708
    public int hashCode() {
8709
      return 0;
8710
    }
8711
 
8712
    public int compareTo(getCouponUsageCountByUser_result other) {
8713
      if (!getClass().equals(other.getClass())) {
8714
        return getClass().getName().compareTo(other.getClass().getName());
8715
      }
8716
 
8717
      int lastComparison = 0;
8718
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
8719
 
3430 rajveer 8720
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 8721
      if (lastComparison != 0) {
8722
        return lastComparison;
8723
      }
3430 rajveer 8724
      if (isSetSuccess()) {
8725
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8726
        if (lastComparison != 0) {
8727
          return lastComparison;
8728
        }
1982 varun.gupt 8729
      }
3430 rajveer 8730
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 8731
      if (lastComparison != 0) {
8732
        return lastComparison;
8733
      }
3430 rajveer 8734
      if (isSetPex()) {
8735
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8736
        if (lastComparison != 0) {
8737
          return lastComparison;
8738
        }
1982 varun.gupt 8739
      }
8740
      return 0;
8741
    }
8742
 
3430 rajveer 8743
    public _Fields fieldForId(int fieldId) {
8744
      return _Fields.findByThriftId(fieldId);
8745
    }
8746
 
8747
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8748
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8749
      iprot.readStructBegin();
8750
      while (true)
8751
      {
8752
        field = iprot.readFieldBegin();
3430 rajveer 8753
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8754
          break;
8755
        }
3430 rajveer 8756
        switch (field.id) {
8757
          case 0: // SUCCESS
8758
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8759
              this.success = iprot.readI64();
8760
              setSuccessIsSet(true);
8761
            } else { 
8762
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8763
            }
8764
            break;
8765
          case 1: // PEX
8766
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8767
              this.pex = new PromotionException();
8768
              this.pex.read(iprot);
8769
            } else { 
8770
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8771
            }
8772
            break;
8773
          default:
8774
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8775
        }
3430 rajveer 8776
        iprot.readFieldEnd();
1982 varun.gupt 8777
      }
8778
      iprot.readStructEnd();
8779
      validate();
8780
    }
8781
 
3430 rajveer 8782
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8783
      oprot.writeStructBegin(STRUCT_DESC);
8784
 
8785
      if (this.isSetSuccess()) {
8786
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8787
        oprot.writeI64(this.success);
8788
        oprot.writeFieldEnd();
8789
      } else if (this.isSetPex()) {
8790
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8791
        this.pex.write(oprot);
8792
        oprot.writeFieldEnd();
8793
      }
8794
      oprot.writeFieldStop();
8795
      oprot.writeStructEnd();
8796
    }
8797
 
8798
    @Override
8799
    public String toString() {
8800
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
8801
      boolean first = true;
8802
 
8803
      sb.append("success:");
8804
      sb.append(this.success);
8805
      first = false;
8806
      if (!first) sb.append(", ");
8807
      sb.append("pex:");
8808
      if (this.pex == null) {
8809
        sb.append("null");
8810
      } else {
8811
        sb.append(this.pex);
8812
      }
8813
      first = false;
8814
      sb.append(")");
8815
      return sb.toString();
8816
    }
8817
 
3430 rajveer 8818
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8819
      // check for required fields
8820
    }
8821
 
3430 rajveer 8822
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8823
      try {
8824
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8825
      } catch (org.apache.thrift.TException te) {
8826
        throw new java.io.IOException(te);
8827
      }
8828
    }
8829
 
8830
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8831
      try {
8832
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8833
      } catch (org.apache.thrift.TException te) {
8834
        throw new java.io.IOException(te);
8835
      }
8836
    }
8837
 
1982 varun.gupt 8838
  }
8839
 
3430 rajveer 8840
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
8841
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 8842
 
8843
 
8844
 
8845
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8846
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 8847
;
8848
 
8849
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8850
 
8851
      static {
8852
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8853
          byName.put(field.getFieldName(), field);
8854
        }
8855
      }
8856
 
8857
      /**
8858
       * Find the _Fields constant that matches fieldId, or null if its not found.
8859
       */
8860
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8861
        switch(fieldId) {
8862
          default:
8863
            return null;
8864
        }
3385 varun.gupt 8865
      }
8866
 
8867
      /**
8868
       * Find the _Fields constant that matches fieldId, throwing an exception
8869
       * if it is not found.
8870
       */
8871
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8872
        _Fields fields = findByThriftId(fieldId);
8873
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8874
        return fields;
8875
      }
8876
 
8877
      /**
8878
       * Find the _Fields constant that matches name, or null if its not found.
8879
       */
8880
      public static _Fields findByName(String name) {
8881
        return byName.get(name);
8882
      }
8883
 
8884
      private final short _thriftId;
8885
      private final String _fieldName;
8886
 
8887
      _Fields(short thriftId, String fieldName) {
8888
        _thriftId = thriftId;
8889
        _fieldName = fieldName;
8890
      }
8891
 
8892
      public short getThriftFieldId() {
8893
        return _thriftId;
8894
      }
8895
 
8896
      public String getFieldName() {
8897
        return _fieldName;
8898
      }
8899
    }
3430 rajveer 8900
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 8901
    static {
3430 rajveer 8902
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8903
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8904
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 8905
    }
8906
 
8907
    public getActiveCoupons_args() {
8908
    }
8909
 
8910
    /**
8911
     * Performs a deep copy on <i>other</i>.
8912
     */
8913
    public getActiveCoupons_args(getActiveCoupons_args other) {
8914
    }
8915
 
8916
    public getActiveCoupons_args deepCopy() {
8917
      return new getActiveCoupons_args(this);
8918
    }
8919
 
3430 rajveer 8920
    @Override
8921
    public void clear() {
3385 varun.gupt 8922
    }
8923
 
8924
    public void setFieldValue(_Fields field, Object value) {
8925
      switch (field) {
8926
      }
8927
    }
8928
 
8929
    public Object getFieldValue(_Fields field) {
8930
      switch (field) {
8931
      }
8932
      throw new IllegalStateException();
8933
    }
8934
 
3430 rajveer 8935
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8936
    public boolean isSet(_Fields field) {
8937
      if (field == null) {
8938
        throw new IllegalArgumentException();
8939
      }
3385 varun.gupt 8940
 
8941
      switch (field) {
8942
      }
8943
      throw new IllegalStateException();
8944
    }
8945
 
8946
    @Override
8947
    public boolean equals(Object that) {
8948
      if (that == null)
8949
        return false;
8950
      if (that instanceof getActiveCoupons_args)
8951
        return this.equals((getActiveCoupons_args)that);
8952
      return false;
8953
    }
8954
 
8955
    public boolean equals(getActiveCoupons_args that) {
8956
      if (that == null)
8957
        return false;
8958
 
8959
      return true;
8960
    }
8961
 
8962
    @Override
8963
    public int hashCode() {
8964
      return 0;
8965
    }
8966
 
8967
    public int compareTo(getActiveCoupons_args other) {
8968
      if (!getClass().equals(other.getClass())) {
8969
        return getClass().getName().compareTo(other.getClass().getName());
8970
      }
8971
 
8972
      int lastComparison = 0;
8973
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
8974
 
8975
      return 0;
8976
    }
8977
 
3430 rajveer 8978
    public _Fields fieldForId(int fieldId) {
8979
      return _Fields.findByThriftId(fieldId);
8980
    }
8981
 
8982
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8983
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 8984
      iprot.readStructBegin();
8985
      while (true)
8986
      {
8987
        field = iprot.readFieldBegin();
3430 rajveer 8988
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 8989
          break;
8990
        }
3430 rajveer 8991
        switch (field.id) {
8992
          default:
8993
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 8994
        }
3430 rajveer 8995
        iprot.readFieldEnd();
3385 varun.gupt 8996
      }
8997
      iprot.readStructEnd();
8998
      validate();
8999
    }
9000
 
3430 rajveer 9001
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 9002
      validate();
9003
 
9004
      oprot.writeStructBegin(STRUCT_DESC);
9005
      oprot.writeFieldStop();
9006
      oprot.writeStructEnd();
9007
    }
9008
 
9009
    @Override
9010
    public String toString() {
9011
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
9012
      boolean first = true;
9013
 
9014
      sb.append(")");
9015
      return sb.toString();
9016
    }
9017
 
3430 rajveer 9018
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 9019
      // check for required fields
9020
    }
9021
 
3430 rajveer 9022
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9023
      try {
9024
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9025
      } catch (org.apache.thrift.TException te) {
9026
        throw new java.io.IOException(te);
9027
      }
9028
    }
9029
 
9030
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9031
      try {
9032
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9033
      } catch (org.apache.thrift.TException te) {
9034
        throw new java.io.IOException(te);
9035
      }
9036
    }
9037
 
3385 varun.gupt 9038
  }
9039
 
3430 rajveer 9040
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
9041
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 9042
 
3430 rajveer 9043
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
9044
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3385 varun.gupt 9045
 
3430 rajveer 9046
    private List<Coupon> success; // required
9047
    private PromotionException pex; // required
3385 varun.gupt 9048
 
9049
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9050
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 9051
      SUCCESS((short)0, "success"),
9052
      PEX((short)1, "pex");
9053
 
9054
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9055
 
9056
      static {
9057
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9058
          byName.put(field.getFieldName(), field);
9059
        }
9060
      }
9061
 
9062
      /**
9063
       * Find the _Fields constant that matches fieldId, or null if its not found.
9064
       */
9065
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9066
        switch(fieldId) {
9067
          case 0: // SUCCESS
9068
            return SUCCESS;
9069
          case 1: // PEX
9070
            return PEX;
9071
          default:
9072
            return null;
9073
        }
3385 varun.gupt 9074
      }
9075
 
9076
      /**
9077
       * Find the _Fields constant that matches fieldId, throwing an exception
9078
       * if it is not found.
9079
       */
9080
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9081
        _Fields fields = findByThriftId(fieldId);
9082
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9083
        return fields;
9084
      }
9085
 
9086
      /**
9087
       * Find the _Fields constant that matches name, or null if its not found.
9088
       */
9089
      public static _Fields findByName(String name) {
9090
        return byName.get(name);
9091
      }
9092
 
9093
      private final short _thriftId;
9094
      private final String _fieldName;
9095
 
9096
      _Fields(short thriftId, String fieldName) {
9097
        _thriftId = thriftId;
9098
        _fieldName = fieldName;
9099
      }
9100
 
9101
      public short getThriftFieldId() {
9102
        return _thriftId;
9103
      }
9104
 
9105
      public String getFieldName() {
9106
        return _fieldName;
9107
      }
9108
    }
9109
 
9110
    // isset id assignments
9111
 
3430 rajveer 9112
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 9113
    static {
3430 rajveer 9114
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9115
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9116
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
9117
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
9118
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9119
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9120
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9121
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 9122
    }
9123
 
9124
    public getActiveCoupons_result() {
9125
    }
9126
 
9127
    public getActiveCoupons_result(
9128
      List<Coupon> success,
9129
      PromotionException pex)
9130
    {
9131
      this();
9132
      this.success = success;
9133
      this.pex = pex;
9134
    }
9135
 
9136
    /**
9137
     * Performs a deep copy on <i>other</i>.
9138
     */
9139
    public getActiveCoupons_result(getActiveCoupons_result other) {
9140
      if (other.isSetSuccess()) {
9141
        List<Coupon> __this__success = new ArrayList<Coupon>();
9142
        for (Coupon other_element : other.success) {
9143
          __this__success.add(new Coupon(other_element));
9144
        }
9145
        this.success = __this__success;
9146
      }
9147
      if (other.isSetPex()) {
9148
        this.pex = new PromotionException(other.pex);
9149
      }
9150
    }
9151
 
9152
    public getActiveCoupons_result deepCopy() {
9153
      return new getActiveCoupons_result(this);
9154
    }
9155
 
3430 rajveer 9156
    @Override
9157
    public void clear() {
9158
      this.success = null;
9159
      this.pex = null;
3385 varun.gupt 9160
    }
9161
 
9162
    public int getSuccessSize() {
9163
      return (this.success == null) ? 0 : this.success.size();
9164
    }
9165
 
9166
    public java.util.Iterator<Coupon> getSuccessIterator() {
9167
      return (this.success == null) ? null : this.success.iterator();
9168
    }
9169
 
9170
    public void addToSuccess(Coupon elem) {
9171
      if (this.success == null) {
9172
        this.success = new ArrayList<Coupon>();
9173
      }
9174
      this.success.add(elem);
9175
    }
9176
 
9177
    public List<Coupon> getSuccess() {
9178
      return this.success;
9179
    }
9180
 
3430 rajveer 9181
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 9182
      this.success = success;
9183
    }
9184
 
9185
    public void unsetSuccess() {
9186
      this.success = null;
9187
    }
9188
 
3430 rajveer 9189
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 9190
    public boolean isSetSuccess() {
9191
      return this.success != null;
9192
    }
9193
 
9194
    public void setSuccessIsSet(boolean value) {
9195
      if (!value) {
9196
        this.success = null;
9197
      }
9198
    }
9199
 
9200
    public PromotionException getPex() {
9201
      return this.pex;
9202
    }
9203
 
3430 rajveer 9204
    public void setPex(PromotionException pex) {
3385 varun.gupt 9205
      this.pex = pex;
9206
    }
9207
 
9208
    public void unsetPex() {
9209
      this.pex = null;
9210
    }
9211
 
3430 rajveer 9212
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 9213
    public boolean isSetPex() {
9214
      return this.pex != null;
9215
    }
9216
 
9217
    public void setPexIsSet(boolean value) {
9218
      if (!value) {
9219
        this.pex = null;
9220
      }
9221
    }
9222
 
9223
    public void setFieldValue(_Fields field, Object value) {
9224
      switch (field) {
9225
      case SUCCESS:
9226
        if (value == null) {
9227
          unsetSuccess();
9228
        } else {
9229
          setSuccess((List<Coupon>)value);
9230
        }
9231
        break;
9232
 
9233
      case PEX:
9234
        if (value == null) {
9235
          unsetPex();
9236
        } else {
9237
          setPex((PromotionException)value);
9238
        }
9239
        break;
9240
 
9241
      }
9242
    }
9243
 
9244
    public Object getFieldValue(_Fields field) {
9245
      switch (field) {
9246
      case SUCCESS:
9247
        return getSuccess();
9248
 
9249
      case PEX:
9250
        return getPex();
9251
 
9252
      }
9253
      throw new IllegalStateException();
9254
    }
9255
 
3430 rajveer 9256
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9257
    public boolean isSet(_Fields field) {
9258
      if (field == null) {
9259
        throw new IllegalArgumentException();
9260
      }
3385 varun.gupt 9261
 
9262
      switch (field) {
9263
      case SUCCESS:
9264
        return isSetSuccess();
9265
      case PEX:
9266
        return isSetPex();
9267
      }
9268
      throw new IllegalStateException();
9269
    }
9270
 
9271
    @Override
9272
    public boolean equals(Object that) {
9273
      if (that == null)
9274
        return false;
9275
      if (that instanceof getActiveCoupons_result)
9276
        return this.equals((getActiveCoupons_result)that);
9277
      return false;
9278
    }
9279
 
9280
    public boolean equals(getActiveCoupons_result that) {
9281
      if (that == null)
9282
        return false;
9283
 
9284
      boolean this_present_success = true && this.isSetSuccess();
9285
      boolean that_present_success = true && that.isSetSuccess();
9286
      if (this_present_success || that_present_success) {
9287
        if (!(this_present_success && that_present_success))
9288
          return false;
9289
        if (!this.success.equals(that.success))
9290
          return false;
9291
      }
9292
 
9293
      boolean this_present_pex = true && this.isSetPex();
9294
      boolean that_present_pex = true && that.isSetPex();
9295
      if (this_present_pex || that_present_pex) {
9296
        if (!(this_present_pex && that_present_pex))
9297
          return false;
9298
        if (!this.pex.equals(that.pex))
9299
          return false;
9300
      }
9301
 
9302
      return true;
9303
    }
9304
 
9305
    @Override
9306
    public int hashCode() {
9307
      return 0;
9308
    }
9309
 
9310
    public int compareTo(getActiveCoupons_result other) {
9311
      if (!getClass().equals(other.getClass())) {
9312
        return getClass().getName().compareTo(other.getClass().getName());
9313
      }
9314
 
9315
      int lastComparison = 0;
9316
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
9317
 
3430 rajveer 9318
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 9319
      if (lastComparison != 0) {
9320
        return lastComparison;
9321
      }
3430 rajveer 9322
      if (isSetSuccess()) {
9323
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9324
        if (lastComparison != 0) {
9325
          return lastComparison;
9326
        }
3385 varun.gupt 9327
      }
3430 rajveer 9328
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 9329
      if (lastComparison != 0) {
9330
        return lastComparison;
9331
      }
3430 rajveer 9332
      if (isSetPex()) {
9333
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9334
        if (lastComparison != 0) {
9335
          return lastComparison;
9336
        }
3385 varun.gupt 9337
      }
9338
      return 0;
9339
    }
9340
 
3430 rajveer 9341
    public _Fields fieldForId(int fieldId) {
9342
      return _Fields.findByThriftId(fieldId);
9343
    }
9344
 
9345
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9346
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 9347
      iprot.readStructBegin();
9348
      while (true)
9349
      {
9350
        field = iprot.readFieldBegin();
3430 rajveer 9351
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 9352
          break;
9353
        }
3430 rajveer 9354
        switch (field.id) {
9355
          case 0: // SUCCESS
9356
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
9357
              {
5327 rajveer 9358
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
9359
                this.success = new ArrayList<Coupon>(_list16.size);
9360
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
3385 varun.gupt 9361
                {
5327 rajveer 9362
                  Coupon _elem18; // required
9363
                  _elem18 = new Coupon();
9364
                  _elem18.read(iprot);
9365
                  this.success.add(_elem18);
3385 varun.gupt 9366
                }
3430 rajveer 9367
                iprot.readListEnd();
3385 varun.gupt 9368
              }
3430 rajveer 9369
            } else { 
9370
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9371
            }
9372
            break;
9373
          case 1: // PEX
9374
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9375
              this.pex = new PromotionException();
9376
              this.pex.read(iprot);
9377
            } else { 
9378
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9379
            }
9380
            break;
9381
          default:
9382
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 9383
        }
3430 rajveer 9384
        iprot.readFieldEnd();
3385 varun.gupt 9385
      }
9386
      iprot.readStructEnd();
9387
      validate();
9388
    }
9389
 
3430 rajveer 9390
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 9391
      oprot.writeStructBegin(STRUCT_DESC);
9392
 
9393
      if (this.isSetSuccess()) {
9394
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9395
        {
3430 rajveer 9396
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 9397
          for (Coupon _iter19 : this.success)
3385 varun.gupt 9398
          {
5327 rajveer 9399
            _iter19.write(oprot);
3385 varun.gupt 9400
          }
9401
          oprot.writeListEnd();
9402
        }
9403
        oprot.writeFieldEnd();
9404
      } else if (this.isSetPex()) {
9405
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9406
        this.pex.write(oprot);
9407
        oprot.writeFieldEnd();
9408
      }
9409
      oprot.writeFieldStop();
9410
      oprot.writeStructEnd();
9411
    }
9412
 
9413
    @Override
9414
    public String toString() {
9415
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
9416
      boolean first = true;
9417
 
9418
      sb.append("success:");
9419
      if (this.success == null) {
9420
        sb.append("null");
9421
      } else {
9422
        sb.append(this.success);
9423
      }
9424
      first = false;
9425
      if (!first) sb.append(", ");
9426
      sb.append("pex:");
9427
      if (this.pex == null) {
9428
        sb.append("null");
9429
      } else {
9430
        sb.append(this.pex);
9431
      }
9432
      first = false;
9433
      sb.append(")");
9434
      return sb.toString();
9435
    }
9436
 
3430 rajveer 9437
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 9438
      // check for required fields
9439
    }
9440
 
3430 rajveer 9441
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9442
      try {
9443
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9444
      } catch (org.apache.thrift.TException te) {
9445
        throw new java.io.IOException(te);
9446
      }
9447
    }
9448
 
9449
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9450
      try {
9451
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9452
      } catch (org.apache.thrift.TException te) {
9453
        throw new java.io.IOException(te);
9454
      }
9455
    }
9456
 
3385 varun.gupt 9457
  }
9458
 
6250 amit.gupta 9459
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
9460
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
9461
 
9462
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
9463
    private static final org.apache.thrift.protocol.TField END_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("endOn", org.apache.thrift.protocol.TType.I64, (short)2);
9464
    private static final org.apache.thrift.protocol.TField EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("email", org.apache.thrift.protocol.TType.STRING, (short)3);
9465
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)4);
6356 amit.gupta 9466
    private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)5);
9467
    private static final org.apache.thrift.protocol.TField USAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("usage", org.apache.thrift.protocol.TType.I64, (short)6);
6250 amit.gupta 9468
 
9469
    private long promotionId; // required
9470
    private long endOn; // required
9471
    private String email; // required
9472
    private long amount; // required
6356 amit.gupta 9473
    private boolean isCod; // required
6250 amit.gupta 9474
    private long usage; // required
9475
 
9476
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9477
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9478
      PROMOTION_ID((short)1, "promotionId"),
9479
      END_ON((short)2, "endOn"),
9480
      EMAIL((short)3, "email"),
9481
      AMOUNT((short)4, "amount"),
6356 amit.gupta 9482
      IS_COD((short)5, "isCod"),
9483
      USAGE((short)6, "usage");
6250 amit.gupta 9484
 
9485
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9486
 
9487
      static {
9488
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9489
          byName.put(field.getFieldName(), field);
9490
        }
9491
      }
9492
 
9493
      /**
9494
       * Find the _Fields constant that matches fieldId, or null if its not found.
9495
       */
9496
      public static _Fields findByThriftId(int fieldId) {
9497
        switch(fieldId) {
9498
          case 1: // PROMOTION_ID
9499
            return PROMOTION_ID;
9500
          case 2: // END_ON
9501
            return END_ON;
9502
          case 3: // EMAIL
9503
            return EMAIL;
9504
          case 4: // AMOUNT
9505
            return AMOUNT;
6356 amit.gupta 9506
          case 5: // IS_COD
9507
            return IS_COD;
9508
          case 6: // USAGE
6250 amit.gupta 9509
            return USAGE;
9510
          default:
9511
            return null;
9512
        }
9513
      }
9514
 
9515
      /**
9516
       * Find the _Fields constant that matches fieldId, throwing an exception
9517
       * if it is not found.
9518
       */
9519
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9520
        _Fields fields = findByThriftId(fieldId);
9521
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9522
        return fields;
9523
      }
9524
 
9525
      /**
9526
       * Find the _Fields constant that matches name, or null if its not found.
9527
       */
9528
      public static _Fields findByName(String name) {
9529
        return byName.get(name);
9530
      }
9531
 
9532
      private final short _thriftId;
9533
      private final String _fieldName;
9534
 
9535
      _Fields(short thriftId, String fieldName) {
9536
        _thriftId = thriftId;
9537
        _fieldName = fieldName;
9538
      }
9539
 
9540
      public short getThriftFieldId() {
9541
        return _thriftId;
9542
      }
9543
 
9544
      public String getFieldName() {
9545
        return _fieldName;
9546
      }
9547
    }
9548
 
9549
    // isset id assignments
9550
    private static final int __PROMOTIONID_ISSET_ID = 0;
9551
    private static final int __ENDON_ISSET_ID = 1;
9552
    private static final int __AMOUNT_ISSET_ID = 2;
6356 amit.gupta 9553
    private static final int __ISCOD_ISSET_ID = 3;
9554
    private static final int __USAGE_ISSET_ID = 4;
9555
    private BitSet __isset_bit_vector = new BitSet(5);
6250 amit.gupta 9556
 
9557
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9558
    static {
9559
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9560
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9561
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9562
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9563
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9564
      tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9565
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9566
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9567
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6356 amit.gupta 9568
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9569
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6250 amit.gupta 9570
      tmpMap.put(_Fields.USAGE, new org.apache.thrift.meta_data.FieldMetaData("usage", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9571
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9572
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9573
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
9574
    }
9575
 
9576
    public createCoupon_args() {
9577
    }
9578
 
9579
    public createCoupon_args(
9580
      long promotionId,
9581
      long endOn,
9582
      String email,
9583
      long amount,
6356 amit.gupta 9584
      boolean isCod,
6250 amit.gupta 9585
      long usage)
9586
    {
9587
      this();
9588
      this.promotionId = promotionId;
9589
      setPromotionIdIsSet(true);
9590
      this.endOn = endOn;
9591
      setEndOnIsSet(true);
9592
      this.email = email;
9593
      this.amount = amount;
9594
      setAmountIsSet(true);
6356 amit.gupta 9595
      this.isCod = isCod;
9596
      setIsCodIsSet(true);
6250 amit.gupta 9597
      this.usage = usage;
9598
      setUsageIsSet(true);
9599
    }
9600
 
9601
    /**
9602
     * Performs a deep copy on <i>other</i>.
9603
     */
9604
    public createCoupon_args(createCoupon_args other) {
9605
      __isset_bit_vector.clear();
9606
      __isset_bit_vector.or(other.__isset_bit_vector);
9607
      this.promotionId = other.promotionId;
9608
      this.endOn = other.endOn;
9609
      if (other.isSetEmail()) {
9610
        this.email = other.email;
9611
      }
9612
      this.amount = other.amount;
6356 amit.gupta 9613
      this.isCod = other.isCod;
6250 amit.gupta 9614
      this.usage = other.usage;
9615
    }
9616
 
9617
    public createCoupon_args deepCopy() {
9618
      return new createCoupon_args(this);
9619
    }
9620
 
9621
    @Override
9622
    public void clear() {
9623
      setPromotionIdIsSet(false);
9624
      this.promotionId = 0;
9625
      setEndOnIsSet(false);
9626
      this.endOn = 0;
9627
      this.email = null;
9628
      setAmountIsSet(false);
9629
      this.amount = 0;
6356 amit.gupta 9630
      setIsCodIsSet(false);
9631
      this.isCod = false;
6250 amit.gupta 9632
      setUsageIsSet(false);
9633
      this.usage = 0;
9634
    }
9635
 
9636
    public long getPromotionId() {
9637
      return this.promotionId;
9638
    }
9639
 
9640
    public void setPromotionId(long promotionId) {
9641
      this.promotionId = promotionId;
9642
      setPromotionIdIsSet(true);
9643
    }
9644
 
9645
    public void unsetPromotionId() {
9646
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
9647
    }
9648
 
9649
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
9650
    public boolean isSetPromotionId() {
9651
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
9652
    }
9653
 
9654
    public void setPromotionIdIsSet(boolean value) {
9655
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
9656
    }
9657
 
9658
    public long getEndOn() {
9659
      return this.endOn;
9660
    }
9661
 
9662
    public void setEndOn(long endOn) {
9663
      this.endOn = endOn;
9664
      setEndOnIsSet(true);
9665
    }
9666
 
9667
    public void unsetEndOn() {
9668
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
9669
    }
9670
 
9671
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
9672
    public boolean isSetEndOn() {
9673
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
9674
    }
9675
 
9676
    public void setEndOnIsSet(boolean value) {
9677
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
9678
    }
9679
 
9680
    public String getEmail() {
9681
      return this.email;
9682
    }
9683
 
9684
    public void setEmail(String email) {
9685
      this.email = email;
9686
    }
9687
 
9688
    public void unsetEmail() {
9689
      this.email = null;
9690
    }
9691
 
9692
    /** Returns true if field email is set (has been assigned a value) and false otherwise */
9693
    public boolean isSetEmail() {
9694
      return this.email != null;
9695
    }
9696
 
9697
    public void setEmailIsSet(boolean value) {
9698
      if (!value) {
9699
        this.email = null;
9700
      }
9701
    }
9702
 
9703
    public long getAmount() {
9704
      return this.amount;
9705
    }
9706
 
9707
    public void setAmount(long amount) {
9708
      this.amount = amount;
9709
      setAmountIsSet(true);
9710
    }
9711
 
9712
    public void unsetAmount() {
9713
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
9714
    }
9715
 
9716
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
9717
    public boolean isSetAmount() {
9718
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
9719
    }
9720
 
9721
    public void setAmountIsSet(boolean value) {
9722
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
9723
    }
9724
 
6356 amit.gupta 9725
    public boolean isIsCod() {
9726
      return this.isCod;
9727
    }
9728
 
9729
    public void setIsCod(boolean isCod) {
9730
      this.isCod = isCod;
9731
      setIsCodIsSet(true);
9732
    }
9733
 
9734
    public void unsetIsCod() {
9735
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
9736
    }
9737
 
9738
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
9739
    public boolean isSetIsCod() {
9740
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
9741
    }
9742
 
9743
    public void setIsCodIsSet(boolean value) {
9744
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
9745
    }
9746
 
6250 amit.gupta 9747
    public long getUsage() {
9748
      return this.usage;
9749
    }
9750
 
9751
    public void setUsage(long usage) {
9752
      this.usage = usage;
9753
      setUsageIsSet(true);
9754
    }
9755
 
9756
    public void unsetUsage() {
9757
      __isset_bit_vector.clear(__USAGE_ISSET_ID);
9758
    }
9759
 
9760
    /** Returns true if field usage is set (has been assigned a value) and false otherwise */
9761
    public boolean isSetUsage() {
9762
      return __isset_bit_vector.get(__USAGE_ISSET_ID);
9763
    }
9764
 
9765
    public void setUsageIsSet(boolean value) {
9766
      __isset_bit_vector.set(__USAGE_ISSET_ID, value);
9767
    }
9768
 
9769
    public void setFieldValue(_Fields field, Object value) {
9770
      switch (field) {
9771
      case PROMOTION_ID:
9772
        if (value == null) {
9773
          unsetPromotionId();
9774
        } else {
9775
          setPromotionId((Long)value);
9776
        }
9777
        break;
9778
 
9779
      case END_ON:
9780
        if (value == null) {
9781
          unsetEndOn();
9782
        } else {
9783
          setEndOn((Long)value);
9784
        }
9785
        break;
9786
 
9787
      case EMAIL:
9788
        if (value == null) {
9789
          unsetEmail();
9790
        } else {
9791
          setEmail((String)value);
9792
        }
9793
        break;
9794
 
9795
      case AMOUNT:
9796
        if (value == null) {
9797
          unsetAmount();
9798
        } else {
9799
          setAmount((Long)value);
9800
        }
9801
        break;
9802
 
6356 amit.gupta 9803
      case IS_COD:
9804
        if (value == null) {
9805
          unsetIsCod();
9806
        } else {
9807
          setIsCod((Boolean)value);
9808
        }
9809
        break;
9810
 
6250 amit.gupta 9811
      case USAGE:
9812
        if (value == null) {
9813
          unsetUsage();
9814
        } else {
9815
          setUsage((Long)value);
9816
        }
9817
        break;
9818
 
9819
      }
9820
    }
9821
 
9822
    public Object getFieldValue(_Fields field) {
9823
      switch (field) {
9824
      case PROMOTION_ID:
9825
        return Long.valueOf(getPromotionId());
9826
 
9827
      case END_ON:
9828
        return Long.valueOf(getEndOn());
9829
 
9830
      case EMAIL:
9831
        return getEmail();
9832
 
9833
      case AMOUNT:
9834
        return Long.valueOf(getAmount());
9835
 
6356 amit.gupta 9836
      case IS_COD:
9837
        return Boolean.valueOf(isIsCod());
9838
 
6250 amit.gupta 9839
      case USAGE:
9840
        return Long.valueOf(getUsage());
9841
 
9842
      }
9843
      throw new IllegalStateException();
9844
    }
9845
 
9846
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9847
    public boolean isSet(_Fields field) {
9848
      if (field == null) {
9849
        throw new IllegalArgumentException();
9850
      }
9851
 
9852
      switch (field) {
9853
      case PROMOTION_ID:
9854
        return isSetPromotionId();
9855
      case END_ON:
9856
        return isSetEndOn();
9857
      case EMAIL:
9858
        return isSetEmail();
9859
      case AMOUNT:
9860
        return isSetAmount();
6356 amit.gupta 9861
      case IS_COD:
9862
        return isSetIsCod();
6250 amit.gupta 9863
      case USAGE:
9864
        return isSetUsage();
9865
      }
9866
      throw new IllegalStateException();
9867
    }
9868
 
9869
    @Override
9870
    public boolean equals(Object that) {
9871
      if (that == null)
9872
        return false;
9873
      if (that instanceof createCoupon_args)
9874
        return this.equals((createCoupon_args)that);
9875
      return false;
9876
    }
9877
 
9878
    public boolean equals(createCoupon_args that) {
9879
      if (that == null)
9880
        return false;
9881
 
9882
      boolean this_present_promotionId = true;
9883
      boolean that_present_promotionId = true;
9884
      if (this_present_promotionId || that_present_promotionId) {
9885
        if (!(this_present_promotionId && that_present_promotionId))
9886
          return false;
9887
        if (this.promotionId != that.promotionId)
9888
          return false;
9889
      }
9890
 
9891
      boolean this_present_endOn = true;
9892
      boolean that_present_endOn = true;
9893
      if (this_present_endOn || that_present_endOn) {
9894
        if (!(this_present_endOn && that_present_endOn))
9895
          return false;
9896
        if (this.endOn != that.endOn)
9897
          return false;
9898
      }
9899
 
9900
      boolean this_present_email = true && this.isSetEmail();
9901
      boolean that_present_email = true && that.isSetEmail();
9902
      if (this_present_email || that_present_email) {
9903
        if (!(this_present_email && that_present_email))
9904
          return false;
9905
        if (!this.email.equals(that.email))
9906
          return false;
9907
      }
9908
 
9909
      boolean this_present_amount = true;
9910
      boolean that_present_amount = true;
9911
      if (this_present_amount || that_present_amount) {
9912
        if (!(this_present_amount && that_present_amount))
9913
          return false;
9914
        if (this.amount != that.amount)
9915
          return false;
9916
      }
9917
 
6356 amit.gupta 9918
      boolean this_present_isCod = true;
9919
      boolean that_present_isCod = true;
9920
      if (this_present_isCod || that_present_isCod) {
9921
        if (!(this_present_isCod && that_present_isCod))
9922
          return false;
9923
        if (this.isCod != that.isCod)
9924
          return false;
9925
      }
9926
 
6250 amit.gupta 9927
      boolean this_present_usage = true;
9928
      boolean that_present_usage = true;
9929
      if (this_present_usage || that_present_usage) {
9930
        if (!(this_present_usage && that_present_usage))
9931
          return false;
9932
        if (this.usage != that.usage)
9933
          return false;
9934
      }
9935
 
9936
      return true;
9937
    }
9938
 
9939
    @Override
9940
    public int hashCode() {
9941
      return 0;
9942
    }
9943
 
9944
    public int compareTo(createCoupon_args other) {
9945
      if (!getClass().equals(other.getClass())) {
9946
        return getClass().getName().compareTo(other.getClass().getName());
9947
      }
9948
 
9949
      int lastComparison = 0;
9950
      createCoupon_args typedOther = (createCoupon_args)other;
9951
 
9952
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
9953
      if (lastComparison != 0) {
9954
        return lastComparison;
9955
      }
9956
      if (isSetPromotionId()) {
9957
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
9958
        if (lastComparison != 0) {
9959
          return lastComparison;
9960
        }
9961
      }
9962
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
9963
      if (lastComparison != 0) {
9964
        return lastComparison;
9965
      }
9966
      if (isSetEndOn()) {
9967
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
9968
        if (lastComparison != 0) {
9969
          return lastComparison;
9970
        }
9971
      }
9972
      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
9973
      if (lastComparison != 0) {
9974
        return lastComparison;
9975
      }
9976
      if (isSetEmail()) {
9977
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
9978
        if (lastComparison != 0) {
9979
          return lastComparison;
9980
        }
9981
      }
9982
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
9983
      if (lastComparison != 0) {
9984
        return lastComparison;
9985
      }
9986
      if (isSetAmount()) {
9987
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
9988
        if (lastComparison != 0) {
9989
          return lastComparison;
9990
        }
9991
      }
6356 amit.gupta 9992
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
9993
      if (lastComparison != 0) {
9994
        return lastComparison;
9995
      }
9996
      if (isSetIsCod()) {
9997
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
9998
        if (lastComparison != 0) {
9999
          return lastComparison;
10000
        }
10001
      }
6250 amit.gupta 10002
      lastComparison = Boolean.valueOf(isSetUsage()).compareTo(typedOther.isSetUsage());
10003
      if (lastComparison != 0) {
10004
        return lastComparison;
10005
      }
10006
      if (isSetUsage()) {
10007
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usage, typedOther.usage);
10008
        if (lastComparison != 0) {
10009
          return lastComparison;
10010
        }
10011
      }
10012
      return 0;
10013
    }
10014
 
10015
    public _Fields fieldForId(int fieldId) {
10016
      return _Fields.findByThriftId(fieldId);
10017
    }
10018
 
10019
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10020
      org.apache.thrift.protocol.TField field;
10021
      iprot.readStructBegin();
10022
      while (true)
10023
      {
10024
        field = iprot.readFieldBegin();
10025
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10026
          break;
10027
        }
10028
        switch (field.id) {
10029
          case 1: // PROMOTION_ID
10030
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10031
              this.promotionId = iprot.readI64();
10032
              setPromotionIdIsSet(true);
10033
            } else { 
10034
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10035
            }
10036
            break;
10037
          case 2: // END_ON
10038
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10039
              this.endOn = iprot.readI64();
10040
              setEndOnIsSet(true);
10041
            } else { 
10042
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10043
            }
10044
            break;
10045
          case 3: // EMAIL
10046
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10047
              this.email = iprot.readString();
10048
            } else { 
10049
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10050
            }
10051
            break;
10052
          case 4: // AMOUNT
10053
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10054
              this.amount = iprot.readI64();
10055
              setAmountIsSet(true);
10056
            } else { 
10057
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10058
            }
10059
            break;
6356 amit.gupta 10060
          case 5: // IS_COD
10061
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
10062
              this.isCod = iprot.readBool();
10063
              setIsCodIsSet(true);
10064
            } else { 
10065
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10066
            }
10067
            break;
10068
          case 6: // USAGE
6250 amit.gupta 10069
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10070
              this.usage = iprot.readI64();
10071
              setUsageIsSet(true);
10072
            } else { 
10073
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10074
            }
10075
            break;
10076
          default:
10077
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10078
        }
10079
        iprot.readFieldEnd();
10080
      }
10081
      iprot.readStructEnd();
10082
      validate();
10083
    }
10084
 
10085
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10086
      validate();
10087
 
10088
      oprot.writeStructBegin(STRUCT_DESC);
10089
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
10090
      oprot.writeI64(this.promotionId);
10091
      oprot.writeFieldEnd();
10092
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
10093
      oprot.writeI64(this.endOn);
10094
      oprot.writeFieldEnd();
10095
      if (this.email != null) {
10096
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
10097
        oprot.writeString(this.email);
10098
        oprot.writeFieldEnd();
10099
      }
10100
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
10101
      oprot.writeI64(this.amount);
10102
      oprot.writeFieldEnd();
6356 amit.gupta 10103
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
10104
      oprot.writeBool(this.isCod);
10105
      oprot.writeFieldEnd();
6250 amit.gupta 10106
      oprot.writeFieldBegin(USAGE_FIELD_DESC);
10107
      oprot.writeI64(this.usage);
10108
      oprot.writeFieldEnd();
10109
      oprot.writeFieldStop();
10110
      oprot.writeStructEnd();
10111
    }
10112
 
10113
    @Override
10114
    public String toString() {
10115
      StringBuilder sb = new StringBuilder("createCoupon_args(");
10116
      boolean first = true;
10117
 
10118
      sb.append("promotionId:");
10119
      sb.append(this.promotionId);
10120
      first = false;
10121
      if (!first) sb.append(", ");
10122
      sb.append("endOn:");
10123
      sb.append(this.endOn);
10124
      first = false;
10125
      if (!first) sb.append(", ");
10126
      sb.append("email:");
10127
      if (this.email == null) {
10128
        sb.append("null");
10129
      } else {
10130
        sb.append(this.email);
10131
      }
10132
      first = false;
10133
      if (!first) sb.append(", ");
10134
      sb.append("amount:");
10135
      sb.append(this.amount);
10136
      first = false;
10137
      if (!first) sb.append(", ");
6356 amit.gupta 10138
      sb.append("isCod:");
10139
      sb.append(this.isCod);
10140
      first = false;
10141
      if (!first) sb.append(", ");
6250 amit.gupta 10142
      sb.append("usage:");
10143
      sb.append(this.usage);
10144
      first = false;
10145
      sb.append(")");
10146
      return sb.toString();
10147
    }
10148
 
10149
    public void validate() throws org.apache.thrift.TException {
10150
      // check for required fields
10151
    }
10152
 
10153
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10154
      try {
10155
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10156
      } catch (org.apache.thrift.TException te) {
10157
        throw new java.io.IOException(te);
10158
      }
10159
    }
10160
 
10161
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10162
      try {
10163
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10164
      } catch (org.apache.thrift.TException te) {
10165
        throw new java.io.IOException(te);
10166
      }
10167
    }
10168
 
10169
  }
10170
 
10171
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
10172
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
10173
 
10174
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
10175
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
10176
 
10177
    private String success; // required
10178
    private PromotionException pex; // required
10179
 
10180
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10181
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10182
      SUCCESS((short)0, "success"),
10183
      PEX((short)1, "pex");
10184
 
10185
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10186
 
10187
      static {
10188
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10189
          byName.put(field.getFieldName(), field);
10190
        }
10191
      }
10192
 
10193
      /**
10194
       * Find the _Fields constant that matches fieldId, or null if its not found.
10195
       */
10196
      public static _Fields findByThriftId(int fieldId) {
10197
        switch(fieldId) {
10198
          case 0: // SUCCESS
10199
            return SUCCESS;
10200
          case 1: // PEX
10201
            return PEX;
10202
          default:
10203
            return null;
10204
        }
10205
      }
10206
 
10207
      /**
10208
       * Find the _Fields constant that matches fieldId, throwing an exception
10209
       * if it is not found.
10210
       */
10211
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10212
        _Fields fields = findByThriftId(fieldId);
10213
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10214
        return fields;
10215
      }
10216
 
10217
      /**
10218
       * Find the _Fields constant that matches name, or null if its not found.
10219
       */
10220
      public static _Fields findByName(String name) {
10221
        return byName.get(name);
10222
      }
10223
 
10224
      private final short _thriftId;
10225
      private final String _fieldName;
10226
 
10227
      _Fields(short thriftId, String fieldName) {
10228
        _thriftId = thriftId;
10229
        _fieldName = fieldName;
10230
      }
10231
 
10232
      public short getThriftFieldId() {
10233
        return _thriftId;
10234
      }
10235
 
10236
      public String getFieldName() {
10237
        return _fieldName;
10238
      }
10239
    }
10240
 
10241
    // isset id assignments
10242
 
10243
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10244
    static {
10245
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10246
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10247
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10248
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10249
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10250
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10251
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
10252
    }
10253
 
10254
    public createCoupon_result() {
10255
    }
10256
 
10257
    public createCoupon_result(
10258
      String success,
10259
      PromotionException pex)
10260
    {
10261
      this();
10262
      this.success = success;
10263
      this.pex = pex;
10264
    }
10265
 
10266
    /**
10267
     * Performs a deep copy on <i>other</i>.
10268
     */
10269
    public createCoupon_result(createCoupon_result other) {
10270
      if (other.isSetSuccess()) {
10271
        this.success = other.success;
10272
      }
10273
      if (other.isSetPex()) {
10274
        this.pex = new PromotionException(other.pex);
10275
      }
10276
    }
10277
 
10278
    public createCoupon_result deepCopy() {
10279
      return new createCoupon_result(this);
10280
    }
10281
 
10282
    @Override
10283
    public void clear() {
10284
      this.success = null;
10285
      this.pex = null;
10286
    }
10287
 
10288
    public String getSuccess() {
10289
      return this.success;
10290
    }
10291
 
10292
    public void setSuccess(String success) {
10293
      this.success = success;
10294
    }
10295
 
10296
    public void unsetSuccess() {
10297
      this.success = null;
10298
    }
10299
 
10300
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
10301
    public boolean isSetSuccess() {
10302
      return this.success != null;
10303
    }
10304
 
10305
    public void setSuccessIsSet(boolean value) {
10306
      if (!value) {
10307
        this.success = null;
10308
      }
10309
    }
10310
 
10311
    public PromotionException getPex() {
10312
      return this.pex;
10313
    }
10314
 
10315
    public void setPex(PromotionException pex) {
10316
      this.pex = pex;
10317
    }
10318
 
10319
    public void unsetPex() {
10320
      this.pex = null;
10321
    }
10322
 
10323
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
10324
    public boolean isSetPex() {
10325
      return this.pex != null;
10326
    }
10327
 
10328
    public void setPexIsSet(boolean value) {
10329
      if (!value) {
10330
        this.pex = null;
10331
      }
10332
    }
10333
 
10334
    public void setFieldValue(_Fields field, Object value) {
10335
      switch (field) {
10336
      case SUCCESS:
10337
        if (value == null) {
10338
          unsetSuccess();
10339
        } else {
10340
          setSuccess((String)value);
10341
        }
10342
        break;
10343
 
10344
      case PEX:
10345
        if (value == null) {
10346
          unsetPex();
10347
        } else {
10348
          setPex((PromotionException)value);
10349
        }
10350
        break;
10351
 
10352
      }
10353
    }
10354
 
10355
    public Object getFieldValue(_Fields field) {
10356
      switch (field) {
10357
      case SUCCESS:
10358
        return getSuccess();
10359
 
10360
      case PEX:
10361
        return getPex();
10362
 
10363
      }
10364
      throw new IllegalStateException();
10365
    }
10366
 
10367
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10368
    public boolean isSet(_Fields field) {
10369
      if (field == null) {
10370
        throw new IllegalArgumentException();
10371
      }
10372
 
10373
      switch (field) {
10374
      case SUCCESS:
10375
        return isSetSuccess();
10376
      case PEX:
10377
        return isSetPex();
10378
      }
10379
      throw new IllegalStateException();
10380
    }
10381
 
10382
    @Override
10383
    public boolean equals(Object that) {
10384
      if (that == null)
10385
        return false;
10386
      if (that instanceof createCoupon_result)
10387
        return this.equals((createCoupon_result)that);
10388
      return false;
10389
    }
10390
 
10391
    public boolean equals(createCoupon_result that) {
10392
      if (that == null)
10393
        return false;
10394
 
10395
      boolean this_present_success = true && this.isSetSuccess();
10396
      boolean that_present_success = true && that.isSetSuccess();
10397
      if (this_present_success || that_present_success) {
10398
        if (!(this_present_success && that_present_success))
10399
          return false;
10400
        if (!this.success.equals(that.success))
10401
          return false;
10402
      }
10403
 
10404
      boolean this_present_pex = true && this.isSetPex();
10405
      boolean that_present_pex = true && that.isSetPex();
10406
      if (this_present_pex || that_present_pex) {
10407
        if (!(this_present_pex && that_present_pex))
10408
          return false;
10409
        if (!this.pex.equals(that.pex))
10410
          return false;
10411
      }
10412
 
10413
      return true;
10414
    }
10415
 
10416
    @Override
10417
    public int hashCode() {
10418
      return 0;
10419
    }
10420
 
10421
    public int compareTo(createCoupon_result other) {
10422
      if (!getClass().equals(other.getClass())) {
10423
        return getClass().getName().compareTo(other.getClass().getName());
10424
      }
10425
 
10426
      int lastComparison = 0;
10427
      createCoupon_result typedOther = (createCoupon_result)other;
10428
 
10429
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
10430
      if (lastComparison != 0) {
10431
        return lastComparison;
10432
      }
10433
      if (isSetSuccess()) {
10434
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10435
        if (lastComparison != 0) {
10436
          return lastComparison;
10437
        }
10438
      }
10439
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
10440
      if (lastComparison != 0) {
10441
        return lastComparison;
10442
      }
10443
      if (isSetPex()) {
10444
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10445
        if (lastComparison != 0) {
10446
          return lastComparison;
10447
        }
10448
      }
10449
      return 0;
10450
    }
10451
 
10452
    public _Fields fieldForId(int fieldId) {
10453
      return _Fields.findByThriftId(fieldId);
10454
    }
10455
 
10456
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10457
      org.apache.thrift.protocol.TField field;
10458
      iprot.readStructBegin();
10459
      while (true)
10460
      {
10461
        field = iprot.readFieldBegin();
10462
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10463
          break;
10464
        }
10465
        switch (field.id) {
10466
          case 0: // SUCCESS
10467
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10468
              this.success = iprot.readString();
10469
            } else { 
10470
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10471
            }
10472
            break;
10473
          case 1: // PEX
10474
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10475
              this.pex = new PromotionException();
10476
              this.pex.read(iprot);
10477
            } else { 
10478
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10479
            }
10480
            break;
10481
          default:
10482
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10483
        }
10484
        iprot.readFieldEnd();
10485
      }
10486
      iprot.readStructEnd();
10487
      validate();
10488
    }
10489
 
10490
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10491
      oprot.writeStructBegin(STRUCT_DESC);
10492
 
10493
      if (this.isSetSuccess()) {
10494
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10495
        oprot.writeString(this.success);
10496
        oprot.writeFieldEnd();
10497
      } else if (this.isSetPex()) {
10498
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10499
        this.pex.write(oprot);
10500
        oprot.writeFieldEnd();
10501
      }
10502
      oprot.writeFieldStop();
10503
      oprot.writeStructEnd();
10504
    }
10505
 
10506
    @Override
10507
    public String toString() {
10508
      StringBuilder sb = new StringBuilder("createCoupon_result(");
10509
      boolean first = true;
10510
 
10511
      sb.append("success:");
10512
      if (this.success == null) {
10513
        sb.append("null");
10514
      } else {
10515
        sb.append(this.success);
10516
      }
10517
      first = false;
10518
      if (!first) sb.append(", ");
10519
      sb.append("pex:");
10520
      if (this.pex == null) {
10521
        sb.append("null");
10522
      } else {
10523
        sb.append(this.pex);
10524
      }
10525
      first = false;
10526
      sb.append(")");
10527
      return sb.toString();
10528
    }
10529
 
10530
    public void validate() throws org.apache.thrift.TException {
10531
      // check for required fields
10532
    }
10533
 
10534
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10535
      try {
10536
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10537
      } catch (org.apache.thrift.TException te) {
10538
        throw new java.io.IOException(te);
10539
      }
10540
    }
10541
 
10542
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10543
      try {
10544
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10545
      } catch (org.apache.thrift.TException te) {
10546
        throw new java.io.IOException(te);
10547
      }
10548
    }
10549
 
10550
  }
10551
 
3430 rajveer 10552
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
10553
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 10554
 
3430 rajveer 10555
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
3385 varun.gupt 10556
 
3430 rajveer 10557
    private String couponCode; // required
3385 varun.gupt 10558
 
10559
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10560
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 10561
      COUPON_CODE((short)1, "couponCode");
10562
 
10563
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10564
 
10565
      static {
10566
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10567
          byName.put(field.getFieldName(), field);
10568
        }
10569
      }
10570
 
10571
      /**
10572
       * Find the _Fields constant that matches fieldId, or null if its not found.
10573
       */
10574
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10575
        switch(fieldId) {
10576
          case 1: // COUPON_CODE
10577
            return COUPON_CODE;
10578
          default:
10579
            return null;
10580
        }
3385 varun.gupt 10581
      }
10582
 
10583
      /**
10584
       * Find the _Fields constant that matches fieldId, throwing an exception
10585
       * if it is not found.
10586
       */
10587
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10588
        _Fields fields = findByThriftId(fieldId);
10589
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10590
        return fields;
10591
      }
10592
 
10593
      /**
10594
       * Find the _Fields constant that matches name, or null if its not found.
10595
       */
10596
      public static _Fields findByName(String name) {
10597
        return byName.get(name);
10598
      }
10599
 
10600
      private final short _thriftId;
10601
      private final String _fieldName;
10602
 
10603
      _Fields(short thriftId, String fieldName) {
10604
        _thriftId = thriftId;
10605
        _fieldName = fieldName;
10606
      }
10607
 
10608
      public short getThriftFieldId() {
10609
        return _thriftId;
10610
      }
10611
 
10612
      public String getFieldName() {
10613
        return _fieldName;
10614
      }
10615
    }
10616
 
10617
    // isset id assignments
10618
 
3430 rajveer 10619
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 10620
    static {
3430 rajveer 10621
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10622
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10623
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10624
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10625
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 10626
    }
10627
 
10628
    public getSuccessfulPaymentCountForCoupon_args() {
10629
    }
10630
 
10631
    public getSuccessfulPaymentCountForCoupon_args(
10632
      String couponCode)
10633
    {
10634
      this();
10635
      this.couponCode = couponCode;
10636
    }
10637
 
10638
    /**
10639
     * Performs a deep copy on <i>other</i>.
10640
     */
10641
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
10642
      if (other.isSetCouponCode()) {
10643
        this.couponCode = other.couponCode;
10644
      }
10645
    }
10646
 
10647
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
10648
      return new getSuccessfulPaymentCountForCoupon_args(this);
10649
    }
10650
 
3430 rajveer 10651
    @Override
10652
    public void clear() {
10653
      this.couponCode = null;
3385 varun.gupt 10654
    }
10655
 
10656
    public String getCouponCode() {
10657
      return this.couponCode;
10658
    }
10659
 
3430 rajveer 10660
    public void setCouponCode(String couponCode) {
3385 varun.gupt 10661
      this.couponCode = couponCode;
10662
    }
10663
 
10664
    public void unsetCouponCode() {
10665
      this.couponCode = null;
10666
    }
10667
 
3430 rajveer 10668
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 10669
    public boolean isSetCouponCode() {
10670
      return this.couponCode != null;
10671
    }
10672
 
10673
    public void setCouponCodeIsSet(boolean value) {
10674
      if (!value) {
10675
        this.couponCode = null;
10676
      }
10677
    }
10678
 
10679
    public void setFieldValue(_Fields field, Object value) {
10680
      switch (field) {
10681
      case COUPON_CODE:
10682
        if (value == null) {
10683
          unsetCouponCode();
10684
        } else {
10685
          setCouponCode((String)value);
10686
        }
10687
        break;
10688
 
10689
      }
10690
    }
10691
 
10692
    public Object getFieldValue(_Fields field) {
10693
      switch (field) {
10694
      case COUPON_CODE:
10695
        return getCouponCode();
10696
 
10697
      }
10698
      throw new IllegalStateException();
10699
    }
10700
 
3430 rajveer 10701
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10702
    public boolean isSet(_Fields field) {
10703
      if (field == null) {
10704
        throw new IllegalArgumentException();
10705
      }
3385 varun.gupt 10706
 
10707
      switch (field) {
10708
      case COUPON_CODE:
10709
        return isSetCouponCode();
10710
      }
10711
      throw new IllegalStateException();
10712
    }
10713
 
10714
    @Override
10715
    public boolean equals(Object that) {
10716
      if (that == null)
10717
        return false;
10718
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
10719
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
10720
      return false;
10721
    }
10722
 
10723
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
10724
      if (that == null)
10725
        return false;
10726
 
10727
      boolean this_present_couponCode = true && this.isSetCouponCode();
10728
      boolean that_present_couponCode = true && that.isSetCouponCode();
10729
      if (this_present_couponCode || that_present_couponCode) {
10730
        if (!(this_present_couponCode && that_present_couponCode))
10731
          return false;
10732
        if (!this.couponCode.equals(that.couponCode))
10733
          return false;
10734
      }
10735
 
10736
      return true;
10737
    }
10738
 
10739
    @Override
10740
    public int hashCode() {
10741
      return 0;
10742
    }
10743
 
10744
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
10745
      if (!getClass().equals(other.getClass())) {
10746
        return getClass().getName().compareTo(other.getClass().getName());
10747
      }
10748
 
10749
      int lastComparison = 0;
10750
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
10751
 
3430 rajveer 10752
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 10753
      if (lastComparison != 0) {
10754
        return lastComparison;
10755
      }
3430 rajveer 10756
      if (isSetCouponCode()) {
10757
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10758
        if (lastComparison != 0) {
10759
          return lastComparison;
10760
        }
3385 varun.gupt 10761
      }
10762
      return 0;
10763
    }
10764
 
3430 rajveer 10765
    public _Fields fieldForId(int fieldId) {
10766
      return _Fields.findByThriftId(fieldId);
10767
    }
10768
 
10769
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10770
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 10771
      iprot.readStructBegin();
10772
      while (true)
10773
      {
10774
        field = iprot.readFieldBegin();
3430 rajveer 10775
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 10776
          break;
10777
        }
3430 rajveer 10778
        switch (field.id) {
10779
          case 1: // COUPON_CODE
10780
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10781
              this.couponCode = iprot.readString();
10782
            } else { 
10783
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10784
            }
10785
            break;
10786
          default:
10787
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 10788
        }
3430 rajveer 10789
        iprot.readFieldEnd();
3385 varun.gupt 10790
      }
10791
      iprot.readStructEnd();
10792
      validate();
10793
    }
10794
 
3430 rajveer 10795
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 10796
      validate();
10797
 
10798
      oprot.writeStructBegin(STRUCT_DESC);
10799
      if (this.couponCode != null) {
10800
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10801
        oprot.writeString(this.couponCode);
10802
        oprot.writeFieldEnd();
10803
      }
10804
      oprot.writeFieldStop();
10805
      oprot.writeStructEnd();
10806
    }
10807
 
10808
    @Override
10809
    public String toString() {
10810
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
10811
      boolean first = true;
10812
 
10813
      sb.append("couponCode:");
10814
      if (this.couponCode == null) {
10815
        sb.append("null");
10816
      } else {
10817
        sb.append(this.couponCode);
10818
      }
10819
      first = false;
10820
      sb.append(")");
10821
      return sb.toString();
10822
    }
10823
 
3430 rajveer 10824
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 10825
      // check for required fields
10826
    }
10827
 
3430 rajveer 10828
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10829
      try {
10830
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10831
      } catch (org.apache.thrift.TException te) {
10832
        throw new java.io.IOException(te);
10833
      }
10834
    }
10835
 
10836
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10837
      try {
10838
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10839
      } catch (org.apache.thrift.TException te) {
10840
        throw new java.io.IOException(te);
10841
      }
10842
    }
10843
 
3385 varun.gupt 10844
  }
10845
 
3430 rajveer 10846
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
10847
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 10848
 
3430 rajveer 10849
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
10850
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3385 varun.gupt 10851
 
3430 rajveer 10852
    private long success; // required
10853
    private PromotionException pex; // required
3385 varun.gupt 10854
 
10855
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10856
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 10857
      SUCCESS((short)0, "success"),
10858
      PEX((short)1, "pex");
10859
 
10860
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10861
 
10862
      static {
10863
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10864
          byName.put(field.getFieldName(), field);
10865
        }
10866
      }
10867
 
10868
      /**
10869
       * Find the _Fields constant that matches fieldId, or null if its not found.
10870
       */
10871
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10872
        switch(fieldId) {
10873
          case 0: // SUCCESS
10874
            return SUCCESS;
10875
          case 1: // PEX
10876
            return PEX;
10877
          default:
10878
            return null;
10879
        }
3385 varun.gupt 10880
      }
10881
 
10882
      /**
10883
       * Find the _Fields constant that matches fieldId, throwing an exception
10884
       * if it is not found.
10885
       */
10886
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10887
        _Fields fields = findByThriftId(fieldId);
10888
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10889
        return fields;
10890
      }
10891
 
10892
      /**
10893
       * Find the _Fields constant that matches name, or null if its not found.
10894
       */
10895
      public static _Fields findByName(String name) {
10896
        return byName.get(name);
10897
      }
10898
 
10899
      private final short _thriftId;
10900
      private final String _fieldName;
10901
 
10902
      _Fields(short thriftId, String fieldName) {
10903
        _thriftId = thriftId;
10904
        _fieldName = fieldName;
10905
      }
10906
 
10907
      public short getThriftFieldId() {
10908
        return _thriftId;
10909
      }
10910
 
10911
      public String getFieldName() {
10912
        return _fieldName;
10913
      }
10914
    }
10915
 
10916
    // isset id assignments
10917
    private static final int __SUCCESS_ISSET_ID = 0;
10918
    private BitSet __isset_bit_vector = new BitSet(1);
10919
 
3430 rajveer 10920
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 10921
    static {
3430 rajveer 10922
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10923
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10924
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10925
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10926
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10927
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10928
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 10929
    }
10930
 
10931
    public getSuccessfulPaymentCountForCoupon_result() {
10932
    }
10933
 
10934
    public getSuccessfulPaymentCountForCoupon_result(
10935
      long success,
10936
      PromotionException pex)
10937
    {
10938
      this();
10939
      this.success = success;
10940
      setSuccessIsSet(true);
10941
      this.pex = pex;
10942
    }
10943
 
10944
    /**
10945
     * Performs a deep copy on <i>other</i>.
10946
     */
10947
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
10948
      __isset_bit_vector.clear();
10949
      __isset_bit_vector.or(other.__isset_bit_vector);
10950
      this.success = other.success;
10951
      if (other.isSetPex()) {
10952
        this.pex = new PromotionException(other.pex);
10953
      }
10954
    }
10955
 
10956
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
10957
      return new getSuccessfulPaymentCountForCoupon_result(this);
10958
    }
10959
 
3430 rajveer 10960
    @Override
10961
    public void clear() {
10962
      setSuccessIsSet(false);
10963
      this.success = 0;
10964
      this.pex = null;
3385 varun.gupt 10965
    }
10966
 
10967
    public long getSuccess() {
10968
      return this.success;
10969
    }
10970
 
3430 rajveer 10971
    public void setSuccess(long success) {
3385 varun.gupt 10972
      this.success = success;
10973
      setSuccessIsSet(true);
10974
    }
10975
 
10976
    public void unsetSuccess() {
10977
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
10978
    }
10979
 
3430 rajveer 10980
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 10981
    public boolean isSetSuccess() {
10982
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
10983
    }
10984
 
10985
    public void setSuccessIsSet(boolean value) {
10986
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
10987
    }
10988
 
10989
    public PromotionException getPex() {
10990
      return this.pex;
10991
    }
10992
 
3430 rajveer 10993
    public void setPex(PromotionException pex) {
3385 varun.gupt 10994
      this.pex = pex;
10995
    }
10996
 
10997
    public void unsetPex() {
10998
      this.pex = null;
10999
    }
11000
 
3430 rajveer 11001
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11002
    public boolean isSetPex() {
11003
      return this.pex != null;
11004
    }
11005
 
11006
    public void setPexIsSet(boolean value) {
11007
      if (!value) {
11008
        this.pex = null;
11009
      }
11010
    }
11011
 
11012
    public void setFieldValue(_Fields field, Object value) {
11013
      switch (field) {
11014
      case SUCCESS:
11015
        if (value == null) {
11016
          unsetSuccess();
11017
        } else {
11018
          setSuccess((Long)value);
11019
        }
11020
        break;
11021
 
11022
      case PEX:
11023
        if (value == null) {
11024
          unsetPex();
11025
        } else {
11026
          setPex((PromotionException)value);
11027
        }
11028
        break;
11029
 
11030
      }
11031
    }
11032
 
11033
    public Object getFieldValue(_Fields field) {
11034
      switch (field) {
11035
      case SUCCESS:
3430 rajveer 11036
        return Long.valueOf(getSuccess());
3385 varun.gupt 11037
 
11038
      case PEX:
11039
        return getPex();
11040
 
11041
      }
11042
      throw new IllegalStateException();
11043
    }
11044
 
3430 rajveer 11045
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11046
    public boolean isSet(_Fields field) {
11047
      if (field == null) {
11048
        throw new IllegalArgumentException();
11049
      }
3385 varun.gupt 11050
 
11051
      switch (field) {
11052
      case SUCCESS:
11053
        return isSetSuccess();
11054
      case PEX:
11055
        return isSetPex();
11056
      }
11057
      throw new IllegalStateException();
11058
    }
11059
 
11060
    @Override
11061
    public boolean equals(Object that) {
11062
      if (that == null)
11063
        return false;
11064
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
11065
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
11066
      return false;
11067
    }
11068
 
11069
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
11070
      if (that == null)
11071
        return false;
11072
 
11073
      boolean this_present_success = true;
11074
      boolean that_present_success = true;
11075
      if (this_present_success || that_present_success) {
11076
        if (!(this_present_success && that_present_success))
11077
          return false;
11078
        if (this.success != that.success)
11079
          return false;
11080
      }
11081
 
11082
      boolean this_present_pex = true && this.isSetPex();
11083
      boolean that_present_pex = true && that.isSetPex();
11084
      if (this_present_pex || that_present_pex) {
11085
        if (!(this_present_pex && that_present_pex))
11086
          return false;
11087
        if (!this.pex.equals(that.pex))
11088
          return false;
11089
      }
11090
 
11091
      return true;
11092
    }
11093
 
11094
    @Override
11095
    public int hashCode() {
11096
      return 0;
11097
    }
11098
 
11099
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
11100
      if (!getClass().equals(other.getClass())) {
11101
        return getClass().getName().compareTo(other.getClass().getName());
11102
      }
11103
 
11104
      int lastComparison = 0;
11105
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
11106
 
3430 rajveer 11107
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 11108
      if (lastComparison != 0) {
11109
        return lastComparison;
11110
      }
3430 rajveer 11111
      if (isSetSuccess()) {
11112
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11113
        if (lastComparison != 0) {
11114
          return lastComparison;
11115
        }
3385 varun.gupt 11116
      }
3430 rajveer 11117
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 11118
      if (lastComparison != 0) {
11119
        return lastComparison;
11120
      }
3430 rajveer 11121
      if (isSetPex()) {
11122
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11123
        if (lastComparison != 0) {
11124
          return lastComparison;
11125
        }
3385 varun.gupt 11126
      }
11127
      return 0;
11128
    }
11129
 
3430 rajveer 11130
    public _Fields fieldForId(int fieldId) {
11131
      return _Fields.findByThriftId(fieldId);
11132
    }
11133
 
11134
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11135
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11136
      iprot.readStructBegin();
11137
      while (true)
11138
      {
11139
        field = iprot.readFieldBegin();
3430 rajveer 11140
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11141
          break;
11142
        }
3430 rajveer 11143
        switch (field.id) {
11144
          case 0: // SUCCESS
11145
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11146
              this.success = iprot.readI64();
11147
              setSuccessIsSet(true);
11148
            } else { 
11149
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11150
            }
11151
            break;
11152
          case 1: // PEX
11153
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11154
              this.pex = new PromotionException();
11155
              this.pex.read(iprot);
11156
            } else { 
11157
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11158
            }
11159
            break;
11160
          default:
11161
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11162
        }
3430 rajveer 11163
        iprot.readFieldEnd();
3385 varun.gupt 11164
      }
11165
      iprot.readStructEnd();
11166
      validate();
11167
    }
11168
 
3430 rajveer 11169
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11170
      oprot.writeStructBegin(STRUCT_DESC);
11171
 
11172
      if (this.isSetSuccess()) {
11173
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11174
        oprot.writeI64(this.success);
11175
        oprot.writeFieldEnd();
11176
      } else if (this.isSetPex()) {
11177
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11178
        this.pex.write(oprot);
11179
        oprot.writeFieldEnd();
11180
      }
11181
      oprot.writeFieldStop();
11182
      oprot.writeStructEnd();
11183
    }
11184
 
11185
    @Override
11186
    public String toString() {
11187
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
11188
      boolean first = true;
11189
 
11190
      sb.append("success:");
11191
      sb.append(this.success);
11192
      first = false;
11193
      if (!first) sb.append(", ");
11194
      sb.append("pex:");
11195
      if (this.pex == null) {
11196
        sb.append("null");
11197
      } else {
11198
        sb.append(this.pex);
11199
      }
11200
      first = false;
11201
      sb.append(")");
11202
      return sb.toString();
11203
    }
11204
 
3430 rajveer 11205
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11206
      // check for required fields
11207
    }
11208
 
3430 rajveer 11209
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11210
      try {
11211
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11212
      } catch (org.apache.thrift.TException te) {
11213
        throw new java.io.IOException(te);
11214
      }
11215
    }
11216
 
11217
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11218
      try {
11219
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11220
      } catch (org.apache.thrift.TException te) {
11221
        throw new java.io.IOException(te);
11222
      }
11223
    }
11224
 
3385 varun.gupt 11225
  }
11226
 
3430 rajveer 11227
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
11228
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 11229
 
3430 rajveer 11230
    private static final org.apache.thrift.protocol.TField RULE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("ruleName", org.apache.thrift.protocol.TType.STRING, (short)1);
3385 varun.gupt 11231
 
3430 rajveer 11232
    private String ruleName; // required
3385 varun.gupt 11233
 
11234
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11235
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11236
      RULE_NAME((short)1, "ruleName");
11237
 
11238
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11239
 
11240
      static {
11241
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11242
          byName.put(field.getFieldName(), field);
11243
        }
11244
      }
11245
 
11246
      /**
11247
       * Find the _Fields constant that matches fieldId, or null if its not found.
11248
       */
11249
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11250
        switch(fieldId) {
11251
          case 1: // RULE_NAME
11252
            return RULE_NAME;
11253
          default:
11254
            return null;
11255
        }
3385 varun.gupt 11256
      }
11257
 
11258
      /**
11259
       * Find the _Fields constant that matches fieldId, throwing an exception
11260
       * if it is not found.
11261
       */
11262
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11263
        _Fields fields = findByThriftId(fieldId);
11264
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11265
        return fields;
11266
      }
11267
 
11268
      /**
11269
       * Find the _Fields constant that matches name, or null if its not found.
11270
       */
11271
      public static _Fields findByName(String name) {
11272
        return byName.get(name);
11273
      }
11274
 
11275
      private final short _thriftId;
11276
      private final String _fieldName;
11277
 
11278
      _Fields(short thriftId, String fieldName) {
11279
        _thriftId = thriftId;
11280
        _fieldName = fieldName;
11281
      }
11282
 
11283
      public short getThriftFieldId() {
11284
        return _thriftId;
11285
      }
11286
 
11287
      public String getFieldName() {
11288
        return _fieldName;
11289
      }
11290
    }
11291
 
11292
    // isset id assignments
11293
 
3430 rajveer 11294
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11295
    static {
3430 rajveer 11296
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11297
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11298
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
11299
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11300
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 11301
    }
11302
 
11303
    public getRuleDocString_args() {
11304
    }
11305
 
11306
    public getRuleDocString_args(
11307
      String ruleName)
11308
    {
11309
      this();
11310
      this.ruleName = ruleName;
11311
    }
11312
 
11313
    /**
11314
     * Performs a deep copy on <i>other</i>.
11315
     */
11316
    public getRuleDocString_args(getRuleDocString_args other) {
11317
      if (other.isSetRuleName()) {
11318
        this.ruleName = other.ruleName;
11319
      }
11320
    }
11321
 
11322
    public getRuleDocString_args deepCopy() {
11323
      return new getRuleDocString_args(this);
11324
    }
11325
 
3430 rajveer 11326
    @Override
11327
    public void clear() {
11328
      this.ruleName = null;
3385 varun.gupt 11329
    }
11330
 
11331
    public String getRuleName() {
11332
      return this.ruleName;
11333
    }
11334
 
3430 rajveer 11335
    public void setRuleName(String ruleName) {
3385 varun.gupt 11336
      this.ruleName = ruleName;
11337
    }
11338
 
11339
    public void unsetRuleName() {
11340
      this.ruleName = null;
11341
    }
11342
 
3430 rajveer 11343
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11344
    public boolean isSetRuleName() {
11345
      return this.ruleName != null;
11346
    }
11347
 
11348
    public void setRuleNameIsSet(boolean value) {
11349
      if (!value) {
11350
        this.ruleName = null;
11351
      }
11352
    }
11353
 
11354
    public void setFieldValue(_Fields field, Object value) {
11355
      switch (field) {
11356
      case RULE_NAME:
11357
        if (value == null) {
11358
          unsetRuleName();
11359
        } else {
11360
          setRuleName((String)value);
11361
        }
11362
        break;
11363
 
11364
      }
11365
    }
11366
 
11367
    public Object getFieldValue(_Fields field) {
11368
      switch (field) {
11369
      case RULE_NAME:
11370
        return getRuleName();
11371
 
11372
      }
11373
      throw new IllegalStateException();
11374
    }
11375
 
3430 rajveer 11376
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11377
    public boolean isSet(_Fields field) {
11378
      if (field == null) {
11379
        throw new IllegalArgumentException();
11380
      }
3385 varun.gupt 11381
 
11382
      switch (field) {
11383
      case RULE_NAME:
11384
        return isSetRuleName();
11385
      }
11386
      throw new IllegalStateException();
11387
    }
11388
 
11389
    @Override
11390
    public boolean equals(Object that) {
11391
      if (that == null)
11392
        return false;
11393
      if (that instanceof getRuleDocString_args)
11394
        return this.equals((getRuleDocString_args)that);
11395
      return false;
11396
    }
11397
 
11398
    public boolean equals(getRuleDocString_args that) {
11399
      if (that == null)
11400
        return false;
11401
 
11402
      boolean this_present_ruleName = true && this.isSetRuleName();
11403
      boolean that_present_ruleName = true && that.isSetRuleName();
11404
      if (this_present_ruleName || that_present_ruleName) {
11405
        if (!(this_present_ruleName && that_present_ruleName))
11406
          return false;
11407
        if (!this.ruleName.equals(that.ruleName))
11408
          return false;
11409
      }
11410
 
11411
      return true;
11412
    }
11413
 
11414
    @Override
11415
    public int hashCode() {
11416
      return 0;
11417
    }
11418
 
11419
    public int compareTo(getRuleDocString_args other) {
11420
      if (!getClass().equals(other.getClass())) {
11421
        return getClass().getName().compareTo(other.getClass().getName());
11422
      }
11423
 
11424
      int lastComparison = 0;
11425
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
11426
 
3430 rajveer 11427
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 11428
      if (lastComparison != 0) {
11429
        return lastComparison;
11430
      }
3430 rajveer 11431
      if (isSetRuleName()) {
11432
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
11433
        if (lastComparison != 0) {
11434
          return lastComparison;
11435
        }
3385 varun.gupt 11436
      }
11437
      return 0;
11438
    }
11439
 
3430 rajveer 11440
    public _Fields fieldForId(int fieldId) {
11441
      return _Fields.findByThriftId(fieldId);
11442
    }
11443
 
11444
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11445
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11446
      iprot.readStructBegin();
11447
      while (true)
11448
      {
11449
        field = iprot.readFieldBegin();
3430 rajveer 11450
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11451
          break;
11452
        }
3430 rajveer 11453
        switch (field.id) {
11454
          case 1: // RULE_NAME
11455
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11456
              this.ruleName = iprot.readString();
11457
            } else { 
11458
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11459
            }
11460
            break;
11461
          default:
11462
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11463
        }
3430 rajveer 11464
        iprot.readFieldEnd();
3385 varun.gupt 11465
      }
11466
      iprot.readStructEnd();
11467
      validate();
11468
    }
11469
 
3430 rajveer 11470
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11471
      validate();
11472
 
11473
      oprot.writeStructBegin(STRUCT_DESC);
11474
      if (this.ruleName != null) {
11475
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
11476
        oprot.writeString(this.ruleName);
11477
        oprot.writeFieldEnd();
11478
      }
11479
      oprot.writeFieldStop();
11480
      oprot.writeStructEnd();
11481
    }
11482
 
11483
    @Override
11484
    public String toString() {
11485
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
11486
      boolean first = true;
11487
 
11488
      sb.append("ruleName:");
11489
      if (this.ruleName == null) {
11490
        sb.append("null");
11491
      } else {
11492
        sb.append(this.ruleName);
11493
      }
11494
      first = false;
11495
      sb.append(")");
11496
      return sb.toString();
11497
    }
11498
 
3430 rajveer 11499
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11500
      // check for required fields
11501
    }
11502
 
3430 rajveer 11503
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11504
      try {
11505
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11506
      } catch (org.apache.thrift.TException te) {
11507
        throw new java.io.IOException(te);
11508
      }
11509
    }
11510
 
11511
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11512
      try {
11513
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11514
      } catch (org.apache.thrift.TException te) {
11515
        throw new java.io.IOException(te);
11516
      }
11517
    }
11518
 
3385 varun.gupt 11519
  }
11520
 
3430 rajveer 11521
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
11522
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 11523
 
3430 rajveer 11524
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
3385 varun.gupt 11525
 
3430 rajveer 11526
    private String success; // required
3385 varun.gupt 11527
 
11528
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11529
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11530
      SUCCESS((short)0, "success");
11531
 
11532
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11533
 
11534
      static {
11535
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11536
          byName.put(field.getFieldName(), field);
11537
        }
11538
      }
11539
 
11540
      /**
11541
       * Find the _Fields constant that matches fieldId, or null if its not found.
11542
       */
11543
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11544
        switch(fieldId) {
11545
          case 0: // SUCCESS
11546
            return SUCCESS;
11547
          default:
11548
            return null;
11549
        }
3385 varun.gupt 11550
      }
11551
 
11552
      /**
11553
       * Find the _Fields constant that matches fieldId, throwing an exception
11554
       * if it is not found.
11555
       */
11556
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11557
        _Fields fields = findByThriftId(fieldId);
11558
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11559
        return fields;
11560
      }
11561
 
11562
      /**
11563
       * Find the _Fields constant that matches name, or null if its not found.
11564
       */
11565
      public static _Fields findByName(String name) {
11566
        return byName.get(name);
11567
      }
11568
 
11569
      private final short _thriftId;
11570
      private final String _fieldName;
11571
 
11572
      _Fields(short thriftId, String fieldName) {
11573
        _thriftId = thriftId;
11574
        _fieldName = fieldName;
11575
      }
11576
 
11577
      public short getThriftFieldId() {
11578
        return _thriftId;
11579
      }
11580
 
11581
      public String getFieldName() {
11582
        return _fieldName;
11583
      }
11584
    }
11585
 
11586
    // isset id assignments
11587
 
3430 rajveer 11588
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11589
    static {
3430 rajveer 11590
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11591
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11592
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
11593
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11594
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 11595
    }
11596
 
11597
    public getRuleDocString_result() {
11598
    }
11599
 
11600
    public getRuleDocString_result(
11601
      String success)
11602
    {
11603
      this();
11604
      this.success = success;
11605
    }
11606
 
11607
    /**
11608
     * Performs a deep copy on <i>other</i>.
11609
     */
11610
    public getRuleDocString_result(getRuleDocString_result other) {
11611
      if (other.isSetSuccess()) {
11612
        this.success = other.success;
11613
      }
11614
    }
11615
 
11616
    public getRuleDocString_result deepCopy() {
11617
      return new getRuleDocString_result(this);
11618
    }
11619
 
3430 rajveer 11620
    @Override
11621
    public void clear() {
11622
      this.success = null;
3385 varun.gupt 11623
    }
11624
 
11625
    public String getSuccess() {
11626
      return this.success;
11627
    }
11628
 
3430 rajveer 11629
    public void setSuccess(String success) {
3385 varun.gupt 11630
      this.success = success;
11631
    }
11632
 
11633
    public void unsetSuccess() {
11634
      this.success = null;
11635
    }
11636
 
3430 rajveer 11637
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11638
    public boolean isSetSuccess() {
11639
      return this.success != null;
11640
    }
11641
 
11642
    public void setSuccessIsSet(boolean value) {
11643
      if (!value) {
11644
        this.success = null;
11645
      }
11646
    }
11647
 
11648
    public void setFieldValue(_Fields field, Object value) {
11649
      switch (field) {
11650
      case SUCCESS:
11651
        if (value == null) {
11652
          unsetSuccess();
11653
        } else {
11654
          setSuccess((String)value);
11655
        }
11656
        break;
11657
 
11658
      }
11659
    }
11660
 
11661
    public Object getFieldValue(_Fields field) {
11662
      switch (field) {
11663
      case SUCCESS:
11664
        return getSuccess();
11665
 
11666
      }
11667
      throw new IllegalStateException();
11668
    }
11669
 
3430 rajveer 11670
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11671
    public boolean isSet(_Fields field) {
11672
      if (field == null) {
11673
        throw new IllegalArgumentException();
11674
      }
3385 varun.gupt 11675
 
11676
      switch (field) {
11677
      case SUCCESS:
11678
        return isSetSuccess();
11679
      }
11680
      throw new IllegalStateException();
11681
    }
11682
 
11683
    @Override
11684
    public boolean equals(Object that) {
11685
      if (that == null)
11686
        return false;
11687
      if (that instanceof getRuleDocString_result)
11688
        return this.equals((getRuleDocString_result)that);
11689
      return false;
11690
    }
11691
 
11692
    public boolean equals(getRuleDocString_result that) {
11693
      if (that == null)
11694
        return false;
11695
 
11696
      boolean this_present_success = true && this.isSetSuccess();
11697
      boolean that_present_success = true && that.isSetSuccess();
11698
      if (this_present_success || that_present_success) {
11699
        if (!(this_present_success && that_present_success))
11700
          return false;
11701
        if (!this.success.equals(that.success))
11702
          return false;
11703
      }
11704
 
11705
      return true;
11706
    }
11707
 
11708
    @Override
11709
    public int hashCode() {
11710
      return 0;
11711
    }
11712
 
11713
    public int compareTo(getRuleDocString_result other) {
11714
      if (!getClass().equals(other.getClass())) {
11715
        return getClass().getName().compareTo(other.getClass().getName());
11716
      }
11717
 
11718
      int lastComparison = 0;
11719
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
11720
 
3430 rajveer 11721
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 11722
      if (lastComparison != 0) {
11723
        return lastComparison;
11724
      }
3430 rajveer 11725
      if (isSetSuccess()) {
11726
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11727
        if (lastComparison != 0) {
11728
          return lastComparison;
11729
        }
3385 varun.gupt 11730
      }
11731
      return 0;
11732
    }
11733
 
3430 rajveer 11734
    public _Fields fieldForId(int fieldId) {
11735
      return _Fields.findByThriftId(fieldId);
11736
    }
11737
 
11738
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11739
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11740
      iprot.readStructBegin();
11741
      while (true)
11742
      {
11743
        field = iprot.readFieldBegin();
3430 rajveer 11744
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11745
          break;
11746
        }
3430 rajveer 11747
        switch (field.id) {
11748
          case 0: // SUCCESS
11749
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11750
              this.success = iprot.readString();
11751
            } else { 
11752
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11753
            }
11754
            break;
11755
          default:
11756
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11757
        }
3430 rajveer 11758
        iprot.readFieldEnd();
3385 varun.gupt 11759
      }
11760
      iprot.readStructEnd();
11761
      validate();
11762
    }
11763
 
3430 rajveer 11764
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11765
      oprot.writeStructBegin(STRUCT_DESC);
11766
 
11767
      if (this.isSetSuccess()) {
11768
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11769
        oprot.writeString(this.success);
11770
        oprot.writeFieldEnd();
11771
      }
11772
      oprot.writeFieldStop();
11773
      oprot.writeStructEnd();
11774
    }
11775
 
11776
    @Override
11777
    public String toString() {
11778
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
11779
      boolean first = true;
11780
 
11781
      sb.append("success:");
11782
      if (this.success == null) {
11783
        sb.append("null");
11784
      } else {
11785
        sb.append(this.success);
11786
      }
11787
      first = false;
11788
      sb.append(")");
11789
      return sb.toString();
11790
    }
11791
 
3430 rajveer 11792
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11793
      // check for required fields
11794
    }
11795
 
3430 rajveer 11796
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11797
      try {
11798
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11799
      } catch (org.apache.thrift.TException te) {
11800
        throw new java.io.IOException(te);
11801
      }
11802
    }
11803
 
11804
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11805
      try {
11806
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11807
      } catch (org.apache.thrift.TException te) {
11808
        throw new java.io.IOException(te);
11809
      }
11810
    }
11811
 
3385 varun.gupt 11812
  }
11813
 
4189 varun.gupt 11814
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
11815
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
11816
 
11817
    private static final org.apache.thrift.protocol.TField ITEM_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("itemIds", org.apache.thrift.protocol.TType.LIST, (short)1);
11818
 
11819
    private List<Long> itemIds; // required
11820
 
11821
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11822
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11823
      ITEM_IDS((short)1, "itemIds");
11824
 
11825
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11826
 
11827
      static {
11828
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11829
          byName.put(field.getFieldName(), field);
11830
        }
11831
      }
11832
 
11833
      /**
11834
       * Find the _Fields constant that matches fieldId, or null if its not found.
11835
       */
11836
      public static _Fields findByThriftId(int fieldId) {
11837
        switch(fieldId) {
11838
          case 1: // ITEM_IDS
11839
            return ITEM_IDS;
11840
          default:
11841
            return null;
11842
        }
11843
      }
11844
 
11845
      /**
11846
       * Find the _Fields constant that matches fieldId, throwing an exception
11847
       * if it is not found.
11848
       */
11849
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11850
        _Fields fields = findByThriftId(fieldId);
11851
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11852
        return fields;
11853
      }
11854
 
11855
      /**
11856
       * Find the _Fields constant that matches name, or null if its not found.
11857
       */
11858
      public static _Fields findByName(String name) {
11859
        return byName.get(name);
11860
      }
11861
 
11862
      private final short _thriftId;
11863
      private final String _fieldName;
11864
 
11865
      _Fields(short thriftId, String fieldName) {
11866
        _thriftId = thriftId;
11867
        _fieldName = fieldName;
11868
      }
11869
 
11870
      public short getThriftFieldId() {
11871
        return _thriftId;
11872
      }
11873
 
11874
      public String getFieldName() {
11875
        return _fieldName;
11876
      }
11877
    }
11878
 
11879
    // isset id assignments
11880
 
11881
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11882
    static {
11883
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11884
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11885
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11886
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
11887
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11888
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
11889
    }
11890
 
11891
    public getItemDiscountMap_args() {
11892
    }
11893
 
11894
    public getItemDiscountMap_args(
11895
      List<Long> itemIds)
11896
    {
11897
      this();
11898
      this.itemIds = itemIds;
11899
    }
11900
 
11901
    /**
11902
     * Performs a deep copy on <i>other</i>.
11903
     */
11904
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
11905
      if (other.isSetItemIds()) {
11906
        List<Long> __this__itemIds = new ArrayList<Long>();
11907
        for (Long other_element : other.itemIds) {
11908
          __this__itemIds.add(other_element);
11909
        }
11910
        this.itemIds = __this__itemIds;
11911
      }
11912
    }
11913
 
11914
    public getItemDiscountMap_args deepCopy() {
11915
      return new getItemDiscountMap_args(this);
11916
    }
11917
 
11918
    @Override
11919
    public void clear() {
11920
      this.itemIds = null;
11921
    }
11922
 
11923
    public int getItemIdsSize() {
11924
      return (this.itemIds == null) ? 0 : this.itemIds.size();
11925
    }
11926
 
11927
    public java.util.Iterator<Long> getItemIdsIterator() {
11928
      return (this.itemIds == null) ? null : this.itemIds.iterator();
11929
    }
11930
 
11931
    public void addToItemIds(long elem) {
11932
      if (this.itemIds == null) {
11933
        this.itemIds = new ArrayList<Long>();
11934
      }
11935
      this.itemIds.add(elem);
11936
    }
11937
 
11938
    public List<Long> getItemIds() {
11939
      return this.itemIds;
11940
    }
11941
 
11942
    public void setItemIds(List<Long> itemIds) {
11943
      this.itemIds = itemIds;
11944
    }
11945
 
11946
    public void unsetItemIds() {
11947
      this.itemIds = null;
11948
    }
11949
 
11950
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
11951
    public boolean isSetItemIds() {
11952
      return this.itemIds != null;
11953
    }
11954
 
11955
    public void setItemIdsIsSet(boolean value) {
11956
      if (!value) {
11957
        this.itemIds = null;
11958
      }
11959
    }
11960
 
11961
    public void setFieldValue(_Fields field, Object value) {
11962
      switch (field) {
11963
      case ITEM_IDS:
11964
        if (value == null) {
11965
          unsetItemIds();
11966
        } else {
11967
          setItemIds((List<Long>)value);
11968
        }
11969
        break;
11970
 
11971
      }
11972
    }
11973
 
11974
    public Object getFieldValue(_Fields field) {
11975
      switch (field) {
11976
      case ITEM_IDS:
11977
        return getItemIds();
11978
 
11979
      }
11980
      throw new IllegalStateException();
11981
    }
11982
 
11983
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11984
    public boolean isSet(_Fields field) {
11985
      if (field == null) {
11986
        throw new IllegalArgumentException();
11987
      }
11988
 
11989
      switch (field) {
11990
      case ITEM_IDS:
11991
        return isSetItemIds();
11992
      }
11993
      throw new IllegalStateException();
11994
    }
11995
 
11996
    @Override
11997
    public boolean equals(Object that) {
11998
      if (that == null)
11999
        return false;
12000
      if (that instanceof getItemDiscountMap_args)
12001
        return this.equals((getItemDiscountMap_args)that);
12002
      return false;
12003
    }
12004
 
12005
    public boolean equals(getItemDiscountMap_args that) {
12006
      if (that == null)
12007
        return false;
12008
 
12009
      boolean this_present_itemIds = true && this.isSetItemIds();
12010
      boolean that_present_itemIds = true && that.isSetItemIds();
12011
      if (this_present_itemIds || that_present_itemIds) {
12012
        if (!(this_present_itemIds && that_present_itemIds))
12013
          return false;
12014
        if (!this.itemIds.equals(that.itemIds))
12015
          return false;
12016
      }
12017
 
12018
      return true;
12019
    }
12020
 
12021
    @Override
12022
    public int hashCode() {
12023
      return 0;
12024
    }
12025
 
12026
    public int compareTo(getItemDiscountMap_args other) {
12027
      if (!getClass().equals(other.getClass())) {
12028
        return getClass().getName().compareTo(other.getClass().getName());
12029
      }
12030
 
12031
      int lastComparison = 0;
12032
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
12033
 
12034
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
12035
      if (lastComparison != 0) {
12036
        return lastComparison;
12037
      }
12038
      if (isSetItemIds()) {
12039
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
12040
        if (lastComparison != 0) {
12041
          return lastComparison;
12042
        }
12043
      }
12044
      return 0;
12045
    }
12046
 
12047
    public _Fields fieldForId(int fieldId) {
12048
      return _Fields.findByThriftId(fieldId);
12049
    }
12050
 
12051
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12052
      org.apache.thrift.protocol.TField field;
12053
      iprot.readStructBegin();
12054
      while (true)
12055
      {
12056
        field = iprot.readFieldBegin();
12057
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12058
          break;
12059
        }
12060
        switch (field.id) {
12061
          case 1: // ITEM_IDS
12062
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12063
              {
5327 rajveer 12064
                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
12065
                this.itemIds = new ArrayList<Long>(_list20.size);
12066
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
4189 varun.gupt 12067
                {
5327 rajveer 12068
                  long _elem22; // required
12069
                  _elem22 = iprot.readI64();
12070
                  this.itemIds.add(_elem22);
4189 varun.gupt 12071
                }
12072
                iprot.readListEnd();
12073
              }
12074
            } else { 
12075
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12076
            }
12077
            break;
12078
          default:
12079
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12080
        }
12081
        iprot.readFieldEnd();
12082
      }
12083
      iprot.readStructEnd();
12084
      validate();
12085
    }
12086
 
12087
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12088
      validate();
12089
 
12090
      oprot.writeStructBegin(STRUCT_DESC);
12091
      if (this.itemIds != null) {
12092
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
12093
        {
12094
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
5327 rajveer 12095
          for (long _iter23 : this.itemIds)
4189 varun.gupt 12096
          {
5327 rajveer 12097
            oprot.writeI64(_iter23);
4189 varun.gupt 12098
          }
12099
          oprot.writeListEnd();
12100
        }
12101
        oprot.writeFieldEnd();
12102
      }
12103
      oprot.writeFieldStop();
12104
      oprot.writeStructEnd();
12105
    }
12106
 
12107
    @Override
12108
    public String toString() {
12109
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
12110
      boolean first = true;
12111
 
12112
      sb.append("itemIds:");
12113
      if (this.itemIds == null) {
12114
        sb.append("null");
12115
      } else {
12116
        sb.append(this.itemIds);
12117
      }
12118
      first = false;
12119
      sb.append(")");
12120
      return sb.toString();
12121
    }
12122
 
12123
    public void validate() throws org.apache.thrift.TException {
12124
      // check for required fields
12125
    }
12126
 
12127
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12128
      try {
12129
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12130
      } catch (org.apache.thrift.TException te) {
12131
        throw new java.io.IOException(te);
12132
      }
12133
    }
12134
 
12135
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12136
      try {
12137
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12138
      } catch (org.apache.thrift.TException te) {
12139
        throw new java.io.IOException(te);
12140
      }
12141
    }
12142
 
12143
  }
12144
 
12145
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
12146
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
12147
 
12148
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
12149
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
12150
 
12151
    private List<ItemCouponDiscount> success; // required
12152
    private PromotionException pex; // required
12153
 
12154
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12155
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12156
      SUCCESS((short)0, "success"),
12157
      PEX((short)1, "pex");
12158
 
12159
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12160
 
12161
      static {
12162
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12163
          byName.put(field.getFieldName(), field);
12164
        }
12165
      }
12166
 
12167
      /**
12168
       * Find the _Fields constant that matches fieldId, or null if its not found.
12169
       */
12170
      public static _Fields findByThriftId(int fieldId) {
12171
        switch(fieldId) {
12172
          case 0: // SUCCESS
12173
            return SUCCESS;
12174
          case 1: // PEX
12175
            return PEX;
12176
          default:
12177
            return null;
12178
        }
12179
      }
12180
 
12181
      /**
12182
       * Find the _Fields constant that matches fieldId, throwing an exception
12183
       * if it is not found.
12184
       */
12185
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12186
        _Fields fields = findByThriftId(fieldId);
12187
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12188
        return fields;
12189
      }
12190
 
12191
      /**
12192
       * Find the _Fields constant that matches name, or null if its not found.
12193
       */
12194
      public static _Fields findByName(String name) {
12195
        return byName.get(name);
12196
      }
12197
 
12198
      private final short _thriftId;
12199
      private final String _fieldName;
12200
 
12201
      _Fields(short thriftId, String fieldName) {
12202
        _thriftId = thriftId;
12203
        _fieldName = fieldName;
12204
      }
12205
 
12206
      public short getThriftFieldId() {
12207
        return _thriftId;
12208
      }
12209
 
12210
      public String getFieldName() {
12211
        return _fieldName;
12212
      }
12213
    }
12214
 
12215
    // isset id assignments
12216
 
12217
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12218
    static {
12219
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12220
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12221
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
12222
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
12223
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12224
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12225
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12226
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
12227
    }
12228
 
12229
    public getItemDiscountMap_result() {
12230
    }
12231
 
12232
    public getItemDiscountMap_result(
12233
      List<ItemCouponDiscount> success,
12234
      PromotionException pex)
12235
    {
12236
      this();
12237
      this.success = success;
12238
      this.pex = pex;
12239
    }
12240
 
12241
    /**
12242
     * Performs a deep copy on <i>other</i>.
12243
     */
12244
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
12245
      if (other.isSetSuccess()) {
12246
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
12247
        for (ItemCouponDiscount other_element : other.success) {
12248
          __this__success.add(new ItemCouponDiscount(other_element));
12249
        }
12250
        this.success = __this__success;
12251
      }
12252
      if (other.isSetPex()) {
12253
        this.pex = new PromotionException(other.pex);
12254
      }
12255
    }
12256
 
12257
    public getItemDiscountMap_result deepCopy() {
12258
      return new getItemDiscountMap_result(this);
12259
    }
12260
 
12261
    @Override
12262
    public void clear() {
12263
      this.success = null;
12264
      this.pex = null;
12265
    }
12266
 
12267
    public int getSuccessSize() {
12268
      return (this.success == null) ? 0 : this.success.size();
12269
    }
12270
 
12271
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
12272
      return (this.success == null) ? null : this.success.iterator();
12273
    }
12274
 
12275
    public void addToSuccess(ItemCouponDiscount elem) {
12276
      if (this.success == null) {
12277
        this.success = new ArrayList<ItemCouponDiscount>();
12278
      }
12279
      this.success.add(elem);
12280
    }
12281
 
12282
    public List<ItemCouponDiscount> getSuccess() {
12283
      return this.success;
12284
    }
12285
 
12286
    public void setSuccess(List<ItemCouponDiscount> success) {
12287
      this.success = success;
12288
    }
12289
 
12290
    public void unsetSuccess() {
12291
      this.success = null;
12292
    }
12293
 
12294
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12295
    public boolean isSetSuccess() {
12296
      return this.success != null;
12297
    }
12298
 
12299
    public void setSuccessIsSet(boolean value) {
12300
      if (!value) {
12301
        this.success = null;
12302
      }
12303
    }
12304
 
12305
    public PromotionException getPex() {
12306
      return this.pex;
12307
    }
12308
 
12309
    public void setPex(PromotionException pex) {
12310
      this.pex = pex;
12311
    }
12312
 
12313
    public void unsetPex() {
12314
      this.pex = null;
12315
    }
12316
 
12317
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12318
    public boolean isSetPex() {
12319
      return this.pex != null;
12320
    }
12321
 
12322
    public void setPexIsSet(boolean value) {
12323
      if (!value) {
12324
        this.pex = null;
12325
      }
12326
    }
12327
 
12328
    public void setFieldValue(_Fields field, Object value) {
12329
      switch (field) {
12330
      case SUCCESS:
12331
        if (value == null) {
12332
          unsetSuccess();
12333
        } else {
12334
          setSuccess((List<ItemCouponDiscount>)value);
12335
        }
12336
        break;
12337
 
12338
      case PEX:
12339
        if (value == null) {
12340
          unsetPex();
12341
        } else {
12342
          setPex((PromotionException)value);
12343
        }
12344
        break;
12345
 
12346
      }
12347
    }
12348
 
12349
    public Object getFieldValue(_Fields field) {
12350
      switch (field) {
12351
      case SUCCESS:
12352
        return getSuccess();
12353
 
12354
      case PEX:
12355
        return getPex();
12356
 
12357
      }
12358
      throw new IllegalStateException();
12359
    }
12360
 
12361
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12362
    public boolean isSet(_Fields field) {
12363
      if (field == null) {
12364
        throw new IllegalArgumentException();
12365
      }
12366
 
12367
      switch (field) {
12368
      case SUCCESS:
12369
        return isSetSuccess();
12370
      case PEX:
12371
        return isSetPex();
12372
      }
12373
      throw new IllegalStateException();
12374
    }
12375
 
12376
    @Override
12377
    public boolean equals(Object that) {
12378
      if (that == null)
12379
        return false;
12380
      if (that instanceof getItemDiscountMap_result)
12381
        return this.equals((getItemDiscountMap_result)that);
12382
      return false;
12383
    }
12384
 
12385
    public boolean equals(getItemDiscountMap_result that) {
12386
      if (that == null)
12387
        return false;
12388
 
12389
      boolean this_present_success = true && this.isSetSuccess();
12390
      boolean that_present_success = true && that.isSetSuccess();
12391
      if (this_present_success || that_present_success) {
12392
        if (!(this_present_success && that_present_success))
12393
          return false;
12394
        if (!this.success.equals(that.success))
12395
          return false;
12396
      }
12397
 
12398
      boolean this_present_pex = true && this.isSetPex();
12399
      boolean that_present_pex = true && that.isSetPex();
12400
      if (this_present_pex || that_present_pex) {
12401
        if (!(this_present_pex && that_present_pex))
12402
          return false;
12403
        if (!this.pex.equals(that.pex))
12404
          return false;
12405
      }
12406
 
12407
      return true;
12408
    }
12409
 
12410
    @Override
12411
    public int hashCode() {
12412
      return 0;
12413
    }
12414
 
12415
    public int compareTo(getItemDiscountMap_result other) {
12416
      if (!getClass().equals(other.getClass())) {
12417
        return getClass().getName().compareTo(other.getClass().getName());
12418
      }
12419
 
12420
      int lastComparison = 0;
12421
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
12422
 
12423
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12424
      if (lastComparison != 0) {
12425
        return lastComparison;
12426
      }
12427
      if (isSetSuccess()) {
12428
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12429
        if (lastComparison != 0) {
12430
          return lastComparison;
12431
        }
12432
      }
12433
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12434
      if (lastComparison != 0) {
12435
        return lastComparison;
12436
      }
12437
      if (isSetPex()) {
12438
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12439
        if (lastComparison != 0) {
12440
          return lastComparison;
12441
        }
12442
      }
12443
      return 0;
12444
    }
12445
 
12446
    public _Fields fieldForId(int fieldId) {
12447
      return _Fields.findByThriftId(fieldId);
12448
    }
12449
 
12450
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12451
      org.apache.thrift.protocol.TField field;
12452
      iprot.readStructBegin();
12453
      while (true)
12454
      {
12455
        field = iprot.readFieldBegin();
12456
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12457
          break;
12458
        }
12459
        switch (field.id) {
12460
          case 0: // SUCCESS
12461
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12462
              {
5327 rajveer 12463
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
12464
                this.success = new ArrayList<ItemCouponDiscount>(_list24.size);
12465
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
4189 varun.gupt 12466
                {
5327 rajveer 12467
                  ItemCouponDiscount _elem26; // required
12468
                  _elem26 = new ItemCouponDiscount();
12469
                  _elem26.read(iprot);
12470
                  this.success.add(_elem26);
4189 varun.gupt 12471
                }
12472
                iprot.readListEnd();
12473
              }
12474
            } else { 
12475
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12476
            }
12477
            break;
12478
          case 1: // PEX
12479
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12480
              this.pex = new PromotionException();
12481
              this.pex.read(iprot);
12482
            } else { 
12483
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12484
            }
12485
            break;
12486
          default:
12487
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12488
        }
12489
        iprot.readFieldEnd();
12490
      }
12491
      iprot.readStructEnd();
12492
      validate();
12493
    }
12494
 
12495
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12496
      oprot.writeStructBegin(STRUCT_DESC);
12497
 
12498
      if (this.isSetSuccess()) {
12499
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12500
        {
12501
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 12502
          for (ItemCouponDiscount _iter27 : this.success)
4189 varun.gupt 12503
          {
5327 rajveer 12504
            _iter27.write(oprot);
4189 varun.gupt 12505
          }
12506
          oprot.writeListEnd();
12507
        }
12508
        oprot.writeFieldEnd();
12509
      } else if (this.isSetPex()) {
12510
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12511
        this.pex.write(oprot);
12512
        oprot.writeFieldEnd();
12513
      }
12514
      oprot.writeFieldStop();
12515
      oprot.writeStructEnd();
12516
    }
12517
 
12518
    @Override
12519
    public String toString() {
12520
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
12521
      boolean first = true;
12522
 
12523
      sb.append("success:");
12524
      if (this.success == null) {
12525
        sb.append("null");
12526
      } else {
12527
        sb.append(this.success);
12528
      }
12529
      first = false;
12530
      if (!first) sb.append(", ");
12531
      sb.append("pex:");
12532
      if (this.pex == null) {
12533
        sb.append("null");
12534
      } else {
12535
        sb.append(this.pex);
12536
      }
12537
      first = false;
12538
      sb.append(")");
12539
      return sb.toString();
12540
    }
12541
 
12542
    public void validate() throws org.apache.thrift.TException {
12543
      // check for required fields
12544
    }
12545
 
12546
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12547
      try {
12548
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12549
      } catch (org.apache.thrift.TException te) {
12550
        throw new java.io.IOException(te);
12551
      }
12552
    }
12553
 
12554
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12555
      try {
12556
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12557
      } catch (org.apache.thrift.TException te) {
12558
        throw new java.io.IOException(te);
12559
      }
12560
    }
12561
 
12562
  }
12563
 
4494 varun.gupt 12564
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
12565
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
12566
 
12567
    private static final org.apache.thrift.protocol.TField ENTITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityId", org.apache.thrift.protocol.TType.I64, (short)1);
12568
 
12569
    private long entityId; // required
12570
 
12571
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12572
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12573
      ENTITY_ID((short)1, "entityId");
12574
 
12575
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12576
 
12577
      static {
12578
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12579
          byName.put(field.getFieldName(), field);
12580
        }
12581
      }
12582
 
12583
      /**
12584
       * Find the _Fields constant that matches fieldId, or null if its not found.
12585
       */
12586
      public static _Fields findByThriftId(int fieldId) {
12587
        switch(fieldId) {
12588
          case 1: // ENTITY_ID
12589
            return ENTITY_ID;
12590
          default:
12591
            return null;
12592
        }
12593
      }
12594
 
12595
      /**
12596
       * Find the _Fields constant that matches fieldId, throwing an exception
12597
       * if it is not found.
12598
       */
12599
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12600
        _Fields fields = findByThriftId(fieldId);
12601
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12602
        return fields;
12603
      }
12604
 
12605
      /**
12606
       * Find the _Fields constant that matches name, or null if its not found.
12607
       */
12608
      public static _Fields findByName(String name) {
12609
        return byName.get(name);
12610
      }
12611
 
12612
      private final short _thriftId;
12613
      private final String _fieldName;
12614
 
12615
      _Fields(short thriftId, String fieldName) {
12616
        _thriftId = thriftId;
12617
        _fieldName = fieldName;
12618
      }
12619
 
12620
      public short getThriftFieldId() {
12621
        return _thriftId;
12622
      }
12623
 
12624
      public String getFieldName() {
12625
        return _fieldName;
12626
      }
12627
    }
12628
 
12629
    // isset id assignments
12630
    private static final int __ENTITYID_ISSET_ID = 0;
12631
    private BitSet __isset_bit_vector = new BitSet(1);
12632
 
12633
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12634
    static {
12635
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12636
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12637
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12638
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12639
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
12640
    }
12641
 
12642
    public getDiscountsForEntity_args() {
12643
    }
12644
 
12645
    public getDiscountsForEntity_args(
12646
      long entityId)
12647
    {
12648
      this();
12649
      this.entityId = entityId;
12650
      setEntityIdIsSet(true);
12651
    }
12652
 
12653
    /**
12654
     * Performs a deep copy on <i>other</i>.
12655
     */
12656
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
12657
      __isset_bit_vector.clear();
12658
      __isset_bit_vector.or(other.__isset_bit_vector);
12659
      this.entityId = other.entityId;
12660
    }
12661
 
12662
    public getDiscountsForEntity_args deepCopy() {
12663
      return new getDiscountsForEntity_args(this);
12664
    }
12665
 
12666
    @Override
12667
    public void clear() {
12668
      setEntityIdIsSet(false);
12669
      this.entityId = 0;
12670
    }
12671
 
12672
    public long getEntityId() {
12673
      return this.entityId;
12674
    }
12675
 
12676
    public void setEntityId(long entityId) {
12677
      this.entityId = entityId;
12678
      setEntityIdIsSet(true);
12679
    }
12680
 
12681
    public void unsetEntityId() {
12682
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
12683
    }
12684
 
12685
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
12686
    public boolean isSetEntityId() {
12687
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
12688
    }
12689
 
12690
    public void setEntityIdIsSet(boolean value) {
12691
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
12692
    }
12693
 
12694
    public void setFieldValue(_Fields field, Object value) {
12695
      switch (field) {
12696
      case ENTITY_ID:
12697
        if (value == null) {
12698
          unsetEntityId();
12699
        } else {
12700
          setEntityId((Long)value);
12701
        }
12702
        break;
12703
 
12704
      }
12705
    }
12706
 
12707
    public Object getFieldValue(_Fields field) {
12708
      switch (field) {
12709
      case ENTITY_ID:
12710
        return Long.valueOf(getEntityId());
12711
 
12712
      }
12713
      throw new IllegalStateException();
12714
    }
12715
 
12716
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12717
    public boolean isSet(_Fields field) {
12718
      if (field == null) {
12719
        throw new IllegalArgumentException();
12720
      }
12721
 
12722
      switch (field) {
12723
      case ENTITY_ID:
12724
        return isSetEntityId();
12725
      }
12726
      throw new IllegalStateException();
12727
    }
12728
 
12729
    @Override
12730
    public boolean equals(Object that) {
12731
      if (that == null)
12732
        return false;
12733
      if (that instanceof getDiscountsForEntity_args)
12734
        return this.equals((getDiscountsForEntity_args)that);
12735
      return false;
12736
    }
12737
 
12738
    public boolean equals(getDiscountsForEntity_args that) {
12739
      if (that == null)
12740
        return false;
12741
 
12742
      boolean this_present_entityId = true;
12743
      boolean that_present_entityId = true;
12744
      if (this_present_entityId || that_present_entityId) {
12745
        if (!(this_present_entityId && that_present_entityId))
12746
          return false;
12747
        if (this.entityId != that.entityId)
12748
          return false;
12749
      }
12750
 
12751
      return true;
12752
    }
12753
 
12754
    @Override
12755
    public int hashCode() {
12756
      return 0;
12757
    }
12758
 
12759
    public int compareTo(getDiscountsForEntity_args other) {
12760
      if (!getClass().equals(other.getClass())) {
12761
        return getClass().getName().compareTo(other.getClass().getName());
12762
      }
12763
 
12764
      int lastComparison = 0;
12765
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
12766
 
12767
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
12768
      if (lastComparison != 0) {
12769
        return lastComparison;
12770
      }
12771
      if (isSetEntityId()) {
12772
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
12773
        if (lastComparison != 0) {
12774
          return lastComparison;
12775
        }
12776
      }
12777
      return 0;
12778
    }
12779
 
12780
    public _Fields fieldForId(int fieldId) {
12781
      return _Fields.findByThriftId(fieldId);
12782
    }
12783
 
12784
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12785
      org.apache.thrift.protocol.TField field;
12786
      iprot.readStructBegin();
12787
      while (true)
12788
      {
12789
        field = iprot.readFieldBegin();
12790
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12791
          break;
12792
        }
12793
        switch (field.id) {
12794
          case 1: // ENTITY_ID
12795
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12796
              this.entityId = iprot.readI64();
12797
              setEntityIdIsSet(true);
12798
            } else { 
12799
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12800
            }
12801
            break;
12802
          default:
12803
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12804
        }
12805
        iprot.readFieldEnd();
12806
      }
12807
      iprot.readStructEnd();
12808
      validate();
12809
    }
12810
 
12811
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12812
      validate();
12813
 
12814
      oprot.writeStructBegin(STRUCT_DESC);
12815
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
12816
      oprot.writeI64(this.entityId);
12817
      oprot.writeFieldEnd();
12818
      oprot.writeFieldStop();
12819
      oprot.writeStructEnd();
12820
    }
12821
 
12822
    @Override
12823
    public String toString() {
12824
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
12825
      boolean first = true;
12826
 
12827
      sb.append("entityId:");
12828
      sb.append(this.entityId);
12829
      first = false;
12830
      sb.append(")");
12831
      return sb.toString();
12832
    }
12833
 
12834
    public void validate() throws org.apache.thrift.TException {
12835
      // check for required fields
12836
    }
12837
 
12838
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12839
      try {
12840
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12841
      } catch (org.apache.thrift.TException te) {
12842
        throw new java.io.IOException(te);
12843
      }
12844
    }
12845
 
12846
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12847
      try {
12848
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
12849
        __isset_bit_vector = new BitSet(1);
12850
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12851
      } catch (org.apache.thrift.TException te) {
12852
        throw new java.io.IOException(te);
12853
      }
12854
    }
12855
 
12856
  }
12857
 
12858
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
12859
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
12860
 
12861
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
12862
 
12863
    private Map<String,Double> success; // required
12864
 
12865
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12866
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12867
      SUCCESS((short)0, "success");
12868
 
12869
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12870
 
12871
      static {
12872
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12873
          byName.put(field.getFieldName(), field);
12874
        }
12875
      }
12876
 
12877
      /**
12878
       * Find the _Fields constant that matches fieldId, or null if its not found.
12879
       */
12880
      public static _Fields findByThriftId(int fieldId) {
12881
        switch(fieldId) {
12882
          case 0: // SUCCESS
12883
            return SUCCESS;
12884
          default:
12885
            return null;
12886
        }
12887
      }
12888
 
12889
      /**
12890
       * Find the _Fields constant that matches fieldId, throwing an exception
12891
       * if it is not found.
12892
       */
12893
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12894
        _Fields fields = findByThriftId(fieldId);
12895
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12896
        return fields;
12897
      }
12898
 
12899
      /**
12900
       * Find the _Fields constant that matches name, or null if its not found.
12901
       */
12902
      public static _Fields findByName(String name) {
12903
        return byName.get(name);
12904
      }
12905
 
12906
      private final short _thriftId;
12907
      private final String _fieldName;
12908
 
12909
      _Fields(short thriftId, String fieldName) {
12910
        _thriftId = thriftId;
12911
        _fieldName = fieldName;
12912
      }
12913
 
12914
      public short getThriftFieldId() {
12915
        return _thriftId;
12916
      }
12917
 
12918
      public String getFieldName() {
12919
        return _fieldName;
12920
      }
12921
    }
12922
 
12923
    // isset id assignments
12924
 
12925
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12926
    static {
12927
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12928
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12929
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
12930
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
12931
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
12932
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12933
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
12934
    }
12935
 
12936
    public getDiscountsForEntity_result() {
12937
    }
12938
 
12939
    public getDiscountsForEntity_result(
12940
      Map<String,Double> success)
12941
    {
12942
      this();
12943
      this.success = success;
12944
    }
12945
 
12946
    /**
12947
     * Performs a deep copy on <i>other</i>.
12948
     */
12949
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
12950
      if (other.isSetSuccess()) {
12951
        Map<String,Double> __this__success = new HashMap<String,Double>();
12952
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
12953
 
12954
          String other_element_key = other_element.getKey();
12955
          Double other_element_value = other_element.getValue();
12956
 
12957
          String __this__success_copy_key = other_element_key;
12958
 
12959
          Double __this__success_copy_value = other_element_value;
12960
 
12961
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
12962
        }
12963
        this.success = __this__success;
12964
      }
12965
    }
12966
 
12967
    public getDiscountsForEntity_result deepCopy() {
12968
      return new getDiscountsForEntity_result(this);
12969
    }
12970
 
12971
    @Override
12972
    public void clear() {
12973
      this.success = null;
12974
    }
12975
 
12976
    public int getSuccessSize() {
12977
      return (this.success == null) ? 0 : this.success.size();
12978
    }
12979
 
12980
    public void putToSuccess(String key, double val) {
12981
      if (this.success == null) {
12982
        this.success = new HashMap<String,Double>();
12983
      }
12984
      this.success.put(key, val);
12985
    }
12986
 
12987
    public Map<String,Double> getSuccess() {
12988
      return this.success;
12989
    }
12990
 
12991
    public void setSuccess(Map<String,Double> success) {
12992
      this.success = success;
12993
    }
12994
 
12995
    public void unsetSuccess() {
12996
      this.success = null;
12997
    }
12998
 
12999
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13000
    public boolean isSetSuccess() {
13001
      return this.success != null;
13002
    }
13003
 
13004
    public void setSuccessIsSet(boolean value) {
13005
      if (!value) {
13006
        this.success = null;
13007
      }
13008
    }
13009
 
13010
    public void setFieldValue(_Fields field, Object value) {
13011
      switch (field) {
13012
      case SUCCESS:
13013
        if (value == null) {
13014
          unsetSuccess();
13015
        } else {
13016
          setSuccess((Map<String,Double>)value);
13017
        }
13018
        break;
13019
 
13020
      }
13021
    }
13022
 
13023
    public Object getFieldValue(_Fields field) {
13024
      switch (field) {
13025
      case SUCCESS:
13026
        return getSuccess();
13027
 
13028
      }
13029
      throw new IllegalStateException();
13030
    }
13031
 
13032
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13033
    public boolean isSet(_Fields field) {
13034
      if (field == null) {
13035
        throw new IllegalArgumentException();
13036
      }
13037
 
13038
      switch (field) {
13039
      case SUCCESS:
13040
        return isSetSuccess();
13041
      }
13042
      throw new IllegalStateException();
13043
    }
13044
 
13045
    @Override
13046
    public boolean equals(Object that) {
13047
      if (that == null)
13048
        return false;
13049
      if (that instanceof getDiscountsForEntity_result)
13050
        return this.equals((getDiscountsForEntity_result)that);
13051
      return false;
13052
    }
13053
 
13054
    public boolean equals(getDiscountsForEntity_result that) {
13055
      if (that == null)
13056
        return false;
13057
 
13058
      boolean this_present_success = true && this.isSetSuccess();
13059
      boolean that_present_success = true && that.isSetSuccess();
13060
      if (this_present_success || that_present_success) {
13061
        if (!(this_present_success && that_present_success))
13062
          return false;
13063
        if (!this.success.equals(that.success))
13064
          return false;
13065
      }
13066
 
13067
      return true;
13068
    }
13069
 
13070
    @Override
13071
    public int hashCode() {
13072
      return 0;
13073
    }
13074
 
13075
    public int compareTo(getDiscountsForEntity_result other) {
13076
      if (!getClass().equals(other.getClass())) {
13077
        return getClass().getName().compareTo(other.getClass().getName());
13078
      }
13079
 
13080
      int lastComparison = 0;
13081
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
13082
 
13083
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
13084
      if (lastComparison != 0) {
13085
        return lastComparison;
13086
      }
13087
      if (isSetSuccess()) {
13088
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13089
        if (lastComparison != 0) {
13090
          return lastComparison;
13091
        }
13092
      }
13093
      return 0;
13094
    }
13095
 
13096
    public _Fields fieldForId(int fieldId) {
13097
      return _Fields.findByThriftId(fieldId);
13098
    }
13099
 
13100
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13101
      org.apache.thrift.protocol.TField field;
13102
      iprot.readStructBegin();
13103
      while (true)
13104
      {
13105
        field = iprot.readFieldBegin();
13106
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13107
          break;
13108
        }
13109
        switch (field.id) {
13110
          case 0: // SUCCESS
13111
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
13112
              {
5327 rajveer 13113
                org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin();
13114
                this.success = new HashMap<String,Double>(2*_map28.size);
13115
                for (int _i29 = 0; _i29 < _map28.size; ++_i29)
4494 varun.gupt 13116
                {
5327 rajveer 13117
                  String _key30; // required
13118
                  double _val31; // required
13119
                  _key30 = iprot.readString();
13120
                  _val31 = iprot.readDouble();
13121
                  this.success.put(_key30, _val31);
4494 varun.gupt 13122
                }
13123
                iprot.readMapEnd();
13124
              }
13125
            } else { 
13126
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13127
            }
13128
            break;
13129
          default:
13130
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13131
        }
13132
        iprot.readFieldEnd();
13133
      }
13134
      iprot.readStructEnd();
13135
      validate();
13136
    }
13137
 
13138
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13139
      oprot.writeStructBegin(STRUCT_DESC);
13140
 
13141
      if (this.isSetSuccess()) {
13142
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13143
        {
13144
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
5327 rajveer 13145
          for (Map.Entry<String, Double> _iter32 : this.success.entrySet())
4494 varun.gupt 13146
          {
5327 rajveer 13147
            oprot.writeString(_iter32.getKey());
13148
            oprot.writeDouble(_iter32.getValue());
4494 varun.gupt 13149
          }
13150
          oprot.writeMapEnd();
13151
        }
13152
        oprot.writeFieldEnd();
13153
      }
13154
      oprot.writeFieldStop();
13155
      oprot.writeStructEnd();
13156
    }
13157
 
13158
    @Override
13159
    public String toString() {
13160
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
13161
      boolean first = true;
13162
 
13163
      sb.append("success:");
13164
      if (this.success == null) {
13165
        sb.append("null");
13166
      } else {
13167
        sb.append(this.success);
13168
      }
13169
      first = false;
13170
      sb.append(")");
13171
      return sb.toString();
13172
    }
13173
 
13174
    public void validate() throws org.apache.thrift.TException {
13175
      // check for required fields
13176
    }
13177
 
13178
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13179
      try {
13180
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13181
      } catch (org.apache.thrift.TException te) {
13182
        throw new java.io.IOException(te);
13183
      }
13184
    }
13185
 
13186
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13187
      try {
13188
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13189
      } catch (org.apache.thrift.TException te) {
13190
        throw new java.io.IOException(te);
13191
      }
13192
    }
13193
 
13194
  }
13195
 
5469 rajveer 13196
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
13197
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
13198
 
13199
    private static final org.apache.thrift.protocol.TField VOUCHER_FIELD_DESC = new org.apache.thrift.protocol.TField("voucher", org.apache.thrift.protocol.TType.STRUCT, (short)1);
13200
 
13201
    private Voucher voucher; // required
13202
 
13203
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13204
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13205
      VOUCHER((short)1, "voucher");
13206
 
13207
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13208
 
13209
      static {
13210
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13211
          byName.put(field.getFieldName(), field);
13212
        }
13213
      }
13214
 
13215
      /**
13216
       * Find the _Fields constant that matches fieldId, or null if its not found.
13217
       */
13218
      public static _Fields findByThriftId(int fieldId) {
13219
        switch(fieldId) {
13220
          case 1: // VOUCHER
13221
            return VOUCHER;
13222
          default:
13223
            return null;
13224
        }
13225
      }
13226
 
13227
      /**
13228
       * Find the _Fields constant that matches fieldId, throwing an exception
13229
       * if it is not found.
13230
       */
13231
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13232
        _Fields fields = findByThriftId(fieldId);
13233
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13234
        return fields;
13235
      }
13236
 
13237
      /**
13238
       * Find the _Fields constant that matches name, or null if its not found.
13239
       */
13240
      public static _Fields findByName(String name) {
13241
        return byName.get(name);
13242
      }
13243
 
13244
      private final short _thriftId;
13245
      private final String _fieldName;
13246
 
13247
      _Fields(short thriftId, String fieldName) {
13248
        _thriftId = thriftId;
13249
        _fieldName = fieldName;
13250
      }
13251
 
13252
      public short getThriftFieldId() {
13253
        return _thriftId;
13254
      }
13255
 
13256
      public String getFieldName() {
13257
        return _fieldName;
13258
      }
13259
    }
13260
 
13261
    // isset id assignments
13262
 
13263
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13264
    static {
13265
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13266
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13267
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
13268
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13269
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
13270
    }
13271
 
13272
    public addVoucher_args() {
13273
    }
13274
 
13275
    public addVoucher_args(
13276
      Voucher voucher)
13277
    {
13278
      this();
13279
      this.voucher = voucher;
13280
    }
13281
 
13282
    /**
13283
     * Performs a deep copy on <i>other</i>.
13284
     */
13285
    public addVoucher_args(addVoucher_args other) {
13286
      if (other.isSetVoucher()) {
13287
        this.voucher = new Voucher(other.voucher);
13288
      }
13289
    }
13290
 
13291
    public addVoucher_args deepCopy() {
13292
      return new addVoucher_args(this);
13293
    }
13294
 
13295
    @Override
13296
    public void clear() {
13297
      this.voucher = null;
13298
    }
13299
 
13300
    public Voucher getVoucher() {
13301
      return this.voucher;
13302
    }
13303
 
13304
    public void setVoucher(Voucher voucher) {
13305
      this.voucher = voucher;
13306
    }
13307
 
13308
    public void unsetVoucher() {
13309
      this.voucher = null;
13310
    }
13311
 
13312
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
13313
    public boolean isSetVoucher() {
13314
      return this.voucher != null;
13315
    }
13316
 
13317
    public void setVoucherIsSet(boolean value) {
13318
      if (!value) {
13319
        this.voucher = null;
13320
      }
13321
    }
13322
 
13323
    public void setFieldValue(_Fields field, Object value) {
13324
      switch (field) {
13325
      case VOUCHER:
13326
        if (value == null) {
13327
          unsetVoucher();
13328
        } else {
13329
          setVoucher((Voucher)value);
13330
        }
13331
        break;
13332
 
13333
      }
13334
    }
13335
 
13336
    public Object getFieldValue(_Fields field) {
13337
      switch (field) {
13338
      case VOUCHER:
13339
        return getVoucher();
13340
 
13341
      }
13342
      throw new IllegalStateException();
13343
    }
13344
 
13345
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13346
    public boolean isSet(_Fields field) {
13347
      if (field == null) {
13348
        throw new IllegalArgumentException();
13349
      }
13350
 
13351
      switch (field) {
13352
      case VOUCHER:
13353
        return isSetVoucher();
13354
      }
13355
      throw new IllegalStateException();
13356
    }
13357
 
13358
    @Override
13359
    public boolean equals(Object that) {
13360
      if (that == null)
13361
        return false;
13362
      if (that instanceof addVoucher_args)
13363
        return this.equals((addVoucher_args)that);
13364
      return false;
13365
    }
13366
 
13367
    public boolean equals(addVoucher_args that) {
13368
      if (that == null)
13369
        return false;
13370
 
13371
      boolean this_present_voucher = true && this.isSetVoucher();
13372
      boolean that_present_voucher = true && that.isSetVoucher();
13373
      if (this_present_voucher || that_present_voucher) {
13374
        if (!(this_present_voucher && that_present_voucher))
13375
          return false;
13376
        if (!this.voucher.equals(that.voucher))
13377
          return false;
13378
      }
13379
 
13380
      return true;
13381
    }
13382
 
13383
    @Override
13384
    public int hashCode() {
13385
      return 0;
13386
    }
13387
 
13388
    public int compareTo(addVoucher_args other) {
13389
      if (!getClass().equals(other.getClass())) {
13390
        return getClass().getName().compareTo(other.getClass().getName());
13391
      }
13392
 
13393
      int lastComparison = 0;
13394
      addVoucher_args typedOther = (addVoucher_args)other;
13395
 
13396
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
13397
      if (lastComparison != 0) {
13398
        return lastComparison;
13399
      }
13400
      if (isSetVoucher()) {
13401
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
13402
        if (lastComparison != 0) {
13403
          return lastComparison;
13404
        }
13405
      }
13406
      return 0;
13407
    }
13408
 
13409
    public _Fields fieldForId(int fieldId) {
13410
      return _Fields.findByThriftId(fieldId);
13411
    }
13412
 
13413
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13414
      org.apache.thrift.protocol.TField field;
13415
      iprot.readStructBegin();
13416
      while (true)
13417
      {
13418
        field = iprot.readFieldBegin();
13419
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13420
          break;
13421
        }
13422
        switch (field.id) {
13423
          case 1: // VOUCHER
13424
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13425
              this.voucher = new Voucher();
13426
              this.voucher.read(iprot);
13427
            } else { 
13428
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13429
            }
13430
            break;
13431
          default:
13432
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13433
        }
13434
        iprot.readFieldEnd();
13435
      }
13436
      iprot.readStructEnd();
13437
      validate();
13438
    }
13439
 
13440
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13441
      validate();
13442
 
13443
      oprot.writeStructBegin(STRUCT_DESC);
13444
      if (this.voucher != null) {
13445
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
13446
        this.voucher.write(oprot);
13447
        oprot.writeFieldEnd();
13448
      }
13449
      oprot.writeFieldStop();
13450
      oprot.writeStructEnd();
13451
    }
13452
 
13453
    @Override
13454
    public String toString() {
13455
      StringBuilder sb = new StringBuilder("addVoucher_args(");
13456
      boolean first = true;
13457
 
13458
      sb.append("voucher:");
13459
      if (this.voucher == null) {
13460
        sb.append("null");
13461
      } else {
13462
        sb.append(this.voucher);
13463
      }
13464
      first = false;
13465
      sb.append(")");
13466
      return sb.toString();
13467
    }
13468
 
13469
    public void validate() throws org.apache.thrift.TException {
13470
      // check for required fields
13471
    }
13472
 
13473
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13474
      try {
13475
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13476
      } catch (org.apache.thrift.TException te) {
13477
        throw new java.io.IOException(te);
13478
      }
13479
    }
13480
 
13481
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13482
      try {
13483
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13484
      } catch (org.apache.thrift.TException te) {
13485
        throw new java.io.IOException(te);
13486
      }
13487
    }
13488
 
13489
  }
13490
 
13491
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
13492
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
13493
 
13494
 
13495
 
13496
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13497
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13498
;
13499
 
13500
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13501
 
13502
      static {
13503
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13504
          byName.put(field.getFieldName(), field);
13505
        }
13506
      }
13507
 
13508
      /**
13509
       * Find the _Fields constant that matches fieldId, or null if its not found.
13510
       */
13511
      public static _Fields findByThriftId(int fieldId) {
13512
        switch(fieldId) {
13513
          default:
13514
            return null;
13515
        }
13516
      }
13517
 
13518
      /**
13519
       * Find the _Fields constant that matches fieldId, throwing an exception
13520
       * if it is not found.
13521
       */
13522
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13523
        _Fields fields = findByThriftId(fieldId);
13524
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13525
        return fields;
13526
      }
13527
 
13528
      /**
13529
       * Find the _Fields constant that matches name, or null if its not found.
13530
       */
13531
      public static _Fields findByName(String name) {
13532
        return byName.get(name);
13533
      }
13534
 
13535
      private final short _thriftId;
13536
      private final String _fieldName;
13537
 
13538
      _Fields(short thriftId, String fieldName) {
13539
        _thriftId = thriftId;
13540
        _fieldName = fieldName;
13541
      }
13542
 
13543
      public short getThriftFieldId() {
13544
        return _thriftId;
13545
      }
13546
 
13547
      public String getFieldName() {
13548
        return _fieldName;
13549
      }
13550
    }
13551
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13552
    static {
13553
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13554
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13555
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
13556
    }
13557
 
13558
    public addVoucher_result() {
13559
    }
13560
 
13561
    /**
13562
     * Performs a deep copy on <i>other</i>.
13563
     */
13564
    public addVoucher_result(addVoucher_result other) {
13565
    }
13566
 
13567
    public addVoucher_result deepCopy() {
13568
      return new addVoucher_result(this);
13569
    }
13570
 
13571
    @Override
13572
    public void clear() {
13573
    }
13574
 
13575
    public void setFieldValue(_Fields field, Object value) {
13576
      switch (field) {
13577
      }
13578
    }
13579
 
13580
    public Object getFieldValue(_Fields field) {
13581
      switch (field) {
13582
      }
13583
      throw new IllegalStateException();
13584
    }
13585
 
13586
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13587
    public boolean isSet(_Fields field) {
13588
      if (field == null) {
13589
        throw new IllegalArgumentException();
13590
      }
13591
 
13592
      switch (field) {
13593
      }
13594
      throw new IllegalStateException();
13595
    }
13596
 
13597
    @Override
13598
    public boolean equals(Object that) {
13599
      if (that == null)
13600
        return false;
13601
      if (that instanceof addVoucher_result)
13602
        return this.equals((addVoucher_result)that);
13603
      return false;
13604
    }
13605
 
13606
    public boolean equals(addVoucher_result that) {
13607
      if (that == null)
13608
        return false;
13609
 
13610
      return true;
13611
    }
13612
 
13613
    @Override
13614
    public int hashCode() {
13615
      return 0;
13616
    }
13617
 
13618
    public int compareTo(addVoucher_result other) {
13619
      if (!getClass().equals(other.getClass())) {
13620
        return getClass().getName().compareTo(other.getClass().getName());
13621
      }
13622
 
13623
      int lastComparison = 0;
13624
      addVoucher_result typedOther = (addVoucher_result)other;
13625
 
13626
      return 0;
13627
    }
13628
 
13629
    public _Fields fieldForId(int fieldId) {
13630
      return _Fields.findByThriftId(fieldId);
13631
    }
13632
 
13633
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13634
      org.apache.thrift.protocol.TField field;
13635
      iprot.readStructBegin();
13636
      while (true)
13637
      {
13638
        field = iprot.readFieldBegin();
13639
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13640
          break;
13641
        }
13642
        switch (field.id) {
13643
          default:
13644
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13645
        }
13646
        iprot.readFieldEnd();
13647
      }
13648
      iprot.readStructEnd();
13649
      validate();
13650
    }
13651
 
13652
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13653
      oprot.writeStructBegin(STRUCT_DESC);
13654
 
13655
      oprot.writeFieldStop();
13656
      oprot.writeStructEnd();
13657
    }
13658
 
13659
    @Override
13660
    public String toString() {
13661
      StringBuilder sb = new StringBuilder("addVoucher_result(");
13662
      boolean first = true;
13663
 
13664
      sb.append(")");
13665
      return sb.toString();
13666
    }
13667
 
13668
    public void validate() throws org.apache.thrift.TException {
13669
      // check for required fields
13670
    }
13671
 
13672
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13673
      try {
13674
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13675
      } catch (org.apache.thrift.TException te) {
13676
        throw new java.io.IOException(te);
13677
      }
13678
    }
13679
 
13680
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13681
      try {
13682
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13683
      } catch (org.apache.thrift.TException te) {
13684
        throw new java.io.IOException(te);
13685
      }
13686
    }
13687
 
13688
  }
13689
 
13690
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
13691
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
13692
 
13693
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1);
13694
    private static final org.apache.thrift.protocol.TField USER_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("userEmail", org.apache.thrift.protocol.TType.STRING, (short)2);
13695
    private static final org.apache.thrift.protocol.TField VOUCHER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("voucherType", org.apache.thrift.protocol.TType.I32, (short)3);
13696
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)4);
13697
 
13698
    private long userId; // required
13699
    private String userEmail; // required
13700
    private VoucherType voucherType; // required
13701
    private long amount; // required
13702
 
13703
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13704
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13705
      USER_ID((short)1, "userId"),
13706
      USER_EMAIL((short)2, "userEmail"),
13707
      /**
13708
       * 
13709
       * @see VoucherType
13710
       */
13711
      VOUCHER_TYPE((short)3, "voucherType"),
13712
      AMOUNT((short)4, "amount");
13713
 
13714
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13715
 
13716
      static {
13717
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13718
          byName.put(field.getFieldName(), field);
13719
        }
13720
      }
13721
 
13722
      /**
13723
       * Find the _Fields constant that matches fieldId, or null if its not found.
13724
       */
13725
      public static _Fields findByThriftId(int fieldId) {
13726
        switch(fieldId) {
13727
          case 1: // USER_ID
13728
            return USER_ID;
13729
          case 2: // USER_EMAIL
13730
            return USER_EMAIL;
13731
          case 3: // VOUCHER_TYPE
13732
            return VOUCHER_TYPE;
13733
          case 4: // AMOUNT
13734
            return AMOUNT;
13735
          default:
13736
            return null;
13737
        }
13738
      }
13739
 
13740
      /**
13741
       * Find the _Fields constant that matches fieldId, throwing an exception
13742
       * if it is not found.
13743
       */
13744
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13745
        _Fields fields = findByThriftId(fieldId);
13746
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13747
        return fields;
13748
      }
13749
 
13750
      /**
13751
       * Find the _Fields constant that matches name, or null if its not found.
13752
       */
13753
      public static _Fields findByName(String name) {
13754
        return byName.get(name);
13755
      }
13756
 
13757
      private final short _thriftId;
13758
      private final String _fieldName;
13759
 
13760
      _Fields(short thriftId, String fieldName) {
13761
        _thriftId = thriftId;
13762
        _fieldName = fieldName;
13763
      }
13764
 
13765
      public short getThriftFieldId() {
13766
        return _thriftId;
13767
      }
13768
 
13769
      public String getFieldName() {
13770
        return _fieldName;
13771
      }
13772
    }
13773
 
13774
    // isset id assignments
13775
    private static final int __USERID_ISSET_ID = 0;
13776
    private static final int __AMOUNT_ISSET_ID = 1;
13777
    private BitSet __isset_bit_vector = new BitSet(2);
13778
 
13779
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13780
    static {
13781
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13782
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13783
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13784
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13785
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13786
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13787
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
13788
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13789
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13790
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13791
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
13792
    }
13793
 
13794
    public assignVoucher_args() {
13795
    }
13796
 
13797
    public assignVoucher_args(
13798
      long userId,
13799
      String userEmail,
13800
      VoucherType voucherType,
13801
      long amount)
13802
    {
13803
      this();
13804
      this.userId = userId;
13805
      setUserIdIsSet(true);
13806
      this.userEmail = userEmail;
13807
      this.voucherType = voucherType;
13808
      this.amount = amount;
13809
      setAmountIsSet(true);
13810
    }
13811
 
13812
    /**
13813
     * Performs a deep copy on <i>other</i>.
13814
     */
13815
    public assignVoucher_args(assignVoucher_args other) {
13816
      __isset_bit_vector.clear();
13817
      __isset_bit_vector.or(other.__isset_bit_vector);
13818
      this.userId = other.userId;
13819
      if (other.isSetUserEmail()) {
13820
        this.userEmail = other.userEmail;
13821
      }
13822
      if (other.isSetVoucherType()) {
13823
        this.voucherType = other.voucherType;
13824
      }
13825
      this.amount = other.amount;
13826
    }
13827
 
13828
    public assignVoucher_args deepCopy() {
13829
      return new assignVoucher_args(this);
13830
    }
13831
 
13832
    @Override
13833
    public void clear() {
13834
      setUserIdIsSet(false);
13835
      this.userId = 0;
13836
      this.userEmail = null;
13837
      this.voucherType = null;
13838
      setAmountIsSet(false);
13839
      this.amount = 0;
13840
    }
13841
 
13842
    public long getUserId() {
13843
      return this.userId;
13844
    }
13845
 
13846
    public void setUserId(long userId) {
13847
      this.userId = userId;
13848
      setUserIdIsSet(true);
13849
    }
13850
 
13851
    public void unsetUserId() {
13852
      __isset_bit_vector.clear(__USERID_ISSET_ID);
13853
    }
13854
 
13855
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
13856
    public boolean isSetUserId() {
13857
      return __isset_bit_vector.get(__USERID_ISSET_ID);
13858
    }
13859
 
13860
    public void setUserIdIsSet(boolean value) {
13861
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
13862
    }
13863
 
13864
    public String getUserEmail() {
13865
      return this.userEmail;
13866
    }
13867
 
13868
    public void setUserEmail(String userEmail) {
13869
      this.userEmail = userEmail;
13870
    }
13871
 
13872
    public void unsetUserEmail() {
13873
      this.userEmail = null;
13874
    }
13875
 
13876
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
13877
    public boolean isSetUserEmail() {
13878
      return this.userEmail != null;
13879
    }
13880
 
13881
    public void setUserEmailIsSet(boolean value) {
13882
      if (!value) {
13883
        this.userEmail = null;
13884
      }
13885
    }
13886
 
13887
    /**
13888
     * 
13889
     * @see VoucherType
13890
     */
13891
    public VoucherType getVoucherType() {
13892
      return this.voucherType;
13893
    }
13894
 
13895
    /**
13896
     * 
13897
     * @see VoucherType
13898
     */
13899
    public void setVoucherType(VoucherType voucherType) {
13900
      this.voucherType = voucherType;
13901
    }
13902
 
13903
    public void unsetVoucherType() {
13904
      this.voucherType = null;
13905
    }
13906
 
13907
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
13908
    public boolean isSetVoucherType() {
13909
      return this.voucherType != null;
13910
    }
13911
 
13912
    public void setVoucherTypeIsSet(boolean value) {
13913
      if (!value) {
13914
        this.voucherType = null;
13915
      }
13916
    }
13917
 
13918
    public long getAmount() {
13919
      return this.amount;
13920
    }
13921
 
13922
    public void setAmount(long amount) {
13923
      this.amount = amount;
13924
      setAmountIsSet(true);
13925
    }
13926
 
13927
    public void unsetAmount() {
13928
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
13929
    }
13930
 
13931
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
13932
    public boolean isSetAmount() {
13933
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
13934
    }
13935
 
13936
    public void setAmountIsSet(boolean value) {
13937
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
13938
    }
13939
 
13940
    public void setFieldValue(_Fields field, Object value) {
13941
      switch (field) {
13942
      case USER_ID:
13943
        if (value == null) {
13944
          unsetUserId();
13945
        } else {
13946
          setUserId((Long)value);
13947
        }
13948
        break;
13949
 
13950
      case USER_EMAIL:
13951
        if (value == null) {
13952
          unsetUserEmail();
13953
        } else {
13954
          setUserEmail((String)value);
13955
        }
13956
        break;
13957
 
13958
      case VOUCHER_TYPE:
13959
        if (value == null) {
13960
          unsetVoucherType();
13961
        } else {
13962
          setVoucherType((VoucherType)value);
13963
        }
13964
        break;
13965
 
13966
      case AMOUNT:
13967
        if (value == null) {
13968
          unsetAmount();
13969
        } else {
13970
          setAmount((Long)value);
13971
        }
13972
        break;
13973
 
13974
      }
13975
    }
13976
 
13977
    public Object getFieldValue(_Fields field) {
13978
      switch (field) {
13979
      case USER_ID:
13980
        return Long.valueOf(getUserId());
13981
 
13982
      case USER_EMAIL:
13983
        return getUserEmail();
13984
 
13985
      case VOUCHER_TYPE:
13986
        return getVoucherType();
13987
 
13988
      case AMOUNT:
13989
        return Long.valueOf(getAmount());
13990
 
13991
      }
13992
      throw new IllegalStateException();
13993
    }
13994
 
13995
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13996
    public boolean isSet(_Fields field) {
13997
      if (field == null) {
13998
        throw new IllegalArgumentException();
13999
      }
14000
 
14001
      switch (field) {
14002
      case USER_ID:
14003
        return isSetUserId();
14004
      case USER_EMAIL:
14005
        return isSetUserEmail();
14006
      case VOUCHER_TYPE:
14007
        return isSetVoucherType();
14008
      case AMOUNT:
14009
        return isSetAmount();
14010
      }
14011
      throw new IllegalStateException();
14012
    }
14013
 
14014
    @Override
14015
    public boolean equals(Object that) {
14016
      if (that == null)
14017
        return false;
14018
      if (that instanceof assignVoucher_args)
14019
        return this.equals((assignVoucher_args)that);
14020
      return false;
14021
    }
14022
 
14023
    public boolean equals(assignVoucher_args that) {
14024
      if (that == null)
14025
        return false;
14026
 
14027
      boolean this_present_userId = true;
14028
      boolean that_present_userId = true;
14029
      if (this_present_userId || that_present_userId) {
14030
        if (!(this_present_userId && that_present_userId))
14031
          return false;
14032
        if (this.userId != that.userId)
14033
          return false;
14034
      }
14035
 
14036
      boolean this_present_userEmail = true && this.isSetUserEmail();
14037
      boolean that_present_userEmail = true && that.isSetUserEmail();
14038
      if (this_present_userEmail || that_present_userEmail) {
14039
        if (!(this_present_userEmail && that_present_userEmail))
14040
          return false;
14041
        if (!this.userEmail.equals(that.userEmail))
14042
          return false;
14043
      }
14044
 
14045
      boolean this_present_voucherType = true && this.isSetVoucherType();
14046
      boolean that_present_voucherType = true && that.isSetVoucherType();
14047
      if (this_present_voucherType || that_present_voucherType) {
14048
        if (!(this_present_voucherType && that_present_voucherType))
14049
          return false;
14050
        if (!this.voucherType.equals(that.voucherType))
14051
          return false;
14052
      }
14053
 
14054
      boolean this_present_amount = true;
14055
      boolean that_present_amount = true;
14056
      if (this_present_amount || that_present_amount) {
14057
        if (!(this_present_amount && that_present_amount))
14058
          return false;
14059
        if (this.amount != that.amount)
14060
          return false;
14061
      }
14062
 
14063
      return true;
14064
    }
14065
 
14066
    @Override
14067
    public int hashCode() {
14068
      return 0;
14069
    }
14070
 
14071
    public int compareTo(assignVoucher_args other) {
14072
      if (!getClass().equals(other.getClass())) {
14073
        return getClass().getName().compareTo(other.getClass().getName());
14074
      }
14075
 
14076
      int lastComparison = 0;
14077
      assignVoucher_args typedOther = (assignVoucher_args)other;
14078
 
14079
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
14080
      if (lastComparison != 0) {
14081
        return lastComparison;
14082
      }
14083
      if (isSetUserId()) {
14084
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
14085
        if (lastComparison != 0) {
14086
          return lastComparison;
14087
        }
14088
      }
14089
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
14090
      if (lastComparison != 0) {
14091
        return lastComparison;
14092
      }
14093
      if (isSetUserEmail()) {
14094
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
14095
        if (lastComparison != 0) {
14096
          return lastComparison;
14097
        }
14098
      }
14099
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
14100
      if (lastComparison != 0) {
14101
        return lastComparison;
14102
      }
14103
      if (isSetVoucherType()) {
14104
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
14105
        if (lastComparison != 0) {
14106
          return lastComparison;
14107
        }
14108
      }
14109
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
14110
      if (lastComparison != 0) {
14111
        return lastComparison;
14112
      }
14113
      if (isSetAmount()) {
14114
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
14115
        if (lastComparison != 0) {
14116
          return lastComparison;
14117
        }
14118
      }
14119
      return 0;
14120
    }
14121
 
14122
    public _Fields fieldForId(int fieldId) {
14123
      return _Fields.findByThriftId(fieldId);
14124
    }
14125
 
14126
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14127
      org.apache.thrift.protocol.TField field;
14128
      iprot.readStructBegin();
14129
      while (true)
14130
      {
14131
        field = iprot.readFieldBegin();
14132
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14133
          break;
14134
        }
14135
        switch (field.id) {
14136
          case 1: // USER_ID
14137
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14138
              this.userId = iprot.readI64();
14139
              setUserIdIsSet(true);
14140
            } else { 
14141
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14142
            }
14143
            break;
14144
          case 2: // USER_EMAIL
14145
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14146
              this.userEmail = iprot.readString();
14147
            } else { 
14148
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14149
            }
14150
            break;
14151
          case 3: // VOUCHER_TYPE
14152
            if (field.type == org.apache.thrift.protocol.TType.I32) {
14153
              this.voucherType = VoucherType.findByValue(iprot.readI32());
14154
            } else { 
14155
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14156
            }
14157
            break;
14158
          case 4: // AMOUNT
14159
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14160
              this.amount = iprot.readI64();
14161
              setAmountIsSet(true);
14162
            } else { 
14163
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14164
            }
14165
            break;
14166
          default:
14167
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14168
        }
14169
        iprot.readFieldEnd();
14170
      }
14171
      iprot.readStructEnd();
14172
      validate();
14173
    }
14174
 
14175
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14176
      validate();
14177
 
14178
      oprot.writeStructBegin(STRUCT_DESC);
14179
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
14180
      oprot.writeI64(this.userId);
14181
      oprot.writeFieldEnd();
14182
      if (this.userEmail != null) {
14183
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
14184
        oprot.writeString(this.userEmail);
14185
        oprot.writeFieldEnd();
14186
      }
14187
      if (this.voucherType != null) {
14188
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
14189
        oprot.writeI32(this.voucherType.getValue());
14190
        oprot.writeFieldEnd();
14191
      }
14192
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
14193
      oprot.writeI64(this.amount);
14194
      oprot.writeFieldEnd();
14195
      oprot.writeFieldStop();
14196
      oprot.writeStructEnd();
14197
    }
14198
 
14199
    @Override
14200
    public String toString() {
14201
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
14202
      boolean first = true;
14203
 
14204
      sb.append("userId:");
14205
      sb.append(this.userId);
14206
      first = false;
14207
      if (!first) sb.append(", ");
14208
      sb.append("userEmail:");
14209
      if (this.userEmail == null) {
14210
        sb.append("null");
14211
      } else {
14212
        sb.append(this.userEmail);
14213
      }
14214
      first = false;
14215
      if (!first) sb.append(", ");
14216
      sb.append("voucherType:");
14217
      if (this.voucherType == null) {
14218
        sb.append("null");
14219
      } else {
14220
        sb.append(this.voucherType);
14221
      }
14222
      first = false;
14223
      if (!first) sb.append(", ");
14224
      sb.append("amount:");
14225
      sb.append(this.amount);
14226
      first = false;
14227
      sb.append(")");
14228
      return sb.toString();
14229
    }
14230
 
14231
    public void validate() throws org.apache.thrift.TException {
14232
      // check for required fields
14233
    }
14234
 
14235
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14236
      try {
14237
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14238
      } catch (org.apache.thrift.TException te) {
14239
        throw new java.io.IOException(te);
14240
      }
14241
    }
14242
 
14243
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14244
      try {
14245
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
14246
        __isset_bit_vector = new BitSet(1);
14247
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14248
      } catch (org.apache.thrift.TException te) {
14249
        throw new java.io.IOException(te);
14250
      }
14251
    }
14252
 
14253
  }
14254
 
14255
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
14256
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
14257
 
14258
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
14259
 
14260
    private Voucher success; // required
14261
 
14262
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14263
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14264
      SUCCESS((short)0, "success");
14265
 
14266
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14267
 
14268
      static {
14269
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14270
          byName.put(field.getFieldName(), field);
14271
        }
14272
      }
14273
 
14274
      /**
14275
       * Find the _Fields constant that matches fieldId, or null if its not found.
14276
       */
14277
      public static _Fields findByThriftId(int fieldId) {
14278
        switch(fieldId) {
14279
          case 0: // SUCCESS
14280
            return SUCCESS;
14281
          default:
14282
            return null;
14283
        }
14284
      }
14285
 
14286
      /**
14287
       * Find the _Fields constant that matches fieldId, throwing an exception
14288
       * if it is not found.
14289
       */
14290
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14291
        _Fields fields = findByThriftId(fieldId);
14292
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14293
        return fields;
14294
      }
14295
 
14296
      /**
14297
       * Find the _Fields constant that matches name, or null if its not found.
14298
       */
14299
      public static _Fields findByName(String name) {
14300
        return byName.get(name);
14301
      }
14302
 
14303
      private final short _thriftId;
14304
      private final String _fieldName;
14305
 
14306
      _Fields(short thriftId, String fieldName) {
14307
        _thriftId = thriftId;
14308
        _fieldName = fieldName;
14309
      }
14310
 
14311
      public short getThriftFieldId() {
14312
        return _thriftId;
14313
      }
14314
 
14315
      public String getFieldName() {
14316
        return _fieldName;
14317
      }
14318
    }
14319
 
14320
    // isset id assignments
14321
 
14322
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14323
    static {
14324
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14325
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14326
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
14327
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14328
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
14329
    }
14330
 
14331
    public assignVoucher_result() {
14332
    }
14333
 
14334
    public assignVoucher_result(
14335
      Voucher success)
14336
    {
14337
      this();
14338
      this.success = success;
14339
    }
14340
 
14341
    /**
14342
     * Performs a deep copy on <i>other</i>.
14343
     */
14344
    public assignVoucher_result(assignVoucher_result other) {
14345
      if (other.isSetSuccess()) {
14346
        this.success = new Voucher(other.success);
14347
      }
14348
    }
14349
 
14350
    public assignVoucher_result deepCopy() {
14351
      return new assignVoucher_result(this);
14352
    }
14353
 
14354
    @Override
14355
    public void clear() {
14356
      this.success = null;
14357
    }
14358
 
14359
    public Voucher getSuccess() {
14360
      return this.success;
14361
    }
14362
 
14363
    public void setSuccess(Voucher success) {
14364
      this.success = success;
14365
    }
14366
 
14367
    public void unsetSuccess() {
14368
      this.success = null;
14369
    }
14370
 
14371
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
14372
    public boolean isSetSuccess() {
14373
      return this.success != null;
14374
    }
14375
 
14376
    public void setSuccessIsSet(boolean value) {
14377
      if (!value) {
14378
        this.success = null;
14379
      }
14380
    }
14381
 
14382
    public void setFieldValue(_Fields field, Object value) {
14383
      switch (field) {
14384
      case SUCCESS:
14385
        if (value == null) {
14386
          unsetSuccess();
14387
        } else {
14388
          setSuccess((Voucher)value);
14389
        }
14390
        break;
14391
 
14392
      }
14393
    }
14394
 
14395
    public Object getFieldValue(_Fields field) {
14396
      switch (field) {
14397
      case SUCCESS:
14398
        return getSuccess();
14399
 
14400
      }
14401
      throw new IllegalStateException();
14402
    }
14403
 
14404
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14405
    public boolean isSet(_Fields field) {
14406
      if (field == null) {
14407
        throw new IllegalArgumentException();
14408
      }
14409
 
14410
      switch (field) {
14411
      case SUCCESS:
14412
        return isSetSuccess();
14413
      }
14414
      throw new IllegalStateException();
14415
    }
14416
 
14417
    @Override
14418
    public boolean equals(Object that) {
14419
      if (that == null)
14420
        return false;
14421
      if (that instanceof assignVoucher_result)
14422
        return this.equals((assignVoucher_result)that);
14423
      return false;
14424
    }
14425
 
14426
    public boolean equals(assignVoucher_result that) {
14427
      if (that == null)
14428
        return false;
14429
 
14430
      boolean this_present_success = true && this.isSetSuccess();
14431
      boolean that_present_success = true && that.isSetSuccess();
14432
      if (this_present_success || that_present_success) {
14433
        if (!(this_present_success && that_present_success))
14434
          return false;
14435
        if (!this.success.equals(that.success))
14436
          return false;
14437
      }
14438
 
14439
      return true;
14440
    }
14441
 
14442
    @Override
14443
    public int hashCode() {
14444
      return 0;
14445
    }
14446
 
14447
    public int compareTo(assignVoucher_result other) {
14448
      if (!getClass().equals(other.getClass())) {
14449
        return getClass().getName().compareTo(other.getClass().getName());
14450
      }
14451
 
14452
      int lastComparison = 0;
14453
      assignVoucher_result typedOther = (assignVoucher_result)other;
14454
 
14455
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
14456
      if (lastComparison != 0) {
14457
        return lastComparison;
14458
      }
14459
      if (isSetSuccess()) {
14460
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14461
        if (lastComparison != 0) {
14462
          return lastComparison;
14463
        }
14464
      }
14465
      return 0;
14466
    }
14467
 
14468
    public _Fields fieldForId(int fieldId) {
14469
      return _Fields.findByThriftId(fieldId);
14470
    }
14471
 
14472
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14473
      org.apache.thrift.protocol.TField field;
14474
      iprot.readStructBegin();
14475
      while (true)
14476
      {
14477
        field = iprot.readFieldBegin();
14478
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14479
          break;
14480
        }
14481
        switch (field.id) {
14482
          case 0: // SUCCESS
14483
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14484
              this.success = new Voucher();
14485
              this.success.read(iprot);
14486
            } else { 
14487
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14488
            }
14489
            break;
14490
          default:
14491
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14492
        }
14493
        iprot.readFieldEnd();
14494
      }
14495
      iprot.readStructEnd();
14496
      validate();
14497
    }
14498
 
14499
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14500
      oprot.writeStructBegin(STRUCT_DESC);
14501
 
14502
      if (this.isSetSuccess()) {
14503
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14504
        this.success.write(oprot);
14505
        oprot.writeFieldEnd();
14506
      }
14507
      oprot.writeFieldStop();
14508
      oprot.writeStructEnd();
14509
    }
14510
 
14511
    @Override
14512
    public String toString() {
14513
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
14514
      boolean first = true;
14515
 
14516
      sb.append("success:");
14517
      if (this.success == null) {
14518
        sb.append("null");
14519
      } else {
14520
        sb.append(this.success);
14521
      }
14522
      first = false;
14523
      sb.append(")");
14524
      return sb.toString();
14525
    }
14526
 
14527
    public void validate() throws org.apache.thrift.TException {
14528
      // check for required fields
14529
    }
14530
 
14531
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14532
      try {
14533
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14534
      } catch (org.apache.thrift.TException te) {
14535
        throw new java.io.IOException(te);
14536
      }
14537
    }
14538
 
14539
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14540
      try {
14541
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14542
      } catch (org.apache.thrift.TException te) {
14543
        throw new java.io.IOException(te);
14544
      }
14545
    }
14546
 
14547
  }
14548
 
14549
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
14550
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
14551
 
14552
    private static final org.apache.thrift.protocol.TField VOUCHER_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("voucherCode", org.apache.thrift.protocol.TType.STRING, (short)1);
14553
    private static final org.apache.thrift.protocol.TField REDEEMED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("redeemedOn", org.apache.thrift.protocol.TType.I64, (short)2);
14554
 
14555
    private String voucherCode; // required
14556
    private long redeemedOn; // required
14557
 
14558
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14559
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14560
      VOUCHER_CODE((short)1, "voucherCode"),
14561
      REDEEMED_ON((short)2, "redeemedOn");
14562
 
14563
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14564
 
14565
      static {
14566
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14567
          byName.put(field.getFieldName(), field);
14568
        }
14569
      }
14570
 
14571
      /**
14572
       * Find the _Fields constant that matches fieldId, or null if its not found.
14573
       */
14574
      public static _Fields findByThriftId(int fieldId) {
14575
        switch(fieldId) {
14576
          case 1: // VOUCHER_CODE
14577
            return VOUCHER_CODE;
14578
          case 2: // REDEEMED_ON
14579
            return REDEEMED_ON;
14580
          default:
14581
            return null;
14582
        }
14583
      }
14584
 
14585
      /**
14586
       * Find the _Fields constant that matches fieldId, throwing an exception
14587
       * if it is not found.
14588
       */
14589
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14590
        _Fields fields = findByThriftId(fieldId);
14591
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14592
        return fields;
14593
      }
14594
 
14595
      /**
14596
       * Find the _Fields constant that matches name, or null if its not found.
14597
       */
14598
      public static _Fields findByName(String name) {
14599
        return byName.get(name);
14600
      }
14601
 
14602
      private final short _thriftId;
14603
      private final String _fieldName;
14604
 
14605
      _Fields(short thriftId, String fieldName) {
14606
        _thriftId = thriftId;
14607
        _fieldName = fieldName;
14608
      }
14609
 
14610
      public short getThriftFieldId() {
14611
        return _thriftId;
14612
      }
14613
 
14614
      public String getFieldName() {
14615
        return _fieldName;
14616
      }
14617
    }
14618
 
14619
    // isset id assignments
14620
    private static final int __REDEEMEDON_ISSET_ID = 0;
14621
    private BitSet __isset_bit_vector = new BitSet(1);
14622
 
14623
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14624
    static {
14625
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14626
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14627
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
14628
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14629
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
14630
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14631
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
14632
    }
14633
 
14634
    public markVoucherAsRedeemed_args() {
14635
    }
14636
 
14637
    public markVoucherAsRedeemed_args(
14638
      String voucherCode,
14639
      long redeemedOn)
14640
    {
14641
      this();
14642
      this.voucherCode = voucherCode;
14643
      this.redeemedOn = redeemedOn;
14644
      setRedeemedOnIsSet(true);
14645
    }
14646
 
14647
    /**
14648
     * Performs a deep copy on <i>other</i>.
14649
     */
14650
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
14651
      __isset_bit_vector.clear();
14652
      __isset_bit_vector.or(other.__isset_bit_vector);
14653
      if (other.isSetVoucherCode()) {
14654
        this.voucherCode = other.voucherCode;
14655
      }
14656
      this.redeemedOn = other.redeemedOn;
14657
    }
14658
 
14659
    public markVoucherAsRedeemed_args deepCopy() {
14660
      return new markVoucherAsRedeemed_args(this);
14661
    }
14662
 
14663
    @Override
14664
    public void clear() {
14665
      this.voucherCode = null;
14666
      setRedeemedOnIsSet(false);
14667
      this.redeemedOn = 0;
14668
    }
14669
 
14670
    public String getVoucherCode() {
14671
      return this.voucherCode;
14672
    }
14673
 
14674
    public void setVoucherCode(String voucherCode) {
14675
      this.voucherCode = voucherCode;
14676
    }
14677
 
14678
    public void unsetVoucherCode() {
14679
      this.voucherCode = null;
14680
    }
14681
 
14682
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
14683
    public boolean isSetVoucherCode() {
14684
      return this.voucherCode != null;
14685
    }
14686
 
14687
    public void setVoucherCodeIsSet(boolean value) {
14688
      if (!value) {
14689
        this.voucherCode = null;
14690
      }
14691
    }
14692
 
14693
    public long getRedeemedOn() {
14694
      return this.redeemedOn;
14695
    }
14696
 
14697
    public void setRedeemedOn(long redeemedOn) {
14698
      this.redeemedOn = redeemedOn;
14699
      setRedeemedOnIsSet(true);
14700
    }
14701
 
14702
    public void unsetRedeemedOn() {
14703
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
14704
    }
14705
 
14706
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
14707
    public boolean isSetRedeemedOn() {
14708
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
14709
    }
14710
 
14711
    public void setRedeemedOnIsSet(boolean value) {
14712
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
14713
    }
14714
 
14715
    public void setFieldValue(_Fields field, Object value) {
14716
      switch (field) {
14717
      case VOUCHER_CODE:
14718
        if (value == null) {
14719
          unsetVoucherCode();
14720
        } else {
14721
          setVoucherCode((String)value);
14722
        }
14723
        break;
14724
 
14725
      case REDEEMED_ON:
14726
        if (value == null) {
14727
          unsetRedeemedOn();
14728
        } else {
14729
          setRedeemedOn((Long)value);
14730
        }
14731
        break;
14732
 
14733
      }
14734
    }
14735
 
14736
    public Object getFieldValue(_Fields field) {
14737
      switch (field) {
14738
      case VOUCHER_CODE:
14739
        return getVoucherCode();
14740
 
14741
      case REDEEMED_ON:
14742
        return Long.valueOf(getRedeemedOn());
14743
 
14744
      }
14745
      throw new IllegalStateException();
14746
    }
14747
 
14748
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14749
    public boolean isSet(_Fields field) {
14750
      if (field == null) {
14751
        throw new IllegalArgumentException();
14752
      }
14753
 
14754
      switch (field) {
14755
      case VOUCHER_CODE:
14756
        return isSetVoucherCode();
14757
      case REDEEMED_ON:
14758
        return isSetRedeemedOn();
14759
      }
14760
      throw new IllegalStateException();
14761
    }
14762
 
14763
    @Override
14764
    public boolean equals(Object that) {
14765
      if (that == null)
14766
        return false;
14767
      if (that instanceof markVoucherAsRedeemed_args)
14768
        return this.equals((markVoucherAsRedeemed_args)that);
14769
      return false;
14770
    }
14771
 
14772
    public boolean equals(markVoucherAsRedeemed_args that) {
14773
      if (that == null)
14774
        return false;
14775
 
14776
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
14777
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
14778
      if (this_present_voucherCode || that_present_voucherCode) {
14779
        if (!(this_present_voucherCode && that_present_voucherCode))
14780
          return false;
14781
        if (!this.voucherCode.equals(that.voucherCode))
14782
          return false;
14783
      }
14784
 
14785
      boolean this_present_redeemedOn = true;
14786
      boolean that_present_redeemedOn = true;
14787
      if (this_present_redeemedOn || that_present_redeemedOn) {
14788
        if (!(this_present_redeemedOn && that_present_redeemedOn))
14789
          return false;
14790
        if (this.redeemedOn != that.redeemedOn)
14791
          return false;
14792
      }
14793
 
14794
      return true;
14795
    }
14796
 
14797
    @Override
14798
    public int hashCode() {
14799
      return 0;
14800
    }
14801
 
14802
    public int compareTo(markVoucherAsRedeemed_args other) {
14803
      if (!getClass().equals(other.getClass())) {
14804
        return getClass().getName().compareTo(other.getClass().getName());
14805
      }
14806
 
14807
      int lastComparison = 0;
14808
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
14809
 
14810
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
14811
      if (lastComparison != 0) {
14812
        return lastComparison;
14813
      }
14814
      if (isSetVoucherCode()) {
14815
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
14816
        if (lastComparison != 0) {
14817
          return lastComparison;
14818
        }
14819
      }
14820
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
14821
      if (lastComparison != 0) {
14822
        return lastComparison;
14823
      }
14824
      if (isSetRedeemedOn()) {
14825
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
14826
        if (lastComparison != 0) {
14827
          return lastComparison;
14828
        }
14829
      }
14830
      return 0;
14831
    }
14832
 
14833
    public _Fields fieldForId(int fieldId) {
14834
      return _Fields.findByThriftId(fieldId);
14835
    }
14836
 
14837
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14838
      org.apache.thrift.protocol.TField field;
14839
      iprot.readStructBegin();
14840
      while (true)
14841
      {
14842
        field = iprot.readFieldBegin();
14843
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14844
          break;
14845
        }
14846
        switch (field.id) {
14847
          case 1: // VOUCHER_CODE
14848
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14849
              this.voucherCode = iprot.readString();
14850
            } else { 
14851
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14852
            }
14853
            break;
14854
          case 2: // REDEEMED_ON
14855
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14856
              this.redeemedOn = iprot.readI64();
14857
              setRedeemedOnIsSet(true);
14858
            } else { 
14859
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14860
            }
14861
            break;
14862
          default:
14863
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14864
        }
14865
        iprot.readFieldEnd();
14866
      }
14867
      iprot.readStructEnd();
14868
      validate();
14869
    }
14870
 
14871
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14872
      validate();
14873
 
14874
      oprot.writeStructBegin(STRUCT_DESC);
14875
      if (this.voucherCode != null) {
14876
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
14877
        oprot.writeString(this.voucherCode);
14878
        oprot.writeFieldEnd();
14879
      }
14880
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
14881
      oprot.writeI64(this.redeemedOn);
14882
      oprot.writeFieldEnd();
14883
      oprot.writeFieldStop();
14884
      oprot.writeStructEnd();
14885
    }
14886
 
14887
    @Override
14888
    public String toString() {
14889
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
14890
      boolean first = true;
14891
 
14892
      sb.append("voucherCode:");
14893
      if (this.voucherCode == null) {
14894
        sb.append("null");
14895
      } else {
14896
        sb.append(this.voucherCode);
14897
      }
14898
      first = false;
14899
      if (!first) sb.append(", ");
14900
      sb.append("redeemedOn:");
14901
      sb.append(this.redeemedOn);
14902
      first = false;
14903
      sb.append(")");
14904
      return sb.toString();
14905
    }
14906
 
14907
    public void validate() throws org.apache.thrift.TException {
14908
      // check for required fields
14909
    }
14910
 
14911
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14912
      try {
14913
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14914
      } catch (org.apache.thrift.TException te) {
14915
        throw new java.io.IOException(te);
14916
      }
14917
    }
14918
 
14919
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14920
      try {
14921
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
14922
        __isset_bit_vector = new BitSet(1);
14923
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14924
      } catch (org.apache.thrift.TException te) {
14925
        throw new java.io.IOException(te);
14926
      }
14927
    }
14928
 
14929
  }
14930
 
14931
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
14932
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
14933
 
14934
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
14935
 
14936
    private boolean success; // required
14937
 
14938
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14939
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14940
      SUCCESS((short)0, "success");
14941
 
14942
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14943
 
14944
      static {
14945
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14946
          byName.put(field.getFieldName(), field);
14947
        }
14948
      }
14949
 
14950
      /**
14951
       * Find the _Fields constant that matches fieldId, or null if its not found.
14952
       */
14953
      public static _Fields findByThriftId(int fieldId) {
14954
        switch(fieldId) {
14955
          case 0: // SUCCESS
14956
            return SUCCESS;
14957
          default:
14958
            return null;
14959
        }
14960
      }
14961
 
14962
      /**
14963
       * Find the _Fields constant that matches fieldId, throwing an exception
14964
       * if it is not found.
14965
       */
14966
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14967
        _Fields fields = findByThriftId(fieldId);
14968
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14969
        return fields;
14970
      }
14971
 
14972
      /**
14973
       * Find the _Fields constant that matches name, or null if its not found.
14974
       */
14975
      public static _Fields findByName(String name) {
14976
        return byName.get(name);
14977
      }
14978
 
14979
      private final short _thriftId;
14980
      private final String _fieldName;
14981
 
14982
      _Fields(short thriftId, String fieldName) {
14983
        _thriftId = thriftId;
14984
        _fieldName = fieldName;
14985
      }
14986
 
14987
      public short getThriftFieldId() {
14988
        return _thriftId;
14989
      }
14990
 
14991
      public String getFieldName() {
14992
        return _fieldName;
14993
      }
14994
    }
14995
 
14996
    // isset id assignments
14997
    private static final int __SUCCESS_ISSET_ID = 0;
14998
    private BitSet __isset_bit_vector = new BitSet(1);
14999
 
15000
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15001
    static {
15002
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15003
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15004
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
15005
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15006
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
15007
    }
15008
 
15009
    public markVoucherAsRedeemed_result() {
15010
    }
15011
 
15012
    public markVoucherAsRedeemed_result(
15013
      boolean success)
15014
    {
15015
      this();
15016
      this.success = success;
15017
      setSuccessIsSet(true);
15018
    }
15019
 
15020
    /**
15021
     * Performs a deep copy on <i>other</i>.
15022
     */
15023
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
15024
      __isset_bit_vector.clear();
15025
      __isset_bit_vector.or(other.__isset_bit_vector);
15026
      this.success = other.success;
15027
    }
15028
 
15029
    public markVoucherAsRedeemed_result deepCopy() {
15030
      return new markVoucherAsRedeemed_result(this);
15031
    }
15032
 
15033
    @Override
15034
    public void clear() {
15035
      setSuccessIsSet(false);
15036
      this.success = false;
15037
    }
15038
 
15039
    public boolean isSuccess() {
15040
      return this.success;
15041
    }
15042
 
15043
    public void setSuccess(boolean success) {
15044
      this.success = success;
15045
      setSuccessIsSet(true);
15046
    }
15047
 
15048
    public void unsetSuccess() {
15049
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
15050
    }
15051
 
15052
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15053
    public boolean isSetSuccess() {
15054
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
15055
    }
15056
 
15057
    public void setSuccessIsSet(boolean value) {
15058
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
15059
    }
15060
 
15061
    public void setFieldValue(_Fields field, Object value) {
15062
      switch (field) {
15063
      case SUCCESS:
15064
        if (value == null) {
15065
          unsetSuccess();
15066
        } else {
15067
          setSuccess((Boolean)value);
15068
        }
15069
        break;
15070
 
15071
      }
15072
    }
15073
 
15074
    public Object getFieldValue(_Fields field) {
15075
      switch (field) {
15076
      case SUCCESS:
15077
        return Boolean.valueOf(isSuccess());
15078
 
15079
      }
15080
      throw new IllegalStateException();
15081
    }
15082
 
15083
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15084
    public boolean isSet(_Fields field) {
15085
      if (field == null) {
15086
        throw new IllegalArgumentException();
15087
      }
15088
 
15089
      switch (field) {
15090
      case SUCCESS:
15091
        return isSetSuccess();
15092
      }
15093
      throw new IllegalStateException();
15094
    }
15095
 
15096
    @Override
15097
    public boolean equals(Object that) {
15098
      if (that == null)
15099
        return false;
15100
      if (that instanceof markVoucherAsRedeemed_result)
15101
        return this.equals((markVoucherAsRedeemed_result)that);
15102
      return false;
15103
    }
15104
 
15105
    public boolean equals(markVoucherAsRedeemed_result that) {
15106
      if (that == null)
15107
        return false;
15108
 
15109
      boolean this_present_success = true;
15110
      boolean that_present_success = true;
15111
      if (this_present_success || that_present_success) {
15112
        if (!(this_present_success && that_present_success))
15113
          return false;
15114
        if (this.success != that.success)
15115
          return false;
15116
      }
15117
 
15118
      return true;
15119
    }
15120
 
15121
    @Override
15122
    public int hashCode() {
15123
      return 0;
15124
    }
15125
 
15126
    public int compareTo(markVoucherAsRedeemed_result other) {
15127
      if (!getClass().equals(other.getClass())) {
15128
        return getClass().getName().compareTo(other.getClass().getName());
15129
      }
15130
 
15131
      int lastComparison = 0;
15132
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
15133
 
15134
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15135
      if (lastComparison != 0) {
15136
        return lastComparison;
15137
      }
15138
      if (isSetSuccess()) {
15139
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15140
        if (lastComparison != 0) {
15141
          return lastComparison;
15142
        }
15143
      }
15144
      return 0;
15145
    }
15146
 
15147
    public _Fields fieldForId(int fieldId) {
15148
      return _Fields.findByThriftId(fieldId);
15149
    }
15150
 
15151
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15152
      org.apache.thrift.protocol.TField field;
15153
      iprot.readStructBegin();
15154
      while (true)
15155
      {
15156
        field = iprot.readFieldBegin();
15157
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15158
          break;
15159
        }
15160
        switch (field.id) {
15161
          case 0: // SUCCESS
15162
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
15163
              this.success = iprot.readBool();
15164
              setSuccessIsSet(true);
15165
            } else { 
15166
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15167
            }
15168
            break;
15169
          default:
15170
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15171
        }
15172
        iprot.readFieldEnd();
15173
      }
15174
      iprot.readStructEnd();
15175
      validate();
15176
    }
15177
 
15178
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15179
      oprot.writeStructBegin(STRUCT_DESC);
15180
 
15181
      if (this.isSetSuccess()) {
15182
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15183
        oprot.writeBool(this.success);
15184
        oprot.writeFieldEnd();
15185
      }
15186
      oprot.writeFieldStop();
15187
      oprot.writeStructEnd();
15188
    }
15189
 
15190
    @Override
15191
    public String toString() {
15192
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
15193
      boolean first = true;
15194
 
15195
      sb.append("success:");
15196
      sb.append(this.success);
15197
      first = false;
15198
      sb.append(")");
15199
      return sb.toString();
15200
    }
15201
 
15202
    public void validate() throws org.apache.thrift.TException {
15203
      // check for required fields
15204
    }
15205
 
15206
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15207
      try {
15208
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15209
      } catch (org.apache.thrift.TException te) {
15210
        throw new java.io.IOException(te);
15211
      }
15212
    }
15213
 
15214
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15215
      try {
15216
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15217
      } catch (org.apache.thrift.TException te) {
15218
        throw new java.io.IOException(te);
15219
      }
15220
    }
15221
 
15222
  }
15223
 
1982 varun.gupt 15224
}