Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
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
 
3430 rajveer 32
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 33
 
3430 rajveer 34
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 35
 
3430 rajveer 36
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 37
 
3430 rajveer 38
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 39
 
3430 rajveer 40
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3385 varun.gupt 44
    /**
45
     * Returns a list of active coupons
46
     */
3430 rajveer 47
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 48
 
49
    /**
6250 amit.gupta 50
     * Creates a coupon and returns couponcode if successfully created
51
     * 
52
     * @param promotionId
53
     * @param endOn
54
     * @param email
55
     * @param amount
56
     * @param usage
57
     */
58
    public String createCoupon(long promotionId, long endOn, String email, long amount, long usage) throws PromotionException, org.apache.thrift.TException;
59
 
60
    /**
3385 varun.gupt 61
     * Returns the count of successful payments done using a given coupon
62
     * 
63
     * @param couponCode
64
     */
3430 rajveer 65
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 66
 
67
    /**
68
     * Returns the doc string of the rule module
69
     * 
70
     * @param ruleName
71
     */
3430 rajveer 72
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 73
 
4189 varun.gupt 74
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
75
 
4494 varun.gupt 76
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
77
 
5469 rajveer 78
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
79
 
80
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
81
 
82
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
83
 
1982 varun.gupt 84
  }
85
 
3430 rajveer 86
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 87
 
3430 rajveer 88
    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 89
 
3430 rajveer 90
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
91
 
92
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
93
 
94
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
95
 
96
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
97
 
98
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
99
 
100
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
101
 
102
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
103
 
6250 amit.gupta 104
    public void createCoupon(long promotionId, long endOn, String email, long amount, long usage, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
105
 
3430 rajveer 106
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
107
 
108
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
109
 
4189 varun.gupt 110
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
111
 
4494 varun.gupt 112
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
113
 
5469 rajveer 114
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
115
 
116
    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;
117
 
118
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
119
 
3430 rajveer 120
  }
121
 
122
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
123
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
124
      public Factory() {}
125
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
126
        return new Client(prot);
127
      }
128
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
129
        return new Client(iprot, oprot);
130
      }
1982 varun.gupt 131
    }
132
 
3430 rajveer 133
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 134
    {
3430 rajveer 135
      super(prot, prot);
1982 varun.gupt 136
    }
137
 
3430 rajveer 138
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
139
      super(iprot, oprot);
1982 varun.gupt 140
    }
141
 
3430 rajveer 142
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 143
    {
144
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
145
      recv_createPromotion();
146
    }
147
 
3430 rajveer 148
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 149
    {
150
      createPromotion_args args = new createPromotion_args();
3430 rajveer 151
      args.setName(name);
152
      args.setRuleExecutionSrc(ruleExecutionSrc);
153
      args.setStartOn(startOn);
154
      args.setEndOn(endOn);
155
      sendBase("createPromotion", args);
1982 varun.gupt 156
    }
157
 
3430 rajveer 158
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 159
    {
160
      createPromotion_result result = new createPromotion_result();
3430 rajveer 161
      receiveBase(result, "createPromotion");
1982 varun.gupt 162
      if (result.pex != null) {
163
        throw result.pex;
164
      }
165
      return;
166
    }
167
 
3430 rajveer 168
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 169
    {
170
      send_getAllPromotions();
171
      return recv_getAllPromotions();
172
    }
173
 
3430 rajveer 174
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 175
    {
176
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 177
      sendBase("getAllPromotions", args);
1982 varun.gupt 178
    }
179
 
3430 rajveer 180
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 181
    {
182
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 183
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 184
      if (result.isSetSuccess()) {
185
        return result.success;
186
      }
187
      if (result.pex != null) {
188
        throw result.pex;
189
      }
3430 rajveer 190
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 191
    }
192
 
3430 rajveer 193
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 194
    {
195
      send_getPromotionById(promotionId);
196
      return recv_getPromotionById();
197
    }
198
 
3430 rajveer 199
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 200
    {
201
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 202
      args.setPromotionId(promotionId);
203
      sendBase("getPromotionById", args);
1982 varun.gupt 204
    }
205
 
3430 rajveer 206
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 207
    {
208
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 209
      receiveBase(result, "getPromotionById");
1982 varun.gupt 210
      if (result.isSetSuccess()) {
211
        return result.success;
212
      }
213
      if (result.pex != null) {
214
        throw result.pex;
215
      }
3430 rajveer 216
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 217
    }
218
 
3430 rajveer 219
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 220
    {
221
      send_generateCouponsForPromotion(promotionId, couponCode);
222
      recv_generateCouponsForPromotion();
223
    }
224
 
3430 rajveer 225
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 226
    {
227
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 228
      args.setPromotionId(promotionId);
229
      args.setCouponCode(couponCode);
230
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 231
    }
232
 
3430 rajveer 233
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 234
    {
235
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 236
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 237
      if (result.pex != null) {
238
        throw result.pex;
239
      }
240
      return;
241
    }
242
 
3430 rajveer 243
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 244
    {
245
      send_applyCoupon(couponCode, cartId);
246
      return recv_applyCoupon();
247
    }
248
 
3430 rajveer 249
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 250
    {
251
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 252
      args.setCouponCode(couponCode);
253
      args.setCartId(cartId);
254
      sendBase("applyCoupon", args);
1982 varun.gupt 255
    }
256
 
3430 rajveer 257
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 258
    {
259
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 260
      receiveBase(result, "applyCoupon");
1982 varun.gupt 261
      if (result.isSetSuccess()) {
262
        return result.success;
263
      }
264
      if (result.pex != null) {
265
        throw result.pex;
266
      }
3430 rajveer 267
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 268
    }
269
 
3430 rajveer 270
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 271
    {
272
      send_trackCouponUsage(couponCode, transactionId, userId);
273
      recv_trackCouponUsage();
274
    }
275
 
3430 rajveer 276
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 277
    {
278
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 279
      args.setCouponCode(couponCode);
280
      args.setTransactionId(transactionId);
281
      args.setUserId(userId);
282
      sendBase("trackCouponUsage", args);
1982 varun.gupt 283
    }
284
 
3430 rajveer 285
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 286
    {
287
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 288
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 289
      if (result.pex != null) {
290
        throw result.pex;
291
      }
292
      return;
293
    }
294
 
3430 rajveer 295
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 296
    {
297
      send_getCouponUsageCountByUser(couponCode, userId);
298
      return recv_getCouponUsageCountByUser();
299
    }
300
 
3430 rajveer 301
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 302
    {
303
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 304
      args.setCouponCode(couponCode);
305
      args.setUserId(userId);
306
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 307
    }
308
 
3430 rajveer 309
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 310
    {
311
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 312
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 313
      if (result.isSetSuccess()) {
314
        return result.success;
315
      }
316
      if (result.pex != null) {
317
        throw result.pex;
318
      }
3430 rajveer 319
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 320
    }
321
 
3430 rajveer 322
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 323
    {
324
      send_getActiveCoupons();
325
      return recv_getActiveCoupons();
326
    }
327
 
3430 rajveer 328
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 329
    {
330
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 331
      sendBase("getActiveCoupons", args);
3385 varun.gupt 332
    }
333
 
3430 rajveer 334
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 335
    {
336
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 337
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 338
      if (result.isSetSuccess()) {
339
        return result.success;
340
      }
341
      if (result.pex != null) {
342
        throw result.pex;
343
      }
3430 rajveer 344
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 345
    }
346
 
6250 amit.gupta 347
    public String createCoupon(long promotionId, long endOn, String email, long amount, long usage) throws PromotionException, org.apache.thrift.TException
348
    {
349
      send_createCoupon(promotionId, endOn, email, amount, usage);
350
      return recv_createCoupon();
351
    }
352
 
353
    public void send_createCoupon(long promotionId, long endOn, String email, long amount, long usage) throws org.apache.thrift.TException
354
    {
355
      createCoupon_args args = new createCoupon_args();
356
      args.setPromotionId(promotionId);
357
      args.setEndOn(endOn);
358
      args.setEmail(email);
359
      args.setAmount(amount);
360
      args.setUsage(usage);
361
      sendBase("createCoupon", args);
362
    }
363
 
364
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
365
    {
366
      createCoupon_result result = new createCoupon_result();
367
      receiveBase(result, "createCoupon");
368
      if (result.isSetSuccess()) {
369
        return result.success;
370
      }
371
      if (result.pex != null) {
372
        throw result.pex;
373
      }
374
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
375
    }
376
 
3430 rajveer 377
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 378
    {
379
      send_getSuccessfulPaymentCountForCoupon(couponCode);
380
      return recv_getSuccessfulPaymentCountForCoupon();
381
    }
382
 
3430 rajveer 383
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 384
    {
385
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 386
      args.setCouponCode(couponCode);
387
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 388
    }
389
 
3430 rajveer 390
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 391
    {
392
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 393
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 394
      if (result.isSetSuccess()) {
395
        return result.success;
396
      }
397
      if (result.pex != null) {
398
        throw result.pex;
399
      }
3430 rajveer 400
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 401
    }
402
 
3430 rajveer 403
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 404
    {
405
      send_getRuleDocString(ruleName);
406
      return recv_getRuleDocString();
407
    }
408
 
3430 rajveer 409
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 410
    {
411
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 412
      args.setRuleName(ruleName);
413
      sendBase("getRuleDocString", args);
3385 varun.gupt 414
    }
415
 
3430 rajveer 416
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 417
    {
418
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 419
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 420
      if (result.isSetSuccess()) {
421
        return result.success;
422
      }
3430 rajveer 423
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 424
    }
425
 
4189 varun.gupt 426
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
427
    {
428
      send_getItemDiscountMap(itemIds);
429
      return recv_getItemDiscountMap();
430
    }
431
 
432
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
433
    {
434
      getItemDiscountMap_args args = new getItemDiscountMap_args();
435
      args.setItemIds(itemIds);
436
      sendBase("getItemDiscountMap", args);
437
    }
438
 
439
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
440
    {
441
      getItemDiscountMap_result result = new getItemDiscountMap_result();
442
      receiveBase(result, "getItemDiscountMap");
443
      if (result.isSetSuccess()) {
444
        return result.success;
445
      }
446
      if (result.pex != null) {
447
        throw result.pex;
448
      }
449
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
450
    }
451
 
4494 varun.gupt 452
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
453
    {
454
      send_getDiscountsForEntity(entityId);
455
      return recv_getDiscountsForEntity();
456
    }
457
 
458
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
459
    {
460
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
461
      args.setEntityId(entityId);
462
      sendBase("getDiscountsForEntity", args);
463
    }
464
 
465
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
466
    {
467
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
468
      receiveBase(result, "getDiscountsForEntity");
469
      if (result.isSetSuccess()) {
470
        return result.success;
471
      }
472
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
473
    }
474
 
5469 rajveer 475
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
476
    {
477
      send_addVoucher(voucher);
478
      recv_addVoucher();
479
    }
480
 
481
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
482
    {
483
      addVoucher_args args = new addVoucher_args();
484
      args.setVoucher(voucher);
485
      sendBase("addVoucher", args);
486
    }
487
 
488
    public void recv_addVoucher() throws org.apache.thrift.TException
489
    {
490
      addVoucher_result result = new addVoucher_result();
491
      receiveBase(result, "addVoucher");
492
      return;
493
    }
494
 
495
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
496
    {
497
      send_assignVoucher(userId, userEmail, voucherType, amount);
498
      return recv_assignVoucher();
499
    }
500
 
501
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
502
    {
503
      assignVoucher_args args = new assignVoucher_args();
504
      args.setUserId(userId);
505
      args.setUserEmail(userEmail);
506
      args.setVoucherType(voucherType);
507
      args.setAmount(amount);
508
      sendBase("assignVoucher", args);
509
    }
510
 
511
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
512
    {
513
      assignVoucher_result result = new assignVoucher_result();
514
      receiveBase(result, "assignVoucher");
515
      if (result.isSetSuccess()) {
516
        return result.success;
517
      }
518
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
519
    }
520
 
521
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
522
    {
523
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
524
      return recv_markVoucherAsRedeemed();
525
    }
526
 
527
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
528
    {
529
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
530
      args.setVoucherCode(voucherCode);
531
      args.setRedeemedOn(redeemedOn);
532
      sendBase("markVoucherAsRedeemed", args);
533
    }
534
 
535
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
536
    {
537
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
538
      receiveBase(result, "markVoucherAsRedeemed");
539
      if (result.isSetSuccess()) {
540
        return result.success;
541
      }
542
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
543
    }
544
 
1982 varun.gupt 545
  }
3430 rajveer 546
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
547
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
548
      private org.apache.thrift.async.TAsyncClientManager clientManager;
549
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
550
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
551
        this.clientManager = clientManager;
552
        this.protocolFactory = protocolFactory;
553
      }
554
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
555
        return new AsyncClient(protocolFactory, clientManager, transport);
556
      }
1982 varun.gupt 557
    }
558
 
3430 rajveer 559
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
560
      super(protocolFactory, clientManager, transport);
561
    }
1982 varun.gupt 562
 
3430 rajveer 563
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
564
      checkReady();
565
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
566
      this.___currentMethod = method_call;
567
      ___manager.call(method_call);
1982 varun.gupt 568
    }
569
 
3430 rajveer 570
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
571
      private String name;
572
      private String ruleExecutionSrc;
573
      private long startOn;
574
      private long endOn;
575
      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 {
576
        super(client, protocolFactory, transport, resultHandler, false);
577
        this.name = name;
578
        this.ruleExecutionSrc = ruleExecutionSrc;
579
        this.startOn = startOn;
580
        this.endOn = endOn;
1982 varun.gupt 581
      }
582
 
3430 rajveer 583
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
584
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 585
        createPromotion_args args = new createPromotion_args();
3430 rajveer 586
        args.setName(name);
587
        args.setRuleExecutionSrc(ruleExecutionSrc);
588
        args.setStartOn(startOn);
589
        args.setEndOn(endOn);
590
        args.write(prot);
591
        prot.writeMessageEnd();
1982 varun.gupt 592
      }
593
 
3430 rajveer 594
      public void getResult() throws PromotionException, org.apache.thrift.TException {
595
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
596
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 597
        }
3430 rajveer 598
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
599
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
600
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 601
      }
3430 rajveer 602
    }
1982 varun.gupt 603
 
3430 rajveer 604
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
605
      checkReady();
606
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
607
      this.___currentMethod = method_call;
608
      ___manager.call(method_call);
1982 varun.gupt 609
    }
610
 
3430 rajveer 611
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
612
      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 {
613
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 614
      }
615
 
3430 rajveer 616
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
617
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
618
        getAllPromotions_args args = new getAllPromotions_args();
619
        args.write(prot);
620
        prot.writeMessageEnd();
621
      }
1982 varun.gupt 622
 
3430 rajveer 623
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
624
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
625
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 626
        }
3430 rajveer 627
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
628
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
629
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 630
      }
3430 rajveer 631
    }
1982 varun.gupt 632
 
3430 rajveer 633
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
634
      checkReady();
635
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
636
      this.___currentMethod = method_call;
637
      ___manager.call(method_call);
1982 varun.gupt 638
    }
639
 
3430 rajveer 640
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
641
      private long promotionId;
642
      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 {
643
        super(client, protocolFactory, transport, resultHandler, false);
644
        this.promotionId = promotionId;
1982 varun.gupt 645
      }
646
 
3430 rajveer 647
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
648
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
649
        getPromotionById_args args = new getPromotionById_args();
650
        args.setPromotionId(promotionId);
651
        args.write(prot);
652
        prot.writeMessageEnd();
653
      }
1982 varun.gupt 654
 
3430 rajveer 655
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
656
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
657
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 658
        }
3430 rajveer 659
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
660
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
661
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 662
      }
3430 rajveer 663
    }
1982 varun.gupt 664
 
3430 rajveer 665
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
666
      checkReady();
667
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
668
      this.___currentMethod = method_call;
669
      ___manager.call(method_call);
1982 varun.gupt 670
    }
671
 
3430 rajveer 672
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
673
      private long promotionId;
674
      private String couponCode;
675
      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 {
676
        super(client, protocolFactory, transport, resultHandler, false);
677
        this.promotionId = promotionId;
678
        this.couponCode = couponCode;
1982 varun.gupt 679
      }
680
 
3430 rajveer 681
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
682
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
683
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
684
        args.setPromotionId(promotionId);
685
        args.setCouponCode(couponCode);
686
        args.write(prot);
687
        prot.writeMessageEnd();
3385 varun.gupt 688
      }
689
 
3430 rajveer 690
      public void getResult() throws PromotionException, org.apache.thrift.TException {
691
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
692
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 693
        }
3430 rajveer 694
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
695
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
696
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 697
      }
698
    }
699
 
3430 rajveer 700
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
701
      checkReady();
702
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
703
      this.___currentMethod = method_call;
704
      ___manager.call(method_call);
3385 varun.gupt 705
    }
706
 
3430 rajveer 707
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
708
      private String couponCode;
709
      private long cartId;
710
      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 {
711
        super(client, protocolFactory, transport, resultHandler, false);
712
        this.couponCode = couponCode;
713
        this.cartId = cartId;
1982 varun.gupt 714
      }
715
 
3430 rajveer 716
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
717
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
718
        applyCoupon_args args = new applyCoupon_args();
719
        args.setCouponCode(couponCode);
720
        args.setCartId(cartId);
721
        args.write(prot);
722
        prot.writeMessageEnd();
1982 varun.gupt 723
      }
724
 
3430 rajveer 725
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
726
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
727
          throw new IllegalStateException("Method call not finished!");
728
        }
729
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
730
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
731
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 732
      }
3430 rajveer 733
    }
1982 varun.gupt 734
 
3430 rajveer 735
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
736
      checkReady();
737
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
738
      this.___currentMethod = method_call;
739
      ___manager.call(method_call);
740
    }
1982 varun.gupt 741
 
3430 rajveer 742
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
743
      private String couponCode;
744
      private long transactionId;
745
      private long userId;
746
      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 {
747
        super(client, protocolFactory, transport, resultHandler, false);
748
        this.couponCode = couponCode;
749
        this.transactionId = transactionId;
750
        this.userId = userId;
1982 varun.gupt 751
      }
752
 
3430 rajveer 753
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
754
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
755
        trackCouponUsage_args args = new trackCouponUsage_args();
756
        args.setCouponCode(couponCode);
757
        args.setTransactionId(transactionId);
758
        args.setUserId(userId);
759
        args.write(prot);
760
        prot.writeMessageEnd();
1982 varun.gupt 761
      }
762
 
3430 rajveer 763
      public void getResult() throws PromotionException, org.apache.thrift.TException {
764
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
765
          throw new IllegalStateException("Method call not finished!");
766
        }
767
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
768
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
769
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 770
      }
771
    }
772
 
3430 rajveer 773
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
774
      checkReady();
775
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
776
      this.___currentMethod = method_call;
777
      ___manager.call(method_call);
1982 varun.gupt 778
    }
779
 
3430 rajveer 780
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
781
      private String couponCode;
782
      private long userId;
783
      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 {
784
        super(client, protocolFactory, transport, resultHandler, false);
785
        this.couponCode = couponCode;
786
        this.userId = userId;
787
      }
1982 varun.gupt 788
 
3430 rajveer 789
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
790
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
791
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
792
        args.setCouponCode(couponCode);
793
        args.setUserId(userId);
794
        args.write(prot);
795
        prot.writeMessageEnd();
796
      }
1982 varun.gupt 797
 
3430 rajveer 798
      public long getResult() throws PromotionException, org.apache.thrift.TException {
799
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
800
          throw new IllegalStateException("Method call not finished!");
801
        }
802
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
803
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
804
        return (new Client(prot)).recv_getCouponUsageCountByUser();
805
      }
1982 varun.gupt 806
    }
807
 
3430 rajveer 808
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
809
      checkReady();
810
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
811
      this.___currentMethod = method_call;
812
      ___manager.call(method_call);
1982 varun.gupt 813
    }
814
 
3430 rajveer 815
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
816
      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 {
817
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 818
      }
819
 
3430 rajveer 820
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
821
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
822
        getActiveCoupons_args args = new getActiveCoupons_args();
823
        args.write(prot);
824
        prot.writeMessageEnd();
825
      }
1982 varun.gupt 826
 
3430 rajveer 827
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
828
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
829
          throw new IllegalStateException("Method call not finished!");
830
        }
831
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
832
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
833
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 834
      }
835
    }
836
 
6250 amit.gupta 837
    public void createCoupon(long promotionId, long endOn, String email, long amount, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
838
      checkReady();
839
      createCoupon_call method_call = new createCoupon_call(promotionId, endOn, email, amount, usage, resultHandler, this, ___protocolFactory, ___transport);
840
      this.___currentMethod = method_call;
841
      ___manager.call(method_call);
842
    }
843
 
844
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
845
      private long promotionId;
846
      private long endOn;
847
      private String email;
848
      private long amount;
849
      private long usage;
850
      public createCoupon_call(long promotionId, long endOn, String email, long amount, 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 {
851
        super(client, protocolFactory, transport, resultHandler, false);
852
        this.promotionId = promotionId;
853
        this.endOn = endOn;
854
        this.email = email;
855
        this.amount = amount;
856
        this.usage = usage;
857
      }
858
 
859
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
860
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
861
        createCoupon_args args = new createCoupon_args();
862
        args.setPromotionId(promotionId);
863
        args.setEndOn(endOn);
864
        args.setEmail(email);
865
        args.setAmount(amount);
866
        args.setUsage(usage);
867
        args.write(prot);
868
        prot.writeMessageEnd();
869
      }
870
 
871
      public String getResult() throws PromotionException, org.apache.thrift.TException {
872
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
873
          throw new IllegalStateException("Method call not finished!");
874
        }
875
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
876
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
877
        return (new Client(prot)).recv_createCoupon();
878
      }
879
    }
880
 
3430 rajveer 881
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
882
      checkReady();
883
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
884
      this.___currentMethod = method_call;
885
      ___manager.call(method_call);
1982 varun.gupt 886
    }
887
 
3430 rajveer 888
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
889
      private String couponCode;
890
      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 {
891
        super(client, protocolFactory, transport, resultHandler, false);
892
        this.couponCode = couponCode;
1982 varun.gupt 893
      }
894
 
3430 rajveer 895
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
896
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
897
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
898
        args.setCouponCode(couponCode);
899
        args.write(prot);
900
        prot.writeMessageEnd();
901
      }
1982 varun.gupt 902
 
3430 rajveer 903
      public long getResult() throws PromotionException, org.apache.thrift.TException {
904
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
905
          throw new IllegalStateException("Method call not finished!");
906
        }
907
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
908
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
909
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
910
      }
1982 varun.gupt 911
    }
912
 
3430 rajveer 913
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
914
      checkReady();
915
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
916
      this.___currentMethod = method_call;
917
      ___manager.call(method_call);
1982 varun.gupt 918
    }
919
 
3430 rajveer 920
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
921
      private String ruleName;
922
      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 {
923
        super(client, protocolFactory, transport, resultHandler, false);
924
        this.ruleName = ruleName;
925
      }
1982 varun.gupt 926
 
3430 rajveer 927
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
928
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
929
        getRuleDocString_args args = new getRuleDocString_args();
930
        args.setRuleName(ruleName);
931
        args.write(prot);
932
        prot.writeMessageEnd();
1982 varun.gupt 933
      }
934
 
3430 rajveer 935
      public String getResult() throws org.apache.thrift.TException {
936
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
937
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 938
        }
3430 rajveer 939
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
940
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
941
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 942
      }
943
    }
944
 
4189 varun.gupt 945
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
946
      checkReady();
947
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
948
      this.___currentMethod = method_call;
949
      ___manager.call(method_call);
950
    }
951
 
952
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
953
      private List<Long> itemIds;
954
      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 {
955
        super(client, protocolFactory, transport, resultHandler, false);
956
        this.itemIds = itemIds;
957
      }
958
 
959
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
960
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
961
        getItemDiscountMap_args args = new getItemDiscountMap_args();
962
        args.setItemIds(itemIds);
963
        args.write(prot);
964
        prot.writeMessageEnd();
965
      }
966
 
967
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
968
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
969
          throw new IllegalStateException("Method call not finished!");
970
        }
971
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
972
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
973
        return (new Client(prot)).recv_getItemDiscountMap();
974
      }
975
    }
976
 
4494 varun.gupt 977
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
978
      checkReady();
979
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
980
      this.___currentMethod = method_call;
981
      ___manager.call(method_call);
982
    }
983
 
984
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
985
      private long entityId;
986
      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 {
987
        super(client, protocolFactory, transport, resultHandler, false);
988
        this.entityId = entityId;
989
      }
990
 
991
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
992
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
993
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
994
        args.setEntityId(entityId);
995
        args.write(prot);
996
        prot.writeMessageEnd();
997
      }
998
 
999
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1000
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1001
          throw new IllegalStateException("Method call not finished!");
1002
        }
1003
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1004
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1005
        return (new Client(prot)).recv_getDiscountsForEntity();
1006
      }
1007
    }
1008
 
5469 rajveer 1009
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1010
      checkReady();
1011
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1012
      this.___currentMethod = method_call;
1013
      ___manager.call(method_call);
1014
    }
1015
 
1016
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1017
      private Voucher voucher;
1018
      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 {
1019
        super(client, protocolFactory, transport, resultHandler, false);
1020
        this.voucher = voucher;
1021
      }
1022
 
1023
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1024
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1025
        addVoucher_args args = new addVoucher_args();
1026
        args.setVoucher(voucher);
1027
        args.write(prot);
1028
        prot.writeMessageEnd();
1029
      }
1030
 
1031
      public void getResult() throws org.apache.thrift.TException {
1032
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1033
          throw new IllegalStateException("Method call not finished!");
1034
        }
1035
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1036
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1037
        (new Client(prot)).recv_addVoucher();
1038
      }
1039
    }
1040
 
1041
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1042
      checkReady();
1043
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1044
      this.___currentMethod = method_call;
1045
      ___manager.call(method_call);
1046
    }
1047
 
1048
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1049
      private long userId;
1050
      private String userEmail;
1051
      private VoucherType voucherType;
1052
      private long amount;
1053
      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 {
1054
        super(client, protocolFactory, transport, resultHandler, false);
1055
        this.userId = userId;
1056
        this.userEmail = userEmail;
1057
        this.voucherType = voucherType;
1058
        this.amount = amount;
1059
      }
1060
 
1061
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1062
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1063
        assignVoucher_args args = new assignVoucher_args();
1064
        args.setUserId(userId);
1065
        args.setUserEmail(userEmail);
1066
        args.setVoucherType(voucherType);
1067
        args.setAmount(amount);
1068
        args.write(prot);
1069
        prot.writeMessageEnd();
1070
      }
1071
 
1072
      public Voucher getResult() throws org.apache.thrift.TException {
1073
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1074
          throw new IllegalStateException("Method call not finished!");
1075
        }
1076
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1077
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1078
        return (new Client(prot)).recv_assignVoucher();
1079
      }
1080
    }
1081
 
1082
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1083
      checkReady();
1084
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1085
      this.___currentMethod = method_call;
1086
      ___manager.call(method_call);
1087
    }
1088
 
1089
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1090
      private String voucherCode;
1091
      private long redeemedOn;
1092
      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 {
1093
        super(client, protocolFactory, transport, resultHandler, false);
1094
        this.voucherCode = voucherCode;
1095
        this.redeemedOn = redeemedOn;
1096
      }
1097
 
1098
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1099
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1100
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1101
        args.setVoucherCode(voucherCode);
1102
        args.setRedeemedOn(redeemedOn);
1103
        args.write(prot);
1104
        prot.writeMessageEnd();
1105
      }
1106
 
1107
      public boolean getResult() throws org.apache.thrift.TException {
1108
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1109
          throw new IllegalStateException("Method call not finished!");
1110
        }
1111
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1112
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1113
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1114
      }
1115
    }
1116
 
3430 rajveer 1117
  }
1982 varun.gupt 1118
 
3430 rajveer 1119
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1120
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1121
    public Processor(I iface) {
1122
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1123
    }
1124
 
3430 rajveer 1125
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1126
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1127
    }
1128
 
3430 rajveer 1129
    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) {
1130
      processMap.put("createPromotion", new createPromotion());
1131
      processMap.put("getAllPromotions", new getAllPromotions());
1132
      processMap.put("getPromotionById", new getPromotionById());
1133
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1134
      processMap.put("applyCoupon", new applyCoupon());
1135
      processMap.put("trackCouponUsage", new trackCouponUsage());
1136
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
1137
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1138
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1139
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1140
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1141
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1142
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1143
      processMap.put("addVoucher", new addVoucher());
1144
      processMap.put("assignVoucher", new assignVoucher());
1145
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1146
      return processMap;
1982 varun.gupt 1147
    }
1148
 
3430 rajveer 1149
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1150
      public createPromotion() {
1151
        super("createPromotion");
1152
      }
1982 varun.gupt 1153
 
3430 rajveer 1154
      protected createPromotion_args getEmptyArgsInstance() {
1155
        return new createPromotion_args();
1156
      }
1982 varun.gupt 1157
 
3430 rajveer 1158
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1159
        createPromotion_result result = new createPromotion_result();
1160
        try {
1161
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1162
        } catch (PromotionException pex) {
1163
          result.pex = pex;
1982 varun.gupt 1164
        }
3430 rajveer 1165
        return result;
1982 varun.gupt 1166
      }
3430 rajveer 1167
    }
1982 varun.gupt 1168
 
3430 rajveer 1169
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1170
      public getAllPromotions() {
1171
        super("getAllPromotions");
1982 varun.gupt 1172
      }
1173
 
3430 rajveer 1174
      protected getAllPromotions_args getEmptyArgsInstance() {
1175
        return new getAllPromotions_args();
1982 varun.gupt 1176
      }
1177
 
3430 rajveer 1178
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1179
        getAllPromotions_result result = new getAllPromotions_result();
1180
        try {
1181
          result.success = iface.getAllPromotions();
1182
        } catch (PromotionException pex) {
1183
          result.pex = pex;
1184
        }
1185
        return result;
1982 varun.gupt 1186
      }
3430 rajveer 1187
    }
1982 varun.gupt 1188
 
3430 rajveer 1189
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1190
      public getPromotionById() {
1191
        super("getPromotionById");
1982 varun.gupt 1192
      }
1193
 
3430 rajveer 1194
      protected getPromotionById_args getEmptyArgsInstance() {
1195
        return new getPromotionById_args();
1982 varun.gupt 1196
      }
1197
 
3430 rajveer 1198
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1199
        getPromotionById_result result = new getPromotionById_result();
1200
        try {
1201
          result.success = iface.getPromotionById(args.promotionId);
1202
        } catch (PromotionException pex) {
1203
          result.pex = pex;
1204
        }
1205
        return result;
1982 varun.gupt 1206
      }
1207
    }
1208
 
3430 rajveer 1209
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1210
      public generateCouponsForPromotion() {
1211
        super("generateCouponsForPromotion");
1212
      }
1982 varun.gupt 1213
 
3430 rajveer 1214
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1215
        return new generateCouponsForPromotion_args();
1216
      }
1982 varun.gupt 1217
 
3430 rajveer 1218
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1219
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1220
        try {
1221
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1222
        } catch (PromotionException pex) {
1223
          result.pex = pex;
1224
        }
1225
        return result;
1226
      }
1982 varun.gupt 1227
    }
1228
 
3430 rajveer 1229
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1230
      public applyCoupon() {
1231
        super("applyCoupon");
1232
      }
1982 varun.gupt 1233
 
3430 rajveer 1234
      protected applyCoupon_args getEmptyArgsInstance() {
1235
        return new applyCoupon_args();
1236
      }
1982 varun.gupt 1237
 
3430 rajveer 1238
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1239
        applyCoupon_result result = new applyCoupon_result();
1240
        try {
1241
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1242
        } catch (PromotionException pex) {
1243
          result.pex = pex;
1244
        }
1245
        return result;
1982 varun.gupt 1246
      }
1247
    }
1248
 
3430 rajveer 1249
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1250
      public trackCouponUsage() {
1251
        super("trackCouponUsage");
1252
      }
1982 varun.gupt 1253
 
3430 rajveer 1254
      protected trackCouponUsage_args getEmptyArgsInstance() {
1255
        return new trackCouponUsage_args();
1982 varun.gupt 1256
      }
1257
 
3430 rajveer 1258
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1259
        trackCouponUsage_result result = new trackCouponUsage_result();
1260
        try {
1261
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1262
        } catch (PromotionException pex) {
1263
          result.pex = pex;
1264
        }
1265
        return result;
1266
      }
1982 varun.gupt 1267
    }
1268
 
3430 rajveer 1269
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1270
      public getCouponUsageCountByUser() {
1271
        super("getCouponUsageCountByUser");
1982 varun.gupt 1272
      }
1273
 
3430 rajveer 1274
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1275
        return new getCouponUsageCountByUser_args();
1276
      }
1982 varun.gupt 1277
 
3430 rajveer 1278
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1279
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1280
        try {
1281
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1282
          result.setSuccessIsSet(true);
1283
        } catch (PromotionException pex) {
1284
          result.pex = pex;
1285
        }
1286
        return result;
1287
      }
1982 varun.gupt 1288
    }
1289
 
3430 rajveer 1290
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1291
      public getActiveCoupons() {
1292
        super("getActiveCoupons");
1293
      }
1982 varun.gupt 1294
 
3430 rajveer 1295
      protected getActiveCoupons_args getEmptyArgsInstance() {
1296
        return new getActiveCoupons_args();
1297
      }
1982 varun.gupt 1298
 
3430 rajveer 1299
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1300
        getActiveCoupons_result result = new getActiveCoupons_result();
1301
        try {
1302
          result.success = iface.getActiveCoupons();
1303
        } catch (PromotionException pex) {
1304
          result.pex = pex;
1305
        }
1306
        return result;
1307
      }
1982 varun.gupt 1308
    }
1309
 
6250 amit.gupta 1310
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
1311
      public createCoupon() {
1312
        super("createCoupon");
1313
      }
1314
 
1315
      protected createCoupon_args getEmptyArgsInstance() {
1316
        return new createCoupon_args();
1317
      }
1318
 
1319
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
1320
        createCoupon_result result = new createCoupon_result();
1321
        try {
1322
          result.success = iface.createCoupon(args.promotionId, args.endOn, args.email, args.amount, args.usage);
1323
        } catch (PromotionException pex) {
1324
          result.pex = pex;
1325
        }
1326
        return result;
1327
      }
1328
    }
1329
 
3430 rajveer 1330
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1331
      public getSuccessfulPaymentCountForCoupon() {
1332
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1333
      }
1334
 
3430 rajveer 1335
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1336
        return new getSuccessfulPaymentCountForCoupon_args();
1337
      }
1982 varun.gupt 1338
 
3430 rajveer 1339
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1340
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1341
        try {
1342
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1343
          result.setSuccessIsSet(true);
1344
        } catch (PromotionException pex) {
1345
          result.pex = pex;
1982 varun.gupt 1346
        }
3430 rajveer 1347
        return result;
1982 varun.gupt 1348
      }
1349
    }
1350
 
3430 rajveer 1351
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1352
      public getRuleDocString() {
1353
        super("getRuleDocString");
1354
      }
1982 varun.gupt 1355
 
3430 rajveer 1356
      protected getRuleDocString_args getEmptyArgsInstance() {
1357
        return new getRuleDocString_args();
1358
      }
1982 varun.gupt 1359
 
3430 rajveer 1360
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1361
        getRuleDocString_result result = new getRuleDocString_result();
1362
        result.success = iface.getRuleDocString(args.ruleName);
1363
        return result;
1364
      }
1982 varun.gupt 1365
    }
1366
 
4189 varun.gupt 1367
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1368
      public getItemDiscountMap() {
1369
        super("getItemDiscountMap");
1370
      }
1371
 
1372
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1373
        return new getItemDiscountMap_args();
1374
      }
1375
 
1376
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1377
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1378
        try {
1379
          result.success = iface.getItemDiscountMap(args.itemIds);
1380
        } catch (PromotionException pex) {
1381
          result.pex = pex;
1382
        }
1383
        return result;
1384
      }
1385
    }
1386
 
4494 varun.gupt 1387
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1388
      public getDiscountsForEntity() {
1389
        super("getDiscountsForEntity");
1390
      }
1391
 
1392
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1393
        return new getDiscountsForEntity_args();
1394
      }
1395
 
1396
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1397
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1398
        result.success = iface.getDiscountsForEntity(args.entityId);
1399
        return result;
1400
      }
1401
    }
1402
 
5469 rajveer 1403
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
1404
      public addVoucher() {
1405
        super("addVoucher");
1406
      }
1407
 
1408
      protected addVoucher_args getEmptyArgsInstance() {
1409
        return new addVoucher_args();
1410
      }
1411
 
1412
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
1413
        addVoucher_result result = new addVoucher_result();
1414
        iface.addVoucher(args.voucher);
1415
        return result;
1416
      }
1417
    }
1418
 
1419
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
1420
      public assignVoucher() {
1421
        super("assignVoucher");
1422
      }
1423
 
1424
      protected assignVoucher_args getEmptyArgsInstance() {
1425
        return new assignVoucher_args();
1426
      }
1427
 
1428
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
1429
        assignVoucher_result result = new assignVoucher_result();
1430
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
1431
        return result;
1432
      }
1433
    }
1434
 
1435
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
1436
      public markVoucherAsRedeemed() {
1437
        super("markVoucherAsRedeemed");
1438
      }
1439
 
1440
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
1441
        return new markVoucherAsRedeemed_args();
1442
      }
1443
 
1444
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
1445
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
1446
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
1447
        result.setSuccessIsSet(true);
1448
        return result;
1449
      }
1450
    }
1451
 
1982 varun.gupt 1452
  }
1453
 
3430 rajveer 1454
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1455
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1456
 
3430 rajveer 1457
    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);
1458
    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);
1459
    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);
1460
    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 1461
 
3430 rajveer 1462
    private String name; // required
1463
    private String ruleExecutionSrc; // required
1464
    private long startOn; // required
1465
    private long endOn; // required
1982 varun.gupt 1466
 
1467
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1468
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1469
      NAME((short)1, "name"),
1470
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1471
      START_ON((short)3, "startOn"),
1472
      END_ON((short)4, "endOn");
1473
 
1474
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1475
 
1476
      static {
1477
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1478
          byName.put(field.getFieldName(), field);
1479
        }
1480
      }
1481
 
1482
      /**
1483
       * Find the _Fields constant that matches fieldId, or null if its not found.
1484
       */
1485
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1486
        switch(fieldId) {
1487
          case 1: // NAME
1488
            return NAME;
1489
          case 2: // RULE_EXECUTION_SRC
1490
            return RULE_EXECUTION_SRC;
1491
          case 3: // START_ON
1492
            return START_ON;
1493
          case 4: // END_ON
1494
            return END_ON;
1495
          default:
1496
            return null;
1497
        }
1982 varun.gupt 1498
      }
1499
 
1500
      /**
1501
       * Find the _Fields constant that matches fieldId, throwing an exception
1502
       * if it is not found.
1503
       */
1504
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1505
        _Fields fields = findByThriftId(fieldId);
1506
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1507
        return fields;
1508
      }
1509
 
1510
      /**
1511
       * Find the _Fields constant that matches name, or null if its not found.
1512
       */
1513
      public static _Fields findByName(String name) {
1514
        return byName.get(name);
1515
      }
1516
 
1517
      private final short _thriftId;
1518
      private final String _fieldName;
1519
 
1520
      _Fields(short thriftId, String fieldName) {
1521
        _thriftId = thriftId;
1522
        _fieldName = fieldName;
1523
      }
1524
 
1525
      public short getThriftFieldId() {
1526
        return _thriftId;
1527
      }
1528
 
1529
      public String getFieldName() {
1530
        return _fieldName;
1531
      }
1532
    }
1533
 
1534
    // isset id assignments
1535
    private static final int __STARTON_ISSET_ID = 0;
1536
    private static final int __ENDON_ISSET_ID = 1;
1537
    private BitSet __isset_bit_vector = new BitSet(2);
1538
 
3430 rajveer 1539
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1540
    static {
3430 rajveer 1541
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1542
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1543
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1544
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1545
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1546
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1547
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1548
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1549
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1550
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1551
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 1552
    }
1553
 
1554
    public createPromotion_args() {
1555
    }
1556
 
1557
    public createPromotion_args(
1558
      String name,
1559
      String ruleExecutionSrc,
1560
      long startOn,
1561
      long endOn)
1562
    {
1563
      this();
1564
      this.name = name;
1565
      this.ruleExecutionSrc = ruleExecutionSrc;
1566
      this.startOn = startOn;
1567
      setStartOnIsSet(true);
1568
      this.endOn = endOn;
1569
      setEndOnIsSet(true);
1570
    }
1571
 
1572
    /**
1573
     * Performs a deep copy on <i>other</i>.
1574
     */
1575
    public createPromotion_args(createPromotion_args other) {
1576
      __isset_bit_vector.clear();
1577
      __isset_bit_vector.or(other.__isset_bit_vector);
1578
      if (other.isSetName()) {
1579
        this.name = other.name;
1580
      }
1581
      if (other.isSetRuleExecutionSrc()) {
1582
        this.ruleExecutionSrc = other.ruleExecutionSrc;
1583
      }
1584
      this.startOn = other.startOn;
1585
      this.endOn = other.endOn;
1586
    }
1587
 
1588
    public createPromotion_args deepCopy() {
1589
      return new createPromotion_args(this);
1590
    }
1591
 
3430 rajveer 1592
    @Override
1593
    public void clear() {
1594
      this.name = null;
1595
      this.ruleExecutionSrc = null;
1596
      setStartOnIsSet(false);
1597
      this.startOn = 0;
1598
      setEndOnIsSet(false);
1599
      this.endOn = 0;
1982 varun.gupt 1600
    }
1601
 
1602
    public String getName() {
1603
      return this.name;
1604
    }
1605
 
3430 rajveer 1606
    public void setName(String name) {
1982 varun.gupt 1607
      this.name = name;
1608
    }
1609
 
1610
    public void unsetName() {
1611
      this.name = null;
1612
    }
1613
 
3430 rajveer 1614
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1615
    public boolean isSetName() {
1616
      return this.name != null;
1617
    }
1618
 
1619
    public void setNameIsSet(boolean value) {
1620
      if (!value) {
1621
        this.name = null;
1622
      }
1623
    }
1624
 
1625
    public String getRuleExecutionSrc() {
1626
      return this.ruleExecutionSrc;
1627
    }
1628
 
3430 rajveer 1629
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 1630
      this.ruleExecutionSrc = ruleExecutionSrc;
1631
    }
1632
 
1633
    public void unsetRuleExecutionSrc() {
1634
      this.ruleExecutionSrc = null;
1635
    }
1636
 
3430 rajveer 1637
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1638
    public boolean isSetRuleExecutionSrc() {
1639
      return this.ruleExecutionSrc != null;
1640
    }
1641
 
1642
    public void setRuleExecutionSrcIsSet(boolean value) {
1643
      if (!value) {
1644
        this.ruleExecutionSrc = null;
1645
      }
1646
    }
1647
 
1648
    public long getStartOn() {
1649
      return this.startOn;
1650
    }
1651
 
3430 rajveer 1652
    public void setStartOn(long startOn) {
1982 varun.gupt 1653
      this.startOn = startOn;
1654
      setStartOnIsSet(true);
1655
    }
1656
 
1657
    public void unsetStartOn() {
1658
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
1659
    }
1660
 
3430 rajveer 1661
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1662
    public boolean isSetStartOn() {
1663
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
1664
    }
1665
 
1666
    public void setStartOnIsSet(boolean value) {
1667
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
1668
    }
1669
 
1670
    public long getEndOn() {
1671
      return this.endOn;
1672
    }
1673
 
3430 rajveer 1674
    public void setEndOn(long endOn) {
1982 varun.gupt 1675
      this.endOn = endOn;
1676
      setEndOnIsSet(true);
1677
    }
1678
 
1679
    public void unsetEndOn() {
1680
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
1681
    }
1682
 
3430 rajveer 1683
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1684
    public boolean isSetEndOn() {
1685
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
1686
    }
1687
 
1688
    public void setEndOnIsSet(boolean value) {
1689
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
1690
    }
1691
 
1692
    public void setFieldValue(_Fields field, Object value) {
1693
      switch (field) {
1694
      case NAME:
1695
        if (value == null) {
1696
          unsetName();
1697
        } else {
1698
          setName((String)value);
1699
        }
1700
        break;
1701
 
1702
      case RULE_EXECUTION_SRC:
1703
        if (value == null) {
1704
          unsetRuleExecutionSrc();
1705
        } else {
1706
          setRuleExecutionSrc((String)value);
1707
        }
1708
        break;
1709
 
1710
      case START_ON:
1711
        if (value == null) {
1712
          unsetStartOn();
1713
        } else {
1714
          setStartOn((Long)value);
1715
        }
1716
        break;
1717
 
1718
      case END_ON:
1719
        if (value == null) {
1720
          unsetEndOn();
1721
        } else {
1722
          setEndOn((Long)value);
1723
        }
1724
        break;
1725
 
1726
      }
1727
    }
1728
 
1729
    public Object getFieldValue(_Fields field) {
1730
      switch (field) {
1731
      case NAME:
1732
        return getName();
1733
 
1734
      case RULE_EXECUTION_SRC:
1735
        return getRuleExecutionSrc();
1736
 
1737
      case START_ON:
3430 rajveer 1738
        return Long.valueOf(getStartOn());
1982 varun.gupt 1739
 
1740
      case END_ON:
3430 rajveer 1741
        return Long.valueOf(getEndOn());
1982 varun.gupt 1742
 
1743
      }
1744
      throw new IllegalStateException();
1745
    }
1746
 
3430 rajveer 1747
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1748
    public boolean isSet(_Fields field) {
1749
      if (field == null) {
1750
        throw new IllegalArgumentException();
1751
      }
1982 varun.gupt 1752
 
1753
      switch (field) {
1754
      case NAME:
1755
        return isSetName();
1756
      case RULE_EXECUTION_SRC:
1757
        return isSetRuleExecutionSrc();
1758
      case START_ON:
1759
        return isSetStartOn();
1760
      case END_ON:
1761
        return isSetEndOn();
1762
      }
1763
      throw new IllegalStateException();
1764
    }
1765
 
1766
    @Override
1767
    public boolean equals(Object that) {
1768
      if (that == null)
1769
        return false;
1770
      if (that instanceof createPromotion_args)
1771
        return this.equals((createPromotion_args)that);
1772
      return false;
1773
    }
1774
 
1775
    public boolean equals(createPromotion_args that) {
1776
      if (that == null)
1777
        return false;
1778
 
1779
      boolean this_present_name = true && this.isSetName();
1780
      boolean that_present_name = true && that.isSetName();
1781
      if (this_present_name || that_present_name) {
1782
        if (!(this_present_name && that_present_name))
1783
          return false;
1784
        if (!this.name.equals(that.name))
1785
          return false;
1786
      }
1787
 
1788
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
1789
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
1790
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
1791
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
1792
          return false;
1793
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
1794
          return false;
1795
      }
1796
 
1797
      boolean this_present_startOn = true;
1798
      boolean that_present_startOn = true;
1799
      if (this_present_startOn || that_present_startOn) {
1800
        if (!(this_present_startOn && that_present_startOn))
1801
          return false;
1802
        if (this.startOn != that.startOn)
1803
          return false;
1804
      }
1805
 
1806
      boolean this_present_endOn = true;
1807
      boolean that_present_endOn = true;
1808
      if (this_present_endOn || that_present_endOn) {
1809
        if (!(this_present_endOn && that_present_endOn))
1810
          return false;
1811
        if (this.endOn != that.endOn)
1812
          return false;
1813
      }
1814
 
1815
      return true;
1816
    }
1817
 
1818
    @Override
1819
    public int hashCode() {
1820
      return 0;
1821
    }
1822
 
1823
    public int compareTo(createPromotion_args other) {
1824
      if (!getClass().equals(other.getClass())) {
1825
        return getClass().getName().compareTo(other.getClass().getName());
1826
      }
1827
 
1828
      int lastComparison = 0;
1829
      createPromotion_args typedOther = (createPromotion_args)other;
1830
 
3430 rajveer 1831
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 1832
      if (lastComparison != 0) {
1833
        return lastComparison;
1834
      }
3430 rajveer 1835
      if (isSetName()) {
1836
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
1837
        if (lastComparison != 0) {
1838
          return lastComparison;
1839
        }
1982 varun.gupt 1840
      }
3430 rajveer 1841
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 1842
      if (lastComparison != 0) {
1843
        return lastComparison;
1844
      }
3430 rajveer 1845
      if (isSetRuleExecutionSrc()) {
1846
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
1847
        if (lastComparison != 0) {
1848
          return lastComparison;
1849
        }
1982 varun.gupt 1850
      }
3430 rajveer 1851
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 1852
      if (lastComparison != 0) {
1853
        return lastComparison;
1854
      }
3430 rajveer 1855
      if (isSetStartOn()) {
1856
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
1857
        if (lastComparison != 0) {
1858
          return lastComparison;
1859
        }
1982 varun.gupt 1860
      }
3430 rajveer 1861
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 1862
      if (lastComparison != 0) {
1863
        return lastComparison;
1864
      }
3430 rajveer 1865
      if (isSetEndOn()) {
1866
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
1867
        if (lastComparison != 0) {
1868
          return lastComparison;
1869
        }
1982 varun.gupt 1870
      }
1871
      return 0;
1872
    }
1873
 
3430 rajveer 1874
    public _Fields fieldForId(int fieldId) {
1875
      return _Fields.findByThriftId(fieldId);
1876
    }
1877
 
1878
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1879
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 1880
      iprot.readStructBegin();
1881
      while (true)
1882
      {
1883
        field = iprot.readFieldBegin();
3430 rajveer 1884
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 1885
          break;
1886
        }
3430 rajveer 1887
        switch (field.id) {
1888
          case 1: // NAME
1889
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
1890
              this.name = iprot.readString();
1891
            } else { 
1892
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1893
            }
1894
            break;
1895
          case 2: // RULE_EXECUTION_SRC
1896
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
1897
              this.ruleExecutionSrc = iprot.readString();
1898
            } else { 
1899
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1900
            }
1901
            break;
1902
          case 3: // START_ON
1903
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1904
              this.startOn = iprot.readI64();
1905
              setStartOnIsSet(true);
1906
            } else { 
1907
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1908
            }
1909
            break;
1910
          case 4: // END_ON
1911
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1912
              this.endOn = iprot.readI64();
1913
              setEndOnIsSet(true);
1914
            } else { 
1915
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1916
            }
1917
            break;
1918
          default:
1919
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 1920
        }
3430 rajveer 1921
        iprot.readFieldEnd();
1982 varun.gupt 1922
      }
1923
      iprot.readStructEnd();
1924
      validate();
1925
    }
1926
 
3430 rajveer 1927
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 1928
      validate();
1929
 
1930
      oprot.writeStructBegin(STRUCT_DESC);
1931
      if (this.name != null) {
1932
        oprot.writeFieldBegin(NAME_FIELD_DESC);
1933
        oprot.writeString(this.name);
1934
        oprot.writeFieldEnd();
1935
      }
1936
      if (this.ruleExecutionSrc != null) {
1937
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
1938
        oprot.writeString(this.ruleExecutionSrc);
1939
        oprot.writeFieldEnd();
1940
      }
1941
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
1942
      oprot.writeI64(this.startOn);
1943
      oprot.writeFieldEnd();
1944
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
1945
      oprot.writeI64(this.endOn);
1946
      oprot.writeFieldEnd();
1947
      oprot.writeFieldStop();
1948
      oprot.writeStructEnd();
1949
    }
1950
 
1951
    @Override
1952
    public String toString() {
1953
      StringBuilder sb = new StringBuilder("createPromotion_args(");
1954
      boolean first = true;
1955
 
1956
      sb.append("name:");
1957
      if (this.name == null) {
1958
        sb.append("null");
1959
      } else {
1960
        sb.append(this.name);
1961
      }
1962
      first = false;
1963
      if (!first) sb.append(", ");
1964
      sb.append("ruleExecutionSrc:");
1965
      if (this.ruleExecutionSrc == null) {
1966
        sb.append("null");
1967
      } else {
1968
        sb.append(this.ruleExecutionSrc);
1969
      }
1970
      first = false;
1971
      if (!first) sb.append(", ");
1972
      sb.append("startOn:");
1973
      sb.append(this.startOn);
1974
      first = false;
1975
      if (!first) sb.append(", ");
1976
      sb.append("endOn:");
1977
      sb.append(this.endOn);
1978
      first = false;
1979
      sb.append(")");
1980
      return sb.toString();
1981
    }
1982
 
3430 rajveer 1983
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 1984
      // check for required fields
1985
    }
1986
 
3430 rajveer 1987
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1988
      try {
1989
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1990
      } catch (org.apache.thrift.TException te) {
1991
        throw new java.io.IOException(te);
1992
      }
1993
    }
1994
 
1995
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1996
      try {
1997
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1998
        __isset_bit_vector = new BitSet(1);
1999
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2000
      } catch (org.apache.thrift.TException te) {
2001
        throw new java.io.IOException(te);
2002
      }
2003
    }
2004
 
1982 varun.gupt 2005
  }
2006
 
3430 rajveer 2007
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2008
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2009
 
3430 rajveer 2010
    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 2011
 
3430 rajveer 2012
    private PromotionException pex; // required
1982 varun.gupt 2013
 
2014
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2015
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2016
      PEX((short)1, "pex");
2017
 
2018
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2019
 
2020
      static {
2021
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2022
          byName.put(field.getFieldName(), field);
2023
        }
2024
      }
2025
 
2026
      /**
2027
       * Find the _Fields constant that matches fieldId, or null if its not found.
2028
       */
2029
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2030
        switch(fieldId) {
2031
          case 1: // PEX
2032
            return PEX;
2033
          default:
2034
            return null;
2035
        }
1982 varun.gupt 2036
      }
2037
 
2038
      /**
2039
       * Find the _Fields constant that matches fieldId, throwing an exception
2040
       * if it is not found.
2041
       */
2042
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2043
        _Fields fields = findByThriftId(fieldId);
2044
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2045
        return fields;
2046
      }
2047
 
2048
      /**
2049
       * Find the _Fields constant that matches name, or null if its not found.
2050
       */
2051
      public static _Fields findByName(String name) {
2052
        return byName.get(name);
2053
      }
2054
 
2055
      private final short _thriftId;
2056
      private final String _fieldName;
2057
 
2058
      _Fields(short thriftId, String fieldName) {
2059
        _thriftId = thriftId;
2060
        _fieldName = fieldName;
2061
      }
2062
 
2063
      public short getThriftFieldId() {
2064
        return _thriftId;
2065
      }
2066
 
2067
      public String getFieldName() {
2068
        return _fieldName;
2069
      }
2070
    }
2071
 
2072
    // isset id assignments
2073
 
3430 rajveer 2074
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2075
    static {
3430 rajveer 2076
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2077
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2078
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2079
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2080
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2081
    }
2082
 
2083
    public createPromotion_result() {
2084
    }
2085
 
2086
    public createPromotion_result(
2087
      PromotionException pex)
2088
    {
2089
      this();
2090
      this.pex = pex;
2091
    }
2092
 
2093
    /**
2094
     * Performs a deep copy on <i>other</i>.
2095
     */
2096
    public createPromotion_result(createPromotion_result other) {
2097
      if (other.isSetPex()) {
2098
        this.pex = new PromotionException(other.pex);
2099
      }
2100
    }
2101
 
2102
    public createPromotion_result deepCopy() {
2103
      return new createPromotion_result(this);
2104
    }
2105
 
3430 rajveer 2106
    @Override
2107
    public void clear() {
2108
      this.pex = null;
1982 varun.gupt 2109
    }
2110
 
2111
    public PromotionException getPex() {
2112
      return this.pex;
2113
    }
2114
 
3430 rajveer 2115
    public void setPex(PromotionException pex) {
1982 varun.gupt 2116
      this.pex = pex;
2117
    }
2118
 
2119
    public void unsetPex() {
2120
      this.pex = null;
2121
    }
2122
 
3430 rajveer 2123
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2124
    public boolean isSetPex() {
2125
      return this.pex != null;
2126
    }
2127
 
2128
    public void setPexIsSet(boolean value) {
2129
      if (!value) {
2130
        this.pex = null;
2131
      }
2132
    }
2133
 
2134
    public void setFieldValue(_Fields field, Object value) {
2135
      switch (field) {
2136
      case PEX:
2137
        if (value == null) {
2138
          unsetPex();
2139
        } else {
2140
          setPex((PromotionException)value);
2141
        }
2142
        break;
2143
 
2144
      }
2145
    }
2146
 
2147
    public Object getFieldValue(_Fields field) {
2148
      switch (field) {
2149
      case PEX:
2150
        return getPex();
2151
 
2152
      }
2153
      throw new IllegalStateException();
2154
    }
2155
 
3430 rajveer 2156
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2157
    public boolean isSet(_Fields field) {
2158
      if (field == null) {
2159
        throw new IllegalArgumentException();
2160
      }
1982 varun.gupt 2161
 
2162
      switch (field) {
2163
      case PEX:
2164
        return isSetPex();
2165
      }
2166
      throw new IllegalStateException();
2167
    }
2168
 
2169
    @Override
2170
    public boolean equals(Object that) {
2171
      if (that == null)
2172
        return false;
2173
      if (that instanceof createPromotion_result)
2174
        return this.equals((createPromotion_result)that);
2175
      return false;
2176
    }
2177
 
2178
    public boolean equals(createPromotion_result that) {
2179
      if (that == null)
2180
        return false;
2181
 
2182
      boolean this_present_pex = true && this.isSetPex();
2183
      boolean that_present_pex = true && that.isSetPex();
2184
      if (this_present_pex || that_present_pex) {
2185
        if (!(this_present_pex && that_present_pex))
2186
          return false;
2187
        if (!this.pex.equals(that.pex))
2188
          return false;
2189
      }
2190
 
2191
      return true;
2192
    }
2193
 
2194
    @Override
2195
    public int hashCode() {
2196
      return 0;
2197
    }
2198
 
2199
    public int compareTo(createPromotion_result other) {
2200
      if (!getClass().equals(other.getClass())) {
2201
        return getClass().getName().compareTo(other.getClass().getName());
2202
      }
2203
 
2204
      int lastComparison = 0;
2205
      createPromotion_result typedOther = (createPromotion_result)other;
2206
 
3430 rajveer 2207
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2208
      if (lastComparison != 0) {
2209
        return lastComparison;
2210
      }
3430 rajveer 2211
      if (isSetPex()) {
2212
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2213
        if (lastComparison != 0) {
2214
          return lastComparison;
2215
        }
1982 varun.gupt 2216
      }
2217
      return 0;
2218
    }
2219
 
3430 rajveer 2220
    public _Fields fieldForId(int fieldId) {
2221
      return _Fields.findByThriftId(fieldId);
2222
    }
2223
 
2224
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2225
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2226
      iprot.readStructBegin();
2227
      while (true)
2228
      {
2229
        field = iprot.readFieldBegin();
3430 rajveer 2230
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2231
          break;
2232
        }
3430 rajveer 2233
        switch (field.id) {
2234
          case 1: // PEX
2235
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2236
              this.pex = new PromotionException();
2237
              this.pex.read(iprot);
2238
            } else { 
2239
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2240
            }
2241
            break;
2242
          default:
2243
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2244
        }
3430 rajveer 2245
        iprot.readFieldEnd();
1982 varun.gupt 2246
      }
2247
      iprot.readStructEnd();
2248
      validate();
2249
    }
2250
 
3430 rajveer 2251
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2252
      oprot.writeStructBegin(STRUCT_DESC);
2253
 
2254
      if (this.isSetPex()) {
2255
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2256
        this.pex.write(oprot);
2257
        oprot.writeFieldEnd();
2258
      }
2259
      oprot.writeFieldStop();
2260
      oprot.writeStructEnd();
2261
    }
2262
 
2263
    @Override
2264
    public String toString() {
2265
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2266
      boolean first = true;
2267
 
2268
      sb.append("pex:");
2269
      if (this.pex == null) {
2270
        sb.append("null");
2271
      } else {
2272
        sb.append(this.pex);
2273
      }
2274
      first = false;
2275
      sb.append(")");
2276
      return sb.toString();
2277
    }
2278
 
3430 rajveer 2279
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2280
      // check for required fields
2281
    }
2282
 
3430 rajveer 2283
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2284
      try {
2285
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2286
      } catch (org.apache.thrift.TException te) {
2287
        throw new java.io.IOException(te);
2288
      }
2289
    }
2290
 
2291
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2292
      try {
2293
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2294
      } catch (org.apache.thrift.TException te) {
2295
        throw new java.io.IOException(te);
2296
      }
2297
    }
2298
 
1982 varun.gupt 2299
  }
2300
 
3430 rajveer 2301
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
2302
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 2303
 
2304
 
2305
 
2306
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2307
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2308
;
2309
 
2310
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2311
 
2312
      static {
2313
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2314
          byName.put(field.getFieldName(), field);
2315
        }
2316
      }
2317
 
2318
      /**
2319
       * Find the _Fields constant that matches fieldId, or null if its not found.
2320
       */
2321
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2322
        switch(fieldId) {
2323
          default:
2324
            return null;
2325
        }
1982 varun.gupt 2326
      }
2327
 
2328
      /**
2329
       * Find the _Fields constant that matches fieldId, throwing an exception
2330
       * if it is not found.
2331
       */
2332
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2333
        _Fields fields = findByThriftId(fieldId);
2334
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2335
        return fields;
2336
      }
2337
 
2338
      /**
2339
       * Find the _Fields constant that matches name, or null if its not found.
2340
       */
2341
      public static _Fields findByName(String name) {
2342
        return byName.get(name);
2343
      }
2344
 
2345
      private final short _thriftId;
2346
      private final String _fieldName;
2347
 
2348
      _Fields(short thriftId, String fieldName) {
2349
        _thriftId = thriftId;
2350
        _fieldName = fieldName;
2351
      }
2352
 
2353
      public short getThriftFieldId() {
2354
        return _thriftId;
2355
      }
2356
 
2357
      public String getFieldName() {
2358
        return _fieldName;
2359
      }
2360
    }
3430 rajveer 2361
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2362
    static {
3430 rajveer 2363
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2364
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2365
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 2366
    }
2367
 
2368
    public getAllPromotions_args() {
2369
    }
2370
 
2371
    /**
2372
     * Performs a deep copy on <i>other</i>.
2373
     */
2374
    public getAllPromotions_args(getAllPromotions_args other) {
2375
    }
2376
 
2377
    public getAllPromotions_args deepCopy() {
2378
      return new getAllPromotions_args(this);
2379
    }
2380
 
3430 rajveer 2381
    @Override
2382
    public void clear() {
1982 varun.gupt 2383
    }
2384
 
2385
    public void setFieldValue(_Fields field, Object value) {
2386
      switch (field) {
2387
      }
2388
    }
2389
 
2390
    public Object getFieldValue(_Fields field) {
2391
      switch (field) {
2392
      }
2393
      throw new IllegalStateException();
2394
    }
2395
 
3430 rajveer 2396
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2397
    public boolean isSet(_Fields field) {
2398
      if (field == null) {
2399
        throw new IllegalArgumentException();
2400
      }
1982 varun.gupt 2401
 
2402
      switch (field) {
2403
      }
2404
      throw new IllegalStateException();
2405
    }
2406
 
2407
    @Override
2408
    public boolean equals(Object that) {
2409
      if (that == null)
2410
        return false;
2411
      if (that instanceof getAllPromotions_args)
2412
        return this.equals((getAllPromotions_args)that);
2413
      return false;
2414
    }
2415
 
2416
    public boolean equals(getAllPromotions_args that) {
2417
      if (that == null)
2418
        return false;
2419
 
2420
      return true;
2421
    }
2422
 
2423
    @Override
2424
    public int hashCode() {
2425
      return 0;
2426
    }
2427
 
2428
    public int compareTo(getAllPromotions_args other) {
2429
      if (!getClass().equals(other.getClass())) {
2430
        return getClass().getName().compareTo(other.getClass().getName());
2431
      }
2432
 
2433
      int lastComparison = 0;
2434
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
2435
 
2436
      return 0;
2437
    }
2438
 
3430 rajveer 2439
    public _Fields fieldForId(int fieldId) {
2440
      return _Fields.findByThriftId(fieldId);
2441
    }
2442
 
2443
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2444
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2445
      iprot.readStructBegin();
2446
      while (true)
2447
      {
2448
        field = iprot.readFieldBegin();
3430 rajveer 2449
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2450
          break;
2451
        }
3430 rajveer 2452
        switch (field.id) {
2453
          default:
2454
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2455
        }
3430 rajveer 2456
        iprot.readFieldEnd();
1982 varun.gupt 2457
      }
2458
      iprot.readStructEnd();
2459
      validate();
2460
    }
2461
 
3430 rajveer 2462
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2463
      validate();
2464
 
2465
      oprot.writeStructBegin(STRUCT_DESC);
2466
      oprot.writeFieldStop();
2467
      oprot.writeStructEnd();
2468
    }
2469
 
2470
    @Override
2471
    public String toString() {
2472
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
2473
      boolean first = true;
2474
 
2475
      sb.append(")");
2476
      return sb.toString();
2477
    }
2478
 
3430 rajveer 2479
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2480
      // check for required fields
2481
    }
2482
 
3430 rajveer 2483
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2484
      try {
2485
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2486
      } catch (org.apache.thrift.TException te) {
2487
        throw new java.io.IOException(te);
2488
      }
2489
    }
2490
 
2491
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2492
      try {
2493
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2494
      } catch (org.apache.thrift.TException te) {
2495
        throw new java.io.IOException(te);
2496
      }
2497
    }
2498
 
1982 varun.gupt 2499
  }
2500
 
3430 rajveer 2501
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
2502
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 2503
 
3430 rajveer 2504
    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);
2505
    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 2506
 
3430 rajveer 2507
    private List<Promotion> success; // required
2508
    private PromotionException pex; // required
1982 varun.gupt 2509
 
2510
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2511
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2512
      SUCCESS((short)0, "success"),
2513
      PEX((short)1, "pex");
2514
 
2515
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2516
 
2517
      static {
2518
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2519
          byName.put(field.getFieldName(), field);
2520
        }
2521
      }
2522
 
2523
      /**
2524
       * Find the _Fields constant that matches fieldId, or null if its not found.
2525
       */
2526
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2527
        switch(fieldId) {
2528
          case 0: // SUCCESS
2529
            return SUCCESS;
2530
          case 1: // PEX
2531
            return PEX;
2532
          default:
2533
            return null;
2534
        }
1982 varun.gupt 2535
      }
2536
 
2537
      /**
2538
       * Find the _Fields constant that matches fieldId, throwing an exception
2539
       * if it is not found.
2540
       */
2541
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2542
        _Fields fields = findByThriftId(fieldId);
2543
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2544
        return fields;
2545
      }
2546
 
2547
      /**
2548
       * Find the _Fields constant that matches name, or null if its not found.
2549
       */
2550
      public static _Fields findByName(String name) {
2551
        return byName.get(name);
2552
      }
2553
 
2554
      private final short _thriftId;
2555
      private final String _fieldName;
2556
 
2557
      _Fields(short thriftId, String fieldName) {
2558
        _thriftId = thriftId;
2559
        _fieldName = fieldName;
2560
      }
2561
 
2562
      public short getThriftFieldId() {
2563
        return _thriftId;
2564
      }
2565
 
2566
      public String getFieldName() {
2567
        return _fieldName;
2568
      }
2569
    }
2570
 
2571
    // isset id assignments
2572
 
3430 rajveer 2573
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2574
    static {
3430 rajveer 2575
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2576
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2577
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
2578
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
2579
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2580
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2581
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2582
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 2583
    }
2584
 
2585
    public getAllPromotions_result() {
2586
    }
2587
 
2588
    public getAllPromotions_result(
2589
      List<Promotion> success,
2590
      PromotionException pex)
2591
    {
2592
      this();
2593
      this.success = success;
2594
      this.pex = pex;
2595
    }
2596
 
2597
    /**
2598
     * Performs a deep copy on <i>other</i>.
2599
     */
2600
    public getAllPromotions_result(getAllPromotions_result other) {
2601
      if (other.isSetSuccess()) {
2602
        List<Promotion> __this__success = new ArrayList<Promotion>();
2603
        for (Promotion other_element : other.success) {
2604
          __this__success.add(new Promotion(other_element));
2605
        }
2606
        this.success = __this__success;
2607
      }
2608
      if (other.isSetPex()) {
2609
        this.pex = new PromotionException(other.pex);
2610
      }
2611
    }
2612
 
2613
    public getAllPromotions_result deepCopy() {
2614
      return new getAllPromotions_result(this);
2615
    }
2616
 
3430 rajveer 2617
    @Override
2618
    public void clear() {
2619
      this.success = null;
2620
      this.pex = null;
1982 varun.gupt 2621
    }
2622
 
2623
    public int getSuccessSize() {
2624
      return (this.success == null) ? 0 : this.success.size();
2625
    }
2626
 
2627
    public java.util.Iterator<Promotion> getSuccessIterator() {
2628
      return (this.success == null) ? null : this.success.iterator();
2629
    }
2630
 
2631
    public void addToSuccess(Promotion elem) {
2632
      if (this.success == null) {
2633
        this.success = new ArrayList<Promotion>();
2634
      }
2635
      this.success.add(elem);
2636
    }
2637
 
2638
    public List<Promotion> getSuccess() {
2639
      return this.success;
2640
    }
2641
 
3430 rajveer 2642
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 2643
      this.success = success;
2644
    }
2645
 
2646
    public void unsetSuccess() {
2647
      this.success = null;
2648
    }
2649
 
3430 rajveer 2650
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2651
    public boolean isSetSuccess() {
2652
      return this.success != null;
2653
    }
2654
 
2655
    public void setSuccessIsSet(boolean value) {
2656
      if (!value) {
2657
        this.success = null;
2658
      }
2659
    }
2660
 
2661
    public PromotionException getPex() {
2662
      return this.pex;
2663
    }
2664
 
3430 rajveer 2665
    public void setPex(PromotionException pex) {
1982 varun.gupt 2666
      this.pex = pex;
2667
    }
2668
 
2669
    public void unsetPex() {
2670
      this.pex = null;
2671
    }
2672
 
3430 rajveer 2673
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2674
    public boolean isSetPex() {
2675
      return this.pex != null;
2676
    }
2677
 
2678
    public void setPexIsSet(boolean value) {
2679
      if (!value) {
2680
        this.pex = null;
2681
      }
2682
    }
2683
 
2684
    public void setFieldValue(_Fields field, Object value) {
2685
      switch (field) {
2686
      case SUCCESS:
2687
        if (value == null) {
2688
          unsetSuccess();
2689
        } else {
2690
          setSuccess((List<Promotion>)value);
2691
        }
2692
        break;
2693
 
2694
      case PEX:
2695
        if (value == null) {
2696
          unsetPex();
2697
        } else {
2698
          setPex((PromotionException)value);
2699
        }
2700
        break;
2701
 
2702
      }
2703
    }
2704
 
2705
    public Object getFieldValue(_Fields field) {
2706
      switch (field) {
2707
      case SUCCESS:
2708
        return getSuccess();
2709
 
2710
      case PEX:
2711
        return getPex();
2712
 
2713
      }
2714
      throw new IllegalStateException();
2715
    }
2716
 
3430 rajveer 2717
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2718
    public boolean isSet(_Fields field) {
2719
      if (field == null) {
2720
        throw new IllegalArgumentException();
2721
      }
1982 varun.gupt 2722
 
2723
      switch (field) {
2724
      case SUCCESS:
2725
        return isSetSuccess();
2726
      case PEX:
2727
        return isSetPex();
2728
      }
2729
      throw new IllegalStateException();
2730
    }
2731
 
2732
    @Override
2733
    public boolean equals(Object that) {
2734
      if (that == null)
2735
        return false;
2736
      if (that instanceof getAllPromotions_result)
2737
        return this.equals((getAllPromotions_result)that);
2738
      return false;
2739
    }
2740
 
2741
    public boolean equals(getAllPromotions_result that) {
2742
      if (that == null)
2743
        return false;
2744
 
2745
      boolean this_present_success = true && this.isSetSuccess();
2746
      boolean that_present_success = true && that.isSetSuccess();
2747
      if (this_present_success || that_present_success) {
2748
        if (!(this_present_success && that_present_success))
2749
          return false;
2750
        if (!this.success.equals(that.success))
2751
          return false;
2752
      }
2753
 
2754
      boolean this_present_pex = true && this.isSetPex();
2755
      boolean that_present_pex = true && that.isSetPex();
2756
      if (this_present_pex || that_present_pex) {
2757
        if (!(this_present_pex && that_present_pex))
2758
          return false;
2759
        if (!this.pex.equals(that.pex))
2760
          return false;
2761
      }
2762
 
2763
      return true;
2764
    }
2765
 
2766
    @Override
2767
    public int hashCode() {
2768
      return 0;
2769
    }
2770
 
2771
    public int compareTo(getAllPromotions_result other) {
2772
      if (!getClass().equals(other.getClass())) {
2773
        return getClass().getName().compareTo(other.getClass().getName());
2774
      }
2775
 
2776
      int lastComparison = 0;
2777
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
2778
 
3430 rajveer 2779
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 2780
      if (lastComparison != 0) {
2781
        return lastComparison;
2782
      }
3430 rajveer 2783
      if (isSetSuccess()) {
2784
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
2785
        if (lastComparison != 0) {
2786
          return lastComparison;
2787
        }
1982 varun.gupt 2788
      }
3430 rajveer 2789
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2790
      if (lastComparison != 0) {
2791
        return lastComparison;
2792
      }
3430 rajveer 2793
      if (isSetPex()) {
2794
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2795
        if (lastComparison != 0) {
2796
          return lastComparison;
2797
        }
1982 varun.gupt 2798
      }
2799
      return 0;
2800
    }
2801
 
3430 rajveer 2802
    public _Fields fieldForId(int fieldId) {
2803
      return _Fields.findByThriftId(fieldId);
2804
    }
2805
 
2806
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2807
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2808
      iprot.readStructBegin();
2809
      while (true)
2810
      {
2811
        field = iprot.readFieldBegin();
3430 rajveer 2812
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2813
          break;
2814
        }
3430 rajveer 2815
        switch (field.id) {
2816
          case 0: // SUCCESS
2817
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
2818
              {
5327 rajveer 2819
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
2820
                this.success = new ArrayList<Promotion>(_list12.size);
2821
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 2822
                {
5327 rajveer 2823
                  Promotion _elem14; // required
2824
                  _elem14 = new Promotion();
2825
                  _elem14.read(iprot);
2826
                  this.success.add(_elem14);
1982 varun.gupt 2827
                }
3430 rajveer 2828
                iprot.readListEnd();
1982 varun.gupt 2829
              }
3430 rajveer 2830
            } else { 
2831
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2832
            }
2833
            break;
2834
          case 1: // PEX
2835
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2836
              this.pex = new PromotionException();
2837
              this.pex.read(iprot);
2838
            } else { 
2839
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2840
            }
2841
            break;
2842
          default:
2843
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2844
        }
3430 rajveer 2845
        iprot.readFieldEnd();
1982 varun.gupt 2846
      }
2847
      iprot.readStructEnd();
2848
      validate();
2849
    }
2850
 
3430 rajveer 2851
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2852
      oprot.writeStructBegin(STRUCT_DESC);
2853
 
2854
      if (this.isSetSuccess()) {
2855
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2856
        {
3430 rajveer 2857
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 2858
          for (Promotion _iter15 : this.success)
1982 varun.gupt 2859
          {
5327 rajveer 2860
            _iter15.write(oprot);
1982 varun.gupt 2861
          }
2862
          oprot.writeListEnd();
2863
        }
2864
        oprot.writeFieldEnd();
2865
      } else if (this.isSetPex()) {
2866
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2867
        this.pex.write(oprot);
2868
        oprot.writeFieldEnd();
2869
      }
2870
      oprot.writeFieldStop();
2871
      oprot.writeStructEnd();
2872
    }
2873
 
2874
    @Override
2875
    public String toString() {
2876
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
2877
      boolean first = true;
2878
 
2879
      sb.append("success:");
2880
      if (this.success == null) {
2881
        sb.append("null");
2882
      } else {
2883
        sb.append(this.success);
2884
      }
2885
      first = false;
2886
      if (!first) sb.append(", ");
2887
      sb.append("pex:");
2888
      if (this.pex == null) {
2889
        sb.append("null");
2890
      } else {
2891
        sb.append(this.pex);
2892
      }
2893
      first = false;
2894
      sb.append(")");
2895
      return sb.toString();
2896
    }
2897
 
3430 rajveer 2898
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2899
      // check for required fields
2900
    }
2901
 
3430 rajveer 2902
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2903
      try {
2904
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2905
      } catch (org.apache.thrift.TException te) {
2906
        throw new java.io.IOException(te);
2907
      }
2908
    }
2909
 
2910
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2911
      try {
2912
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2913
      } catch (org.apache.thrift.TException te) {
2914
        throw new java.io.IOException(te);
2915
      }
2916
    }
2917
 
1982 varun.gupt 2918
  }
2919
 
3430 rajveer 2920
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
2921
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 2922
 
3430 rajveer 2923
    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 2924
 
3430 rajveer 2925
    private long promotionId; // required
1982 varun.gupt 2926
 
2927
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2928
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2929
      PROMOTION_ID((short)1, "promotionId");
2930
 
2931
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2932
 
2933
      static {
2934
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2935
          byName.put(field.getFieldName(), field);
2936
        }
2937
      }
2938
 
2939
      /**
2940
       * Find the _Fields constant that matches fieldId, or null if its not found.
2941
       */
2942
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2943
        switch(fieldId) {
2944
          case 1: // PROMOTION_ID
2945
            return PROMOTION_ID;
2946
          default:
2947
            return null;
2948
        }
1982 varun.gupt 2949
      }
2950
 
2951
      /**
2952
       * Find the _Fields constant that matches fieldId, throwing an exception
2953
       * if it is not found.
2954
       */
2955
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2956
        _Fields fields = findByThriftId(fieldId);
2957
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2958
        return fields;
2959
      }
2960
 
2961
      /**
2962
       * Find the _Fields constant that matches name, or null if its not found.
2963
       */
2964
      public static _Fields findByName(String name) {
2965
        return byName.get(name);
2966
      }
2967
 
2968
      private final short _thriftId;
2969
      private final String _fieldName;
2970
 
2971
      _Fields(short thriftId, String fieldName) {
2972
        _thriftId = thriftId;
2973
        _fieldName = fieldName;
2974
      }
2975
 
2976
      public short getThriftFieldId() {
2977
        return _thriftId;
2978
      }
2979
 
2980
      public String getFieldName() {
2981
        return _fieldName;
2982
      }
2983
    }
2984
 
2985
    // isset id assignments
2986
    private static final int __PROMOTIONID_ISSET_ID = 0;
2987
    private BitSet __isset_bit_vector = new BitSet(1);
2988
 
3430 rajveer 2989
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2990
    static {
3430 rajveer 2991
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2992
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2993
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2994
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2995
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 2996
    }
2997
 
2998
    public getPromotionById_args() {
2999
    }
3000
 
3001
    public getPromotionById_args(
3002
      long promotionId)
3003
    {
3004
      this();
3005
      this.promotionId = promotionId;
3006
      setPromotionIdIsSet(true);
3007
    }
3008
 
3009
    /**
3010
     * Performs a deep copy on <i>other</i>.
3011
     */
3012
    public getPromotionById_args(getPromotionById_args other) {
3013
      __isset_bit_vector.clear();
3014
      __isset_bit_vector.or(other.__isset_bit_vector);
3015
      this.promotionId = other.promotionId;
3016
    }
3017
 
3018
    public getPromotionById_args deepCopy() {
3019
      return new getPromotionById_args(this);
3020
    }
3021
 
3430 rajveer 3022
    @Override
3023
    public void clear() {
3024
      setPromotionIdIsSet(false);
3025
      this.promotionId = 0;
1982 varun.gupt 3026
    }
3027
 
3028
    public long getPromotionId() {
3029
      return this.promotionId;
3030
    }
3031
 
3430 rajveer 3032
    public void setPromotionId(long promotionId) {
1982 varun.gupt 3033
      this.promotionId = promotionId;
3034
      setPromotionIdIsSet(true);
3035
    }
3036
 
3037
    public void unsetPromotionId() {
3038
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3039
    }
3040
 
3430 rajveer 3041
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3042
    public boolean isSetPromotionId() {
3043
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3044
    }
3045
 
3046
    public void setPromotionIdIsSet(boolean value) {
3047
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3048
    }
3049
 
3050
    public void setFieldValue(_Fields field, Object value) {
3051
      switch (field) {
3052
      case PROMOTION_ID:
3053
        if (value == null) {
3054
          unsetPromotionId();
3055
        } else {
3056
          setPromotionId((Long)value);
3057
        }
3058
        break;
3059
 
3060
      }
3061
    }
3062
 
3063
    public Object getFieldValue(_Fields field) {
3064
      switch (field) {
3065
      case PROMOTION_ID:
3430 rajveer 3066
        return Long.valueOf(getPromotionId());
1982 varun.gupt 3067
 
3068
      }
3069
      throw new IllegalStateException();
3070
    }
3071
 
3430 rajveer 3072
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3073
    public boolean isSet(_Fields field) {
3074
      if (field == null) {
3075
        throw new IllegalArgumentException();
3076
      }
1982 varun.gupt 3077
 
3078
      switch (field) {
3079
      case PROMOTION_ID:
3080
        return isSetPromotionId();
3081
      }
3082
      throw new IllegalStateException();
3083
    }
3084
 
3085
    @Override
3086
    public boolean equals(Object that) {
3087
      if (that == null)
3088
        return false;
3089
      if (that instanceof getPromotionById_args)
3090
        return this.equals((getPromotionById_args)that);
3091
      return false;
3092
    }
3093
 
3094
    public boolean equals(getPromotionById_args that) {
3095
      if (that == null)
3096
        return false;
3097
 
3098
      boolean this_present_promotionId = true;
3099
      boolean that_present_promotionId = true;
3100
      if (this_present_promotionId || that_present_promotionId) {
3101
        if (!(this_present_promotionId && that_present_promotionId))
3102
          return false;
3103
        if (this.promotionId != that.promotionId)
3104
          return false;
3105
      }
3106
 
3107
      return true;
3108
    }
3109
 
3110
    @Override
3111
    public int hashCode() {
3112
      return 0;
3113
    }
3114
 
3115
    public int compareTo(getPromotionById_args other) {
3116
      if (!getClass().equals(other.getClass())) {
3117
        return getClass().getName().compareTo(other.getClass().getName());
3118
      }
3119
 
3120
      int lastComparison = 0;
3121
      getPromotionById_args typedOther = (getPromotionById_args)other;
3122
 
3430 rajveer 3123
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 3124
      if (lastComparison != 0) {
3125
        return lastComparison;
3126
      }
3430 rajveer 3127
      if (isSetPromotionId()) {
3128
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3129
        if (lastComparison != 0) {
3130
          return lastComparison;
3131
        }
1982 varun.gupt 3132
      }
3133
      return 0;
3134
    }
3135
 
3430 rajveer 3136
    public _Fields fieldForId(int fieldId) {
3137
      return _Fields.findByThriftId(fieldId);
3138
    }
3139
 
3140
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3141
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3142
      iprot.readStructBegin();
3143
      while (true)
3144
      {
3145
        field = iprot.readFieldBegin();
3430 rajveer 3146
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3147
          break;
3148
        }
3430 rajveer 3149
        switch (field.id) {
3150
          case 1: // PROMOTION_ID
3151
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3152
              this.promotionId = iprot.readI64();
3153
              setPromotionIdIsSet(true);
3154
            } else { 
3155
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3156
            }
3157
            break;
3158
          default:
3159
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3160
        }
3430 rajveer 3161
        iprot.readFieldEnd();
1982 varun.gupt 3162
      }
3163
      iprot.readStructEnd();
3164
      validate();
3165
    }
3166
 
3430 rajveer 3167
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3168
      validate();
3169
 
3170
      oprot.writeStructBegin(STRUCT_DESC);
3171
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3172
      oprot.writeI64(this.promotionId);
3173
      oprot.writeFieldEnd();
3174
      oprot.writeFieldStop();
3175
      oprot.writeStructEnd();
3176
    }
3177
 
3178
    @Override
3179
    public String toString() {
3180
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
3181
      boolean first = true;
3182
 
3183
      sb.append("promotionId:");
3184
      sb.append(this.promotionId);
3185
      first = false;
3186
      sb.append(")");
3187
      return sb.toString();
3188
    }
3189
 
3430 rajveer 3190
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3191
      // check for required fields
3192
    }
3193
 
3430 rajveer 3194
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3195
      try {
3196
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3197
      } catch (org.apache.thrift.TException te) {
3198
        throw new java.io.IOException(te);
3199
      }
3200
    }
3201
 
3202
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3203
      try {
3204
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3205
        __isset_bit_vector = new BitSet(1);
3206
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3207
      } catch (org.apache.thrift.TException te) {
3208
        throw new java.io.IOException(te);
3209
      }
3210
    }
3211
 
1982 varun.gupt 3212
  }
3213
 
3430 rajveer 3214
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
3215
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 3216
 
3430 rajveer 3217
    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);
3218
    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 3219
 
3430 rajveer 3220
    private Promotion success; // required
3221
    private PromotionException pex; // required
1982 varun.gupt 3222
 
3223
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3224
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3225
      SUCCESS((short)0, "success"),
3226
      PEX((short)1, "pex");
3227
 
3228
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3229
 
3230
      static {
3231
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3232
          byName.put(field.getFieldName(), field);
3233
        }
3234
      }
3235
 
3236
      /**
3237
       * Find the _Fields constant that matches fieldId, or null if its not found.
3238
       */
3239
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3240
        switch(fieldId) {
3241
          case 0: // SUCCESS
3242
            return SUCCESS;
3243
          case 1: // PEX
3244
            return PEX;
3245
          default:
3246
            return null;
3247
        }
1982 varun.gupt 3248
      }
3249
 
3250
      /**
3251
       * Find the _Fields constant that matches fieldId, throwing an exception
3252
       * if it is not found.
3253
       */
3254
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3255
        _Fields fields = findByThriftId(fieldId);
3256
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3257
        return fields;
3258
      }
3259
 
3260
      /**
3261
       * Find the _Fields constant that matches name, or null if its not found.
3262
       */
3263
      public static _Fields findByName(String name) {
3264
        return byName.get(name);
3265
      }
3266
 
3267
      private final short _thriftId;
3268
      private final String _fieldName;
3269
 
3270
      _Fields(short thriftId, String fieldName) {
3271
        _thriftId = thriftId;
3272
        _fieldName = fieldName;
3273
      }
3274
 
3275
      public short getThriftFieldId() {
3276
        return _thriftId;
3277
      }
3278
 
3279
      public String getFieldName() {
3280
        return _fieldName;
3281
      }
3282
    }
3283
 
3284
    // isset id assignments
3285
 
3430 rajveer 3286
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3287
    static {
3430 rajveer 3288
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3289
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3290
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
3291
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3292
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3293
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3294
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 3295
    }
3296
 
3297
    public getPromotionById_result() {
3298
    }
3299
 
3300
    public getPromotionById_result(
3301
      Promotion success,
3302
      PromotionException pex)
3303
    {
3304
      this();
3305
      this.success = success;
3306
      this.pex = pex;
3307
    }
3308
 
3309
    /**
3310
     * Performs a deep copy on <i>other</i>.
3311
     */
3312
    public getPromotionById_result(getPromotionById_result other) {
3313
      if (other.isSetSuccess()) {
3314
        this.success = new Promotion(other.success);
3315
      }
3316
      if (other.isSetPex()) {
3317
        this.pex = new PromotionException(other.pex);
3318
      }
3319
    }
3320
 
3321
    public getPromotionById_result deepCopy() {
3322
      return new getPromotionById_result(this);
3323
    }
3324
 
3430 rajveer 3325
    @Override
3326
    public void clear() {
3327
      this.success = null;
3328
      this.pex = null;
1982 varun.gupt 3329
    }
3330
 
3331
    public Promotion getSuccess() {
3332
      return this.success;
3333
    }
3334
 
3430 rajveer 3335
    public void setSuccess(Promotion success) {
1982 varun.gupt 3336
      this.success = success;
3337
    }
3338
 
3339
    public void unsetSuccess() {
3340
      this.success = null;
3341
    }
3342
 
3430 rajveer 3343
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3344
    public boolean isSetSuccess() {
3345
      return this.success != null;
3346
    }
3347
 
3348
    public void setSuccessIsSet(boolean value) {
3349
      if (!value) {
3350
        this.success = null;
3351
      }
3352
    }
3353
 
3354
    public PromotionException getPex() {
3355
      return this.pex;
3356
    }
3357
 
3430 rajveer 3358
    public void setPex(PromotionException pex) {
1982 varun.gupt 3359
      this.pex = pex;
3360
    }
3361
 
3362
    public void unsetPex() {
3363
      this.pex = null;
3364
    }
3365
 
3430 rajveer 3366
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3367
    public boolean isSetPex() {
3368
      return this.pex != null;
3369
    }
3370
 
3371
    public void setPexIsSet(boolean value) {
3372
      if (!value) {
3373
        this.pex = null;
3374
      }
3375
    }
3376
 
3377
    public void setFieldValue(_Fields field, Object value) {
3378
      switch (field) {
3379
      case SUCCESS:
3380
        if (value == null) {
3381
          unsetSuccess();
3382
        } else {
3383
          setSuccess((Promotion)value);
3384
        }
3385
        break;
3386
 
3387
      case PEX:
3388
        if (value == null) {
3389
          unsetPex();
3390
        } else {
3391
          setPex((PromotionException)value);
3392
        }
3393
        break;
3394
 
3395
      }
3396
    }
3397
 
3398
    public Object getFieldValue(_Fields field) {
3399
      switch (field) {
3400
      case SUCCESS:
3401
        return getSuccess();
3402
 
3403
      case PEX:
3404
        return getPex();
3405
 
3406
      }
3407
      throw new IllegalStateException();
3408
    }
3409
 
3430 rajveer 3410
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3411
    public boolean isSet(_Fields field) {
3412
      if (field == null) {
3413
        throw new IllegalArgumentException();
3414
      }
1982 varun.gupt 3415
 
3416
      switch (field) {
3417
      case SUCCESS:
3418
        return isSetSuccess();
3419
      case PEX:
3420
        return isSetPex();
3421
      }
3422
      throw new IllegalStateException();
3423
    }
3424
 
3425
    @Override
3426
    public boolean equals(Object that) {
3427
      if (that == null)
3428
        return false;
3429
      if (that instanceof getPromotionById_result)
3430
        return this.equals((getPromotionById_result)that);
3431
      return false;
3432
    }
3433
 
3434
    public boolean equals(getPromotionById_result that) {
3435
      if (that == null)
3436
        return false;
3437
 
3438
      boolean this_present_success = true && this.isSetSuccess();
3439
      boolean that_present_success = true && that.isSetSuccess();
3440
      if (this_present_success || that_present_success) {
3441
        if (!(this_present_success && that_present_success))
3442
          return false;
3443
        if (!this.success.equals(that.success))
3444
          return false;
3445
      }
3446
 
3447
      boolean this_present_pex = true && this.isSetPex();
3448
      boolean that_present_pex = true && that.isSetPex();
3449
      if (this_present_pex || that_present_pex) {
3450
        if (!(this_present_pex && that_present_pex))
3451
          return false;
3452
        if (!this.pex.equals(that.pex))
3453
          return false;
3454
      }
3455
 
3456
      return true;
3457
    }
3458
 
3459
    @Override
3460
    public int hashCode() {
3461
      return 0;
3462
    }
3463
 
3464
    public int compareTo(getPromotionById_result other) {
3465
      if (!getClass().equals(other.getClass())) {
3466
        return getClass().getName().compareTo(other.getClass().getName());
3467
      }
3468
 
3469
      int lastComparison = 0;
3470
      getPromotionById_result typedOther = (getPromotionById_result)other;
3471
 
3430 rajveer 3472
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 3473
      if (lastComparison != 0) {
3474
        return lastComparison;
3475
      }
3430 rajveer 3476
      if (isSetSuccess()) {
3477
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3478
        if (lastComparison != 0) {
3479
          return lastComparison;
3480
        }
1982 varun.gupt 3481
      }
3430 rajveer 3482
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 3483
      if (lastComparison != 0) {
3484
        return lastComparison;
3485
      }
3430 rajveer 3486
      if (isSetPex()) {
3487
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3488
        if (lastComparison != 0) {
3489
          return lastComparison;
3490
        }
1982 varun.gupt 3491
      }
3492
      return 0;
3493
    }
3494
 
3430 rajveer 3495
    public _Fields fieldForId(int fieldId) {
3496
      return _Fields.findByThriftId(fieldId);
3497
    }
3498
 
3499
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3500
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3501
      iprot.readStructBegin();
3502
      while (true)
3503
      {
3504
        field = iprot.readFieldBegin();
3430 rajveer 3505
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3506
          break;
3507
        }
3430 rajveer 3508
        switch (field.id) {
3509
          case 0: // SUCCESS
3510
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3511
              this.success = new Promotion();
3512
              this.success.read(iprot);
3513
            } else { 
3514
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3515
            }
3516
            break;
3517
          case 1: // PEX
3518
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3519
              this.pex = new PromotionException();
3520
              this.pex.read(iprot);
3521
            } else { 
3522
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3523
            }
3524
            break;
3525
          default:
3526
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3527
        }
3430 rajveer 3528
        iprot.readFieldEnd();
1982 varun.gupt 3529
      }
3530
      iprot.readStructEnd();
3531
      validate();
3532
    }
3533
 
3430 rajveer 3534
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3535
      oprot.writeStructBegin(STRUCT_DESC);
3536
 
3537
      if (this.isSetSuccess()) {
3538
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3539
        this.success.write(oprot);
3540
        oprot.writeFieldEnd();
3541
      } else if (this.isSetPex()) {
3542
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3543
        this.pex.write(oprot);
3544
        oprot.writeFieldEnd();
3545
      }
3546
      oprot.writeFieldStop();
3547
      oprot.writeStructEnd();
3548
    }
3549
 
3550
    @Override
3551
    public String toString() {
3552
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
3553
      boolean first = true;
3554
 
3555
      sb.append("success:");
3556
      if (this.success == null) {
3557
        sb.append("null");
3558
      } else {
3559
        sb.append(this.success);
3560
      }
3561
      first = false;
3562
      if (!first) sb.append(", ");
3563
      sb.append("pex:");
3564
      if (this.pex == null) {
3565
        sb.append("null");
3566
      } else {
3567
        sb.append(this.pex);
3568
      }
3569
      first = false;
3570
      sb.append(")");
3571
      return sb.toString();
3572
    }
3573
 
3430 rajveer 3574
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3575
      // check for required fields
3576
    }
3577
 
3430 rajveer 3578
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3579
      try {
3580
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3581
      } catch (org.apache.thrift.TException te) {
3582
        throw new java.io.IOException(te);
3583
      }
3584
    }
3585
 
3586
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3587
      try {
3588
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3589
      } catch (org.apache.thrift.TException te) {
3590
        throw new java.io.IOException(te);
3591
      }
3592
    }
3593
 
1982 varun.gupt 3594
  }
3595
 
3430 rajveer 3596
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
3597
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 3598
 
3430 rajveer 3599
    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);
3600
    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 3601
 
3430 rajveer 3602
    private long promotionId; // required
3603
    private String couponCode; // required
1982 varun.gupt 3604
 
3605
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3606
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3607
      PROMOTION_ID((short)1, "promotionId"),
3608
      COUPON_CODE((short)2, "couponCode");
3609
 
3610
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3611
 
3612
      static {
3613
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3614
          byName.put(field.getFieldName(), field);
3615
        }
3616
      }
3617
 
3618
      /**
3619
       * Find the _Fields constant that matches fieldId, or null if its not found.
3620
       */
3621
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3622
        switch(fieldId) {
3623
          case 1: // PROMOTION_ID
3624
            return PROMOTION_ID;
3625
          case 2: // COUPON_CODE
3626
            return COUPON_CODE;
3627
          default:
3628
            return null;
3629
        }
1982 varun.gupt 3630
      }
3631
 
3632
      /**
3633
       * Find the _Fields constant that matches fieldId, throwing an exception
3634
       * if it is not found.
3635
       */
3636
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3637
        _Fields fields = findByThriftId(fieldId);
3638
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3639
        return fields;
3640
      }
3641
 
3642
      /**
3643
       * Find the _Fields constant that matches name, or null if its not found.
3644
       */
3645
      public static _Fields findByName(String name) {
3646
        return byName.get(name);
3647
      }
3648
 
3649
      private final short _thriftId;
3650
      private final String _fieldName;
3651
 
3652
      _Fields(short thriftId, String fieldName) {
3653
        _thriftId = thriftId;
3654
        _fieldName = fieldName;
3655
      }
3656
 
3657
      public short getThriftFieldId() {
3658
        return _thriftId;
3659
      }
3660
 
3661
      public String getFieldName() {
3662
        return _fieldName;
3663
      }
3664
    }
3665
 
3666
    // isset id assignments
3667
    private static final int __PROMOTIONID_ISSET_ID = 0;
3668
    private BitSet __isset_bit_vector = new BitSet(1);
3669
 
3430 rajveer 3670
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3671
    static {
3430 rajveer 3672
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3673
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3674
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3675
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3676
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3677
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3678
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 3679
    }
3680
 
3681
    public generateCouponsForPromotion_args() {
3682
    }
3683
 
3684
    public generateCouponsForPromotion_args(
3685
      long promotionId,
3686
      String couponCode)
3687
    {
3688
      this();
3689
      this.promotionId = promotionId;
3690
      setPromotionIdIsSet(true);
3691
      this.couponCode = couponCode;
3692
    }
3693
 
3694
    /**
3695
     * Performs a deep copy on <i>other</i>.
3696
     */
3697
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
3698
      __isset_bit_vector.clear();
3699
      __isset_bit_vector.or(other.__isset_bit_vector);
3700
      this.promotionId = other.promotionId;
3701
      if (other.isSetCouponCode()) {
3702
        this.couponCode = other.couponCode;
3703
      }
3704
    }
3705
 
3706
    public generateCouponsForPromotion_args deepCopy() {
3707
      return new generateCouponsForPromotion_args(this);
3708
    }
3709
 
3430 rajveer 3710
    @Override
3711
    public void clear() {
3712
      setPromotionIdIsSet(false);
3713
      this.promotionId = 0;
3714
      this.couponCode = null;
1982 varun.gupt 3715
    }
3716
 
3717
    public long getPromotionId() {
3718
      return this.promotionId;
3719
    }
3720
 
3430 rajveer 3721
    public void setPromotionId(long promotionId) {
1982 varun.gupt 3722
      this.promotionId = promotionId;
3723
      setPromotionIdIsSet(true);
3724
    }
3725
 
3726
    public void unsetPromotionId() {
3727
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3728
    }
3729
 
3430 rajveer 3730
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3731
    public boolean isSetPromotionId() {
3732
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3733
    }
3734
 
3735
    public void setPromotionIdIsSet(boolean value) {
3736
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3737
    }
3738
 
3739
    public String getCouponCode() {
3740
      return this.couponCode;
3741
    }
3742
 
3430 rajveer 3743
    public void setCouponCode(String couponCode) {
1982 varun.gupt 3744
      this.couponCode = couponCode;
3745
    }
3746
 
3747
    public void unsetCouponCode() {
3748
      this.couponCode = null;
3749
    }
3750
 
3430 rajveer 3751
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3752
    public boolean isSetCouponCode() {
3753
      return this.couponCode != null;
3754
    }
3755
 
3756
    public void setCouponCodeIsSet(boolean value) {
3757
      if (!value) {
3758
        this.couponCode = null;
3759
      }
3760
    }
3761
 
3762
    public void setFieldValue(_Fields field, Object value) {
3763
      switch (field) {
3764
      case PROMOTION_ID:
3765
        if (value == null) {
3766
          unsetPromotionId();
3767
        } else {
3768
          setPromotionId((Long)value);
3769
        }
3770
        break;
3771
 
3772
      case COUPON_CODE:
3773
        if (value == null) {
3774
          unsetCouponCode();
3775
        } else {
3776
          setCouponCode((String)value);
3777
        }
3778
        break;
3779
 
3780
      }
3781
    }
3782
 
3783
    public Object getFieldValue(_Fields field) {
3784
      switch (field) {
3785
      case PROMOTION_ID:
3430 rajveer 3786
        return Long.valueOf(getPromotionId());
1982 varun.gupt 3787
 
3788
      case COUPON_CODE:
3789
        return getCouponCode();
3790
 
3791
      }
3792
      throw new IllegalStateException();
3793
    }
3794
 
3430 rajveer 3795
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3796
    public boolean isSet(_Fields field) {
3797
      if (field == null) {
3798
        throw new IllegalArgumentException();
3799
      }
1982 varun.gupt 3800
 
3801
      switch (field) {
3802
      case PROMOTION_ID:
3803
        return isSetPromotionId();
3804
      case COUPON_CODE:
3805
        return isSetCouponCode();
3806
      }
3807
      throw new IllegalStateException();
3808
    }
3809
 
3810
    @Override
3811
    public boolean equals(Object that) {
3812
      if (that == null)
3813
        return false;
3814
      if (that instanceof generateCouponsForPromotion_args)
3815
        return this.equals((generateCouponsForPromotion_args)that);
3816
      return false;
3817
    }
3818
 
3819
    public boolean equals(generateCouponsForPromotion_args that) {
3820
      if (that == null)
3821
        return false;
3822
 
3823
      boolean this_present_promotionId = true;
3824
      boolean that_present_promotionId = true;
3825
      if (this_present_promotionId || that_present_promotionId) {
3826
        if (!(this_present_promotionId && that_present_promotionId))
3827
          return false;
3828
        if (this.promotionId != that.promotionId)
3829
          return false;
3830
      }
3831
 
3832
      boolean this_present_couponCode = true && this.isSetCouponCode();
3833
      boolean that_present_couponCode = true && that.isSetCouponCode();
3834
      if (this_present_couponCode || that_present_couponCode) {
3835
        if (!(this_present_couponCode && that_present_couponCode))
3836
          return false;
3837
        if (!this.couponCode.equals(that.couponCode))
3838
          return false;
3839
      }
3840
 
3841
      return true;
3842
    }
3843
 
3844
    @Override
3845
    public int hashCode() {
3846
      return 0;
3847
    }
3848
 
3849
    public int compareTo(generateCouponsForPromotion_args other) {
3850
      if (!getClass().equals(other.getClass())) {
3851
        return getClass().getName().compareTo(other.getClass().getName());
3852
      }
3853
 
3854
      int lastComparison = 0;
3855
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
3856
 
3430 rajveer 3857
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 3858
      if (lastComparison != 0) {
3859
        return lastComparison;
3860
      }
3430 rajveer 3861
      if (isSetPromotionId()) {
3862
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3863
        if (lastComparison != 0) {
3864
          return lastComparison;
3865
        }
1982 varun.gupt 3866
      }
3430 rajveer 3867
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 3868
      if (lastComparison != 0) {
3869
        return lastComparison;
3870
      }
3430 rajveer 3871
      if (isSetCouponCode()) {
3872
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3873
        if (lastComparison != 0) {
3874
          return lastComparison;
3875
        }
1982 varun.gupt 3876
      }
3877
      return 0;
3878
    }
3879
 
3430 rajveer 3880
    public _Fields fieldForId(int fieldId) {
3881
      return _Fields.findByThriftId(fieldId);
3882
    }
3883
 
3884
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3885
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3886
      iprot.readStructBegin();
3887
      while (true)
3888
      {
3889
        field = iprot.readFieldBegin();
3430 rajveer 3890
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3891
          break;
3892
        }
3430 rajveer 3893
        switch (field.id) {
3894
          case 1: // PROMOTION_ID
3895
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3896
              this.promotionId = iprot.readI64();
3897
              setPromotionIdIsSet(true);
3898
            } else { 
3899
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3900
            }
3901
            break;
3902
          case 2: // COUPON_CODE
3903
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3904
              this.couponCode = iprot.readString();
3905
            } else { 
3906
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3907
            }
3908
            break;
3909
          default:
3910
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3911
        }
3430 rajveer 3912
        iprot.readFieldEnd();
1982 varun.gupt 3913
      }
3914
      iprot.readStructEnd();
3915
      validate();
3916
    }
3917
 
3430 rajveer 3918
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3919
      validate();
3920
 
3921
      oprot.writeStructBegin(STRUCT_DESC);
3922
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3923
      oprot.writeI64(this.promotionId);
3924
      oprot.writeFieldEnd();
3925
      if (this.couponCode != null) {
3926
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3927
        oprot.writeString(this.couponCode);
3928
        oprot.writeFieldEnd();
3929
      }
3930
      oprot.writeFieldStop();
3931
      oprot.writeStructEnd();
3932
    }
3933
 
3934
    @Override
3935
    public String toString() {
3936
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
3937
      boolean first = true;
3938
 
3939
      sb.append("promotionId:");
3940
      sb.append(this.promotionId);
3941
      first = false;
3942
      if (!first) sb.append(", ");
3943
      sb.append("couponCode:");
3944
      if (this.couponCode == null) {
3945
        sb.append("null");
3946
      } else {
3947
        sb.append(this.couponCode);
3948
      }
3949
      first = false;
3950
      sb.append(")");
3951
      return sb.toString();
3952
    }
3953
 
3430 rajveer 3954
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3955
      // check for required fields
3956
    }
3957
 
3430 rajveer 3958
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3959
      try {
3960
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3961
      } catch (org.apache.thrift.TException te) {
3962
        throw new java.io.IOException(te);
3963
      }
3964
    }
3965
 
3966
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3967
      try {
3968
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3969
        __isset_bit_vector = new BitSet(1);
3970
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3971
      } catch (org.apache.thrift.TException te) {
3972
        throw new java.io.IOException(te);
3973
      }
3974
    }
3975
 
1982 varun.gupt 3976
  }
3977
 
3430 rajveer 3978
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
3979
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 3980
 
3430 rajveer 3981
    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 3982
 
3430 rajveer 3983
    private PromotionException pex; // required
1982 varun.gupt 3984
 
3985
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3986
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3987
      PEX((short)1, "pex");
3988
 
3989
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3990
 
3991
      static {
3992
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3993
          byName.put(field.getFieldName(), field);
3994
        }
3995
      }
3996
 
3997
      /**
3998
       * Find the _Fields constant that matches fieldId, or null if its not found.
3999
       */
4000
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4001
        switch(fieldId) {
4002
          case 1: // PEX
4003
            return PEX;
4004
          default:
4005
            return null;
4006
        }
1982 varun.gupt 4007
      }
4008
 
4009
      /**
4010
       * Find the _Fields constant that matches fieldId, throwing an exception
4011
       * if it is not found.
4012
       */
4013
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4014
        _Fields fields = findByThriftId(fieldId);
4015
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4016
        return fields;
4017
      }
4018
 
4019
      /**
4020
       * Find the _Fields constant that matches name, or null if its not found.
4021
       */
4022
      public static _Fields findByName(String name) {
4023
        return byName.get(name);
4024
      }
4025
 
4026
      private final short _thriftId;
4027
      private final String _fieldName;
4028
 
4029
      _Fields(short thriftId, String fieldName) {
4030
        _thriftId = thriftId;
4031
        _fieldName = fieldName;
4032
      }
4033
 
4034
      public short getThriftFieldId() {
4035
        return _thriftId;
4036
      }
4037
 
4038
      public String getFieldName() {
4039
        return _fieldName;
4040
      }
4041
    }
4042
 
4043
    // isset id assignments
4044
 
3430 rajveer 4045
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4046
    static {
3430 rajveer 4047
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4048
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4049
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4050
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4051
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 4052
    }
4053
 
4054
    public generateCouponsForPromotion_result() {
4055
    }
4056
 
4057
    public generateCouponsForPromotion_result(
4058
      PromotionException pex)
4059
    {
4060
      this();
4061
      this.pex = pex;
4062
    }
4063
 
4064
    /**
4065
     * Performs a deep copy on <i>other</i>.
4066
     */
4067
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
4068
      if (other.isSetPex()) {
4069
        this.pex = new PromotionException(other.pex);
4070
      }
4071
    }
4072
 
4073
    public generateCouponsForPromotion_result deepCopy() {
4074
      return new generateCouponsForPromotion_result(this);
4075
    }
4076
 
3430 rajveer 4077
    @Override
4078
    public void clear() {
4079
      this.pex = null;
1982 varun.gupt 4080
    }
4081
 
4082
    public PromotionException getPex() {
4083
      return this.pex;
4084
    }
4085
 
3430 rajveer 4086
    public void setPex(PromotionException pex) {
1982 varun.gupt 4087
      this.pex = pex;
4088
    }
4089
 
4090
    public void unsetPex() {
4091
      this.pex = null;
4092
    }
4093
 
3430 rajveer 4094
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4095
    public boolean isSetPex() {
4096
      return this.pex != null;
4097
    }
4098
 
4099
    public void setPexIsSet(boolean value) {
4100
      if (!value) {
4101
        this.pex = null;
4102
      }
4103
    }
4104
 
4105
    public void setFieldValue(_Fields field, Object value) {
4106
      switch (field) {
4107
      case PEX:
4108
        if (value == null) {
4109
          unsetPex();
4110
        } else {
4111
          setPex((PromotionException)value);
4112
        }
4113
        break;
4114
 
4115
      }
4116
    }
4117
 
4118
    public Object getFieldValue(_Fields field) {
4119
      switch (field) {
4120
      case PEX:
4121
        return getPex();
4122
 
4123
      }
4124
      throw new IllegalStateException();
4125
    }
4126
 
3430 rajveer 4127
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4128
    public boolean isSet(_Fields field) {
4129
      if (field == null) {
4130
        throw new IllegalArgumentException();
4131
      }
1982 varun.gupt 4132
 
4133
      switch (field) {
4134
      case PEX:
4135
        return isSetPex();
4136
      }
4137
      throw new IllegalStateException();
4138
    }
4139
 
4140
    @Override
4141
    public boolean equals(Object that) {
4142
      if (that == null)
4143
        return false;
4144
      if (that instanceof generateCouponsForPromotion_result)
4145
        return this.equals((generateCouponsForPromotion_result)that);
4146
      return false;
4147
    }
4148
 
4149
    public boolean equals(generateCouponsForPromotion_result that) {
4150
      if (that == null)
4151
        return false;
4152
 
4153
      boolean this_present_pex = true && this.isSetPex();
4154
      boolean that_present_pex = true && that.isSetPex();
4155
      if (this_present_pex || that_present_pex) {
4156
        if (!(this_present_pex && that_present_pex))
4157
          return false;
4158
        if (!this.pex.equals(that.pex))
4159
          return false;
4160
      }
4161
 
4162
      return true;
4163
    }
4164
 
4165
    @Override
4166
    public int hashCode() {
4167
      return 0;
4168
    }
4169
 
4170
    public int compareTo(generateCouponsForPromotion_result other) {
4171
      if (!getClass().equals(other.getClass())) {
4172
        return getClass().getName().compareTo(other.getClass().getName());
4173
      }
4174
 
4175
      int lastComparison = 0;
4176
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
4177
 
3430 rajveer 4178
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 4179
      if (lastComparison != 0) {
4180
        return lastComparison;
4181
      }
3430 rajveer 4182
      if (isSetPex()) {
4183
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4184
        if (lastComparison != 0) {
4185
          return lastComparison;
4186
        }
1982 varun.gupt 4187
      }
4188
      return 0;
4189
    }
4190
 
3430 rajveer 4191
    public _Fields fieldForId(int fieldId) {
4192
      return _Fields.findByThriftId(fieldId);
4193
    }
4194
 
4195
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4196
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4197
      iprot.readStructBegin();
4198
      while (true)
4199
      {
4200
        field = iprot.readFieldBegin();
3430 rajveer 4201
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4202
          break;
4203
        }
3430 rajveer 4204
        switch (field.id) {
4205
          case 1: // PEX
4206
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4207
              this.pex = new PromotionException();
4208
              this.pex.read(iprot);
4209
            } else { 
4210
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4211
            }
4212
            break;
4213
          default:
4214
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4215
        }
3430 rajveer 4216
        iprot.readFieldEnd();
1982 varun.gupt 4217
      }
4218
      iprot.readStructEnd();
4219
      validate();
4220
    }
4221
 
3430 rajveer 4222
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4223
      oprot.writeStructBegin(STRUCT_DESC);
4224
 
4225
      if (this.isSetPex()) {
4226
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4227
        this.pex.write(oprot);
4228
        oprot.writeFieldEnd();
4229
      }
4230
      oprot.writeFieldStop();
4231
      oprot.writeStructEnd();
4232
    }
4233
 
4234
    @Override
4235
    public String toString() {
4236
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
4237
      boolean first = true;
4238
 
4239
      sb.append("pex:");
4240
      if (this.pex == null) {
4241
        sb.append("null");
4242
      } else {
4243
        sb.append(this.pex);
4244
      }
4245
      first = false;
4246
      sb.append(")");
4247
      return sb.toString();
4248
    }
4249
 
3430 rajveer 4250
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4251
      // check for required fields
4252
    }
4253
 
3430 rajveer 4254
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4255
      try {
4256
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4257
      } catch (org.apache.thrift.TException te) {
4258
        throw new java.io.IOException(te);
4259
      }
4260
    }
4261
 
4262
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4263
      try {
4264
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4265
      } catch (org.apache.thrift.TException te) {
4266
        throw new java.io.IOException(te);
4267
      }
4268
    }
4269
 
1982 varun.gupt 4270
  }
4271
 
3430 rajveer 4272
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
4273
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 4274
 
3430 rajveer 4275
    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);
4276
    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 4277
 
3430 rajveer 4278
    private String couponCode; // required
4279
    private long cartId; // required
1982 varun.gupt 4280
 
4281
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4282
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4283
      COUPON_CODE((short)1, "couponCode"),
4284
      CART_ID((short)2, "cartId");
4285
 
4286
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4287
 
4288
      static {
4289
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4290
          byName.put(field.getFieldName(), field);
4291
        }
4292
      }
4293
 
4294
      /**
4295
       * Find the _Fields constant that matches fieldId, or null if its not found.
4296
       */
4297
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4298
        switch(fieldId) {
4299
          case 1: // COUPON_CODE
4300
            return COUPON_CODE;
4301
          case 2: // CART_ID
4302
            return CART_ID;
4303
          default:
4304
            return null;
4305
        }
1982 varun.gupt 4306
      }
4307
 
4308
      /**
4309
       * Find the _Fields constant that matches fieldId, throwing an exception
4310
       * if it is not found.
4311
       */
4312
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4313
        _Fields fields = findByThriftId(fieldId);
4314
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4315
        return fields;
4316
      }
4317
 
4318
      /**
4319
       * Find the _Fields constant that matches name, or null if its not found.
4320
       */
4321
      public static _Fields findByName(String name) {
4322
        return byName.get(name);
4323
      }
4324
 
4325
      private final short _thriftId;
4326
      private final String _fieldName;
4327
 
4328
      _Fields(short thriftId, String fieldName) {
4329
        _thriftId = thriftId;
4330
        _fieldName = fieldName;
4331
      }
4332
 
4333
      public short getThriftFieldId() {
4334
        return _thriftId;
4335
      }
4336
 
4337
      public String getFieldName() {
4338
        return _fieldName;
4339
      }
4340
    }
4341
 
4342
    // isset id assignments
4343
    private static final int __CARTID_ISSET_ID = 0;
4344
    private BitSet __isset_bit_vector = new BitSet(1);
4345
 
3430 rajveer 4346
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4347
    static {
3430 rajveer 4348
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4349
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4350
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4351
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4352
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4353
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4354
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 4355
    }
4356
 
4357
    public applyCoupon_args() {
4358
    }
4359
 
4360
    public applyCoupon_args(
4361
      String couponCode,
4362
      long cartId)
4363
    {
4364
      this();
4365
      this.couponCode = couponCode;
4366
      this.cartId = cartId;
4367
      setCartIdIsSet(true);
4368
    }
4369
 
4370
    /**
4371
     * Performs a deep copy on <i>other</i>.
4372
     */
4373
    public applyCoupon_args(applyCoupon_args other) {
4374
      __isset_bit_vector.clear();
4375
      __isset_bit_vector.or(other.__isset_bit_vector);
4376
      if (other.isSetCouponCode()) {
4377
        this.couponCode = other.couponCode;
4378
      }
4379
      this.cartId = other.cartId;
4380
    }
4381
 
4382
    public applyCoupon_args deepCopy() {
4383
      return new applyCoupon_args(this);
4384
    }
4385
 
3430 rajveer 4386
    @Override
4387
    public void clear() {
4388
      this.couponCode = null;
4389
      setCartIdIsSet(false);
4390
      this.cartId = 0;
1982 varun.gupt 4391
    }
4392
 
4393
    public String getCouponCode() {
4394
      return this.couponCode;
4395
    }
4396
 
3430 rajveer 4397
    public void setCouponCode(String couponCode) {
1982 varun.gupt 4398
      this.couponCode = couponCode;
4399
    }
4400
 
4401
    public void unsetCouponCode() {
4402
      this.couponCode = null;
4403
    }
4404
 
3430 rajveer 4405
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4406
    public boolean isSetCouponCode() {
4407
      return this.couponCode != null;
4408
    }
4409
 
4410
    public void setCouponCodeIsSet(boolean value) {
4411
      if (!value) {
4412
        this.couponCode = null;
4413
      }
4414
    }
4415
 
4416
    public long getCartId() {
4417
      return this.cartId;
4418
    }
4419
 
3430 rajveer 4420
    public void setCartId(long cartId) {
1982 varun.gupt 4421
      this.cartId = cartId;
4422
      setCartIdIsSet(true);
4423
    }
4424
 
4425
    public void unsetCartId() {
4426
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
4427
    }
4428
 
3430 rajveer 4429
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4430
    public boolean isSetCartId() {
4431
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
4432
    }
4433
 
4434
    public void setCartIdIsSet(boolean value) {
4435
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
4436
    }
4437
 
4438
    public void setFieldValue(_Fields field, Object value) {
4439
      switch (field) {
4440
      case COUPON_CODE:
4441
        if (value == null) {
4442
          unsetCouponCode();
4443
        } else {
4444
          setCouponCode((String)value);
4445
        }
4446
        break;
4447
 
4448
      case CART_ID:
4449
        if (value == null) {
4450
          unsetCartId();
4451
        } else {
4452
          setCartId((Long)value);
4453
        }
4454
        break;
4455
 
4456
      }
4457
    }
4458
 
4459
    public Object getFieldValue(_Fields field) {
4460
      switch (field) {
4461
      case COUPON_CODE:
4462
        return getCouponCode();
4463
 
4464
      case CART_ID:
3430 rajveer 4465
        return Long.valueOf(getCartId());
1982 varun.gupt 4466
 
4467
      }
4468
      throw new IllegalStateException();
4469
    }
4470
 
3430 rajveer 4471
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4472
    public boolean isSet(_Fields field) {
4473
      if (field == null) {
4474
        throw new IllegalArgumentException();
4475
      }
1982 varun.gupt 4476
 
4477
      switch (field) {
4478
      case COUPON_CODE:
4479
        return isSetCouponCode();
4480
      case CART_ID:
4481
        return isSetCartId();
4482
      }
4483
      throw new IllegalStateException();
4484
    }
4485
 
4486
    @Override
4487
    public boolean equals(Object that) {
4488
      if (that == null)
4489
        return false;
4490
      if (that instanceof applyCoupon_args)
4491
        return this.equals((applyCoupon_args)that);
4492
      return false;
4493
    }
4494
 
4495
    public boolean equals(applyCoupon_args that) {
4496
      if (that == null)
4497
        return false;
4498
 
4499
      boolean this_present_couponCode = true && this.isSetCouponCode();
4500
      boolean that_present_couponCode = true && that.isSetCouponCode();
4501
      if (this_present_couponCode || that_present_couponCode) {
4502
        if (!(this_present_couponCode && that_present_couponCode))
4503
          return false;
4504
        if (!this.couponCode.equals(that.couponCode))
4505
          return false;
4506
      }
4507
 
4508
      boolean this_present_cartId = true;
4509
      boolean that_present_cartId = true;
4510
      if (this_present_cartId || that_present_cartId) {
4511
        if (!(this_present_cartId && that_present_cartId))
4512
          return false;
4513
        if (this.cartId != that.cartId)
4514
          return false;
4515
      }
4516
 
4517
      return true;
4518
    }
4519
 
4520
    @Override
4521
    public int hashCode() {
4522
      return 0;
4523
    }
4524
 
4525
    public int compareTo(applyCoupon_args other) {
4526
      if (!getClass().equals(other.getClass())) {
4527
        return getClass().getName().compareTo(other.getClass().getName());
4528
      }
4529
 
4530
      int lastComparison = 0;
4531
      applyCoupon_args typedOther = (applyCoupon_args)other;
4532
 
3430 rajveer 4533
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 4534
      if (lastComparison != 0) {
4535
        return lastComparison;
4536
      }
3430 rajveer 4537
      if (isSetCouponCode()) {
4538
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4539
        if (lastComparison != 0) {
4540
          return lastComparison;
4541
        }
1982 varun.gupt 4542
      }
3430 rajveer 4543
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 4544
      if (lastComparison != 0) {
4545
        return lastComparison;
4546
      }
3430 rajveer 4547
      if (isSetCartId()) {
4548
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
4549
        if (lastComparison != 0) {
4550
          return lastComparison;
4551
        }
1982 varun.gupt 4552
      }
4553
      return 0;
4554
    }
4555
 
3430 rajveer 4556
    public _Fields fieldForId(int fieldId) {
4557
      return _Fields.findByThriftId(fieldId);
4558
    }
4559
 
4560
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4561
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4562
      iprot.readStructBegin();
4563
      while (true)
4564
      {
4565
        field = iprot.readFieldBegin();
3430 rajveer 4566
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4567
          break;
4568
        }
3430 rajveer 4569
        switch (field.id) {
4570
          case 1: // COUPON_CODE
4571
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4572
              this.couponCode = iprot.readString();
4573
            } else { 
4574
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4575
            }
4576
            break;
4577
          case 2: // CART_ID
4578
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4579
              this.cartId = iprot.readI64();
4580
              setCartIdIsSet(true);
4581
            } else { 
4582
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4583
            }
4584
            break;
4585
          default:
4586
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4587
        }
3430 rajveer 4588
        iprot.readFieldEnd();
1982 varun.gupt 4589
      }
4590
      iprot.readStructEnd();
4591
      validate();
4592
    }
4593
 
3430 rajveer 4594
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4595
      validate();
4596
 
4597
      oprot.writeStructBegin(STRUCT_DESC);
4598
      if (this.couponCode != null) {
4599
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4600
        oprot.writeString(this.couponCode);
4601
        oprot.writeFieldEnd();
4602
      }
4603
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
4604
      oprot.writeI64(this.cartId);
4605
      oprot.writeFieldEnd();
4606
      oprot.writeFieldStop();
4607
      oprot.writeStructEnd();
4608
    }
4609
 
4610
    @Override
4611
    public String toString() {
4612
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
4613
      boolean first = true;
4614
 
4615
      sb.append("couponCode:");
4616
      if (this.couponCode == null) {
4617
        sb.append("null");
4618
      } else {
4619
        sb.append(this.couponCode);
4620
      }
4621
      first = false;
4622
      if (!first) sb.append(", ");
4623
      sb.append("cartId:");
4624
      sb.append(this.cartId);
4625
      first = false;
4626
      sb.append(")");
4627
      return sb.toString();
4628
    }
4629
 
3430 rajveer 4630
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4631
      // check for required fields
4632
    }
4633
 
3430 rajveer 4634
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4635
      try {
4636
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4637
      } catch (org.apache.thrift.TException te) {
4638
        throw new java.io.IOException(te);
4639
      }
4640
    }
4641
 
4642
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4643
      try {
4644
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
4645
        __isset_bit_vector = new BitSet(1);
4646
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4647
      } catch (org.apache.thrift.TException te) {
4648
        throw new java.io.IOException(te);
4649
      }
4650
    }
4651
 
1982 varun.gupt 4652
  }
4653
 
3430 rajveer 4654
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4655
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 4656
 
3430 rajveer 4657
    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);
4658
    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 4659
 
3430 rajveer 4660
    private Cart success; // required
4661
    private PromotionException pex; // required
1982 varun.gupt 4662
 
4663
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4664
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4665
      SUCCESS((short)0, "success"),
4666
      PEX((short)1, "pex");
4667
 
4668
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4669
 
4670
      static {
4671
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4672
          byName.put(field.getFieldName(), field);
4673
        }
4674
      }
4675
 
4676
      /**
4677
       * Find the _Fields constant that matches fieldId, or null if its not found.
4678
       */
4679
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4680
        switch(fieldId) {
4681
          case 0: // SUCCESS
4682
            return SUCCESS;
4683
          case 1: // PEX
4684
            return PEX;
4685
          default:
4686
            return null;
4687
        }
1982 varun.gupt 4688
      }
4689
 
4690
      /**
4691
       * Find the _Fields constant that matches fieldId, throwing an exception
4692
       * if it is not found.
4693
       */
4694
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4695
        _Fields fields = findByThriftId(fieldId);
4696
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4697
        return fields;
4698
      }
4699
 
4700
      /**
4701
       * Find the _Fields constant that matches name, or null if its not found.
4702
       */
4703
      public static _Fields findByName(String name) {
4704
        return byName.get(name);
4705
      }
4706
 
4707
      private final short _thriftId;
4708
      private final String _fieldName;
4709
 
4710
      _Fields(short thriftId, String fieldName) {
4711
        _thriftId = thriftId;
4712
        _fieldName = fieldName;
4713
      }
4714
 
4715
      public short getThriftFieldId() {
4716
        return _thriftId;
4717
      }
4718
 
4719
      public String getFieldName() {
4720
        return _fieldName;
4721
      }
4722
    }
4723
 
4724
    // isset id assignments
4725
 
3430 rajveer 4726
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4727
    static {
3430 rajveer 4728
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4729
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4730
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
4731
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4732
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4733
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4734
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 4735
    }
4736
 
4737
    public applyCoupon_result() {
4738
    }
4739
 
4740
    public applyCoupon_result(
4741
      Cart success,
4742
      PromotionException pex)
4743
    {
4744
      this();
4745
      this.success = success;
4746
      this.pex = pex;
4747
    }
4748
 
4749
    /**
4750
     * Performs a deep copy on <i>other</i>.
4751
     */
4752
    public applyCoupon_result(applyCoupon_result other) {
4753
      if (other.isSetSuccess()) {
4754
        this.success = new Cart(other.success);
4755
      }
4756
      if (other.isSetPex()) {
4757
        this.pex = new PromotionException(other.pex);
4758
      }
4759
    }
4760
 
4761
    public applyCoupon_result deepCopy() {
4762
      return new applyCoupon_result(this);
4763
    }
4764
 
3430 rajveer 4765
    @Override
4766
    public void clear() {
4767
      this.success = null;
4768
      this.pex = null;
1982 varun.gupt 4769
    }
4770
 
4771
    public Cart getSuccess() {
4772
      return this.success;
4773
    }
4774
 
3430 rajveer 4775
    public void setSuccess(Cart success) {
1982 varun.gupt 4776
      this.success = success;
4777
    }
4778
 
4779
    public void unsetSuccess() {
4780
      this.success = null;
4781
    }
4782
 
3430 rajveer 4783
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4784
    public boolean isSetSuccess() {
4785
      return this.success != null;
4786
    }
4787
 
4788
    public void setSuccessIsSet(boolean value) {
4789
      if (!value) {
4790
        this.success = null;
4791
      }
4792
    }
4793
 
4794
    public PromotionException getPex() {
4795
      return this.pex;
4796
    }
4797
 
3430 rajveer 4798
    public void setPex(PromotionException pex) {
1982 varun.gupt 4799
      this.pex = pex;
4800
    }
4801
 
4802
    public void unsetPex() {
4803
      this.pex = null;
4804
    }
4805
 
3430 rajveer 4806
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4807
    public boolean isSetPex() {
4808
      return this.pex != null;
4809
    }
4810
 
4811
    public void setPexIsSet(boolean value) {
4812
      if (!value) {
4813
        this.pex = null;
4814
      }
4815
    }
4816
 
4817
    public void setFieldValue(_Fields field, Object value) {
4818
      switch (field) {
4819
      case SUCCESS:
4820
        if (value == null) {
4821
          unsetSuccess();
4822
        } else {
4823
          setSuccess((Cart)value);
4824
        }
4825
        break;
4826
 
4827
      case PEX:
4828
        if (value == null) {
4829
          unsetPex();
4830
        } else {
4831
          setPex((PromotionException)value);
4832
        }
4833
        break;
4834
 
4835
      }
4836
    }
4837
 
4838
    public Object getFieldValue(_Fields field) {
4839
      switch (field) {
4840
      case SUCCESS:
4841
        return getSuccess();
4842
 
4843
      case PEX:
4844
        return getPex();
4845
 
4846
      }
4847
      throw new IllegalStateException();
4848
    }
4849
 
3430 rajveer 4850
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4851
    public boolean isSet(_Fields field) {
4852
      if (field == null) {
4853
        throw new IllegalArgumentException();
4854
      }
1982 varun.gupt 4855
 
4856
      switch (field) {
4857
      case SUCCESS:
4858
        return isSetSuccess();
4859
      case PEX:
4860
        return isSetPex();
4861
      }
4862
      throw new IllegalStateException();
4863
    }
4864
 
4865
    @Override
4866
    public boolean equals(Object that) {
4867
      if (that == null)
4868
        return false;
4869
      if (that instanceof applyCoupon_result)
4870
        return this.equals((applyCoupon_result)that);
4871
      return false;
4872
    }
4873
 
4874
    public boolean equals(applyCoupon_result that) {
4875
      if (that == null)
4876
        return false;
4877
 
4878
      boolean this_present_success = true && this.isSetSuccess();
4879
      boolean that_present_success = true && that.isSetSuccess();
4880
      if (this_present_success || that_present_success) {
4881
        if (!(this_present_success && that_present_success))
4882
          return false;
4883
        if (!this.success.equals(that.success))
4884
          return false;
4885
      }
4886
 
4887
      boolean this_present_pex = true && this.isSetPex();
4888
      boolean that_present_pex = true && that.isSetPex();
4889
      if (this_present_pex || that_present_pex) {
4890
        if (!(this_present_pex && that_present_pex))
4891
          return false;
4892
        if (!this.pex.equals(that.pex))
4893
          return false;
4894
      }
4895
 
4896
      return true;
4897
    }
4898
 
4899
    @Override
4900
    public int hashCode() {
4901
      return 0;
4902
    }
4903
 
4904
    public int compareTo(applyCoupon_result other) {
4905
      if (!getClass().equals(other.getClass())) {
4906
        return getClass().getName().compareTo(other.getClass().getName());
4907
      }
4908
 
4909
      int lastComparison = 0;
4910
      applyCoupon_result typedOther = (applyCoupon_result)other;
4911
 
3430 rajveer 4912
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 4913
      if (lastComparison != 0) {
4914
        return lastComparison;
4915
      }
3430 rajveer 4916
      if (isSetSuccess()) {
4917
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4918
        if (lastComparison != 0) {
4919
          return lastComparison;
4920
        }
1982 varun.gupt 4921
      }
3430 rajveer 4922
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 4923
      if (lastComparison != 0) {
4924
        return lastComparison;
4925
      }
3430 rajveer 4926
      if (isSetPex()) {
4927
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4928
        if (lastComparison != 0) {
4929
          return lastComparison;
4930
        }
1982 varun.gupt 4931
      }
4932
      return 0;
4933
    }
4934
 
3430 rajveer 4935
    public _Fields fieldForId(int fieldId) {
4936
      return _Fields.findByThriftId(fieldId);
4937
    }
4938
 
4939
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4940
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4941
      iprot.readStructBegin();
4942
      while (true)
4943
      {
4944
        field = iprot.readFieldBegin();
3430 rajveer 4945
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4946
          break;
4947
        }
3430 rajveer 4948
        switch (field.id) {
4949
          case 0: // SUCCESS
4950
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4951
              this.success = new Cart();
4952
              this.success.read(iprot);
4953
            } else { 
4954
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4955
            }
4956
            break;
4957
          case 1: // PEX
4958
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4959
              this.pex = new PromotionException();
4960
              this.pex.read(iprot);
4961
            } else { 
4962
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4963
            }
4964
            break;
4965
          default:
4966
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4967
        }
3430 rajveer 4968
        iprot.readFieldEnd();
1982 varun.gupt 4969
      }
4970
      iprot.readStructEnd();
4971
      validate();
4972
    }
4973
 
3430 rajveer 4974
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4975
      oprot.writeStructBegin(STRUCT_DESC);
4976
 
4977
      if (this.isSetSuccess()) {
4978
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4979
        this.success.write(oprot);
4980
        oprot.writeFieldEnd();
4981
      } else if (this.isSetPex()) {
4982
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4983
        this.pex.write(oprot);
4984
        oprot.writeFieldEnd();
4985
      }
4986
      oprot.writeFieldStop();
4987
      oprot.writeStructEnd();
4988
    }
4989
 
4990
    @Override
4991
    public String toString() {
4992
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
4993
      boolean first = true;
4994
 
4995
      sb.append("success:");
4996
      if (this.success == null) {
4997
        sb.append("null");
4998
      } else {
4999
        sb.append(this.success);
5000
      }
5001
      first = false;
5002
      if (!first) sb.append(", ");
5003
      sb.append("pex:");
5004
      if (this.pex == null) {
5005
        sb.append("null");
5006
      } else {
5007
        sb.append(this.pex);
5008
      }
5009
      first = false;
5010
      sb.append(")");
5011
      return sb.toString();
5012
    }
5013
 
3430 rajveer 5014
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5015
      // check for required fields
5016
    }
5017
 
3430 rajveer 5018
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5019
      try {
5020
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5021
      } catch (org.apache.thrift.TException te) {
5022
        throw new java.io.IOException(te);
5023
      }
5024
    }
5025
 
5026
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5027
      try {
5028
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5029
      } catch (org.apache.thrift.TException te) {
5030
        throw new java.io.IOException(te);
5031
      }
5032
    }
5033
 
1982 varun.gupt 5034
  }
5035
 
3430 rajveer 5036
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
5037
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 5038
 
3430 rajveer 5039
    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);
5040
    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);
5041
    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 5042
 
3430 rajveer 5043
    private String couponCode; // required
5044
    private long transactionId; // required
5045
    private long userId; // required
1982 varun.gupt 5046
 
5047
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5048
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5049
      COUPON_CODE((short)1, "couponCode"),
5050
      TRANSACTION_ID((short)2, "transactionId"),
5051
      USER_ID((short)3, "userId");
5052
 
5053
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5054
 
5055
      static {
5056
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5057
          byName.put(field.getFieldName(), field);
5058
        }
5059
      }
5060
 
5061
      /**
5062
       * Find the _Fields constant that matches fieldId, or null if its not found.
5063
       */
5064
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5065
        switch(fieldId) {
5066
          case 1: // COUPON_CODE
5067
            return COUPON_CODE;
5068
          case 2: // TRANSACTION_ID
5069
            return TRANSACTION_ID;
5070
          case 3: // USER_ID
5071
            return USER_ID;
5072
          default:
5073
            return null;
5074
        }
1982 varun.gupt 5075
      }
5076
 
5077
      /**
5078
       * Find the _Fields constant that matches fieldId, throwing an exception
5079
       * if it is not found.
5080
       */
5081
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5082
        _Fields fields = findByThriftId(fieldId);
5083
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5084
        return fields;
5085
      }
5086
 
5087
      /**
5088
       * Find the _Fields constant that matches name, or null if its not found.
5089
       */
5090
      public static _Fields findByName(String name) {
5091
        return byName.get(name);
5092
      }
5093
 
5094
      private final short _thriftId;
5095
      private final String _fieldName;
5096
 
5097
      _Fields(short thriftId, String fieldName) {
5098
        _thriftId = thriftId;
5099
        _fieldName = fieldName;
5100
      }
5101
 
5102
      public short getThriftFieldId() {
5103
        return _thriftId;
5104
      }
5105
 
5106
      public String getFieldName() {
5107
        return _fieldName;
5108
      }
5109
    }
5110
 
5111
    // isset id assignments
5112
    private static final int __TRANSACTIONID_ISSET_ID = 0;
5113
    private static final int __USERID_ISSET_ID = 1;
5114
    private BitSet __isset_bit_vector = new BitSet(2);
5115
 
3430 rajveer 5116
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5117
    static {
3430 rajveer 5118
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5119
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5120
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5121
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5122
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5123
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5124
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5125
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5126
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 5127
    }
5128
 
5129
    public trackCouponUsage_args() {
5130
    }
5131
 
5132
    public trackCouponUsage_args(
5133
      String couponCode,
5134
      long transactionId,
5135
      long userId)
5136
    {
5137
      this();
5138
      this.couponCode = couponCode;
5139
      this.transactionId = transactionId;
5140
      setTransactionIdIsSet(true);
5141
      this.userId = userId;
5142
      setUserIdIsSet(true);
5143
    }
5144
 
5145
    /**
5146
     * Performs a deep copy on <i>other</i>.
5147
     */
5148
    public trackCouponUsage_args(trackCouponUsage_args other) {
5149
      __isset_bit_vector.clear();
5150
      __isset_bit_vector.or(other.__isset_bit_vector);
5151
      if (other.isSetCouponCode()) {
5152
        this.couponCode = other.couponCode;
5153
      }
5154
      this.transactionId = other.transactionId;
5155
      this.userId = other.userId;
5156
    }
5157
 
5158
    public trackCouponUsage_args deepCopy() {
5159
      return new trackCouponUsage_args(this);
5160
    }
5161
 
3430 rajveer 5162
    @Override
5163
    public void clear() {
5164
      this.couponCode = null;
5165
      setTransactionIdIsSet(false);
5166
      this.transactionId = 0;
5167
      setUserIdIsSet(false);
5168
      this.userId = 0;
1982 varun.gupt 5169
    }
5170
 
5171
    public String getCouponCode() {
5172
      return this.couponCode;
5173
    }
5174
 
3430 rajveer 5175
    public void setCouponCode(String couponCode) {
1982 varun.gupt 5176
      this.couponCode = couponCode;
5177
    }
5178
 
5179
    public void unsetCouponCode() {
5180
      this.couponCode = null;
5181
    }
5182
 
3430 rajveer 5183
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5184
    public boolean isSetCouponCode() {
5185
      return this.couponCode != null;
5186
    }
5187
 
5188
    public void setCouponCodeIsSet(boolean value) {
5189
      if (!value) {
5190
        this.couponCode = null;
5191
      }
5192
    }
5193
 
5194
    public long getTransactionId() {
5195
      return this.transactionId;
5196
    }
5197
 
3430 rajveer 5198
    public void setTransactionId(long transactionId) {
1982 varun.gupt 5199
      this.transactionId = transactionId;
5200
      setTransactionIdIsSet(true);
5201
    }
5202
 
5203
    public void unsetTransactionId() {
5204
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
5205
    }
5206
 
3430 rajveer 5207
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5208
    public boolean isSetTransactionId() {
5209
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
5210
    }
5211
 
5212
    public void setTransactionIdIsSet(boolean value) {
5213
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
5214
    }
5215
 
5216
    public long getUserId() {
5217
      return this.userId;
5218
    }
5219
 
3430 rajveer 5220
    public void setUserId(long userId) {
1982 varun.gupt 5221
      this.userId = userId;
5222
      setUserIdIsSet(true);
5223
    }
5224
 
5225
    public void unsetUserId() {
5226
      __isset_bit_vector.clear(__USERID_ISSET_ID);
5227
    }
5228
 
3430 rajveer 5229
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5230
    public boolean isSetUserId() {
5231
      return __isset_bit_vector.get(__USERID_ISSET_ID);
5232
    }
5233
 
5234
    public void setUserIdIsSet(boolean value) {
5235
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
5236
    }
5237
 
5238
    public void setFieldValue(_Fields field, Object value) {
5239
      switch (field) {
5240
      case COUPON_CODE:
5241
        if (value == null) {
5242
          unsetCouponCode();
5243
        } else {
5244
          setCouponCode((String)value);
5245
        }
5246
        break;
5247
 
5248
      case TRANSACTION_ID:
5249
        if (value == null) {
5250
          unsetTransactionId();
5251
        } else {
5252
          setTransactionId((Long)value);
5253
        }
5254
        break;
5255
 
5256
      case USER_ID:
5257
        if (value == null) {
5258
          unsetUserId();
5259
        } else {
5260
          setUserId((Long)value);
5261
        }
5262
        break;
5263
 
5264
      }
5265
    }
5266
 
5267
    public Object getFieldValue(_Fields field) {
5268
      switch (field) {
5269
      case COUPON_CODE:
5270
        return getCouponCode();
5271
 
5272
      case TRANSACTION_ID:
3430 rajveer 5273
        return Long.valueOf(getTransactionId());
1982 varun.gupt 5274
 
5275
      case USER_ID:
3430 rajveer 5276
        return Long.valueOf(getUserId());
1982 varun.gupt 5277
 
5278
      }
5279
      throw new IllegalStateException();
5280
    }
5281
 
3430 rajveer 5282
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5283
    public boolean isSet(_Fields field) {
5284
      if (field == null) {
5285
        throw new IllegalArgumentException();
5286
      }
1982 varun.gupt 5287
 
5288
      switch (field) {
5289
      case COUPON_CODE:
5290
        return isSetCouponCode();
5291
      case TRANSACTION_ID:
5292
        return isSetTransactionId();
5293
      case USER_ID:
5294
        return isSetUserId();
5295
      }
5296
      throw new IllegalStateException();
5297
    }
5298
 
5299
    @Override
5300
    public boolean equals(Object that) {
5301
      if (that == null)
5302
        return false;
5303
      if (that instanceof trackCouponUsage_args)
5304
        return this.equals((trackCouponUsage_args)that);
5305
      return false;
5306
    }
5307
 
5308
    public boolean equals(trackCouponUsage_args that) {
5309
      if (that == null)
5310
        return false;
5311
 
5312
      boolean this_present_couponCode = true && this.isSetCouponCode();
5313
      boolean that_present_couponCode = true && that.isSetCouponCode();
5314
      if (this_present_couponCode || that_present_couponCode) {
5315
        if (!(this_present_couponCode && that_present_couponCode))
5316
          return false;
5317
        if (!this.couponCode.equals(that.couponCode))
5318
          return false;
5319
      }
5320
 
5321
      boolean this_present_transactionId = true;
5322
      boolean that_present_transactionId = true;
5323
      if (this_present_transactionId || that_present_transactionId) {
5324
        if (!(this_present_transactionId && that_present_transactionId))
5325
          return false;
5326
        if (this.transactionId != that.transactionId)
5327
          return false;
5328
      }
5329
 
5330
      boolean this_present_userId = true;
5331
      boolean that_present_userId = true;
5332
      if (this_present_userId || that_present_userId) {
5333
        if (!(this_present_userId && that_present_userId))
5334
          return false;
5335
        if (this.userId != that.userId)
5336
          return false;
5337
      }
5338
 
5339
      return true;
5340
    }
5341
 
5342
    @Override
5343
    public int hashCode() {
5344
      return 0;
5345
    }
5346
 
5347
    public int compareTo(trackCouponUsage_args other) {
5348
      if (!getClass().equals(other.getClass())) {
5349
        return getClass().getName().compareTo(other.getClass().getName());
5350
      }
5351
 
5352
      int lastComparison = 0;
5353
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
5354
 
3430 rajveer 5355
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 5356
      if (lastComparison != 0) {
5357
        return lastComparison;
5358
      }
3430 rajveer 5359
      if (isSetCouponCode()) {
5360
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5361
        if (lastComparison != 0) {
5362
          return lastComparison;
5363
        }
1982 varun.gupt 5364
      }
3430 rajveer 5365
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 5366
      if (lastComparison != 0) {
5367
        return lastComparison;
5368
      }
3430 rajveer 5369
      if (isSetTransactionId()) {
5370
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
5371
        if (lastComparison != 0) {
5372
          return lastComparison;
5373
        }
1982 varun.gupt 5374
      }
3430 rajveer 5375
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 5376
      if (lastComparison != 0) {
5377
        return lastComparison;
5378
      }
3430 rajveer 5379
      if (isSetUserId()) {
5380
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
5381
        if (lastComparison != 0) {
5382
          return lastComparison;
5383
        }
1982 varun.gupt 5384
      }
5385
      return 0;
5386
    }
5387
 
3430 rajveer 5388
    public _Fields fieldForId(int fieldId) {
5389
      return _Fields.findByThriftId(fieldId);
5390
    }
5391
 
5392
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5393
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5394
      iprot.readStructBegin();
5395
      while (true)
5396
      {
5397
        field = iprot.readFieldBegin();
3430 rajveer 5398
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5399
          break;
5400
        }
3430 rajveer 5401
        switch (field.id) {
5402
          case 1: // COUPON_CODE
5403
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5404
              this.couponCode = iprot.readString();
5405
            } else { 
5406
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5407
            }
5408
            break;
5409
          case 2: // TRANSACTION_ID
5410
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5411
              this.transactionId = iprot.readI64();
5412
              setTransactionIdIsSet(true);
5413
            } else { 
5414
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5415
            }
5416
            break;
5417
          case 3: // USER_ID
5418
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5419
              this.userId = iprot.readI64();
5420
              setUserIdIsSet(true);
5421
            } else { 
5422
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5423
            }
5424
            break;
5425
          default:
5426
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5427
        }
3430 rajveer 5428
        iprot.readFieldEnd();
1982 varun.gupt 5429
      }
5430
      iprot.readStructEnd();
5431
      validate();
5432
    }
5433
 
3430 rajveer 5434
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5435
      validate();
5436
 
5437
      oprot.writeStructBegin(STRUCT_DESC);
5438
      if (this.couponCode != null) {
5439
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5440
        oprot.writeString(this.couponCode);
5441
        oprot.writeFieldEnd();
5442
      }
5443
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
5444
      oprot.writeI64(this.transactionId);
5445
      oprot.writeFieldEnd();
5446
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
5447
      oprot.writeI64(this.userId);
5448
      oprot.writeFieldEnd();
5449
      oprot.writeFieldStop();
5450
      oprot.writeStructEnd();
5451
    }
5452
 
5453
    @Override
5454
    public String toString() {
5455
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
5456
      boolean first = true;
5457
 
5458
      sb.append("couponCode:");
5459
      if (this.couponCode == null) {
5460
        sb.append("null");
5461
      } else {
5462
        sb.append(this.couponCode);
5463
      }
5464
      first = false;
5465
      if (!first) sb.append(", ");
5466
      sb.append("transactionId:");
5467
      sb.append(this.transactionId);
5468
      first = false;
5469
      if (!first) sb.append(", ");
5470
      sb.append("userId:");
5471
      sb.append(this.userId);
5472
      first = false;
5473
      sb.append(")");
5474
      return sb.toString();
5475
    }
5476
 
3430 rajveer 5477
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5478
      // check for required fields
5479
    }
5480
 
3430 rajveer 5481
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5482
      try {
5483
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5484
      } catch (org.apache.thrift.TException te) {
5485
        throw new java.io.IOException(te);
5486
      }
5487
    }
5488
 
5489
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5490
      try {
5491
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5492
        __isset_bit_vector = new BitSet(1);
5493
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5494
      } catch (org.apache.thrift.TException te) {
5495
        throw new java.io.IOException(te);
5496
      }
5497
    }
5498
 
1982 varun.gupt 5499
  }
5500
 
3430 rajveer 5501
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
5502
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 5503
 
3430 rajveer 5504
    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 5505
 
3430 rajveer 5506
    private PromotionException pex; // required
1982 varun.gupt 5507
 
5508
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5509
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5510
      PEX((short)1, "pex");
5511
 
5512
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5513
 
5514
      static {
5515
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5516
          byName.put(field.getFieldName(), field);
5517
        }
5518
      }
5519
 
5520
      /**
5521
       * Find the _Fields constant that matches fieldId, or null if its not found.
5522
       */
5523
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5524
        switch(fieldId) {
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.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5572
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5573
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5574
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 5575
    }
5576
 
5577
    public trackCouponUsage_result() {
5578
    }
5579
 
5580
    public trackCouponUsage_result(
5581
      PromotionException pex)
5582
    {
5583
      this();
5584
      this.pex = pex;
5585
    }
5586
 
5587
    /**
5588
     * Performs a deep copy on <i>other</i>.
5589
     */
5590
    public trackCouponUsage_result(trackCouponUsage_result other) {
5591
      if (other.isSetPex()) {
5592
        this.pex = new PromotionException(other.pex);
5593
      }
5594
    }
5595
 
5596
    public trackCouponUsage_result deepCopy() {
5597
      return new trackCouponUsage_result(this);
5598
    }
5599
 
3430 rajveer 5600
    @Override
5601
    public void clear() {
5602
      this.pex = null;
1982 varun.gupt 5603
    }
5604
 
5605
    public PromotionException getPex() {
5606
      return this.pex;
5607
    }
5608
 
3430 rajveer 5609
    public void setPex(PromotionException pex) {
1982 varun.gupt 5610
      this.pex = pex;
5611
    }
5612
 
5613
    public void unsetPex() {
5614
      this.pex = null;
5615
    }
5616
 
3430 rajveer 5617
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5618
    public boolean isSetPex() {
5619
      return this.pex != null;
5620
    }
5621
 
5622
    public void setPexIsSet(boolean value) {
5623
      if (!value) {
5624
        this.pex = null;
5625
      }
5626
    }
5627
 
5628
    public void setFieldValue(_Fields field, Object value) {
5629
      switch (field) {
5630
      case PEX:
5631
        if (value == null) {
5632
          unsetPex();
5633
        } else {
5634
          setPex((PromotionException)value);
5635
        }
5636
        break;
5637
 
5638
      }
5639
    }
5640
 
5641
    public Object getFieldValue(_Fields field) {
5642
      switch (field) {
5643
      case PEX:
5644
        return getPex();
5645
 
5646
      }
5647
      throw new IllegalStateException();
5648
    }
5649
 
3430 rajveer 5650
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5651
    public boolean isSet(_Fields field) {
5652
      if (field == null) {
5653
        throw new IllegalArgumentException();
5654
      }
1982 varun.gupt 5655
 
5656
      switch (field) {
5657
      case PEX:
5658
        return isSetPex();
5659
      }
5660
      throw new IllegalStateException();
5661
    }
5662
 
5663
    @Override
5664
    public boolean equals(Object that) {
5665
      if (that == null)
5666
        return false;
5667
      if (that instanceof trackCouponUsage_result)
5668
        return this.equals((trackCouponUsage_result)that);
5669
      return false;
5670
    }
5671
 
5672
    public boolean equals(trackCouponUsage_result that) {
5673
      if (that == null)
5674
        return false;
5675
 
5676
      boolean this_present_pex = true && this.isSetPex();
5677
      boolean that_present_pex = true && that.isSetPex();
5678
      if (this_present_pex || that_present_pex) {
5679
        if (!(this_present_pex && that_present_pex))
5680
          return false;
5681
        if (!this.pex.equals(that.pex))
5682
          return false;
5683
      }
5684
 
5685
      return true;
5686
    }
5687
 
5688
    @Override
5689
    public int hashCode() {
5690
      return 0;
5691
    }
5692
 
5693
    public int compareTo(trackCouponUsage_result other) {
5694
      if (!getClass().equals(other.getClass())) {
5695
        return getClass().getName().compareTo(other.getClass().getName());
5696
      }
5697
 
5698
      int lastComparison = 0;
5699
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
5700
 
3430 rajveer 5701
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5702
      if (lastComparison != 0) {
5703
        return lastComparison;
5704
      }
3430 rajveer 5705
      if (isSetPex()) {
5706
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5707
        if (lastComparison != 0) {
5708
          return lastComparison;
5709
        }
1982 varun.gupt 5710
      }
5711
      return 0;
5712
    }
5713
 
3430 rajveer 5714
    public _Fields fieldForId(int fieldId) {
5715
      return _Fields.findByThriftId(fieldId);
5716
    }
5717
 
5718
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5719
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5720
      iprot.readStructBegin();
5721
      while (true)
5722
      {
5723
        field = iprot.readFieldBegin();
3430 rajveer 5724
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5725
          break;
5726
        }
3430 rajveer 5727
        switch (field.id) {
5728
          case 1: // PEX
5729
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5730
              this.pex = new PromotionException();
5731
              this.pex.read(iprot);
5732
            } else { 
5733
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5734
            }
5735
            break;
5736
          default:
5737
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5738
        }
3430 rajveer 5739
        iprot.readFieldEnd();
1982 varun.gupt 5740
      }
5741
      iprot.readStructEnd();
5742
      validate();
5743
    }
5744
 
3430 rajveer 5745
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5746
      oprot.writeStructBegin(STRUCT_DESC);
5747
 
5748
      if (this.isSetPex()) {
5749
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5750
        this.pex.write(oprot);
5751
        oprot.writeFieldEnd();
5752
      }
5753
      oprot.writeFieldStop();
5754
      oprot.writeStructEnd();
5755
    }
5756
 
5757
    @Override
5758
    public String toString() {
5759
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
5760
      boolean first = true;
5761
 
5762
      sb.append("pex:");
5763
      if (this.pex == null) {
5764
        sb.append("null");
5765
      } else {
5766
        sb.append(this.pex);
5767
      }
5768
      first = false;
5769
      sb.append(")");
5770
      return sb.toString();
5771
    }
5772
 
3430 rajveer 5773
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5774
      // check for required fields
5775
    }
5776
 
3430 rajveer 5777
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5778
      try {
5779
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5780
      } catch (org.apache.thrift.TException te) {
5781
        throw new java.io.IOException(te);
5782
      }
5783
    }
5784
 
5785
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5786
      try {
5787
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5788
      } catch (org.apache.thrift.TException te) {
5789
        throw new java.io.IOException(te);
5790
      }
5791
    }
5792
 
1982 varun.gupt 5793
  }
5794
 
3430 rajveer 5795
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
5796
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 5797
 
3430 rajveer 5798
    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);
5799
    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 5800
 
3430 rajveer 5801
    private String couponCode; // required
5802
    private long userId; // required
1982 varun.gupt 5803
 
5804
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5805
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5806
      COUPON_CODE((short)1, "couponCode"),
5807
      USER_ID((short)2, "userId");
5808
 
5809
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5810
 
5811
      static {
5812
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5813
          byName.put(field.getFieldName(), field);
5814
        }
5815
      }
5816
 
5817
      /**
5818
       * Find the _Fields constant that matches fieldId, or null if its not found.
5819
       */
5820
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5821
        switch(fieldId) {
5822
          case 1: // COUPON_CODE
5823
            return COUPON_CODE;
5824
          case 2: // USER_ID
5825
            return USER_ID;
5826
          default:
5827
            return null;
5828
        }
1982 varun.gupt 5829
      }
5830
 
5831
      /**
5832
       * Find the _Fields constant that matches fieldId, throwing an exception
5833
       * if it is not found.
5834
       */
5835
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5836
        _Fields fields = findByThriftId(fieldId);
5837
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5838
        return fields;
5839
      }
5840
 
5841
      /**
5842
       * Find the _Fields constant that matches name, or null if its not found.
5843
       */
5844
      public static _Fields findByName(String name) {
5845
        return byName.get(name);
5846
      }
5847
 
5848
      private final short _thriftId;
5849
      private final String _fieldName;
5850
 
5851
      _Fields(short thriftId, String fieldName) {
5852
        _thriftId = thriftId;
5853
        _fieldName = fieldName;
5854
      }
5855
 
5856
      public short getThriftFieldId() {
5857
        return _thriftId;
5858
      }
5859
 
5860
      public String getFieldName() {
5861
        return _fieldName;
5862
      }
5863
    }
5864
 
5865
    // isset id assignments
5866
    private static final int __USERID_ISSET_ID = 0;
5867
    private BitSet __isset_bit_vector = new BitSet(1);
5868
 
3430 rajveer 5869
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5870
    static {
3430 rajveer 5871
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5872
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5873
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5874
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5875
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5876
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5877
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 5878
    }
5879
 
5880
    public getCouponUsageCountByUser_args() {
5881
    }
5882
 
5883
    public getCouponUsageCountByUser_args(
5884
      String couponCode,
5885
      long userId)
5886
    {
5887
      this();
5888
      this.couponCode = couponCode;
5889
      this.userId = userId;
5890
      setUserIdIsSet(true);
5891
    }
5892
 
5893
    /**
5894
     * Performs a deep copy on <i>other</i>.
5895
     */
5896
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
5897
      __isset_bit_vector.clear();
5898
      __isset_bit_vector.or(other.__isset_bit_vector);
5899
      if (other.isSetCouponCode()) {
5900
        this.couponCode = other.couponCode;
5901
      }
5902
      this.userId = other.userId;
5903
    }
5904
 
5905
    public getCouponUsageCountByUser_args deepCopy() {
5906
      return new getCouponUsageCountByUser_args(this);
5907
    }
5908
 
3430 rajveer 5909
    @Override
5910
    public void clear() {
5911
      this.couponCode = null;
5912
      setUserIdIsSet(false);
5913
      this.userId = 0;
1982 varun.gupt 5914
    }
5915
 
5916
    public String getCouponCode() {
5917
      return this.couponCode;
5918
    }
5919
 
3430 rajveer 5920
    public void setCouponCode(String couponCode) {
1982 varun.gupt 5921
      this.couponCode = couponCode;
5922
    }
5923
 
5924
    public void unsetCouponCode() {
5925
      this.couponCode = null;
5926
    }
5927
 
3430 rajveer 5928
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5929
    public boolean isSetCouponCode() {
5930
      return this.couponCode != null;
5931
    }
5932
 
5933
    public void setCouponCodeIsSet(boolean value) {
5934
      if (!value) {
5935
        this.couponCode = null;
5936
      }
5937
    }
5938
 
5939
    public long getUserId() {
5940
      return this.userId;
5941
    }
5942
 
3430 rajveer 5943
    public void setUserId(long userId) {
1982 varun.gupt 5944
      this.userId = userId;
5945
      setUserIdIsSet(true);
5946
    }
5947
 
5948
    public void unsetUserId() {
5949
      __isset_bit_vector.clear(__USERID_ISSET_ID);
5950
    }
5951
 
3430 rajveer 5952
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5953
    public boolean isSetUserId() {
5954
      return __isset_bit_vector.get(__USERID_ISSET_ID);
5955
    }
5956
 
5957
    public void setUserIdIsSet(boolean value) {
5958
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
5959
    }
5960
 
5961
    public void setFieldValue(_Fields field, Object value) {
5962
      switch (field) {
5963
      case COUPON_CODE:
5964
        if (value == null) {
5965
          unsetCouponCode();
5966
        } else {
5967
          setCouponCode((String)value);
5968
        }
5969
        break;
5970
 
5971
      case USER_ID:
5972
        if (value == null) {
5973
          unsetUserId();
5974
        } else {
5975
          setUserId((Long)value);
5976
        }
5977
        break;
5978
 
5979
      }
5980
    }
5981
 
5982
    public Object getFieldValue(_Fields field) {
5983
      switch (field) {
5984
      case COUPON_CODE:
5985
        return getCouponCode();
5986
 
5987
      case USER_ID:
3430 rajveer 5988
        return Long.valueOf(getUserId());
1982 varun.gupt 5989
 
5990
      }
5991
      throw new IllegalStateException();
5992
    }
5993
 
3430 rajveer 5994
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5995
    public boolean isSet(_Fields field) {
5996
      if (field == null) {
5997
        throw new IllegalArgumentException();
5998
      }
1982 varun.gupt 5999
 
6000
      switch (field) {
6001
      case COUPON_CODE:
6002
        return isSetCouponCode();
6003
      case USER_ID:
6004
        return isSetUserId();
6005
      }
6006
      throw new IllegalStateException();
6007
    }
6008
 
6009
    @Override
6010
    public boolean equals(Object that) {
6011
      if (that == null)
6012
        return false;
6013
      if (that instanceof getCouponUsageCountByUser_args)
6014
        return this.equals((getCouponUsageCountByUser_args)that);
6015
      return false;
6016
    }
6017
 
6018
    public boolean equals(getCouponUsageCountByUser_args that) {
6019
      if (that == null)
6020
        return false;
6021
 
6022
      boolean this_present_couponCode = true && this.isSetCouponCode();
6023
      boolean that_present_couponCode = true && that.isSetCouponCode();
6024
      if (this_present_couponCode || that_present_couponCode) {
6025
        if (!(this_present_couponCode && that_present_couponCode))
6026
          return false;
6027
        if (!this.couponCode.equals(that.couponCode))
6028
          return false;
6029
      }
6030
 
6031
      boolean this_present_userId = true;
6032
      boolean that_present_userId = true;
6033
      if (this_present_userId || that_present_userId) {
6034
        if (!(this_present_userId && that_present_userId))
6035
          return false;
6036
        if (this.userId != that.userId)
6037
          return false;
6038
      }
6039
 
6040
      return true;
6041
    }
6042
 
6043
    @Override
6044
    public int hashCode() {
6045
      return 0;
6046
    }
6047
 
6048
    public int compareTo(getCouponUsageCountByUser_args other) {
6049
      if (!getClass().equals(other.getClass())) {
6050
        return getClass().getName().compareTo(other.getClass().getName());
6051
      }
6052
 
6053
      int lastComparison = 0;
6054
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
6055
 
3430 rajveer 6056
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6057
      if (lastComparison != 0) {
6058
        return lastComparison;
6059
      }
3430 rajveer 6060
      if (isSetCouponCode()) {
6061
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6062
        if (lastComparison != 0) {
6063
          return lastComparison;
6064
        }
1982 varun.gupt 6065
      }
3430 rajveer 6066
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 6067
      if (lastComparison != 0) {
6068
        return lastComparison;
6069
      }
3430 rajveer 6070
      if (isSetUserId()) {
6071
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
6072
        if (lastComparison != 0) {
6073
          return lastComparison;
6074
        }
1982 varun.gupt 6075
      }
6076
      return 0;
6077
    }
6078
 
3430 rajveer 6079
    public _Fields fieldForId(int fieldId) {
6080
      return _Fields.findByThriftId(fieldId);
6081
    }
6082
 
6083
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6084
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6085
      iprot.readStructBegin();
6086
      while (true)
6087
      {
6088
        field = iprot.readFieldBegin();
3430 rajveer 6089
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6090
          break;
6091
        }
3430 rajveer 6092
        switch (field.id) {
6093
          case 1: // COUPON_CODE
6094
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6095
              this.couponCode = iprot.readString();
6096
            } else { 
6097
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6098
            }
6099
            break;
6100
          case 2: // USER_ID
6101
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6102
              this.userId = iprot.readI64();
6103
              setUserIdIsSet(true);
6104
            } else { 
6105
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6106
            }
6107
            break;
6108
          default:
6109
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6110
        }
3430 rajveer 6111
        iprot.readFieldEnd();
1982 varun.gupt 6112
      }
6113
      iprot.readStructEnd();
6114
      validate();
6115
    }
6116
 
3430 rajveer 6117
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6118
      validate();
6119
 
6120
      oprot.writeStructBegin(STRUCT_DESC);
6121
      if (this.couponCode != null) {
6122
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6123
        oprot.writeString(this.couponCode);
6124
        oprot.writeFieldEnd();
6125
      }
6126
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
6127
      oprot.writeI64(this.userId);
6128
      oprot.writeFieldEnd();
6129
      oprot.writeFieldStop();
6130
      oprot.writeStructEnd();
6131
    }
6132
 
6133
    @Override
6134
    public String toString() {
6135
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
6136
      boolean first = true;
6137
 
6138
      sb.append("couponCode:");
6139
      if (this.couponCode == null) {
6140
        sb.append("null");
6141
      } else {
6142
        sb.append(this.couponCode);
6143
      }
6144
      first = false;
6145
      if (!first) sb.append(", ");
6146
      sb.append("userId:");
6147
      sb.append(this.userId);
6148
      first = false;
6149
      sb.append(")");
6150
      return sb.toString();
6151
    }
6152
 
3430 rajveer 6153
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6154
      // check for required fields
6155
    }
6156
 
3430 rajveer 6157
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6158
      try {
6159
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6160
      } catch (org.apache.thrift.TException te) {
6161
        throw new java.io.IOException(te);
6162
      }
6163
    }
6164
 
6165
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6166
      try {
6167
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6168
        __isset_bit_vector = new BitSet(1);
6169
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6170
      } catch (org.apache.thrift.TException te) {
6171
        throw new java.io.IOException(te);
6172
      }
6173
    }
6174
 
1982 varun.gupt 6175
  }
6176
 
3430 rajveer 6177
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
6178
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 6179
 
3430 rajveer 6180
    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);
6181
    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 6182
 
3430 rajveer 6183
    private long success; // required
6184
    private PromotionException pex; // required
1982 varun.gupt 6185
 
6186
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6187
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6188
      SUCCESS((short)0, "success"),
6189
      PEX((short)1, "pex");
6190
 
6191
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6192
 
6193
      static {
6194
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6195
          byName.put(field.getFieldName(), field);
6196
        }
6197
      }
6198
 
6199
      /**
6200
       * Find the _Fields constant that matches fieldId, or null if its not found.
6201
       */
6202
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6203
        switch(fieldId) {
6204
          case 0: // SUCCESS
6205
            return SUCCESS;
6206
          case 1: // PEX
6207
            return PEX;
6208
          default:
6209
            return null;
6210
        }
1982 varun.gupt 6211
      }
6212
 
6213
      /**
6214
       * Find the _Fields constant that matches fieldId, throwing an exception
6215
       * if it is not found.
6216
       */
6217
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6218
        _Fields fields = findByThriftId(fieldId);
6219
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6220
        return fields;
6221
      }
6222
 
6223
      /**
6224
       * Find the _Fields constant that matches name, or null if its not found.
6225
       */
6226
      public static _Fields findByName(String name) {
6227
        return byName.get(name);
6228
      }
6229
 
6230
      private final short _thriftId;
6231
      private final String _fieldName;
6232
 
6233
      _Fields(short thriftId, String fieldName) {
6234
        _thriftId = thriftId;
6235
        _fieldName = fieldName;
6236
      }
6237
 
6238
      public short getThriftFieldId() {
6239
        return _thriftId;
6240
      }
6241
 
6242
      public String getFieldName() {
6243
        return _fieldName;
6244
      }
6245
    }
6246
 
6247
    // isset id assignments
6248
    private static final int __SUCCESS_ISSET_ID = 0;
6249
    private BitSet __isset_bit_vector = new BitSet(1);
6250
 
3430 rajveer 6251
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6252
    static {
3430 rajveer 6253
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6254
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6255
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6256
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6257
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6258
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6259
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 6260
    }
6261
 
6262
    public getCouponUsageCountByUser_result() {
6263
    }
6264
 
6265
    public getCouponUsageCountByUser_result(
6266
      long success,
6267
      PromotionException pex)
6268
    {
6269
      this();
6270
      this.success = success;
6271
      setSuccessIsSet(true);
6272
      this.pex = pex;
6273
    }
6274
 
6275
    /**
6276
     * Performs a deep copy on <i>other</i>.
6277
     */
6278
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
6279
      __isset_bit_vector.clear();
6280
      __isset_bit_vector.or(other.__isset_bit_vector);
6281
      this.success = other.success;
6282
      if (other.isSetPex()) {
6283
        this.pex = new PromotionException(other.pex);
6284
      }
6285
    }
6286
 
6287
    public getCouponUsageCountByUser_result deepCopy() {
6288
      return new getCouponUsageCountByUser_result(this);
6289
    }
6290
 
3430 rajveer 6291
    @Override
6292
    public void clear() {
6293
      setSuccessIsSet(false);
6294
      this.success = 0;
6295
      this.pex = null;
1982 varun.gupt 6296
    }
6297
 
6298
    public long getSuccess() {
6299
      return this.success;
6300
    }
6301
 
3430 rajveer 6302
    public void setSuccess(long success) {
1982 varun.gupt 6303
      this.success = success;
6304
      setSuccessIsSet(true);
6305
    }
6306
 
6307
    public void unsetSuccess() {
6308
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
6309
    }
6310
 
3430 rajveer 6311
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6312
    public boolean isSetSuccess() {
6313
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
6314
    }
6315
 
6316
    public void setSuccessIsSet(boolean value) {
6317
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
6318
    }
6319
 
6320
    public PromotionException getPex() {
6321
      return this.pex;
6322
    }
6323
 
3430 rajveer 6324
    public void setPex(PromotionException pex) {
1982 varun.gupt 6325
      this.pex = pex;
6326
    }
6327
 
6328
    public void unsetPex() {
6329
      this.pex = null;
6330
    }
6331
 
3430 rajveer 6332
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6333
    public boolean isSetPex() {
6334
      return this.pex != null;
6335
    }
6336
 
6337
    public void setPexIsSet(boolean value) {
6338
      if (!value) {
6339
        this.pex = null;
6340
      }
6341
    }
6342
 
6343
    public void setFieldValue(_Fields field, Object value) {
6344
      switch (field) {
6345
      case SUCCESS:
6346
        if (value == null) {
6347
          unsetSuccess();
6348
        } else {
6349
          setSuccess((Long)value);
6350
        }
6351
        break;
6352
 
6353
      case PEX:
6354
        if (value == null) {
6355
          unsetPex();
6356
        } else {
6357
          setPex((PromotionException)value);
6358
        }
6359
        break;
6360
 
6361
      }
6362
    }
6363
 
6364
    public Object getFieldValue(_Fields field) {
6365
      switch (field) {
6366
      case SUCCESS:
3430 rajveer 6367
        return Long.valueOf(getSuccess());
1982 varun.gupt 6368
 
6369
      case PEX:
6370
        return getPex();
6371
 
6372
      }
6373
      throw new IllegalStateException();
6374
    }
6375
 
3430 rajveer 6376
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6377
    public boolean isSet(_Fields field) {
6378
      if (field == null) {
6379
        throw new IllegalArgumentException();
6380
      }
1982 varun.gupt 6381
 
6382
      switch (field) {
6383
      case SUCCESS:
6384
        return isSetSuccess();
6385
      case PEX:
6386
        return isSetPex();
6387
      }
6388
      throw new IllegalStateException();
6389
    }
6390
 
6391
    @Override
6392
    public boolean equals(Object that) {
6393
      if (that == null)
6394
        return false;
6395
      if (that instanceof getCouponUsageCountByUser_result)
6396
        return this.equals((getCouponUsageCountByUser_result)that);
6397
      return false;
6398
    }
6399
 
6400
    public boolean equals(getCouponUsageCountByUser_result that) {
6401
      if (that == null)
6402
        return false;
6403
 
6404
      boolean this_present_success = true;
6405
      boolean that_present_success = true;
6406
      if (this_present_success || that_present_success) {
6407
        if (!(this_present_success && that_present_success))
6408
          return false;
6409
        if (this.success != that.success)
6410
          return false;
6411
      }
6412
 
6413
      boolean this_present_pex = true && this.isSetPex();
6414
      boolean that_present_pex = true && that.isSetPex();
6415
      if (this_present_pex || that_present_pex) {
6416
        if (!(this_present_pex && that_present_pex))
6417
          return false;
6418
        if (!this.pex.equals(that.pex))
6419
          return false;
6420
      }
6421
 
6422
      return true;
6423
    }
6424
 
6425
    @Override
6426
    public int hashCode() {
6427
      return 0;
6428
    }
6429
 
6430
    public int compareTo(getCouponUsageCountByUser_result other) {
6431
      if (!getClass().equals(other.getClass())) {
6432
        return getClass().getName().compareTo(other.getClass().getName());
6433
      }
6434
 
6435
      int lastComparison = 0;
6436
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
6437
 
3430 rajveer 6438
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6439
      if (lastComparison != 0) {
6440
        return lastComparison;
6441
      }
3430 rajveer 6442
      if (isSetSuccess()) {
6443
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6444
        if (lastComparison != 0) {
6445
          return lastComparison;
6446
        }
1982 varun.gupt 6447
      }
3430 rajveer 6448
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6449
      if (lastComparison != 0) {
6450
        return lastComparison;
6451
      }
3430 rajveer 6452
      if (isSetPex()) {
6453
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6454
        if (lastComparison != 0) {
6455
          return lastComparison;
6456
        }
1982 varun.gupt 6457
      }
6458
      return 0;
6459
    }
6460
 
3430 rajveer 6461
    public _Fields fieldForId(int fieldId) {
6462
      return _Fields.findByThriftId(fieldId);
6463
    }
6464
 
6465
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6466
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6467
      iprot.readStructBegin();
6468
      while (true)
6469
      {
6470
        field = iprot.readFieldBegin();
3430 rajveer 6471
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6472
          break;
6473
        }
3430 rajveer 6474
        switch (field.id) {
6475
          case 0: // SUCCESS
6476
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6477
              this.success = iprot.readI64();
6478
              setSuccessIsSet(true);
6479
            } else { 
6480
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6481
            }
6482
            break;
6483
          case 1: // PEX
6484
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6485
              this.pex = new PromotionException();
6486
              this.pex.read(iprot);
6487
            } else { 
6488
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6489
            }
6490
            break;
6491
          default:
6492
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6493
        }
3430 rajveer 6494
        iprot.readFieldEnd();
1982 varun.gupt 6495
      }
6496
      iprot.readStructEnd();
6497
      validate();
6498
    }
6499
 
3430 rajveer 6500
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6501
      oprot.writeStructBegin(STRUCT_DESC);
6502
 
6503
      if (this.isSetSuccess()) {
6504
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6505
        oprot.writeI64(this.success);
6506
        oprot.writeFieldEnd();
6507
      } else 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("getCouponUsageCountByUser_result(");
6519
      boolean first = true;
6520
 
6521
      sb.append("success:");
6522
      sb.append(this.success);
6523
      first = false;
6524
      if (!first) sb.append(", ");
6525
      sb.append("pex:");
6526
      if (this.pex == null) {
6527
        sb.append("null");
6528
      } else {
6529
        sb.append(this.pex);
6530
      }
6531
      first = false;
6532
      sb.append(")");
6533
      return sb.toString();
6534
    }
6535
 
3430 rajveer 6536
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6537
      // check for required fields
6538
    }
6539
 
3430 rajveer 6540
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6541
      try {
6542
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6543
      } catch (org.apache.thrift.TException te) {
6544
        throw new java.io.IOException(te);
6545
      }
6546
    }
6547
 
6548
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6549
      try {
6550
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6551
      } catch (org.apache.thrift.TException te) {
6552
        throw new java.io.IOException(te);
6553
      }
6554
    }
6555
 
1982 varun.gupt 6556
  }
6557
 
3430 rajveer 6558
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
6559
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 6560
 
6561
 
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 {
3385 varun.gupt 6565
;
6566
 
6567
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6568
 
6569
      static {
6570
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6571
          byName.put(field.getFieldName(), field);
6572
        }
6573
      }
6574
 
6575
      /**
6576
       * Find the _Fields constant that matches fieldId, or null if its not found.
6577
       */
6578
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6579
        switch(fieldId) {
6580
          default:
6581
            return null;
6582
        }
3385 varun.gupt 6583
      }
6584
 
6585
      /**
6586
       * Find the _Fields constant that matches fieldId, throwing an exception
6587
       * if it is not found.
6588
       */
6589
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6590
        _Fields fields = findByThriftId(fieldId);
6591
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6592
        return fields;
6593
      }
6594
 
6595
      /**
6596
       * Find the _Fields constant that matches name, or null if its not found.
6597
       */
6598
      public static _Fields findByName(String name) {
6599
        return byName.get(name);
6600
      }
6601
 
6602
      private final short _thriftId;
6603
      private final String _fieldName;
6604
 
6605
      _Fields(short thriftId, String fieldName) {
6606
        _thriftId = thriftId;
6607
        _fieldName = fieldName;
6608
      }
6609
 
6610
      public short getThriftFieldId() {
6611
        return _thriftId;
6612
      }
6613
 
6614
      public String getFieldName() {
6615
        return _fieldName;
6616
      }
6617
    }
3430 rajveer 6618
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6619
    static {
3430 rajveer 6620
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6621
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6622
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 6623
    }
6624
 
6625
    public getActiveCoupons_args() {
6626
    }
6627
 
6628
    /**
6629
     * Performs a deep copy on <i>other</i>.
6630
     */
6631
    public getActiveCoupons_args(getActiveCoupons_args other) {
6632
    }
6633
 
6634
    public getActiveCoupons_args deepCopy() {
6635
      return new getActiveCoupons_args(this);
6636
    }
6637
 
3430 rajveer 6638
    @Override
6639
    public void clear() {
3385 varun.gupt 6640
    }
6641
 
6642
    public void setFieldValue(_Fields field, Object value) {
6643
      switch (field) {
6644
      }
6645
    }
6646
 
6647
    public Object getFieldValue(_Fields field) {
6648
      switch (field) {
6649
      }
6650
      throw new IllegalStateException();
6651
    }
6652
 
3430 rajveer 6653
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6654
    public boolean isSet(_Fields field) {
6655
      if (field == null) {
6656
        throw new IllegalArgumentException();
6657
      }
3385 varun.gupt 6658
 
6659
      switch (field) {
6660
      }
6661
      throw new IllegalStateException();
6662
    }
6663
 
6664
    @Override
6665
    public boolean equals(Object that) {
6666
      if (that == null)
6667
        return false;
6668
      if (that instanceof getActiveCoupons_args)
6669
        return this.equals((getActiveCoupons_args)that);
6670
      return false;
6671
    }
6672
 
6673
    public boolean equals(getActiveCoupons_args that) {
6674
      if (that == null)
6675
        return false;
6676
 
6677
      return true;
6678
    }
6679
 
6680
    @Override
6681
    public int hashCode() {
6682
      return 0;
6683
    }
6684
 
6685
    public int compareTo(getActiveCoupons_args other) {
6686
      if (!getClass().equals(other.getClass())) {
6687
        return getClass().getName().compareTo(other.getClass().getName());
6688
      }
6689
 
6690
      int lastComparison = 0;
6691
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
6692
 
6693
      return 0;
6694
    }
6695
 
3430 rajveer 6696
    public _Fields fieldForId(int fieldId) {
6697
      return _Fields.findByThriftId(fieldId);
6698
    }
6699
 
6700
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6701
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 6702
      iprot.readStructBegin();
6703
      while (true)
6704
      {
6705
        field = iprot.readFieldBegin();
3430 rajveer 6706
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 6707
          break;
6708
        }
3430 rajveer 6709
        switch (field.id) {
6710
          default:
6711
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 6712
        }
3430 rajveer 6713
        iprot.readFieldEnd();
3385 varun.gupt 6714
      }
6715
      iprot.readStructEnd();
6716
      validate();
6717
    }
6718
 
3430 rajveer 6719
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 6720
      validate();
6721
 
6722
      oprot.writeStructBegin(STRUCT_DESC);
6723
      oprot.writeFieldStop();
6724
      oprot.writeStructEnd();
6725
    }
6726
 
6727
    @Override
6728
    public String toString() {
6729
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
6730
      boolean first = true;
6731
 
6732
      sb.append(")");
6733
      return sb.toString();
6734
    }
6735
 
3430 rajveer 6736
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 6737
      // check for required fields
6738
    }
6739
 
3430 rajveer 6740
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6741
      try {
6742
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6743
      } catch (org.apache.thrift.TException te) {
6744
        throw new java.io.IOException(te);
6745
      }
6746
    }
6747
 
6748
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6749
      try {
6750
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6751
      } catch (org.apache.thrift.TException te) {
6752
        throw new java.io.IOException(te);
6753
      }
6754
    }
6755
 
3385 varun.gupt 6756
  }
6757
 
3430 rajveer 6758
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
6759
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 6760
 
3430 rajveer 6761
    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);
6762
    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 6763
 
3430 rajveer 6764
    private List<Coupon> success; // required
6765
    private PromotionException pex; // required
3385 varun.gupt 6766
 
6767
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6768
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6769
      SUCCESS((short)0, "success"),
6770
      PEX((short)1, "pex");
6771
 
6772
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6773
 
6774
      static {
6775
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6776
          byName.put(field.getFieldName(), field);
6777
        }
6778
      }
6779
 
6780
      /**
6781
       * Find the _Fields constant that matches fieldId, or null if its not found.
6782
       */
6783
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6784
        switch(fieldId) {
6785
          case 0: // SUCCESS
6786
            return SUCCESS;
6787
          case 1: // PEX
6788
            return PEX;
6789
          default:
6790
            return null;
6791
        }
3385 varun.gupt 6792
      }
6793
 
6794
      /**
6795
       * Find the _Fields constant that matches fieldId, throwing an exception
6796
       * if it is not found.
6797
       */
6798
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6799
        _Fields fields = findByThriftId(fieldId);
6800
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6801
        return fields;
6802
      }
6803
 
6804
      /**
6805
       * Find the _Fields constant that matches name, or null if its not found.
6806
       */
6807
      public static _Fields findByName(String name) {
6808
        return byName.get(name);
6809
      }
6810
 
6811
      private final short _thriftId;
6812
      private final String _fieldName;
6813
 
6814
      _Fields(short thriftId, String fieldName) {
6815
        _thriftId = thriftId;
6816
        _fieldName = fieldName;
6817
      }
6818
 
6819
      public short getThriftFieldId() {
6820
        return _thriftId;
6821
      }
6822
 
6823
      public String getFieldName() {
6824
        return _fieldName;
6825
      }
6826
    }
6827
 
6828
    // isset id assignments
6829
 
3430 rajveer 6830
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6831
    static {
3430 rajveer 6832
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6833
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6834
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6835
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
6836
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6837
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6838
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6839
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 6840
    }
6841
 
6842
    public getActiveCoupons_result() {
6843
    }
6844
 
6845
    public getActiveCoupons_result(
6846
      List<Coupon> success,
6847
      PromotionException pex)
6848
    {
6849
      this();
6850
      this.success = success;
6851
      this.pex = pex;
6852
    }
6853
 
6854
    /**
6855
     * Performs a deep copy on <i>other</i>.
6856
     */
6857
    public getActiveCoupons_result(getActiveCoupons_result other) {
6858
      if (other.isSetSuccess()) {
6859
        List<Coupon> __this__success = new ArrayList<Coupon>();
6860
        for (Coupon other_element : other.success) {
6861
          __this__success.add(new Coupon(other_element));
6862
        }
6863
        this.success = __this__success;
6864
      }
6865
      if (other.isSetPex()) {
6866
        this.pex = new PromotionException(other.pex);
6867
      }
6868
    }
6869
 
6870
    public getActiveCoupons_result deepCopy() {
6871
      return new getActiveCoupons_result(this);
6872
    }
6873
 
3430 rajveer 6874
    @Override
6875
    public void clear() {
6876
      this.success = null;
6877
      this.pex = null;
3385 varun.gupt 6878
    }
6879
 
6880
    public int getSuccessSize() {
6881
      return (this.success == null) ? 0 : this.success.size();
6882
    }
6883
 
6884
    public java.util.Iterator<Coupon> getSuccessIterator() {
6885
      return (this.success == null) ? null : this.success.iterator();
6886
    }
6887
 
6888
    public void addToSuccess(Coupon elem) {
6889
      if (this.success == null) {
6890
        this.success = new ArrayList<Coupon>();
6891
      }
6892
      this.success.add(elem);
6893
    }
6894
 
6895
    public List<Coupon> getSuccess() {
6896
      return this.success;
6897
    }
6898
 
3430 rajveer 6899
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 6900
      this.success = success;
6901
    }
6902
 
6903
    public void unsetSuccess() {
6904
      this.success = null;
6905
    }
6906
 
3430 rajveer 6907
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 6908
    public boolean isSetSuccess() {
6909
      return this.success != null;
6910
    }
6911
 
6912
    public void setSuccessIsSet(boolean value) {
6913
      if (!value) {
6914
        this.success = null;
6915
      }
6916
    }
6917
 
6918
    public PromotionException getPex() {
6919
      return this.pex;
6920
    }
6921
 
3430 rajveer 6922
    public void setPex(PromotionException pex) {
3385 varun.gupt 6923
      this.pex = pex;
6924
    }
6925
 
6926
    public void unsetPex() {
6927
      this.pex = null;
6928
    }
6929
 
3430 rajveer 6930
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 6931
    public boolean isSetPex() {
6932
      return this.pex != null;
6933
    }
6934
 
6935
    public void setPexIsSet(boolean value) {
6936
      if (!value) {
6937
        this.pex = null;
6938
      }
6939
    }
6940
 
6941
    public void setFieldValue(_Fields field, Object value) {
6942
      switch (field) {
6943
      case SUCCESS:
6944
        if (value == null) {
6945
          unsetSuccess();
6946
        } else {
6947
          setSuccess((List<Coupon>)value);
6948
        }
6949
        break;
6950
 
6951
      case PEX:
6952
        if (value == null) {
6953
          unsetPex();
6954
        } else {
6955
          setPex((PromotionException)value);
6956
        }
6957
        break;
6958
 
6959
      }
6960
    }
6961
 
6962
    public Object getFieldValue(_Fields field) {
6963
      switch (field) {
6964
      case SUCCESS:
6965
        return getSuccess();
6966
 
6967
      case PEX:
6968
        return getPex();
6969
 
6970
      }
6971
      throw new IllegalStateException();
6972
    }
6973
 
3430 rajveer 6974
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6975
    public boolean isSet(_Fields field) {
6976
      if (field == null) {
6977
        throw new IllegalArgumentException();
6978
      }
3385 varun.gupt 6979
 
6980
      switch (field) {
6981
      case SUCCESS:
6982
        return isSetSuccess();
6983
      case PEX:
6984
        return isSetPex();
6985
      }
6986
      throw new IllegalStateException();
6987
    }
6988
 
6989
    @Override
6990
    public boolean equals(Object that) {
6991
      if (that == null)
6992
        return false;
6993
      if (that instanceof getActiveCoupons_result)
6994
        return this.equals((getActiveCoupons_result)that);
6995
      return false;
6996
    }
6997
 
6998
    public boolean equals(getActiveCoupons_result that) {
6999
      if (that == null)
7000
        return false;
7001
 
7002
      boolean this_present_success = true && this.isSetSuccess();
7003
      boolean that_present_success = true && that.isSetSuccess();
7004
      if (this_present_success || that_present_success) {
7005
        if (!(this_present_success && that_present_success))
7006
          return false;
7007
        if (!this.success.equals(that.success))
7008
          return false;
7009
      }
7010
 
7011
      boolean this_present_pex = true && this.isSetPex();
7012
      boolean that_present_pex = true && that.isSetPex();
7013
      if (this_present_pex || that_present_pex) {
7014
        if (!(this_present_pex && that_present_pex))
7015
          return false;
7016
        if (!this.pex.equals(that.pex))
7017
          return false;
7018
      }
7019
 
7020
      return true;
7021
    }
7022
 
7023
    @Override
7024
    public int hashCode() {
7025
      return 0;
7026
    }
7027
 
7028
    public int compareTo(getActiveCoupons_result other) {
7029
      if (!getClass().equals(other.getClass())) {
7030
        return getClass().getName().compareTo(other.getClass().getName());
7031
      }
7032
 
7033
      int lastComparison = 0;
7034
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
7035
 
3430 rajveer 7036
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 7037
      if (lastComparison != 0) {
7038
        return lastComparison;
7039
      }
3430 rajveer 7040
      if (isSetSuccess()) {
7041
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7042
        if (lastComparison != 0) {
7043
          return lastComparison;
7044
        }
3385 varun.gupt 7045
      }
3430 rajveer 7046
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 7047
      if (lastComparison != 0) {
7048
        return lastComparison;
7049
      }
3430 rajveer 7050
      if (isSetPex()) {
7051
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7052
        if (lastComparison != 0) {
7053
          return lastComparison;
7054
        }
3385 varun.gupt 7055
      }
7056
      return 0;
7057
    }
7058
 
3430 rajveer 7059
    public _Fields fieldForId(int fieldId) {
7060
      return _Fields.findByThriftId(fieldId);
7061
    }
7062
 
7063
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7064
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 7065
      iprot.readStructBegin();
7066
      while (true)
7067
      {
7068
        field = iprot.readFieldBegin();
3430 rajveer 7069
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 7070
          break;
7071
        }
3430 rajveer 7072
        switch (field.id) {
7073
          case 0: // SUCCESS
7074
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
7075
              {
5327 rajveer 7076
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
7077
                this.success = new ArrayList<Coupon>(_list16.size);
7078
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
3385 varun.gupt 7079
                {
5327 rajveer 7080
                  Coupon _elem18; // required
7081
                  _elem18 = new Coupon();
7082
                  _elem18.read(iprot);
7083
                  this.success.add(_elem18);
3385 varun.gupt 7084
                }
3430 rajveer 7085
                iprot.readListEnd();
3385 varun.gupt 7086
              }
3430 rajveer 7087
            } else { 
7088
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7089
            }
7090
            break;
7091
          case 1: // PEX
7092
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7093
              this.pex = new PromotionException();
7094
              this.pex.read(iprot);
7095
            } else { 
7096
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7097
            }
7098
            break;
7099
          default:
7100
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7101
        }
3430 rajveer 7102
        iprot.readFieldEnd();
3385 varun.gupt 7103
      }
7104
      iprot.readStructEnd();
7105
      validate();
7106
    }
7107
 
3430 rajveer 7108
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7109
      oprot.writeStructBegin(STRUCT_DESC);
7110
 
7111
      if (this.isSetSuccess()) {
7112
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7113
        {
3430 rajveer 7114
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 7115
          for (Coupon _iter19 : this.success)
3385 varun.gupt 7116
          {
5327 rajveer 7117
            _iter19.write(oprot);
3385 varun.gupt 7118
          }
7119
          oprot.writeListEnd();
7120
        }
7121
        oprot.writeFieldEnd();
7122
      } else if (this.isSetPex()) {
7123
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7124
        this.pex.write(oprot);
7125
        oprot.writeFieldEnd();
7126
      }
7127
      oprot.writeFieldStop();
7128
      oprot.writeStructEnd();
7129
    }
7130
 
7131
    @Override
7132
    public String toString() {
7133
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
7134
      boolean first = true;
7135
 
7136
      sb.append("success:");
7137
      if (this.success == null) {
7138
        sb.append("null");
7139
      } else {
7140
        sb.append(this.success);
7141
      }
7142
      first = false;
7143
      if (!first) sb.append(", ");
7144
      sb.append("pex:");
7145
      if (this.pex == null) {
7146
        sb.append("null");
7147
      } else {
7148
        sb.append(this.pex);
7149
      }
7150
      first = false;
7151
      sb.append(")");
7152
      return sb.toString();
7153
    }
7154
 
3430 rajveer 7155
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7156
      // check for required fields
7157
    }
7158
 
3430 rajveer 7159
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7160
      try {
7161
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7162
      } catch (org.apache.thrift.TException te) {
7163
        throw new java.io.IOException(te);
7164
      }
7165
    }
7166
 
7167
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7168
      try {
7169
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7170
      } catch (org.apache.thrift.TException te) {
7171
        throw new java.io.IOException(te);
7172
      }
7173
    }
7174
 
3385 varun.gupt 7175
  }
7176
 
6250 amit.gupta 7177
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7178
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
7179
 
7180
    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);
7181
    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);
7182
    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);
7183
    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);
7184
    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)5);
7185
 
7186
    private long promotionId; // required
7187
    private long endOn; // required
7188
    private String email; // required
7189
    private long amount; // required
7190
    private long usage; // required
7191
 
7192
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7193
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7194
      PROMOTION_ID((short)1, "promotionId"),
7195
      END_ON((short)2, "endOn"),
7196
      EMAIL((short)3, "email"),
7197
      AMOUNT((short)4, "amount"),
7198
      USAGE((short)5, "usage");
7199
 
7200
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7201
 
7202
      static {
7203
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7204
          byName.put(field.getFieldName(), field);
7205
        }
7206
      }
7207
 
7208
      /**
7209
       * Find the _Fields constant that matches fieldId, or null if its not found.
7210
       */
7211
      public static _Fields findByThriftId(int fieldId) {
7212
        switch(fieldId) {
7213
          case 1: // PROMOTION_ID
7214
            return PROMOTION_ID;
7215
          case 2: // END_ON
7216
            return END_ON;
7217
          case 3: // EMAIL
7218
            return EMAIL;
7219
          case 4: // AMOUNT
7220
            return AMOUNT;
7221
          case 5: // USAGE
7222
            return USAGE;
7223
          default:
7224
            return null;
7225
        }
7226
      }
7227
 
7228
      /**
7229
       * Find the _Fields constant that matches fieldId, throwing an exception
7230
       * if it is not found.
7231
       */
7232
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7233
        _Fields fields = findByThriftId(fieldId);
7234
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7235
        return fields;
7236
      }
7237
 
7238
      /**
7239
       * Find the _Fields constant that matches name, or null if its not found.
7240
       */
7241
      public static _Fields findByName(String name) {
7242
        return byName.get(name);
7243
      }
7244
 
7245
      private final short _thriftId;
7246
      private final String _fieldName;
7247
 
7248
      _Fields(short thriftId, String fieldName) {
7249
        _thriftId = thriftId;
7250
        _fieldName = fieldName;
7251
      }
7252
 
7253
      public short getThriftFieldId() {
7254
        return _thriftId;
7255
      }
7256
 
7257
      public String getFieldName() {
7258
        return _fieldName;
7259
      }
7260
    }
7261
 
7262
    // isset id assignments
7263
    private static final int __PROMOTIONID_ISSET_ID = 0;
7264
    private static final int __ENDON_ISSET_ID = 1;
7265
    private static final int __AMOUNT_ISSET_ID = 2;
7266
    private static final int __USAGE_ISSET_ID = 3;
7267
    private BitSet __isset_bit_vector = new BitSet(4);
7268
 
7269
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7270
    static {
7271
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7272
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7273
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7274
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7275
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7276
      tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7277
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7278
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7279
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7280
      tmpMap.put(_Fields.USAGE, new org.apache.thrift.meta_data.FieldMetaData("usage", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7281
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7282
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7283
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
7284
    }
7285
 
7286
    public createCoupon_args() {
7287
    }
7288
 
7289
    public createCoupon_args(
7290
      long promotionId,
7291
      long endOn,
7292
      String email,
7293
      long amount,
7294
      long usage)
7295
    {
7296
      this();
7297
      this.promotionId = promotionId;
7298
      setPromotionIdIsSet(true);
7299
      this.endOn = endOn;
7300
      setEndOnIsSet(true);
7301
      this.email = email;
7302
      this.amount = amount;
7303
      setAmountIsSet(true);
7304
      this.usage = usage;
7305
      setUsageIsSet(true);
7306
    }
7307
 
7308
    /**
7309
     * Performs a deep copy on <i>other</i>.
7310
     */
7311
    public createCoupon_args(createCoupon_args other) {
7312
      __isset_bit_vector.clear();
7313
      __isset_bit_vector.or(other.__isset_bit_vector);
7314
      this.promotionId = other.promotionId;
7315
      this.endOn = other.endOn;
7316
      if (other.isSetEmail()) {
7317
        this.email = other.email;
7318
      }
7319
      this.amount = other.amount;
7320
      this.usage = other.usage;
7321
    }
7322
 
7323
    public createCoupon_args deepCopy() {
7324
      return new createCoupon_args(this);
7325
    }
7326
 
7327
    @Override
7328
    public void clear() {
7329
      setPromotionIdIsSet(false);
7330
      this.promotionId = 0;
7331
      setEndOnIsSet(false);
7332
      this.endOn = 0;
7333
      this.email = null;
7334
      setAmountIsSet(false);
7335
      this.amount = 0;
7336
      setUsageIsSet(false);
7337
      this.usage = 0;
7338
    }
7339
 
7340
    public long getPromotionId() {
7341
      return this.promotionId;
7342
    }
7343
 
7344
    public void setPromotionId(long promotionId) {
7345
      this.promotionId = promotionId;
7346
      setPromotionIdIsSet(true);
7347
    }
7348
 
7349
    public void unsetPromotionId() {
7350
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
7351
    }
7352
 
7353
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
7354
    public boolean isSetPromotionId() {
7355
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
7356
    }
7357
 
7358
    public void setPromotionIdIsSet(boolean value) {
7359
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
7360
    }
7361
 
7362
    public long getEndOn() {
7363
      return this.endOn;
7364
    }
7365
 
7366
    public void setEndOn(long endOn) {
7367
      this.endOn = endOn;
7368
      setEndOnIsSet(true);
7369
    }
7370
 
7371
    public void unsetEndOn() {
7372
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
7373
    }
7374
 
7375
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
7376
    public boolean isSetEndOn() {
7377
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
7378
    }
7379
 
7380
    public void setEndOnIsSet(boolean value) {
7381
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
7382
    }
7383
 
7384
    public String getEmail() {
7385
      return this.email;
7386
    }
7387
 
7388
    public void setEmail(String email) {
7389
      this.email = email;
7390
    }
7391
 
7392
    public void unsetEmail() {
7393
      this.email = null;
7394
    }
7395
 
7396
    /** Returns true if field email is set (has been assigned a value) and false otherwise */
7397
    public boolean isSetEmail() {
7398
      return this.email != null;
7399
    }
7400
 
7401
    public void setEmailIsSet(boolean value) {
7402
      if (!value) {
7403
        this.email = null;
7404
      }
7405
    }
7406
 
7407
    public long getAmount() {
7408
      return this.amount;
7409
    }
7410
 
7411
    public void setAmount(long amount) {
7412
      this.amount = amount;
7413
      setAmountIsSet(true);
7414
    }
7415
 
7416
    public void unsetAmount() {
7417
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
7418
    }
7419
 
7420
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
7421
    public boolean isSetAmount() {
7422
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
7423
    }
7424
 
7425
    public void setAmountIsSet(boolean value) {
7426
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
7427
    }
7428
 
7429
    public long getUsage() {
7430
      return this.usage;
7431
    }
7432
 
7433
    public void setUsage(long usage) {
7434
      this.usage = usage;
7435
      setUsageIsSet(true);
7436
    }
7437
 
7438
    public void unsetUsage() {
7439
      __isset_bit_vector.clear(__USAGE_ISSET_ID);
7440
    }
7441
 
7442
    /** Returns true if field usage is set (has been assigned a value) and false otherwise */
7443
    public boolean isSetUsage() {
7444
      return __isset_bit_vector.get(__USAGE_ISSET_ID);
7445
    }
7446
 
7447
    public void setUsageIsSet(boolean value) {
7448
      __isset_bit_vector.set(__USAGE_ISSET_ID, value);
7449
    }
7450
 
7451
    public void setFieldValue(_Fields field, Object value) {
7452
      switch (field) {
7453
      case PROMOTION_ID:
7454
        if (value == null) {
7455
          unsetPromotionId();
7456
        } else {
7457
          setPromotionId((Long)value);
7458
        }
7459
        break;
7460
 
7461
      case END_ON:
7462
        if (value == null) {
7463
          unsetEndOn();
7464
        } else {
7465
          setEndOn((Long)value);
7466
        }
7467
        break;
7468
 
7469
      case EMAIL:
7470
        if (value == null) {
7471
          unsetEmail();
7472
        } else {
7473
          setEmail((String)value);
7474
        }
7475
        break;
7476
 
7477
      case AMOUNT:
7478
        if (value == null) {
7479
          unsetAmount();
7480
        } else {
7481
          setAmount((Long)value);
7482
        }
7483
        break;
7484
 
7485
      case USAGE:
7486
        if (value == null) {
7487
          unsetUsage();
7488
        } else {
7489
          setUsage((Long)value);
7490
        }
7491
        break;
7492
 
7493
      }
7494
    }
7495
 
7496
    public Object getFieldValue(_Fields field) {
7497
      switch (field) {
7498
      case PROMOTION_ID:
7499
        return Long.valueOf(getPromotionId());
7500
 
7501
      case END_ON:
7502
        return Long.valueOf(getEndOn());
7503
 
7504
      case EMAIL:
7505
        return getEmail();
7506
 
7507
      case AMOUNT:
7508
        return Long.valueOf(getAmount());
7509
 
7510
      case USAGE:
7511
        return Long.valueOf(getUsage());
7512
 
7513
      }
7514
      throw new IllegalStateException();
7515
    }
7516
 
7517
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7518
    public boolean isSet(_Fields field) {
7519
      if (field == null) {
7520
        throw new IllegalArgumentException();
7521
      }
7522
 
7523
      switch (field) {
7524
      case PROMOTION_ID:
7525
        return isSetPromotionId();
7526
      case END_ON:
7527
        return isSetEndOn();
7528
      case EMAIL:
7529
        return isSetEmail();
7530
      case AMOUNT:
7531
        return isSetAmount();
7532
      case USAGE:
7533
        return isSetUsage();
7534
      }
7535
      throw new IllegalStateException();
7536
    }
7537
 
7538
    @Override
7539
    public boolean equals(Object that) {
7540
      if (that == null)
7541
        return false;
7542
      if (that instanceof createCoupon_args)
7543
        return this.equals((createCoupon_args)that);
7544
      return false;
7545
    }
7546
 
7547
    public boolean equals(createCoupon_args that) {
7548
      if (that == null)
7549
        return false;
7550
 
7551
      boolean this_present_promotionId = true;
7552
      boolean that_present_promotionId = true;
7553
      if (this_present_promotionId || that_present_promotionId) {
7554
        if (!(this_present_promotionId && that_present_promotionId))
7555
          return false;
7556
        if (this.promotionId != that.promotionId)
7557
          return false;
7558
      }
7559
 
7560
      boolean this_present_endOn = true;
7561
      boolean that_present_endOn = true;
7562
      if (this_present_endOn || that_present_endOn) {
7563
        if (!(this_present_endOn && that_present_endOn))
7564
          return false;
7565
        if (this.endOn != that.endOn)
7566
          return false;
7567
      }
7568
 
7569
      boolean this_present_email = true && this.isSetEmail();
7570
      boolean that_present_email = true && that.isSetEmail();
7571
      if (this_present_email || that_present_email) {
7572
        if (!(this_present_email && that_present_email))
7573
          return false;
7574
        if (!this.email.equals(that.email))
7575
          return false;
7576
      }
7577
 
7578
      boolean this_present_amount = true;
7579
      boolean that_present_amount = true;
7580
      if (this_present_amount || that_present_amount) {
7581
        if (!(this_present_amount && that_present_amount))
7582
          return false;
7583
        if (this.amount != that.amount)
7584
          return false;
7585
      }
7586
 
7587
      boolean this_present_usage = true;
7588
      boolean that_present_usage = true;
7589
      if (this_present_usage || that_present_usage) {
7590
        if (!(this_present_usage && that_present_usage))
7591
          return false;
7592
        if (this.usage != that.usage)
7593
          return false;
7594
      }
7595
 
7596
      return true;
7597
    }
7598
 
7599
    @Override
7600
    public int hashCode() {
7601
      return 0;
7602
    }
7603
 
7604
    public int compareTo(createCoupon_args other) {
7605
      if (!getClass().equals(other.getClass())) {
7606
        return getClass().getName().compareTo(other.getClass().getName());
7607
      }
7608
 
7609
      int lastComparison = 0;
7610
      createCoupon_args typedOther = (createCoupon_args)other;
7611
 
7612
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
7613
      if (lastComparison != 0) {
7614
        return lastComparison;
7615
      }
7616
      if (isSetPromotionId()) {
7617
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
7618
        if (lastComparison != 0) {
7619
          return lastComparison;
7620
        }
7621
      }
7622
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
7623
      if (lastComparison != 0) {
7624
        return lastComparison;
7625
      }
7626
      if (isSetEndOn()) {
7627
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
7628
        if (lastComparison != 0) {
7629
          return lastComparison;
7630
        }
7631
      }
7632
      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
7633
      if (lastComparison != 0) {
7634
        return lastComparison;
7635
      }
7636
      if (isSetEmail()) {
7637
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
7638
        if (lastComparison != 0) {
7639
          return lastComparison;
7640
        }
7641
      }
7642
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
7643
      if (lastComparison != 0) {
7644
        return lastComparison;
7645
      }
7646
      if (isSetAmount()) {
7647
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
7648
        if (lastComparison != 0) {
7649
          return lastComparison;
7650
        }
7651
      }
7652
      lastComparison = Boolean.valueOf(isSetUsage()).compareTo(typedOther.isSetUsage());
7653
      if (lastComparison != 0) {
7654
        return lastComparison;
7655
      }
7656
      if (isSetUsage()) {
7657
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usage, typedOther.usage);
7658
        if (lastComparison != 0) {
7659
          return lastComparison;
7660
        }
7661
      }
7662
      return 0;
7663
    }
7664
 
7665
    public _Fields fieldForId(int fieldId) {
7666
      return _Fields.findByThriftId(fieldId);
7667
    }
7668
 
7669
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7670
      org.apache.thrift.protocol.TField field;
7671
      iprot.readStructBegin();
7672
      while (true)
7673
      {
7674
        field = iprot.readFieldBegin();
7675
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7676
          break;
7677
        }
7678
        switch (field.id) {
7679
          case 1: // PROMOTION_ID
7680
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7681
              this.promotionId = iprot.readI64();
7682
              setPromotionIdIsSet(true);
7683
            } else { 
7684
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7685
            }
7686
            break;
7687
          case 2: // END_ON
7688
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7689
              this.endOn = iprot.readI64();
7690
              setEndOnIsSet(true);
7691
            } else { 
7692
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7693
            }
7694
            break;
7695
          case 3: // EMAIL
7696
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7697
              this.email = iprot.readString();
7698
            } else { 
7699
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7700
            }
7701
            break;
7702
          case 4: // AMOUNT
7703
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7704
              this.amount = iprot.readI64();
7705
              setAmountIsSet(true);
7706
            } else { 
7707
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7708
            }
7709
            break;
7710
          case 5: // USAGE
7711
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7712
              this.usage = iprot.readI64();
7713
              setUsageIsSet(true);
7714
            } else { 
7715
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7716
            }
7717
            break;
7718
          default:
7719
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7720
        }
7721
        iprot.readFieldEnd();
7722
      }
7723
      iprot.readStructEnd();
7724
      validate();
7725
    }
7726
 
7727
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7728
      validate();
7729
 
7730
      oprot.writeStructBegin(STRUCT_DESC);
7731
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
7732
      oprot.writeI64(this.promotionId);
7733
      oprot.writeFieldEnd();
7734
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
7735
      oprot.writeI64(this.endOn);
7736
      oprot.writeFieldEnd();
7737
      if (this.email != null) {
7738
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
7739
        oprot.writeString(this.email);
7740
        oprot.writeFieldEnd();
7741
      }
7742
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
7743
      oprot.writeI64(this.amount);
7744
      oprot.writeFieldEnd();
7745
      oprot.writeFieldBegin(USAGE_FIELD_DESC);
7746
      oprot.writeI64(this.usage);
7747
      oprot.writeFieldEnd();
7748
      oprot.writeFieldStop();
7749
      oprot.writeStructEnd();
7750
    }
7751
 
7752
    @Override
7753
    public String toString() {
7754
      StringBuilder sb = new StringBuilder("createCoupon_args(");
7755
      boolean first = true;
7756
 
7757
      sb.append("promotionId:");
7758
      sb.append(this.promotionId);
7759
      first = false;
7760
      if (!first) sb.append(", ");
7761
      sb.append("endOn:");
7762
      sb.append(this.endOn);
7763
      first = false;
7764
      if (!first) sb.append(", ");
7765
      sb.append("email:");
7766
      if (this.email == null) {
7767
        sb.append("null");
7768
      } else {
7769
        sb.append(this.email);
7770
      }
7771
      first = false;
7772
      if (!first) sb.append(", ");
7773
      sb.append("amount:");
7774
      sb.append(this.amount);
7775
      first = false;
7776
      if (!first) sb.append(", ");
7777
      sb.append("usage:");
7778
      sb.append(this.usage);
7779
      first = false;
7780
      sb.append(")");
7781
      return sb.toString();
7782
    }
7783
 
7784
    public void validate() throws org.apache.thrift.TException {
7785
      // check for required fields
7786
    }
7787
 
7788
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7789
      try {
7790
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7791
      } catch (org.apache.thrift.TException te) {
7792
        throw new java.io.IOException(te);
7793
      }
7794
    }
7795
 
7796
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7797
      try {
7798
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7799
      } catch (org.apache.thrift.TException te) {
7800
        throw new java.io.IOException(te);
7801
      }
7802
    }
7803
 
7804
  }
7805
 
7806
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7807
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
7808
 
7809
    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);
7810
    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);
7811
 
7812
    private String success; // required
7813
    private PromotionException pex; // required
7814
 
7815
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7816
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7817
      SUCCESS((short)0, "success"),
7818
      PEX((short)1, "pex");
7819
 
7820
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7821
 
7822
      static {
7823
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7824
          byName.put(field.getFieldName(), field);
7825
        }
7826
      }
7827
 
7828
      /**
7829
       * Find the _Fields constant that matches fieldId, or null if its not found.
7830
       */
7831
      public static _Fields findByThriftId(int fieldId) {
7832
        switch(fieldId) {
7833
          case 0: // SUCCESS
7834
            return SUCCESS;
7835
          case 1: // PEX
7836
            return PEX;
7837
          default:
7838
            return null;
7839
        }
7840
      }
7841
 
7842
      /**
7843
       * Find the _Fields constant that matches fieldId, throwing an exception
7844
       * if it is not found.
7845
       */
7846
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7847
        _Fields fields = findByThriftId(fieldId);
7848
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7849
        return fields;
7850
      }
7851
 
7852
      /**
7853
       * Find the _Fields constant that matches name, or null if its not found.
7854
       */
7855
      public static _Fields findByName(String name) {
7856
        return byName.get(name);
7857
      }
7858
 
7859
      private final short _thriftId;
7860
      private final String _fieldName;
7861
 
7862
      _Fields(short thriftId, String fieldName) {
7863
        _thriftId = thriftId;
7864
        _fieldName = fieldName;
7865
      }
7866
 
7867
      public short getThriftFieldId() {
7868
        return _thriftId;
7869
      }
7870
 
7871
      public String getFieldName() {
7872
        return _fieldName;
7873
      }
7874
    }
7875
 
7876
    // isset id assignments
7877
 
7878
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7879
    static {
7880
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7881
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7882
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7883
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7884
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7885
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7886
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
7887
    }
7888
 
7889
    public createCoupon_result() {
7890
    }
7891
 
7892
    public createCoupon_result(
7893
      String success,
7894
      PromotionException pex)
7895
    {
7896
      this();
7897
      this.success = success;
7898
      this.pex = pex;
7899
    }
7900
 
7901
    /**
7902
     * Performs a deep copy on <i>other</i>.
7903
     */
7904
    public createCoupon_result(createCoupon_result other) {
7905
      if (other.isSetSuccess()) {
7906
        this.success = other.success;
7907
      }
7908
      if (other.isSetPex()) {
7909
        this.pex = new PromotionException(other.pex);
7910
      }
7911
    }
7912
 
7913
    public createCoupon_result deepCopy() {
7914
      return new createCoupon_result(this);
7915
    }
7916
 
7917
    @Override
7918
    public void clear() {
7919
      this.success = null;
7920
      this.pex = null;
7921
    }
7922
 
7923
    public String getSuccess() {
7924
      return this.success;
7925
    }
7926
 
7927
    public void setSuccess(String success) {
7928
      this.success = success;
7929
    }
7930
 
7931
    public void unsetSuccess() {
7932
      this.success = null;
7933
    }
7934
 
7935
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
7936
    public boolean isSetSuccess() {
7937
      return this.success != null;
7938
    }
7939
 
7940
    public void setSuccessIsSet(boolean value) {
7941
      if (!value) {
7942
        this.success = null;
7943
      }
7944
    }
7945
 
7946
    public PromotionException getPex() {
7947
      return this.pex;
7948
    }
7949
 
7950
    public void setPex(PromotionException pex) {
7951
      this.pex = pex;
7952
    }
7953
 
7954
    public void unsetPex() {
7955
      this.pex = null;
7956
    }
7957
 
7958
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
7959
    public boolean isSetPex() {
7960
      return this.pex != null;
7961
    }
7962
 
7963
    public void setPexIsSet(boolean value) {
7964
      if (!value) {
7965
        this.pex = null;
7966
      }
7967
    }
7968
 
7969
    public void setFieldValue(_Fields field, Object value) {
7970
      switch (field) {
7971
      case SUCCESS:
7972
        if (value == null) {
7973
          unsetSuccess();
7974
        } else {
7975
          setSuccess((String)value);
7976
        }
7977
        break;
7978
 
7979
      case PEX:
7980
        if (value == null) {
7981
          unsetPex();
7982
        } else {
7983
          setPex((PromotionException)value);
7984
        }
7985
        break;
7986
 
7987
      }
7988
    }
7989
 
7990
    public Object getFieldValue(_Fields field) {
7991
      switch (field) {
7992
      case SUCCESS:
7993
        return getSuccess();
7994
 
7995
      case PEX:
7996
        return getPex();
7997
 
7998
      }
7999
      throw new IllegalStateException();
8000
    }
8001
 
8002
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8003
    public boolean isSet(_Fields field) {
8004
      if (field == null) {
8005
        throw new IllegalArgumentException();
8006
      }
8007
 
8008
      switch (field) {
8009
      case SUCCESS:
8010
        return isSetSuccess();
8011
      case PEX:
8012
        return isSetPex();
8013
      }
8014
      throw new IllegalStateException();
8015
    }
8016
 
8017
    @Override
8018
    public boolean equals(Object that) {
8019
      if (that == null)
8020
        return false;
8021
      if (that instanceof createCoupon_result)
8022
        return this.equals((createCoupon_result)that);
8023
      return false;
8024
    }
8025
 
8026
    public boolean equals(createCoupon_result that) {
8027
      if (that == null)
8028
        return false;
8029
 
8030
      boolean this_present_success = true && this.isSetSuccess();
8031
      boolean that_present_success = true && that.isSetSuccess();
8032
      if (this_present_success || that_present_success) {
8033
        if (!(this_present_success && that_present_success))
8034
          return false;
8035
        if (!this.success.equals(that.success))
8036
          return false;
8037
      }
8038
 
8039
      boolean this_present_pex = true && this.isSetPex();
8040
      boolean that_present_pex = true && that.isSetPex();
8041
      if (this_present_pex || that_present_pex) {
8042
        if (!(this_present_pex && that_present_pex))
8043
          return false;
8044
        if (!this.pex.equals(that.pex))
8045
          return false;
8046
      }
8047
 
8048
      return true;
8049
    }
8050
 
8051
    @Override
8052
    public int hashCode() {
8053
      return 0;
8054
    }
8055
 
8056
    public int compareTo(createCoupon_result other) {
8057
      if (!getClass().equals(other.getClass())) {
8058
        return getClass().getName().compareTo(other.getClass().getName());
8059
      }
8060
 
8061
      int lastComparison = 0;
8062
      createCoupon_result typedOther = (createCoupon_result)other;
8063
 
8064
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8065
      if (lastComparison != 0) {
8066
        return lastComparison;
8067
      }
8068
      if (isSetSuccess()) {
8069
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8070
        if (lastComparison != 0) {
8071
          return lastComparison;
8072
        }
8073
      }
8074
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
8075
      if (lastComparison != 0) {
8076
        return lastComparison;
8077
      }
8078
      if (isSetPex()) {
8079
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8080
        if (lastComparison != 0) {
8081
          return lastComparison;
8082
        }
8083
      }
8084
      return 0;
8085
    }
8086
 
8087
    public _Fields fieldForId(int fieldId) {
8088
      return _Fields.findByThriftId(fieldId);
8089
    }
8090
 
8091
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8092
      org.apache.thrift.protocol.TField field;
8093
      iprot.readStructBegin();
8094
      while (true)
8095
      {
8096
        field = iprot.readFieldBegin();
8097
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8098
          break;
8099
        }
8100
        switch (field.id) {
8101
          case 0: // SUCCESS
8102
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8103
              this.success = iprot.readString();
8104
            } else { 
8105
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8106
            }
8107
            break;
8108
          case 1: // PEX
8109
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8110
              this.pex = new PromotionException();
8111
              this.pex.read(iprot);
8112
            } else { 
8113
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8114
            }
8115
            break;
8116
          default:
8117
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8118
        }
8119
        iprot.readFieldEnd();
8120
      }
8121
      iprot.readStructEnd();
8122
      validate();
8123
    }
8124
 
8125
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8126
      oprot.writeStructBegin(STRUCT_DESC);
8127
 
8128
      if (this.isSetSuccess()) {
8129
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8130
        oprot.writeString(this.success);
8131
        oprot.writeFieldEnd();
8132
      } else if (this.isSetPex()) {
8133
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8134
        this.pex.write(oprot);
8135
        oprot.writeFieldEnd();
8136
      }
8137
      oprot.writeFieldStop();
8138
      oprot.writeStructEnd();
8139
    }
8140
 
8141
    @Override
8142
    public String toString() {
8143
      StringBuilder sb = new StringBuilder("createCoupon_result(");
8144
      boolean first = true;
8145
 
8146
      sb.append("success:");
8147
      if (this.success == null) {
8148
        sb.append("null");
8149
      } else {
8150
        sb.append(this.success);
8151
      }
8152
      first = false;
8153
      if (!first) sb.append(", ");
8154
      sb.append("pex:");
8155
      if (this.pex == null) {
8156
        sb.append("null");
8157
      } else {
8158
        sb.append(this.pex);
8159
      }
8160
      first = false;
8161
      sb.append(")");
8162
      return sb.toString();
8163
    }
8164
 
8165
    public void validate() throws org.apache.thrift.TException {
8166
      // check for required fields
8167
    }
8168
 
8169
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8170
      try {
8171
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8172
      } catch (org.apache.thrift.TException te) {
8173
        throw new java.io.IOException(te);
8174
      }
8175
    }
8176
 
8177
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8178
      try {
8179
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8180
      } catch (org.apache.thrift.TException te) {
8181
        throw new java.io.IOException(te);
8182
      }
8183
    }
8184
 
8185
  }
8186
 
3430 rajveer 8187
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
8188
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 8189
 
3430 rajveer 8190
    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 8191
 
3430 rajveer 8192
    private String couponCode; // required
3385 varun.gupt 8193
 
8194
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8195
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 8196
      COUPON_CODE((short)1, "couponCode");
8197
 
8198
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8199
 
8200
      static {
8201
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8202
          byName.put(field.getFieldName(), field);
8203
        }
8204
      }
8205
 
8206
      /**
8207
       * Find the _Fields constant that matches fieldId, or null if its not found.
8208
       */
8209
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8210
        switch(fieldId) {
8211
          case 1: // COUPON_CODE
8212
            return COUPON_CODE;
8213
          default:
8214
            return null;
8215
        }
3385 varun.gupt 8216
      }
8217
 
8218
      /**
8219
       * Find the _Fields constant that matches fieldId, throwing an exception
8220
       * if it is not found.
8221
       */
8222
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8223
        _Fields fields = findByThriftId(fieldId);
8224
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8225
        return fields;
8226
      }
8227
 
8228
      /**
8229
       * Find the _Fields constant that matches name, or null if its not found.
8230
       */
8231
      public static _Fields findByName(String name) {
8232
        return byName.get(name);
8233
      }
8234
 
8235
      private final short _thriftId;
8236
      private final String _fieldName;
8237
 
8238
      _Fields(short thriftId, String fieldName) {
8239
        _thriftId = thriftId;
8240
        _fieldName = fieldName;
8241
      }
8242
 
8243
      public short getThriftFieldId() {
8244
        return _thriftId;
8245
      }
8246
 
8247
      public String getFieldName() {
8248
        return _fieldName;
8249
      }
8250
    }
8251
 
8252
    // isset id assignments
8253
 
3430 rajveer 8254
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 8255
    static {
3430 rajveer 8256
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8257
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8258
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8259
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8260
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 8261
    }
8262
 
8263
    public getSuccessfulPaymentCountForCoupon_args() {
8264
    }
8265
 
8266
    public getSuccessfulPaymentCountForCoupon_args(
8267
      String couponCode)
8268
    {
8269
      this();
8270
      this.couponCode = couponCode;
8271
    }
8272
 
8273
    /**
8274
     * Performs a deep copy on <i>other</i>.
8275
     */
8276
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
8277
      if (other.isSetCouponCode()) {
8278
        this.couponCode = other.couponCode;
8279
      }
8280
    }
8281
 
8282
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
8283
      return new getSuccessfulPaymentCountForCoupon_args(this);
8284
    }
8285
 
3430 rajveer 8286
    @Override
8287
    public void clear() {
8288
      this.couponCode = null;
3385 varun.gupt 8289
    }
8290
 
8291
    public String getCouponCode() {
8292
      return this.couponCode;
8293
    }
8294
 
3430 rajveer 8295
    public void setCouponCode(String couponCode) {
3385 varun.gupt 8296
      this.couponCode = couponCode;
8297
    }
8298
 
8299
    public void unsetCouponCode() {
8300
      this.couponCode = null;
8301
    }
8302
 
3430 rajveer 8303
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 8304
    public boolean isSetCouponCode() {
8305
      return this.couponCode != null;
8306
    }
8307
 
8308
    public void setCouponCodeIsSet(boolean value) {
8309
      if (!value) {
8310
        this.couponCode = null;
8311
      }
8312
    }
8313
 
8314
    public void setFieldValue(_Fields field, Object value) {
8315
      switch (field) {
8316
      case COUPON_CODE:
8317
        if (value == null) {
8318
          unsetCouponCode();
8319
        } else {
8320
          setCouponCode((String)value);
8321
        }
8322
        break;
8323
 
8324
      }
8325
    }
8326
 
8327
    public Object getFieldValue(_Fields field) {
8328
      switch (field) {
8329
      case COUPON_CODE:
8330
        return getCouponCode();
8331
 
8332
      }
8333
      throw new IllegalStateException();
8334
    }
8335
 
3430 rajveer 8336
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8337
    public boolean isSet(_Fields field) {
8338
      if (field == null) {
8339
        throw new IllegalArgumentException();
8340
      }
3385 varun.gupt 8341
 
8342
      switch (field) {
8343
      case COUPON_CODE:
8344
        return isSetCouponCode();
8345
      }
8346
      throw new IllegalStateException();
8347
    }
8348
 
8349
    @Override
8350
    public boolean equals(Object that) {
8351
      if (that == null)
8352
        return false;
8353
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
8354
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
8355
      return false;
8356
    }
8357
 
8358
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
8359
      if (that == null)
8360
        return false;
8361
 
8362
      boolean this_present_couponCode = true && this.isSetCouponCode();
8363
      boolean that_present_couponCode = true && that.isSetCouponCode();
8364
      if (this_present_couponCode || that_present_couponCode) {
8365
        if (!(this_present_couponCode && that_present_couponCode))
8366
          return false;
8367
        if (!this.couponCode.equals(that.couponCode))
8368
          return false;
8369
      }
8370
 
8371
      return true;
8372
    }
8373
 
8374
    @Override
8375
    public int hashCode() {
8376
      return 0;
8377
    }
8378
 
8379
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
8380
      if (!getClass().equals(other.getClass())) {
8381
        return getClass().getName().compareTo(other.getClass().getName());
8382
      }
8383
 
8384
      int lastComparison = 0;
8385
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
8386
 
3430 rajveer 8387
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 8388
      if (lastComparison != 0) {
8389
        return lastComparison;
8390
      }
3430 rajveer 8391
      if (isSetCouponCode()) {
8392
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8393
        if (lastComparison != 0) {
8394
          return lastComparison;
8395
        }
3385 varun.gupt 8396
      }
8397
      return 0;
8398
    }
8399
 
3430 rajveer 8400
    public _Fields fieldForId(int fieldId) {
8401
      return _Fields.findByThriftId(fieldId);
8402
    }
8403
 
8404
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8405
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 8406
      iprot.readStructBegin();
8407
      while (true)
8408
      {
8409
        field = iprot.readFieldBegin();
3430 rajveer 8410
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 8411
          break;
8412
        }
3430 rajveer 8413
        switch (field.id) {
8414
          case 1: // COUPON_CODE
8415
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8416
              this.couponCode = iprot.readString();
8417
            } else { 
8418
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8419
            }
8420
            break;
8421
          default:
8422
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 8423
        }
3430 rajveer 8424
        iprot.readFieldEnd();
3385 varun.gupt 8425
      }
8426
      iprot.readStructEnd();
8427
      validate();
8428
    }
8429
 
3430 rajveer 8430
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 8431
      validate();
8432
 
8433
      oprot.writeStructBegin(STRUCT_DESC);
8434
      if (this.couponCode != null) {
8435
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8436
        oprot.writeString(this.couponCode);
8437
        oprot.writeFieldEnd();
8438
      }
8439
      oprot.writeFieldStop();
8440
      oprot.writeStructEnd();
8441
    }
8442
 
8443
    @Override
8444
    public String toString() {
8445
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
8446
      boolean first = true;
8447
 
8448
      sb.append("couponCode:");
8449
      if (this.couponCode == null) {
8450
        sb.append("null");
8451
      } else {
8452
        sb.append(this.couponCode);
8453
      }
8454
      first = false;
8455
      sb.append(")");
8456
      return sb.toString();
8457
    }
8458
 
3430 rajveer 8459
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 8460
      // check for required fields
8461
    }
8462
 
3430 rajveer 8463
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8464
      try {
8465
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8466
      } catch (org.apache.thrift.TException te) {
8467
        throw new java.io.IOException(te);
8468
      }
8469
    }
8470
 
8471
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8472
      try {
8473
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8474
      } catch (org.apache.thrift.TException te) {
8475
        throw new java.io.IOException(te);
8476
      }
8477
    }
8478
 
3385 varun.gupt 8479
  }
8480
 
3430 rajveer 8481
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8482
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 8483
 
3430 rajveer 8484
    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);
8485
    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 8486
 
3430 rajveer 8487
    private long success; // required
8488
    private PromotionException pex; // required
3385 varun.gupt 8489
 
8490
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8491
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 8492
      SUCCESS((short)0, "success"),
8493
      PEX((short)1, "pex");
8494
 
8495
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8496
 
8497
      static {
8498
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8499
          byName.put(field.getFieldName(), field);
8500
        }
8501
      }
8502
 
8503
      /**
8504
       * Find the _Fields constant that matches fieldId, or null if its not found.
8505
       */
8506
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8507
        switch(fieldId) {
8508
          case 0: // SUCCESS
8509
            return SUCCESS;
8510
          case 1: // PEX
8511
            return PEX;
8512
          default:
8513
            return null;
8514
        }
3385 varun.gupt 8515
      }
8516
 
8517
      /**
8518
       * Find the _Fields constant that matches fieldId, throwing an exception
8519
       * if it is not found.
8520
       */
8521
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8522
        _Fields fields = findByThriftId(fieldId);
8523
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8524
        return fields;
8525
      }
8526
 
8527
      /**
8528
       * Find the _Fields constant that matches name, or null if its not found.
8529
       */
8530
      public static _Fields findByName(String name) {
8531
        return byName.get(name);
8532
      }
8533
 
8534
      private final short _thriftId;
8535
      private final String _fieldName;
8536
 
8537
      _Fields(short thriftId, String fieldName) {
8538
        _thriftId = thriftId;
8539
        _fieldName = fieldName;
8540
      }
8541
 
8542
      public short getThriftFieldId() {
8543
        return _thriftId;
8544
      }
8545
 
8546
      public String getFieldName() {
8547
        return _fieldName;
8548
      }
8549
    }
8550
 
8551
    // isset id assignments
8552
    private static final int __SUCCESS_ISSET_ID = 0;
8553
    private BitSet __isset_bit_vector = new BitSet(1);
8554
 
3430 rajveer 8555
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 8556
    static {
3430 rajveer 8557
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8558
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8559
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8560
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8561
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8562
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8563
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 8564
    }
8565
 
8566
    public getSuccessfulPaymentCountForCoupon_result() {
8567
    }
8568
 
8569
    public getSuccessfulPaymentCountForCoupon_result(
8570
      long success,
8571
      PromotionException pex)
8572
    {
8573
      this();
8574
      this.success = success;
8575
      setSuccessIsSet(true);
8576
      this.pex = pex;
8577
    }
8578
 
8579
    /**
8580
     * Performs a deep copy on <i>other</i>.
8581
     */
8582
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
8583
      __isset_bit_vector.clear();
8584
      __isset_bit_vector.or(other.__isset_bit_vector);
8585
      this.success = other.success;
8586
      if (other.isSetPex()) {
8587
        this.pex = new PromotionException(other.pex);
8588
      }
8589
    }
8590
 
8591
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
8592
      return new getSuccessfulPaymentCountForCoupon_result(this);
8593
    }
8594
 
3430 rajveer 8595
    @Override
8596
    public void clear() {
8597
      setSuccessIsSet(false);
8598
      this.success = 0;
8599
      this.pex = null;
3385 varun.gupt 8600
    }
8601
 
8602
    public long getSuccess() {
8603
      return this.success;
8604
    }
8605
 
3430 rajveer 8606
    public void setSuccess(long success) {
3385 varun.gupt 8607
      this.success = success;
8608
      setSuccessIsSet(true);
8609
    }
8610
 
8611
    public void unsetSuccess() {
8612
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
8613
    }
8614
 
3430 rajveer 8615
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 8616
    public boolean isSetSuccess() {
8617
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
8618
    }
8619
 
8620
    public void setSuccessIsSet(boolean value) {
8621
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
8622
    }
8623
 
8624
    public PromotionException getPex() {
8625
      return this.pex;
8626
    }
8627
 
3430 rajveer 8628
    public void setPex(PromotionException pex) {
3385 varun.gupt 8629
      this.pex = pex;
8630
    }
8631
 
8632
    public void unsetPex() {
8633
      this.pex = null;
8634
    }
8635
 
3430 rajveer 8636
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 8637
    public boolean isSetPex() {
8638
      return this.pex != null;
8639
    }
8640
 
8641
    public void setPexIsSet(boolean value) {
8642
      if (!value) {
8643
        this.pex = null;
8644
      }
8645
    }
8646
 
8647
    public void setFieldValue(_Fields field, Object value) {
8648
      switch (field) {
8649
      case SUCCESS:
8650
        if (value == null) {
8651
          unsetSuccess();
8652
        } else {
8653
          setSuccess((Long)value);
8654
        }
8655
        break;
8656
 
8657
      case PEX:
8658
        if (value == null) {
8659
          unsetPex();
8660
        } else {
8661
          setPex((PromotionException)value);
8662
        }
8663
        break;
8664
 
8665
      }
8666
    }
8667
 
8668
    public Object getFieldValue(_Fields field) {
8669
      switch (field) {
8670
      case SUCCESS:
3430 rajveer 8671
        return Long.valueOf(getSuccess());
3385 varun.gupt 8672
 
8673
      case PEX:
8674
        return getPex();
8675
 
8676
      }
8677
      throw new IllegalStateException();
8678
    }
8679
 
3430 rajveer 8680
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8681
    public boolean isSet(_Fields field) {
8682
      if (field == null) {
8683
        throw new IllegalArgumentException();
8684
      }
3385 varun.gupt 8685
 
8686
      switch (field) {
8687
      case SUCCESS:
8688
        return isSetSuccess();
8689
      case PEX:
8690
        return isSetPex();
8691
      }
8692
      throw new IllegalStateException();
8693
    }
8694
 
8695
    @Override
8696
    public boolean equals(Object that) {
8697
      if (that == null)
8698
        return false;
8699
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
8700
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
8701
      return false;
8702
    }
8703
 
8704
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
8705
      if (that == null)
8706
        return false;
8707
 
8708
      boolean this_present_success = true;
8709
      boolean that_present_success = true;
8710
      if (this_present_success || that_present_success) {
8711
        if (!(this_present_success && that_present_success))
8712
          return false;
8713
        if (this.success != that.success)
8714
          return false;
8715
      }
8716
 
8717
      boolean this_present_pex = true && this.isSetPex();
8718
      boolean that_present_pex = true && that.isSetPex();
8719
      if (this_present_pex || that_present_pex) {
8720
        if (!(this_present_pex && that_present_pex))
8721
          return false;
8722
        if (!this.pex.equals(that.pex))
8723
          return false;
8724
      }
8725
 
8726
      return true;
8727
    }
8728
 
8729
    @Override
8730
    public int hashCode() {
8731
      return 0;
8732
    }
8733
 
8734
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
8735
      if (!getClass().equals(other.getClass())) {
8736
        return getClass().getName().compareTo(other.getClass().getName());
8737
      }
8738
 
8739
      int lastComparison = 0;
8740
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
8741
 
3430 rajveer 8742
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 8743
      if (lastComparison != 0) {
8744
        return lastComparison;
8745
      }
3430 rajveer 8746
      if (isSetSuccess()) {
8747
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8748
        if (lastComparison != 0) {
8749
          return lastComparison;
8750
        }
3385 varun.gupt 8751
      }
3430 rajveer 8752
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 8753
      if (lastComparison != 0) {
8754
        return lastComparison;
8755
      }
3430 rajveer 8756
      if (isSetPex()) {
8757
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8758
        if (lastComparison != 0) {
8759
          return lastComparison;
8760
        }
3385 varun.gupt 8761
      }
8762
      return 0;
8763
    }
8764
 
3430 rajveer 8765
    public _Fields fieldForId(int fieldId) {
8766
      return _Fields.findByThriftId(fieldId);
8767
    }
8768
 
8769
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8770
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 8771
      iprot.readStructBegin();
8772
      while (true)
8773
      {
8774
        field = iprot.readFieldBegin();
3430 rajveer 8775
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 8776
          break;
8777
        }
3430 rajveer 8778
        switch (field.id) {
8779
          case 0: // SUCCESS
8780
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8781
              this.success = iprot.readI64();
8782
              setSuccessIsSet(true);
8783
            } else { 
8784
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8785
            }
8786
            break;
8787
          case 1: // PEX
8788
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8789
              this.pex = new PromotionException();
8790
              this.pex.read(iprot);
8791
            } else { 
8792
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8793
            }
8794
            break;
8795
          default:
8796
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 8797
        }
3430 rajveer 8798
        iprot.readFieldEnd();
3385 varun.gupt 8799
      }
8800
      iprot.readStructEnd();
8801
      validate();
8802
    }
8803
 
3430 rajveer 8804
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 8805
      oprot.writeStructBegin(STRUCT_DESC);
8806
 
8807
      if (this.isSetSuccess()) {
8808
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8809
        oprot.writeI64(this.success);
8810
        oprot.writeFieldEnd();
8811
      } else if (this.isSetPex()) {
8812
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8813
        this.pex.write(oprot);
8814
        oprot.writeFieldEnd();
8815
      }
8816
      oprot.writeFieldStop();
8817
      oprot.writeStructEnd();
8818
    }
8819
 
8820
    @Override
8821
    public String toString() {
8822
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
8823
      boolean first = true;
8824
 
8825
      sb.append("success:");
8826
      sb.append(this.success);
8827
      first = false;
8828
      if (!first) sb.append(", ");
8829
      sb.append("pex:");
8830
      if (this.pex == null) {
8831
        sb.append("null");
8832
      } else {
8833
        sb.append(this.pex);
8834
      }
8835
      first = false;
8836
      sb.append(")");
8837
      return sb.toString();
8838
    }
8839
 
3430 rajveer 8840
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 8841
      // check for required fields
8842
    }
8843
 
3430 rajveer 8844
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8845
      try {
8846
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8847
      } catch (org.apache.thrift.TException te) {
8848
        throw new java.io.IOException(te);
8849
      }
8850
    }
8851
 
8852
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8853
      try {
8854
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8855
      } catch (org.apache.thrift.TException te) {
8856
        throw new java.io.IOException(te);
8857
      }
8858
    }
8859
 
3385 varun.gupt 8860
  }
8861
 
3430 rajveer 8862
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
8863
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 8864
 
3430 rajveer 8865
    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 8866
 
3430 rajveer 8867
    private String ruleName; // required
3385 varun.gupt 8868
 
8869
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8870
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 8871
      RULE_NAME((short)1, "ruleName");
8872
 
8873
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8874
 
8875
      static {
8876
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8877
          byName.put(field.getFieldName(), field);
8878
        }
8879
      }
8880
 
8881
      /**
8882
       * Find the _Fields constant that matches fieldId, or null if its not found.
8883
       */
8884
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8885
        switch(fieldId) {
8886
          case 1: // RULE_NAME
8887
            return RULE_NAME;
8888
          default:
8889
            return null;
8890
        }
3385 varun.gupt 8891
      }
8892
 
8893
      /**
8894
       * Find the _Fields constant that matches fieldId, throwing an exception
8895
       * if it is not found.
8896
       */
8897
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8898
        _Fields fields = findByThriftId(fieldId);
8899
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8900
        return fields;
8901
      }
8902
 
8903
      /**
8904
       * Find the _Fields constant that matches name, or null if its not found.
8905
       */
8906
      public static _Fields findByName(String name) {
8907
        return byName.get(name);
8908
      }
8909
 
8910
      private final short _thriftId;
8911
      private final String _fieldName;
8912
 
8913
      _Fields(short thriftId, String fieldName) {
8914
        _thriftId = thriftId;
8915
        _fieldName = fieldName;
8916
      }
8917
 
8918
      public short getThriftFieldId() {
8919
        return _thriftId;
8920
      }
8921
 
8922
      public String getFieldName() {
8923
        return _fieldName;
8924
      }
8925
    }
8926
 
8927
    // isset id assignments
8928
 
3430 rajveer 8929
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 8930
    static {
3430 rajveer 8931
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8932
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8933
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8934
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8935
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 8936
    }
8937
 
8938
    public getRuleDocString_args() {
8939
    }
8940
 
8941
    public getRuleDocString_args(
8942
      String ruleName)
8943
    {
8944
      this();
8945
      this.ruleName = ruleName;
8946
    }
8947
 
8948
    /**
8949
     * Performs a deep copy on <i>other</i>.
8950
     */
8951
    public getRuleDocString_args(getRuleDocString_args other) {
8952
      if (other.isSetRuleName()) {
8953
        this.ruleName = other.ruleName;
8954
      }
8955
    }
8956
 
8957
    public getRuleDocString_args deepCopy() {
8958
      return new getRuleDocString_args(this);
8959
    }
8960
 
3430 rajveer 8961
    @Override
8962
    public void clear() {
8963
      this.ruleName = null;
3385 varun.gupt 8964
    }
8965
 
8966
    public String getRuleName() {
8967
      return this.ruleName;
8968
    }
8969
 
3430 rajveer 8970
    public void setRuleName(String ruleName) {
3385 varun.gupt 8971
      this.ruleName = ruleName;
8972
    }
8973
 
8974
    public void unsetRuleName() {
8975
      this.ruleName = null;
8976
    }
8977
 
3430 rajveer 8978
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 8979
    public boolean isSetRuleName() {
8980
      return this.ruleName != null;
8981
    }
8982
 
8983
    public void setRuleNameIsSet(boolean value) {
8984
      if (!value) {
8985
        this.ruleName = null;
8986
      }
8987
    }
8988
 
8989
    public void setFieldValue(_Fields field, Object value) {
8990
      switch (field) {
8991
      case RULE_NAME:
8992
        if (value == null) {
8993
          unsetRuleName();
8994
        } else {
8995
          setRuleName((String)value);
8996
        }
8997
        break;
8998
 
8999
      }
9000
    }
9001
 
9002
    public Object getFieldValue(_Fields field) {
9003
      switch (field) {
9004
      case RULE_NAME:
9005
        return getRuleName();
9006
 
9007
      }
9008
      throw new IllegalStateException();
9009
    }
9010
 
3430 rajveer 9011
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9012
    public boolean isSet(_Fields field) {
9013
      if (field == null) {
9014
        throw new IllegalArgumentException();
9015
      }
3385 varun.gupt 9016
 
9017
      switch (field) {
9018
      case RULE_NAME:
9019
        return isSetRuleName();
9020
      }
9021
      throw new IllegalStateException();
9022
    }
9023
 
9024
    @Override
9025
    public boolean equals(Object that) {
9026
      if (that == null)
9027
        return false;
9028
      if (that instanceof getRuleDocString_args)
9029
        return this.equals((getRuleDocString_args)that);
9030
      return false;
9031
    }
9032
 
9033
    public boolean equals(getRuleDocString_args that) {
9034
      if (that == null)
9035
        return false;
9036
 
9037
      boolean this_present_ruleName = true && this.isSetRuleName();
9038
      boolean that_present_ruleName = true && that.isSetRuleName();
9039
      if (this_present_ruleName || that_present_ruleName) {
9040
        if (!(this_present_ruleName && that_present_ruleName))
9041
          return false;
9042
        if (!this.ruleName.equals(that.ruleName))
9043
          return false;
9044
      }
9045
 
9046
      return true;
9047
    }
9048
 
9049
    @Override
9050
    public int hashCode() {
9051
      return 0;
9052
    }
9053
 
9054
    public int compareTo(getRuleDocString_args other) {
9055
      if (!getClass().equals(other.getClass())) {
9056
        return getClass().getName().compareTo(other.getClass().getName());
9057
      }
9058
 
9059
      int lastComparison = 0;
9060
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
9061
 
3430 rajveer 9062
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 9063
      if (lastComparison != 0) {
9064
        return lastComparison;
9065
      }
3430 rajveer 9066
      if (isSetRuleName()) {
9067
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
9068
        if (lastComparison != 0) {
9069
          return lastComparison;
9070
        }
3385 varun.gupt 9071
      }
9072
      return 0;
9073
    }
9074
 
3430 rajveer 9075
    public _Fields fieldForId(int fieldId) {
9076
      return _Fields.findByThriftId(fieldId);
9077
    }
9078
 
9079
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9080
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 9081
      iprot.readStructBegin();
9082
      while (true)
9083
      {
9084
        field = iprot.readFieldBegin();
3430 rajveer 9085
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 9086
          break;
9087
        }
3430 rajveer 9088
        switch (field.id) {
9089
          case 1: // RULE_NAME
9090
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9091
              this.ruleName = iprot.readString();
9092
            } else { 
9093
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9094
            }
9095
            break;
9096
          default:
9097
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 9098
        }
3430 rajveer 9099
        iprot.readFieldEnd();
3385 varun.gupt 9100
      }
9101
      iprot.readStructEnd();
9102
      validate();
9103
    }
9104
 
3430 rajveer 9105
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 9106
      validate();
9107
 
9108
      oprot.writeStructBegin(STRUCT_DESC);
9109
      if (this.ruleName != null) {
9110
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
9111
        oprot.writeString(this.ruleName);
9112
        oprot.writeFieldEnd();
9113
      }
9114
      oprot.writeFieldStop();
9115
      oprot.writeStructEnd();
9116
    }
9117
 
9118
    @Override
9119
    public String toString() {
9120
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
9121
      boolean first = true;
9122
 
9123
      sb.append("ruleName:");
9124
      if (this.ruleName == null) {
9125
        sb.append("null");
9126
      } else {
9127
        sb.append(this.ruleName);
9128
      }
9129
      first = false;
9130
      sb.append(")");
9131
      return sb.toString();
9132
    }
9133
 
3430 rajveer 9134
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 9135
      // check for required fields
9136
    }
9137
 
3430 rajveer 9138
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9139
      try {
9140
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9141
      } catch (org.apache.thrift.TException te) {
9142
        throw new java.io.IOException(te);
9143
      }
9144
    }
9145
 
9146
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9147
      try {
9148
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9149
      } catch (org.apache.thrift.TException te) {
9150
        throw new java.io.IOException(te);
9151
      }
9152
    }
9153
 
3385 varun.gupt 9154
  }
9155
 
3430 rajveer 9156
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
9157
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 9158
 
3430 rajveer 9159
    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 9160
 
3430 rajveer 9161
    private String success; // required
3385 varun.gupt 9162
 
9163
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9164
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 9165
      SUCCESS((short)0, "success");
9166
 
9167
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9168
 
9169
      static {
9170
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9171
          byName.put(field.getFieldName(), field);
9172
        }
9173
      }
9174
 
9175
      /**
9176
       * Find the _Fields constant that matches fieldId, or null if its not found.
9177
       */
9178
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9179
        switch(fieldId) {
9180
          case 0: // SUCCESS
9181
            return SUCCESS;
9182
          default:
9183
            return null;
9184
        }
3385 varun.gupt 9185
      }
9186
 
9187
      /**
9188
       * Find the _Fields constant that matches fieldId, throwing an exception
9189
       * if it is not found.
9190
       */
9191
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9192
        _Fields fields = findByThriftId(fieldId);
9193
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9194
        return fields;
9195
      }
9196
 
9197
      /**
9198
       * Find the _Fields constant that matches name, or null if its not found.
9199
       */
9200
      public static _Fields findByName(String name) {
9201
        return byName.get(name);
9202
      }
9203
 
9204
      private final short _thriftId;
9205
      private final String _fieldName;
9206
 
9207
      _Fields(short thriftId, String fieldName) {
9208
        _thriftId = thriftId;
9209
        _fieldName = fieldName;
9210
      }
9211
 
9212
      public short getThriftFieldId() {
9213
        return _thriftId;
9214
      }
9215
 
9216
      public String getFieldName() {
9217
        return _fieldName;
9218
      }
9219
    }
9220
 
9221
    // isset id assignments
9222
 
3430 rajveer 9223
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 9224
    static {
3430 rajveer 9225
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9226
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9227
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9228
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9229
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 9230
    }
9231
 
9232
    public getRuleDocString_result() {
9233
    }
9234
 
9235
    public getRuleDocString_result(
9236
      String success)
9237
    {
9238
      this();
9239
      this.success = success;
9240
    }
9241
 
9242
    /**
9243
     * Performs a deep copy on <i>other</i>.
9244
     */
9245
    public getRuleDocString_result(getRuleDocString_result other) {
9246
      if (other.isSetSuccess()) {
9247
        this.success = other.success;
9248
      }
9249
    }
9250
 
9251
    public getRuleDocString_result deepCopy() {
9252
      return new getRuleDocString_result(this);
9253
    }
9254
 
3430 rajveer 9255
    @Override
9256
    public void clear() {
9257
      this.success = null;
3385 varun.gupt 9258
    }
9259
 
9260
    public String getSuccess() {
9261
      return this.success;
9262
    }
9263
 
3430 rajveer 9264
    public void setSuccess(String success) {
3385 varun.gupt 9265
      this.success = success;
9266
    }
9267
 
9268
    public void unsetSuccess() {
9269
      this.success = null;
9270
    }
9271
 
3430 rajveer 9272
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 9273
    public boolean isSetSuccess() {
9274
      return this.success != null;
9275
    }
9276
 
9277
    public void setSuccessIsSet(boolean value) {
9278
      if (!value) {
9279
        this.success = null;
9280
      }
9281
    }
9282
 
9283
    public void setFieldValue(_Fields field, Object value) {
9284
      switch (field) {
9285
      case SUCCESS:
9286
        if (value == null) {
9287
          unsetSuccess();
9288
        } else {
9289
          setSuccess((String)value);
9290
        }
9291
        break;
9292
 
9293
      }
9294
    }
9295
 
9296
    public Object getFieldValue(_Fields field) {
9297
      switch (field) {
9298
      case SUCCESS:
9299
        return getSuccess();
9300
 
9301
      }
9302
      throw new IllegalStateException();
9303
    }
9304
 
3430 rajveer 9305
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9306
    public boolean isSet(_Fields field) {
9307
      if (field == null) {
9308
        throw new IllegalArgumentException();
9309
      }
3385 varun.gupt 9310
 
9311
      switch (field) {
9312
      case SUCCESS:
9313
        return isSetSuccess();
9314
      }
9315
      throw new IllegalStateException();
9316
    }
9317
 
9318
    @Override
9319
    public boolean equals(Object that) {
9320
      if (that == null)
9321
        return false;
9322
      if (that instanceof getRuleDocString_result)
9323
        return this.equals((getRuleDocString_result)that);
9324
      return false;
9325
    }
9326
 
9327
    public boolean equals(getRuleDocString_result that) {
9328
      if (that == null)
9329
        return false;
9330
 
9331
      boolean this_present_success = true && this.isSetSuccess();
9332
      boolean that_present_success = true && that.isSetSuccess();
9333
      if (this_present_success || that_present_success) {
9334
        if (!(this_present_success && that_present_success))
9335
          return false;
9336
        if (!this.success.equals(that.success))
9337
          return false;
9338
      }
9339
 
9340
      return true;
9341
    }
9342
 
9343
    @Override
9344
    public int hashCode() {
9345
      return 0;
9346
    }
9347
 
9348
    public int compareTo(getRuleDocString_result other) {
9349
      if (!getClass().equals(other.getClass())) {
9350
        return getClass().getName().compareTo(other.getClass().getName());
9351
      }
9352
 
9353
      int lastComparison = 0;
9354
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
9355
 
3430 rajveer 9356
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 9357
      if (lastComparison != 0) {
9358
        return lastComparison;
9359
      }
3430 rajveer 9360
      if (isSetSuccess()) {
9361
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9362
        if (lastComparison != 0) {
9363
          return lastComparison;
9364
        }
3385 varun.gupt 9365
      }
9366
      return 0;
9367
    }
9368
 
3430 rajveer 9369
    public _Fields fieldForId(int fieldId) {
9370
      return _Fields.findByThriftId(fieldId);
9371
    }
9372
 
9373
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9374
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 9375
      iprot.readStructBegin();
9376
      while (true)
9377
      {
9378
        field = iprot.readFieldBegin();
3430 rajveer 9379
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 9380
          break;
9381
        }
3430 rajveer 9382
        switch (field.id) {
9383
          case 0: // SUCCESS
9384
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9385
              this.success = iprot.readString();
9386
            } else { 
9387
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9388
            }
9389
            break;
9390
          default:
9391
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 9392
        }
3430 rajveer 9393
        iprot.readFieldEnd();
3385 varun.gupt 9394
      }
9395
      iprot.readStructEnd();
9396
      validate();
9397
    }
9398
 
3430 rajveer 9399
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 9400
      oprot.writeStructBegin(STRUCT_DESC);
9401
 
9402
      if (this.isSetSuccess()) {
9403
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9404
        oprot.writeString(this.success);
9405
        oprot.writeFieldEnd();
9406
      }
9407
      oprot.writeFieldStop();
9408
      oprot.writeStructEnd();
9409
    }
9410
 
9411
    @Override
9412
    public String toString() {
9413
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
9414
      boolean first = true;
9415
 
9416
      sb.append("success:");
9417
      if (this.success == null) {
9418
        sb.append("null");
9419
      } else {
9420
        sb.append(this.success);
9421
      }
9422
      first = false;
9423
      sb.append(")");
9424
      return sb.toString();
9425
    }
9426
 
3430 rajveer 9427
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 9428
      // check for required fields
9429
    }
9430
 
3430 rajveer 9431
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9432
      try {
9433
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9434
      } catch (org.apache.thrift.TException te) {
9435
        throw new java.io.IOException(te);
9436
      }
9437
    }
9438
 
9439
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9440
      try {
9441
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9442
      } catch (org.apache.thrift.TException te) {
9443
        throw new java.io.IOException(te);
9444
      }
9445
    }
9446
 
3385 varun.gupt 9447
  }
9448
 
4189 varun.gupt 9449
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
9450
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
9451
 
9452
    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);
9453
 
9454
    private List<Long> itemIds; // required
9455
 
9456
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9457
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9458
      ITEM_IDS((short)1, "itemIds");
9459
 
9460
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9461
 
9462
      static {
9463
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9464
          byName.put(field.getFieldName(), field);
9465
        }
9466
      }
9467
 
9468
      /**
9469
       * Find the _Fields constant that matches fieldId, or null if its not found.
9470
       */
9471
      public static _Fields findByThriftId(int fieldId) {
9472
        switch(fieldId) {
9473
          case 1: // ITEM_IDS
9474
            return ITEM_IDS;
9475
          default:
9476
            return null;
9477
        }
9478
      }
9479
 
9480
      /**
9481
       * Find the _Fields constant that matches fieldId, throwing an exception
9482
       * if it is not found.
9483
       */
9484
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9485
        _Fields fields = findByThriftId(fieldId);
9486
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9487
        return fields;
9488
      }
9489
 
9490
      /**
9491
       * Find the _Fields constant that matches name, or null if its not found.
9492
       */
9493
      public static _Fields findByName(String name) {
9494
        return byName.get(name);
9495
      }
9496
 
9497
      private final short _thriftId;
9498
      private final String _fieldName;
9499
 
9500
      _Fields(short thriftId, String fieldName) {
9501
        _thriftId = thriftId;
9502
        _fieldName = fieldName;
9503
      }
9504
 
9505
      public short getThriftFieldId() {
9506
        return _thriftId;
9507
      }
9508
 
9509
      public String getFieldName() {
9510
        return _fieldName;
9511
      }
9512
    }
9513
 
9514
    // isset id assignments
9515
 
9516
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9517
    static {
9518
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9519
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9520
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
9521
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
9522
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9523
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
9524
    }
9525
 
9526
    public getItemDiscountMap_args() {
9527
    }
9528
 
9529
    public getItemDiscountMap_args(
9530
      List<Long> itemIds)
9531
    {
9532
      this();
9533
      this.itemIds = itemIds;
9534
    }
9535
 
9536
    /**
9537
     * Performs a deep copy on <i>other</i>.
9538
     */
9539
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
9540
      if (other.isSetItemIds()) {
9541
        List<Long> __this__itemIds = new ArrayList<Long>();
9542
        for (Long other_element : other.itemIds) {
9543
          __this__itemIds.add(other_element);
9544
        }
9545
        this.itemIds = __this__itemIds;
9546
      }
9547
    }
9548
 
9549
    public getItemDiscountMap_args deepCopy() {
9550
      return new getItemDiscountMap_args(this);
9551
    }
9552
 
9553
    @Override
9554
    public void clear() {
9555
      this.itemIds = null;
9556
    }
9557
 
9558
    public int getItemIdsSize() {
9559
      return (this.itemIds == null) ? 0 : this.itemIds.size();
9560
    }
9561
 
9562
    public java.util.Iterator<Long> getItemIdsIterator() {
9563
      return (this.itemIds == null) ? null : this.itemIds.iterator();
9564
    }
9565
 
9566
    public void addToItemIds(long elem) {
9567
      if (this.itemIds == null) {
9568
        this.itemIds = new ArrayList<Long>();
9569
      }
9570
      this.itemIds.add(elem);
9571
    }
9572
 
9573
    public List<Long> getItemIds() {
9574
      return this.itemIds;
9575
    }
9576
 
9577
    public void setItemIds(List<Long> itemIds) {
9578
      this.itemIds = itemIds;
9579
    }
9580
 
9581
    public void unsetItemIds() {
9582
      this.itemIds = null;
9583
    }
9584
 
9585
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
9586
    public boolean isSetItemIds() {
9587
      return this.itemIds != null;
9588
    }
9589
 
9590
    public void setItemIdsIsSet(boolean value) {
9591
      if (!value) {
9592
        this.itemIds = null;
9593
      }
9594
    }
9595
 
9596
    public void setFieldValue(_Fields field, Object value) {
9597
      switch (field) {
9598
      case ITEM_IDS:
9599
        if (value == null) {
9600
          unsetItemIds();
9601
        } else {
9602
          setItemIds((List<Long>)value);
9603
        }
9604
        break;
9605
 
9606
      }
9607
    }
9608
 
9609
    public Object getFieldValue(_Fields field) {
9610
      switch (field) {
9611
      case ITEM_IDS:
9612
        return getItemIds();
9613
 
9614
      }
9615
      throw new IllegalStateException();
9616
    }
9617
 
9618
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9619
    public boolean isSet(_Fields field) {
9620
      if (field == null) {
9621
        throw new IllegalArgumentException();
9622
      }
9623
 
9624
      switch (field) {
9625
      case ITEM_IDS:
9626
        return isSetItemIds();
9627
      }
9628
      throw new IllegalStateException();
9629
    }
9630
 
9631
    @Override
9632
    public boolean equals(Object that) {
9633
      if (that == null)
9634
        return false;
9635
      if (that instanceof getItemDiscountMap_args)
9636
        return this.equals((getItemDiscountMap_args)that);
9637
      return false;
9638
    }
9639
 
9640
    public boolean equals(getItemDiscountMap_args that) {
9641
      if (that == null)
9642
        return false;
9643
 
9644
      boolean this_present_itemIds = true && this.isSetItemIds();
9645
      boolean that_present_itemIds = true && that.isSetItemIds();
9646
      if (this_present_itemIds || that_present_itemIds) {
9647
        if (!(this_present_itemIds && that_present_itemIds))
9648
          return false;
9649
        if (!this.itemIds.equals(that.itemIds))
9650
          return false;
9651
      }
9652
 
9653
      return true;
9654
    }
9655
 
9656
    @Override
9657
    public int hashCode() {
9658
      return 0;
9659
    }
9660
 
9661
    public int compareTo(getItemDiscountMap_args other) {
9662
      if (!getClass().equals(other.getClass())) {
9663
        return getClass().getName().compareTo(other.getClass().getName());
9664
      }
9665
 
9666
      int lastComparison = 0;
9667
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
9668
 
9669
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
9670
      if (lastComparison != 0) {
9671
        return lastComparison;
9672
      }
9673
      if (isSetItemIds()) {
9674
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
9675
        if (lastComparison != 0) {
9676
          return lastComparison;
9677
        }
9678
      }
9679
      return 0;
9680
    }
9681
 
9682
    public _Fields fieldForId(int fieldId) {
9683
      return _Fields.findByThriftId(fieldId);
9684
    }
9685
 
9686
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9687
      org.apache.thrift.protocol.TField field;
9688
      iprot.readStructBegin();
9689
      while (true)
9690
      {
9691
        field = iprot.readFieldBegin();
9692
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9693
          break;
9694
        }
9695
        switch (field.id) {
9696
          case 1: // ITEM_IDS
9697
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
9698
              {
5327 rajveer 9699
                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
9700
                this.itemIds = new ArrayList<Long>(_list20.size);
9701
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
4189 varun.gupt 9702
                {
5327 rajveer 9703
                  long _elem22; // required
9704
                  _elem22 = iprot.readI64();
9705
                  this.itemIds.add(_elem22);
4189 varun.gupt 9706
                }
9707
                iprot.readListEnd();
9708
              }
9709
            } else { 
9710
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9711
            }
9712
            break;
9713
          default:
9714
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9715
        }
9716
        iprot.readFieldEnd();
9717
      }
9718
      iprot.readStructEnd();
9719
      validate();
9720
    }
9721
 
9722
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9723
      validate();
9724
 
9725
      oprot.writeStructBegin(STRUCT_DESC);
9726
      if (this.itemIds != null) {
9727
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
9728
        {
9729
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
5327 rajveer 9730
          for (long _iter23 : this.itemIds)
4189 varun.gupt 9731
          {
5327 rajveer 9732
            oprot.writeI64(_iter23);
4189 varun.gupt 9733
          }
9734
          oprot.writeListEnd();
9735
        }
9736
        oprot.writeFieldEnd();
9737
      }
9738
      oprot.writeFieldStop();
9739
      oprot.writeStructEnd();
9740
    }
9741
 
9742
    @Override
9743
    public String toString() {
9744
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
9745
      boolean first = true;
9746
 
9747
      sb.append("itemIds:");
9748
      if (this.itemIds == null) {
9749
        sb.append("null");
9750
      } else {
9751
        sb.append(this.itemIds);
9752
      }
9753
      first = false;
9754
      sb.append(")");
9755
      return sb.toString();
9756
    }
9757
 
9758
    public void validate() throws org.apache.thrift.TException {
9759
      // check for required fields
9760
    }
9761
 
9762
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9763
      try {
9764
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9765
      } catch (org.apache.thrift.TException te) {
9766
        throw new java.io.IOException(te);
9767
      }
9768
    }
9769
 
9770
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9771
      try {
9772
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9773
      } catch (org.apache.thrift.TException te) {
9774
        throw new java.io.IOException(te);
9775
      }
9776
    }
9777
 
9778
  }
9779
 
9780
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
9781
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
9782
 
9783
    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);
9784
    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);
9785
 
9786
    private List<ItemCouponDiscount> success; // required
9787
    private PromotionException pex; // required
9788
 
9789
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9790
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9791
      SUCCESS((short)0, "success"),
9792
      PEX((short)1, "pex");
9793
 
9794
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9795
 
9796
      static {
9797
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9798
          byName.put(field.getFieldName(), field);
9799
        }
9800
      }
9801
 
9802
      /**
9803
       * Find the _Fields constant that matches fieldId, or null if its not found.
9804
       */
9805
      public static _Fields findByThriftId(int fieldId) {
9806
        switch(fieldId) {
9807
          case 0: // SUCCESS
9808
            return SUCCESS;
9809
          case 1: // PEX
9810
            return PEX;
9811
          default:
9812
            return null;
9813
        }
9814
      }
9815
 
9816
      /**
9817
       * Find the _Fields constant that matches fieldId, throwing an exception
9818
       * if it is not found.
9819
       */
9820
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9821
        _Fields fields = findByThriftId(fieldId);
9822
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9823
        return fields;
9824
      }
9825
 
9826
      /**
9827
       * Find the _Fields constant that matches name, or null if its not found.
9828
       */
9829
      public static _Fields findByName(String name) {
9830
        return byName.get(name);
9831
      }
9832
 
9833
      private final short _thriftId;
9834
      private final String _fieldName;
9835
 
9836
      _Fields(short thriftId, String fieldName) {
9837
        _thriftId = thriftId;
9838
        _fieldName = fieldName;
9839
      }
9840
 
9841
      public short getThriftFieldId() {
9842
        return _thriftId;
9843
      }
9844
 
9845
      public String getFieldName() {
9846
        return _fieldName;
9847
      }
9848
    }
9849
 
9850
    // isset id assignments
9851
 
9852
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9853
    static {
9854
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9855
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9856
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
9857
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
9858
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9859
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9860
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9861
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
9862
    }
9863
 
9864
    public getItemDiscountMap_result() {
9865
    }
9866
 
9867
    public getItemDiscountMap_result(
9868
      List<ItemCouponDiscount> success,
9869
      PromotionException pex)
9870
    {
9871
      this();
9872
      this.success = success;
9873
      this.pex = pex;
9874
    }
9875
 
9876
    /**
9877
     * Performs a deep copy on <i>other</i>.
9878
     */
9879
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
9880
      if (other.isSetSuccess()) {
9881
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
9882
        for (ItemCouponDiscount other_element : other.success) {
9883
          __this__success.add(new ItemCouponDiscount(other_element));
9884
        }
9885
        this.success = __this__success;
9886
      }
9887
      if (other.isSetPex()) {
9888
        this.pex = new PromotionException(other.pex);
9889
      }
9890
    }
9891
 
9892
    public getItemDiscountMap_result deepCopy() {
9893
      return new getItemDiscountMap_result(this);
9894
    }
9895
 
9896
    @Override
9897
    public void clear() {
9898
      this.success = null;
9899
      this.pex = null;
9900
    }
9901
 
9902
    public int getSuccessSize() {
9903
      return (this.success == null) ? 0 : this.success.size();
9904
    }
9905
 
9906
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
9907
      return (this.success == null) ? null : this.success.iterator();
9908
    }
9909
 
9910
    public void addToSuccess(ItemCouponDiscount elem) {
9911
      if (this.success == null) {
9912
        this.success = new ArrayList<ItemCouponDiscount>();
9913
      }
9914
      this.success.add(elem);
9915
    }
9916
 
9917
    public List<ItemCouponDiscount> getSuccess() {
9918
      return this.success;
9919
    }
9920
 
9921
    public void setSuccess(List<ItemCouponDiscount> success) {
9922
      this.success = success;
9923
    }
9924
 
9925
    public void unsetSuccess() {
9926
      this.success = null;
9927
    }
9928
 
9929
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9930
    public boolean isSetSuccess() {
9931
      return this.success != null;
9932
    }
9933
 
9934
    public void setSuccessIsSet(boolean value) {
9935
      if (!value) {
9936
        this.success = null;
9937
      }
9938
    }
9939
 
9940
    public PromotionException getPex() {
9941
      return this.pex;
9942
    }
9943
 
9944
    public void setPex(PromotionException pex) {
9945
      this.pex = pex;
9946
    }
9947
 
9948
    public void unsetPex() {
9949
      this.pex = null;
9950
    }
9951
 
9952
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
9953
    public boolean isSetPex() {
9954
      return this.pex != null;
9955
    }
9956
 
9957
    public void setPexIsSet(boolean value) {
9958
      if (!value) {
9959
        this.pex = null;
9960
      }
9961
    }
9962
 
9963
    public void setFieldValue(_Fields field, Object value) {
9964
      switch (field) {
9965
      case SUCCESS:
9966
        if (value == null) {
9967
          unsetSuccess();
9968
        } else {
9969
          setSuccess((List<ItemCouponDiscount>)value);
9970
        }
9971
        break;
9972
 
9973
      case PEX:
9974
        if (value == null) {
9975
          unsetPex();
9976
        } else {
9977
          setPex((PromotionException)value);
9978
        }
9979
        break;
9980
 
9981
      }
9982
    }
9983
 
9984
    public Object getFieldValue(_Fields field) {
9985
      switch (field) {
9986
      case SUCCESS:
9987
        return getSuccess();
9988
 
9989
      case PEX:
9990
        return getPex();
9991
 
9992
      }
9993
      throw new IllegalStateException();
9994
    }
9995
 
9996
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9997
    public boolean isSet(_Fields field) {
9998
      if (field == null) {
9999
        throw new IllegalArgumentException();
10000
      }
10001
 
10002
      switch (field) {
10003
      case SUCCESS:
10004
        return isSetSuccess();
10005
      case PEX:
10006
        return isSetPex();
10007
      }
10008
      throw new IllegalStateException();
10009
    }
10010
 
10011
    @Override
10012
    public boolean equals(Object that) {
10013
      if (that == null)
10014
        return false;
10015
      if (that instanceof getItemDiscountMap_result)
10016
        return this.equals((getItemDiscountMap_result)that);
10017
      return false;
10018
    }
10019
 
10020
    public boolean equals(getItemDiscountMap_result that) {
10021
      if (that == null)
10022
        return false;
10023
 
10024
      boolean this_present_success = true && this.isSetSuccess();
10025
      boolean that_present_success = true && that.isSetSuccess();
10026
      if (this_present_success || that_present_success) {
10027
        if (!(this_present_success && that_present_success))
10028
          return false;
10029
        if (!this.success.equals(that.success))
10030
          return false;
10031
      }
10032
 
10033
      boolean this_present_pex = true && this.isSetPex();
10034
      boolean that_present_pex = true && that.isSetPex();
10035
      if (this_present_pex || that_present_pex) {
10036
        if (!(this_present_pex && that_present_pex))
10037
          return false;
10038
        if (!this.pex.equals(that.pex))
10039
          return false;
10040
      }
10041
 
10042
      return true;
10043
    }
10044
 
10045
    @Override
10046
    public int hashCode() {
10047
      return 0;
10048
    }
10049
 
10050
    public int compareTo(getItemDiscountMap_result other) {
10051
      if (!getClass().equals(other.getClass())) {
10052
        return getClass().getName().compareTo(other.getClass().getName());
10053
      }
10054
 
10055
      int lastComparison = 0;
10056
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
10057
 
10058
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
10059
      if (lastComparison != 0) {
10060
        return lastComparison;
10061
      }
10062
      if (isSetSuccess()) {
10063
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10064
        if (lastComparison != 0) {
10065
          return lastComparison;
10066
        }
10067
      }
10068
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
10069
      if (lastComparison != 0) {
10070
        return lastComparison;
10071
      }
10072
      if (isSetPex()) {
10073
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10074
        if (lastComparison != 0) {
10075
          return lastComparison;
10076
        }
10077
      }
10078
      return 0;
10079
    }
10080
 
10081
    public _Fields fieldForId(int fieldId) {
10082
      return _Fields.findByThriftId(fieldId);
10083
    }
10084
 
10085
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10086
      org.apache.thrift.protocol.TField field;
10087
      iprot.readStructBegin();
10088
      while (true)
10089
      {
10090
        field = iprot.readFieldBegin();
10091
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10092
          break;
10093
        }
10094
        switch (field.id) {
10095
          case 0: // SUCCESS
10096
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
10097
              {
5327 rajveer 10098
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
10099
                this.success = new ArrayList<ItemCouponDiscount>(_list24.size);
10100
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
4189 varun.gupt 10101
                {
5327 rajveer 10102
                  ItemCouponDiscount _elem26; // required
10103
                  _elem26 = new ItemCouponDiscount();
10104
                  _elem26.read(iprot);
10105
                  this.success.add(_elem26);
4189 varun.gupt 10106
                }
10107
                iprot.readListEnd();
10108
              }
10109
            } else { 
10110
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10111
            }
10112
            break;
10113
          case 1: // PEX
10114
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10115
              this.pex = new PromotionException();
10116
              this.pex.read(iprot);
10117
            } else { 
10118
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10119
            }
10120
            break;
10121
          default:
10122
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10123
        }
10124
        iprot.readFieldEnd();
10125
      }
10126
      iprot.readStructEnd();
10127
      validate();
10128
    }
10129
 
10130
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10131
      oprot.writeStructBegin(STRUCT_DESC);
10132
 
10133
      if (this.isSetSuccess()) {
10134
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10135
        {
10136
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 10137
          for (ItemCouponDiscount _iter27 : this.success)
4189 varun.gupt 10138
          {
5327 rajveer 10139
            _iter27.write(oprot);
4189 varun.gupt 10140
          }
10141
          oprot.writeListEnd();
10142
        }
10143
        oprot.writeFieldEnd();
10144
      } else if (this.isSetPex()) {
10145
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10146
        this.pex.write(oprot);
10147
        oprot.writeFieldEnd();
10148
      }
10149
      oprot.writeFieldStop();
10150
      oprot.writeStructEnd();
10151
    }
10152
 
10153
    @Override
10154
    public String toString() {
10155
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
10156
      boolean first = true;
10157
 
10158
      sb.append("success:");
10159
      if (this.success == null) {
10160
        sb.append("null");
10161
      } else {
10162
        sb.append(this.success);
10163
      }
10164
      first = false;
10165
      if (!first) sb.append(", ");
10166
      sb.append("pex:");
10167
      if (this.pex == null) {
10168
        sb.append("null");
10169
      } else {
10170
        sb.append(this.pex);
10171
      }
10172
      first = false;
10173
      sb.append(")");
10174
      return sb.toString();
10175
    }
10176
 
10177
    public void validate() throws org.apache.thrift.TException {
10178
      // check for required fields
10179
    }
10180
 
10181
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10182
      try {
10183
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10184
      } catch (org.apache.thrift.TException te) {
10185
        throw new java.io.IOException(te);
10186
      }
10187
    }
10188
 
10189
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10190
      try {
10191
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10192
      } catch (org.apache.thrift.TException te) {
10193
        throw new java.io.IOException(te);
10194
      }
10195
    }
10196
 
10197
  }
10198
 
4494 varun.gupt 10199
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
10200
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
10201
 
10202
    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);
10203
 
10204
    private long entityId; // required
10205
 
10206
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10207
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10208
      ENTITY_ID((short)1, "entityId");
10209
 
10210
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10211
 
10212
      static {
10213
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10214
          byName.put(field.getFieldName(), field);
10215
        }
10216
      }
10217
 
10218
      /**
10219
       * Find the _Fields constant that matches fieldId, or null if its not found.
10220
       */
10221
      public static _Fields findByThriftId(int fieldId) {
10222
        switch(fieldId) {
10223
          case 1: // ENTITY_ID
10224
            return ENTITY_ID;
10225
          default:
10226
            return null;
10227
        }
10228
      }
10229
 
10230
      /**
10231
       * Find the _Fields constant that matches fieldId, throwing an exception
10232
       * if it is not found.
10233
       */
10234
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10235
        _Fields fields = findByThriftId(fieldId);
10236
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10237
        return fields;
10238
      }
10239
 
10240
      /**
10241
       * Find the _Fields constant that matches name, or null if its not found.
10242
       */
10243
      public static _Fields findByName(String name) {
10244
        return byName.get(name);
10245
      }
10246
 
10247
      private final short _thriftId;
10248
      private final String _fieldName;
10249
 
10250
      _Fields(short thriftId, String fieldName) {
10251
        _thriftId = thriftId;
10252
        _fieldName = fieldName;
10253
      }
10254
 
10255
      public short getThriftFieldId() {
10256
        return _thriftId;
10257
      }
10258
 
10259
      public String getFieldName() {
10260
        return _fieldName;
10261
      }
10262
    }
10263
 
10264
    // isset id assignments
10265
    private static final int __ENTITYID_ISSET_ID = 0;
10266
    private BitSet __isset_bit_vector = new BitSet(1);
10267
 
10268
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10269
    static {
10270
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10271
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10272
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10273
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10274
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
10275
    }
10276
 
10277
    public getDiscountsForEntity_args() {
10278
    }
10279
 
10280
    public getDiscountsForEntity_args(
10281
      long entityId)
10282
    {
10283
      this();
10284
      this.entityId = entityId;
10285
      setEntityIdIsSet(true);
10286
    }
10287
 
10288
    /**
10289
     * Performs a deep copy on <i>other</i>.
10290
     */
10291
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
10292
      __isset_bit_vector.clear();
10293
      __isset_bit_vector.or(other.__isset_bit_vector);
10294
      this.entityId = other.entityId;
10295
    }
10296
 
10297
    public getDiscountsForEntity_args deepCopy() {
10298
      return new getDiscountsForEntity_args(this);
10299
    }
10300
 
10301
    @Override
10302
    public void clear() {
10303
      setEntityIdIsSet(false);
10304
      this.entityId = 0;
10305
    }
10306
 
10307
    public long getEntityId() {
10308
      return this.entityId;
10309
    }
10310
 
10311
    public void setEntityId(long entityId) {
10312
      this.entityId = entityId;
10313
      setEntityIdIsSet(true);
10314
    }
10315
 
10316
    public void unsetEntityId() {
10317
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
10318
    }
10319
 
10320
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
10321
    public boolean isSetEntityId() {
10322
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
10323
    }
10324
 
10325
    public void setEntityIdIsSet(boolean value) {
10326
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
10327
    }
10328
 
10329
    public void setFieldValue(_Fields field, Object value) {
10330
      switch (field) {
10331
      case ENTITY_ID:
10332
        if (value == null) {
10333
          unsetEntityId();
10334
        } else {
10335
          setEntityId((Long)value);
10336
        }
10337
        break;
10338
 
10339
      }
10340
    }
10341
 
10342
    public Object getFieldValue(_Fields field) {
10343
      switch (field) {
10344
      case ENTITY_ID:
10345
        return Long.valueOf(getEntityId());
10346
 
10347
      }
10348
      throw new IllegalStateException();
10349
    }
10350
 
10351
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10352
    public boolean isSet(_Fields field) {
10353
      if (field == null) {
10354
        throw new IllegalArgumentException();
10355
      }
10356
 
10357
      switch (field) {
10358
      case ENTITY_ID:
10359
        return isSetEntityId();
10360
      }
10361
      throw new IllegalStateException();
10362
    }
10363
 
10364
    @Override
10365
    public boolean equals(Object that) {
10366
      if (that == null)
10367
        return false;
10368
      if (that instanceof getDiscountsForEntity_args)
10369
        return this.equals((getDiscountsForEntity_args)that);
10370
      return false;
10371
    }
10372
 
10373
    public boolean equals(getDiscountsForEntity_args that) {
10374
      if (that == null)
10375
        return false;
10376
 
10377
      boolean this_present_entityId = true;
10378
      boolean that_present_entityId = true;
10379
      if (this_present_entityId || that_present_entityId) {
10380
        if (!(this_present_entityId && that_present_entityId))
10381
          return false;
10382
        if (this.entityId != that.entityId)
10383
          return false;
10384
      }
10385
 
10386
      return true;
10387
    }
10388
 
10389
    @Override
10390
    public int hashCode() {
10391
      return 0;
10392
    }
10393
 
10394
    public int compareTo(getDiscountsForEntity_args other) {
10395
      if (!getClass().equals(other.getClass())) {
10396
        return getClass().getName().compareTo(other.getClass().getName());
10397
      }
10398
 
10399
      int lastComparison = 0;
10400
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
10401
 
10402
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
10403
      if (lastComparison != 0) {
10404
        return lastComparison;
10405
      }
10406
      if (isSetEntityId()) {
10407
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
10408
        if (lastComparison != 0) {
10409
          return lastComparison;
10410
        }
10411
      }
10412
      return 0;
10413
    }
10414
 
10415
    public _Fields fieldForId(int fieldId) {
10416
      return _Fields.findByThriftId(fieldId);
10417
    }
10418
 
10419
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10420
      org.apache.thrift.protocol.TField field;
10421
      iprot.readStructBegin();
10422
      while (true)
10423
      {
10424
        field = iprot.readFieldBegin();
10425
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10426
          break;
10427
        }
10428
        switch (field.id) {
10429
          case 1: // ENTITY_ID
10430
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10431
              this.entityId = iprot.readI64();
10432
              setEntityIdIsSet(true);
10433
            } else { 
10434
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10435
            }
10436
            break;
10437
          default:
10438
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10439
        }
10440
        iprot.readFieldEnd();
10441
      }
10442
      iprot.readStructEnd();
10443
      validate();
10444
    }
10445
 
10446
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10447
      validate();
10448
 
10449
      oprot.writeStructBegin(STRUCT_DESC);
10450
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
10451
      oprot.writeI64(this.entityId);
10452
      oprot.writeFieldEnd();
10453
      oprot.writeFieldStop();
10454
      oprot.writeStructEnd();
10455
    }
10456
 
10457
    @Override
10458
    public String toString() {
10459
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
10460
      boolean first = true;
10461
 
10462
      sb.append("entityId:");
10463
      sb.append(this.entityId);
10464
      first = false;
10465
      sb.append(")");
10466
      return sb.toString();
10467
    }
10468
 
10469
    public void validate() throws org.apache.thrift.TException {
10470
      // check for required fields
10471
    }
10472
 
10473
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10474
      try {
10475
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10476
      } catch (org.apache.thrift.TException te) {
10477
        throw new java.io.IOException(te);
10478
      }
10479
    }
10480
 
10481
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10482
      try {
10483
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10484
        __isset_bit_vector = new BitSet(1);
10485
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10486
      } catch (org.apache.thrift.TException te) {
10487
        throw new java.io.IOException(te);
10488
      }
10489
    }
10490
 
10491
  }
10492
 
10493
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
10494
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
10495
 
10496
    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);
10497
 
10498
    private Map<String,Double> success; // required
10499
 
10500
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10501
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10502
      SUCCESS((short)0, "success");
10503
 
10504
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10505
 
10506
      static {
10507
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10508
          byName.put(field.getFieldName(), field);
10509
        }
10510
      }
10511
 
10512
      /**
10513
       * Find the _Fields constant that matches fieldId, or null if its not found.
10514
       */
10515
      public static _Fields findByThriftId(int fieldId) {
10516
        switch(fieldId) {
10517
          case 0: // SUCCESS
10518
            return SUCCESS;
10519
          default:
10520
            return null;
10521
        }
10522
      }
10523
 
10524
      /**
10525
       * Find the _Fields constant that matches fieldId, throwing an exception
10526
       * if it is not found.
10527
       */
10528
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10529
        _Fields fields = findByThriftId(fieldId);
10530
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10531
        return fields;
10532
      }
10533
 
10534
      /**
10535
       * Find the _Fields constant that matches name, or null if its not found.
10536
       */
10537
      public static _Fields findByName(String name) {
10538
        return byName.get(name);
10539
      }
10540
 
10541
      private final short _thriftId;
10542
      private final String _fieldName;
10543
 
10544
      _Fields(short thriftId, String fieldName) {
10545
        _thriftId = thriftId;
10546
        _fieldName = fieldName;
10547
      }
10548
 
10549
      public short getThriftFieldId() {
10550
        return _thriftId;
10551
      }
10552
 
10553
      public String getFieldName() {
10554
        return _fieldName;
10555
      }
10556
    }
10557
 
10558
    // isset id assignments
10559
 
10560
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10561
    static {
10562
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10563
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10564
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
10565
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
10566
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
10567
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10568
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
10569
    }
10570
 
10571
    public getDiscountsForEntity_result() {
10572
    }
10573
 
10574
    public getDiscountsForEntity_result(
10575
      Map<String,Double> success)
10576
    {
10577
      this();
10578
      this.success = success;
10579
    }
10580
 
10581
    /**
10582
     * Performs a deep copy on <i>other</i>.
10583
     */
10584
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
10585
      if (other.isSetSuccess()) {
10586
        Map<String,Double> __this__success = new HashMap<String,Double>();
10587
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
10588
 
10589
          String other_element_key = other_element.getKey();
10590
          Double other_element_value = other_element.getValue();
10591
 
10592
          String __this__success_copy_key = other_element_key;
10593
 
10594
          Double __this__success_copy_value = other_element_value;
10595
 
10596
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
10597
        }
10598
        this.success = __this__success;
10599
      }
10600
    }
10601
 
10602
    public getDiscountsForEntity_result deepCopy() {
10603
      return new getDiscountsForEntity_result(this);
10604
    }
10605
 
10606
    @Override
10607
    public void clear() {
10608
      this.success = null;
10609
    }
10610
 
10611
    public int getSuccessSize() {
10612
      return (this.success == null) ? 0 : this.success.size();
10613
    }
10614
 
10615
    public void putToSuccess(String key, double val) {
10616
      if (this.success == null) {
10617
        this.success = new HashMap<String,Double>();
10618
      }
10619
      this.success.put(key, val);
10620
    }
10621
 
10622
    public Map<String,Double> getSuccess() {
10623
      return this.success;
10624
    }
10625
 
10626
    public void setSuccess(Map<String,Double> success) {
10627
      this.success = success;
10628
    }
10629
 
10630
    public void unsetSuccess() {
10631
      this.success = null;
10632
    }
10633
 
10634
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
10635
    public boolean isSetSuccess() {
10636
      return this.success != null;
10637
    }
10638
 
10639
    public void setSuccessIsSet(boolean value) {
10640
      if (!value) {
10641
        this.success = null;
10642
      }
10643
    }
10644
 
10645
    public void setFieldValue(_Fields field, Object value) {
10646
      switch (field) {
10647
      case SUCCESS:
10648
        if (value == null) {
10649
          unsetSuccess();
10650
        } else {
10651
          setSuccess((Map<String,Double>)value);
10652
        }
10653
        break;
10654
 
10655
      }
10656
    }
10657
 
10658
    public Object getFieldValue(_Fields field) {
10659
      switch (field) {
10660
      case SUCCESS:
10661
        return getSuccess();
10662
 
10663
      }
10664
      throw new IllegalStateException();
10665
    }
10666
 
10667
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10668
    public boolean isSet(_Fields field) {
10669
      if (field == null) {
10670
        throw new IllegalArgumentException();
10671
      }
10672
 
10673
      switch (field) {
10674
      case SUCCESS:
10675
        return isSetSuccess();
10676
      }
10677
      throw new IllegalStateException();
10678
    }
10679
 
10680
    @Override
10681
    public boolean equals(Object that) {
10682
      if (that == null)
10683
        return false;
10684
      if (that instanceof getDiscountsForEntity_result)
10685
        return this.equals((getDiscountsForEntity_result)that);
10686
      return false;
10687
    }
10688
 
10689
    public boolean equals(getDiscountsForEntity_result that) {
10690
      if (that == null)
10691
        return false;
10692
 
10693
      boolean this_present_success = true && this.isSetSuccess();
10694
      boolean that_present_success = true && that.isSetSuccess();
10695
      if (this_present_success || that_present_success) {
10696
        if (!(this_present_success && that_present_success))
10697
          return false;
10698
        if (!this.success.equals(that.success))
10699
          return false;
10700
      }
10701
 
10702
      return true;
10703
    }
10704
 
10705
    @Override
10706
    public int hashCode() {
10707
      return 0;
10708
    }
10709
 
10710
    public int compareTo(getDiscountsForEntity_result other) {
10711
      if (!getClass().equals(other.getClass())) {
10712
        return getClass().getName().compareTo(other.getClass().getName());
10713
      }
10714
 
10715
      int lastComparison = 0;
10716
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
10717
 
10718
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
10719
      if (lastComparison != 0) {
10720
        return lastComparison;
10721
      }
10722
      if (isSetSuccess()) {
10723
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10724
        if (lastComparison != 0) {
10725
          return lastComparison;
10726
        }
10727
      }
10728
      return 0;
10729
    }
10730
 
10731
    public _Fields fieldForId(int fieldId) {
10732
      return _Fields.findByThriftId(fieldId);
10733
    }
10734
 
10735
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10736
      org.apache.thrift.protocol.TField field;
10737
      iprot.readStructBegin();
10738
      while (true)
10739
      {
10740
        field = iprot.readFieldBegin();
10741
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10742
          break;
10743
        }
10744
        switch (field.id) {
10745
          case 0: // SUCCESS
10746
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
10747
              {
5327 rajveer 10748
                org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin();
10749
                this.success = new HashMap<String,Double>(2*_map28.size);
10750
                for (int _i29 = 0; _i29 < _map28.size; ++_i29)
4494 varun.gupt 10751
                {
5327 rajveer 10752
                  String _key30; // required
10753
                  double _val31; // required
10754
                  _key30 = iprot.readString();
10755
                  _val31 = iprot.readDouble();
10756
                  this.success.put(_key30, _val31);
4494 varun.gupt 10757
                }
10758
                iprot.readMapEnd();
10759
              }
10760
            } else { 
10761
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10762
            }
10763
            break;
10764
          default:
10765
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10766
        }
10767
        iprot.readFieldEnd();
10768
      }
10769
      iprot.readStructEnd();
10770
      validate();
10771
    }
10772
 
10773
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10774
      oprot.writeStructBegin(STRUCT_DESC);
10775
 
10776
      if (this.isSetSuccess()) {
10777
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10778
        {
10779
          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 10780
          for (Map.Entry<String, Double> _iter32 : this.success.entrySet())
4494 varun.gupt 10781
          {
5327 rajveer 10782
            oprot.writeString(_iter32.getKey());
10783
            oprot.writeDouble(_iter32.getValue());
4494 varun.gupt 10784
          }
10785
          oprot.writeMapEnd();
10786
        }
10787
        oprot.writeFieldEnd();
10788
      }
10789
      oprot.writeFieldStop();
10790
      oprot.writeStructEnd();
10791
    }
10792
 
10793
    @Override
10794
    public String toString() {
10795
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
10796
      boolean first = true;
10797
 
10798
      sb.append("success:");
10799
      if (this.success == null) {
10800
        sb.append("null");
10801
      } else {
10802
        sb.append(this.success);
10803
      }
10804
      first = false;
10805
      sb.append(")");
10806
      return sb.toString();
10807
    }
10808
 
10809
    public void validate() throws org.apache.thrift.TException {
10810
      // check for required fields
10811
    }
10812
 
10813
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10814
      try {
10815
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10816
      } catch (org.apache.thrift.TException te) {
10817
        throw new java.io.IOException(te);
10818
      }
10819
    }
10820
 
10821
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10822
      try {
10823
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10824
      } catch (org.apache.thrift.TException te) {
10825
        throw new java.io.IOException(te);
10826
      }
10827
    }
10828
 
10829
  }
10830
 
5469 rajveer 10831
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
10832
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
10833
 
10834
    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);
10835
 
10836
    private Voucher voucher; // required
10837
 
10838
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10839
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10840
      VOUCHER((short)1, "voucher");
10841
 
10842
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10843
 
10844
      static {
10845
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10846
          byName.put(field.getFieldName(), field);
10847
        }
10848
      }
10849
 
10850
      /**
10851
       * Find the _Fields constant that matches fieldId, or null if its not found.
10852
       */
10853
      public static _Fields findByThriftId(int fieldId) {
10854
        switch(fieldId) {
10855
          case 1: // VOUCHER
10856
            return VOUCHER;
10857
          default:
10858
            return null;
10859
        }
10860
      }
10861
 
10862
      /**
10863
       * Find the _Fields constant that matches fieldId, throwing an exception
10864
       * if it is not found.
10865
       */
10866
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10867
        _Fields fields = findByThriftId(fieldId);
10868
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10869
        return fields;
10870
      }
10871
 
10872
      /**
10873
       * Find the _Fields constant that matches name, or null if its not found.
10874
       */
10875
      public static _Fields findByName(String name) {
10876
        return byName.get(name);
10877
      }
10878
 
10879
      private final short _thriftId;
10880
      private final String _fieldName;
10881
 
10882
      _Fields(short thriftId, String fieldName) {
10883
        _thriftId = thriftId;
10884
        _fieldName = fieldName;
10885
      }
10886
 
10887
      public short getThriftFieldId() {
10888
        return _thriftId;
10889
      }
10890
 
10891
      public String getFieldName() {
10892
        return _fieldName;
10893
      }
10894
    }
10895
 
10896
    // isset id assignments
10897
 
10898
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10899
    static {
10900
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10901
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10902
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
10903
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10904
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
10905
    }
10906
 
10907
    public addVoucher_args() {
10908
    }
10909
 
10910
    public addVoucher_args(
10911
      Voucher voucher)
10912
    {
10913
      this();
10914
      this.voucher = voucher;
10915
    }
10916
 
10917
    /**
10918
     * Performs a deep copy on <i>other</i>.
10919
     */
10920
    public addVoucher_args(addVoucher_args other) {
10921
      if (other.isSetVoucher()) {
10922
        this.voucher = new Voucher(other.voucher);
10923
      }
10924
    }
10925
 
10926
    public addVoucher_args deepCopy() {
10927
      return new addVoucher_args(this);
10928
    }
10929
 
10930
    @Override
10931
    public void clear() {
10932
      this.voucher = null;
10933
    }
10934
 
10935
    public Voucher getVoucher() {
10936
      return this.voucher;
10937
    }
10938
 
10939
    public void setVoucher(Voucher voucher) {
10940
      this.voucher = voucher;
10941
    }
10942
 
10943
    public void unsetVoucher() {
10944
      this.voucher = null;
10945
    }
10946
 
10947
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
10948
    public boolean isSetVoucher() {
10949
      return this.voucher != null;
10950
    }
10951
 
10952
    public void setVoucherIsSet(boolean value) {
10953
      if (!value) {
10954
        this.voucher = null;
10955
      }
10956
    }
10957
 
10958
    public void setFieldValue(_Fields field, Object value) {
10959
      switch (field) {
10960
      case VOUCHER:
10961
        if (value == null) {
10962
          unsetVoucher();
10963
        } else {
10964
          setVoucher((Voucher)value);
10965
        }
10966
        break;
10967
 
10968
      }
10969
    }
10970
 
10971
    public Object getFieldValue(_Fields field) {
10972
      switch (field) {
10973
      case VOUCHER:
10974
        return getVoucher();
10975
 
10976
      }
10977
      throw new IllegalStateException();
10978
    }
10979
 
10980
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10981
    public boolean isSet(_Fields field) {
10982
      if (field == null) {
10983
        throw new IllegalArgumentException();
10984
      }
10985
 
10986
      switch (field) {
10987
      case VOUCHER:
10988
        return isSetVoucher();
10989
      }
10990
      throw new IllegalStateException();
10991
    }
10992
 
10993
    @Override
10994
    public boolean equals(Object that) {
10995
      if (that == null)
10996
        return false;
10997
      if (that instanceof addVoucher_args)
10998
        return this.equals((addVoucher_args)that);
10999
      return false;
11000
    }
11001
 
11002
    public boolean equals(addVoucher_args that) {
11003
      if (that == null)
11004
        return false;
11005
 
11006
      boolean this_present_voucher = true && this.isSetVoucher();
11007
      boolean that_present_voucher = true && that.isSetVoucher();
11008
      if (this_present_voucher || that_present_voucher) {
11009
        if (!(this_present_voucher && that_present_voucher))
11010
          return false;
11011
        if (!this.voucher.equals(that.voucher))
11012
          return false;
11013
      }
11014
 
11015
      return true;
11016
    }
11017
 
11018
    @Override
11019
    public int hashCode() {
11020
      return 0;
11021
    }
11022
 
11023
    public int compareTo(addVoucher_args other) {
11024
      if (!getClass().equals(other.getClass())) {
11025
        return getClass().getName().compareTo(other.getClass().getName());
11026
      }
11027
 
11028
      int lastComparison = 0;
11029
      addVoucher_args typedOther = (addVoucher_args)other;
11030
 
11031
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
11032
      if (lastComparison != 0) {
11033
        return lastComparison;
11034
      }
11035
      if (isSetVoucher()) {
11036
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
11037
        if (lastComparison != 0) {
11038
          return lastComparison;
11039
        }
11040
      }
11041
      return 0;
11042
    }
11043
 
11044
    public _Fields fieldForId(int fieldId) {
11045
      return _Fields.findByThriftId(fieldId);
11046
    }
11047
 
11048
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11049
      org.apache.thrift.protocol.TField field;
11050
      iprot.readStructBegin();
11051
      while (true)
11052
      {
11053
        field = iprot.readFieldBegin();
11054
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11055
          break;
11056
        }
11057
        switch (field.id) {
11058
          case 1: // VOUCHER
11059
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11060
              this.voucher = new Voucher();
11061
              this.voucher.read(iprot);
11062
            } else { 
11063
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11064
            }
11065
            break;
11066
          default:
11067
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11068
        }
11069
        iprot.readFieldEnd();
11070
      }
11071
      iprot.readStructEnd();
11072
      validate();
11073
    }
11074
 
11075
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11076
      validate();
11077
 
11078
      oprot.writeStructBegin(STRUCT_DESC);
11079
      if (this.voucher != null) {
11080
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
11081
        this.voucher.write(oprot);
11082
        oprot.writeFieldEnd();
11083
      }
11084
      oprot.writeFieldStop();
11085
      oprot.writeStructEnd();
11086
    }
11087
 
11088
    @Override
11089
    public String toString() {
11090
      StringBuilder sb = new StringBuilder("addVoucher_args(");
11091
      boolean first = true;
11092
 
11093
      sb.append("voucher:");
11094
      if (this.voucher == null) {
11095
        sb.append("null");
11096
      } else {
11097
        sb.append(this.voucher);
11098
      }
11099
      first = false;
11100
      sb.append(")");
11101
      return sb.toString();
11102
    }
11103
 
11104
    public void validate() throws org.apache.thrift.TException {
11105
      // check for required fields
11106
    }
11107
 
11108
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11109
      try {
11110
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11111
      } catch (org.apache.thrift.TException te) {
11112
        throw new java.io.IOException(te);
11113
      }
11114
    }
11115
 
11116
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11117
      try {
11118
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11119
      } catch (org.apache.thrift.TException te) {
11120
        throw new java.io.IOException(te);
11121
      }
11122
    }
11123
 
11124
  }
11125
 
11126
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
11127
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
11128
 
11129
 
11130
 
11131
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11132
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11133
;
11134
 
11135
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11136
 
11137
      static {
11138
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11139
          byName.put(field.getFieldName(), field);
11140
        }
11141
      }
11142
 
11143
      /**
11144
       * Find the _Fields constant that matches fieldId, or null if its not found.
11145
       */
11146
      public static _Fields findByThriftId(int fieldId) {
11147
        switch(fieldId) {
11148
          default:
11149
            return null;
11150
        }
11151
      }
11152
 
11153
      /**
11154
       * Find the _Fields constant that matches fieldId, throwing an exception
11155
       * if it is not found.
11156
       */
11157
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11158
        _Fields fields = findByThriftId(fieldId);
11159
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11160
        return fields;
11161
      }
11162
 
11163
      /**
11164
       * Find the _Fields constant that matches name, or null if its not found.
11165
       */
11166
      public static _Fields findByName(String name) {
11167
        return byName.get(name);
11168
      }
11169
 
11170
      private final short _thriftId;
11171
      private final String _fieldName;
11172
 
11173
      _Fields(short thriftId, String fieldName) {
11174
        _thriftId = thriftId;
11175
        _fieldName = fieldName;
11176
      }
11177
 
11178
      public short getThriftFieldId() {
11179
        return _thriftId;
11180
      }
11181
 
11182
      public String getFieldName() {
11183
        return _fieldName;
11184
      }
11185
    }
11186
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11187
    static {
11188
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11189
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11190
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
11191
    }
11192
 
11193
    public addVoucher_result() {
11194
    }
11195
 
11196
    /**
11197
     * Performs a deep copy on <i>other</i>.
11198
     */
11199
    public addVoucher_result(addVoucher_result other) {
11200
    }
11201
 
11202
    public addVoucher_result deepCopy() {
11203
      return new addVoucher_result(this);
11204
    }
11205
 
11206
    @Override
11207
    public void clear() {
11208
    }
11209
 
11210
    public void setFieldValue(_Fields field, Object value) {
11211
      switch (field) {
11212
      }
11213
    }
11214
 
11215
    public Object getFieldValue(_Fields field) {
11216
      switch (field) {
11217
      }
11218
      throw new IllegalStateException();
11219
    }
11220
 
11221
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11222
    public boolean isSet(_Fields field) {
11223
      if (field == null) {
11224
        throw new IllegalArgumentException();
11225
      }
11226
 
11227
      switch (field) {
11228
      }
11229
      throw new IllegalStateException();
11230
    }
11231
 
11232
    @Override
11233
    public boolean equals(Object that) {
11234
      if (that == null)
11235
        return false;
11236
      if (that instanceof addVoucher_result)
11237
        return this.equals((addVoucher_result)that);
11238
      return false;
11239
    }
11240
 
11241
    public boolean equals(addVoucher_result that) {
11242
      if (that == null)
11243
        return false;
11244
 
11245
      return true;
11246
    }
11247
 
11248
    @Override
11249
    public int hashCode() {
11250
      return 0;
11251
    }
11252
 
11253
    public int compareTo(addVoucher_result other) {
11254
      if (!getClass().equals(other.getClass())) {
11255
        return getClass().getName().compareTo(other.getClass().getName());
11256
      }
11257
 
11258
      int lastComparison = 0;
11259
      addVoucher_result typedOther = (addVoucher_result)other;
11260
 
11261
      return 0;
11262
    }
11263
 
11264
    public _Fields fieldForId(int fieldId) {
11265
      return _Fields.findByThriftId(fieldId);
11266
    }
11267
 
11268
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11269
      org.apache.thrift.protocol.TField field;
11270
      iprot.readStructBegin();
11271
      while (true)
11272
      {
11273
        field = iprot.readFieldBegin();
11274
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11275
          break;
11276
        }
11277
        switch (field.id) {
11278
          default:
11279
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11280
        }
11281
        iprot.readFieldEnd();
11282
      }
11283
      iprot.readStructEnd();
11284
      validate();
11285
    }
11286
 
11287
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11288
      oprot.writeStructBegin(STRUCT_DESC);
11289
 
11290
      oprot.writeFieldStop();
11291
      oprot.writeStructEnd();
11292
    }
11293
 
11294
    @Override
11295
    public String toString() {
11296
      StringBuilder sb = new StringBuilder("addVoucher_result(");
11297
      boolean first = true;
11298
 
11299
      sb.append(")");
11300
      return sb.toString();
11301
    }
11302
 
11303
    public void validate() throws org.apache.thrift.TException {
11304
      // check for required fields
11305
    }
11306
 
11307
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11308
      try {
11309
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11310
      } catch (org.apache.thrift.TException te) {
11311
        throw new java.io.IOException(te);
11312
      }
11313
    }
11314
 
11315
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11316
      try {
11317
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11318
      } catch (org.apache.thrift.TException te) {
11319
        throw new java.io.IOException(te);
11320
      }
11321
    }
11322
 
11323
  }
11324
 
11325
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
11326
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
11327
 
11328
    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);
11329
    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);
11330
    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);
11331
    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);
11332
 
11333
    private long userId; // required
11334
    private String userEmail; // required
11335
    private VoucherType voucherType; // required
11336
    private long amount; // required
11337
 
11338
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11339
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11340
      USER_ID((short)1, "userId"),
11341
      USER_EMAIL((short)2, "userEmail"),
11342
      /**
11343
       * 
11344
       * @see VoucherType
11345
       */
11346
      VOUCHER_TYPE((short)3, "voucherType"),
11347
      AMOUNT((short)4, "amount");
11348
 
11349
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11350
 
11351
      static {
11352
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11353
          byName.put(field.getFieldName(), field);
11354
        }
11355
      }
11356
 
11357
      /**
11358
       * Find the _Fields constant that matches fieldId, or null if its not found.
11359
       */
11360
      public static _Fields findByThriftId(int fieldId) {
11361
        switch(fieldId) {
11362
          case 1: // USER_ID
11363
            return USER_ID;
11364
          case 2: // USER_EMAIL
11365
            return USER_EMAIL;
11366
          case 3: // VOUCHER_TYPE
11367
            return VOUCHER_TYPE;
11368
          case 4: // AMOUNT
11369
            return AMOUNT;
11370
          default:
11371
            return null;
11372
        }
11373
      }
11374
 
11375
      /**
11376
       * Find the _Fields constant that matches fieldId, throwing an exception
11377
       * if it is not found.
11378
       */
11379
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11380
        _Fields fields = findByThriftId(fieldId);
11381
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11382
        return fields;
11383
      }
11384
 
11385
      /**
11386
       * Find the _Fields constant that matches name, or null if its not found.
11387
       */
11388
      public static _Fields findByName(String name) {
11389
        return byName.get(name);
11390
      }
11391
 
11392
      private final short _thriftId;
11393
      private final String _fieldName;
11394
 
11395
      _Fields(short thriftId, String fieldName) {
11396
        _thriftId = thriftId;
11397
        _fieldName = fieldName;
11398
      }
11399
 
11400
      public short getThriftFieldId() {
11401
        return _thriftId;
11402
      }
11403
 
11404
      public String getFieldName() {
11405
        return _fieldName;
11406
      }
11407
    }
11408
 
11409
    // isset id assignments
11410
    private static final int __USERID_ISSET_ID = 0;
11411
    private static final int __AMOUNT_ISSET_ID = 1;
11412
    private BitSet __isset_bit_vector = new BitSet(2);
11413
 
11414
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11415
    static {
11416
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11417
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11418
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11419
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11420
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
11421
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11422
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
11423
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11424
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11425
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11426
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
11427
    }
11428
 
11429
    public assignVoucher_args() {
11430
    }
11431
 
11432
    public assignVoucher_args(
11433
      long userId,
11434
      String userEmail,
11435
      VoucherType voucherType,
11436
      long amount)
11437
    {
11438
      this();
11439
      this.userId = userId;
11440
      setUserIdIsSet(true);
11441
      this.userEmail = userEmail;
11442
      this.voucherType = voucherType;
11443
      this.amount = amount;
11444
      setAmountIsSet(true);
11445
    }
11446
 
11447
    /**
11448
     * Performs a deep copy on <i>other</i>.
11449
     */
11450
    public assignVoucher_args(assignVoucher_args other) {
11451
      __isset_bit_vector.clear();
11452
      __isset_bit_vector.or(other.__isset_bit_vector);
11453
      this.userId = other.userId;
11454
      if (other.isSetUserEmail()) {
11455
        this.userEmail = other.userEmail;
11456
      }
11457
      if (other.isSetVoucherType()) {
11458
        this.voucherType = other.voucherType;
11459
      }
11460
      this.amount = other.amount;
11461
    }
11462
 
11463
    public assignVoucher_args deepCopy() {
11464
      return new assignVoucher_args(this);
11465
    }
11466
 
11467
    @Override
11468
    public void clear() {
11469
      setUserIdIsSet(false);
11470
      this.userId = 0;
11471
      this.userEmail = null;
11472
      this.voucherType = null;
11473
      setAmountIsSet(false);
11474
      this.amount = 0;
11475
    }
11476
 
11477
    public long getUserId() {
11478
      return this.userId;
11479
    }
11480
 
11481
    public void setUserId(long userId) {
11482
      this.userId = userId;
11483
      setUserIdIsSet(true);
11484
    }
11485
 
11486
    public void unsetUserId() {
11487
      __isset_bit_vector.clear(__USERID_ISSET_ID);
11488
    }
11489
 
11490
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
11491
    public boolean isSetUserId() {
11492
      return __isset_bit_vector.get(__USERID_ISSET_ID);
11493
    }
11494
 
11495
    public void setUserIdIsSet(boolean value) {
11496
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
11497
    }
11498
 
11499
    public String getUserEmail() {
11500
      return this.userEmail;
11501
    }
11502
 
11503
    public void setUserEmail(String userEmail) {
11504
      this.userEmail = userEmail;
11505
    }
11506
 
11507
    public void unsetUserEmail() {
11508
      this.userEmail = null;
11509
    }
11510
 
11511
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
11512
    public boolean isSetUserEmail() {
11513
      return this.userEmail != null;
11514
    }
11515
 
11516
    public void setUserEmailIsSet(boolean value) {
11517
      if (!value) {
11518
        this.userEmail = null;
11519
      }
11520
    }
11521
 
11522
    /**
11523
     * 
11524
     * @see VoucherType
11525
     */
11526
    public VoucherType getVoucherType() {
11527
      return this.voucherType;
11528
    }
11529
 
11530
    /**
11531
     * 
11532
     * @see VoucherType
11533
     */
11534
    public void setVoucherType(VoucherType voucherType) {
11535
      this.voucherType = voucherType;
11536
    }
11537
 
11538
    public void unsetVoucherType() {
11539
      this.voucherType = null;
11540
    }
11541
 
11542
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
11543
    public boolean isSetVoucherType() {
11544
      return this.voucherType != null;
11545
    }
11546
 
11547
    public void setVoucherTypeIsSet(boolean value) {
11548
      if (!value) {
11549
        this.voucherType = null;
11550
      }
11551
    }
11552
 
11553
    public long getAmount() {
11554
      return this.amount;
11555
    }
11556
 
11557
    public void setAmount(long amount) {
11558
      this.amount = amount;
11559
      setAmountIsSet(true);
11560
    }
11561
 
11562
    public void unsetAmount() {
11563
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
11564
    }
11565
 
11566
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
11567
    public boolean isSetAmount() {
11568
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
11569
    }
11570
 
11571
    public void setAmountIsSet(boolean value) {
11572
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
11573
    }
11574
 
11575
    public void setFieldValue(_Fields field, Object value) {
11576
      switch (field) {
11577
      case USER_ID:
11578
        if (value == null) {
11579
          unsetUserId();
11580
        } else {
11581
          setUserId((Long)value);
11582
        }
11583
        break;
11584
 
11585
      case USER_EMAIL:
11586
        if (value == null) {
11587
          unsetUserEmail();
11588
        } else {
11589
          setUserEmail((String)value);
11590
        }
11591
        break;
11592
 
11593
      case VOUCHER_TYPE:
11594
        if (value == null) {
11595
          unsetVoucherType();
11596
        } else {
11597
          setVoucherType((VoucherType)value);
11598
        }
11599
        break;
11600
 
11601
      case AMOUNT:
11602
        if (value == null) {
11603
          unsetAmount();
11604
        } else {
11605
          setAmount((Long)value);
11606
        }
11607
        break;
11608
 
11609
      }
11610
    }
11611
 
11612
    public Object getFieldValue(_Fields field) {
11613
      switch (field) {
11614
      case USER_ID:
11615
        return Long.valueOf(getUserId());
11616
 
11617
      case USER_EMAIL:
11618
        return getUserEmail();
11619
 
11620
      case VOUCHER_TYPE:
11621
        return getVoucherType();
11622
 
11623
      case AMOUNT:
11624
        return Long.valueOf(getAmount());
11625
 
11626
      }
11627
      throw new IllegalStateException();
11628
    }
11629
 
11630
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11631
    public boolean isSet(_Fields field) {
11632
      if (field == null) {
11633
        throw new IllegalArgumentException();
11634
      }
11635
 
11636
      switch (field) {
11637
      case USER_ID:
11638
        return isSetUserId();
11639
      case USER_EMAIL:
11640
        return isSetUserEmail();
11641
      case VOUCHER_TYPE:
11642
        return isSetVoucherType();
11643
      case AMOUNT:
11644
        return isSetAmount();
11645
      }
11646
      throw new IllegalStateException();
11647
    }
11648
 
11649
    @Override
11650
    public boolean equals(Object that) {
11651
      if (that == null)
11652
        return false;
11653
      if (that instanceof assignVoucher_args)
11654
        return this.equals((assignVoucher_args)that);
11655
      return false;
11656
    }
11657
 
11658
    public boolean equals(assignVoucher_args that) {
11659
      if (that == null)
11660
        return false;
11661
 
11662
      boolean this_present_userId = true;
11663
      boolean that_present_userId = true;
11664
      if (this_present_userId || that_present_userId) {
11665
        if (!(this_present_userId && that_present_userId))
11666
          return false;
11667
        if (this.userId != that.userId)
11668
          return false;
11669
      }
11670
 
11671
      boolean this_present_userEmail = true && this.isSetUserEmail();
11672
      boolean that_present_userEmail = true && that.isSetUserEmail();
11673
      if (this_present_userEmail || that_present_userEmail) {
11674
        if (!(this_present_userEmail && that_present_userEmail))
11675
          return false;
11676
        if (!this.userEmail.equals(that.userEmail))
11677
          return false;
11678
      }
11679
 
11680
      boolean this_present_voucherType = true && this.isSetVoucherType();
11681
      boolean that_present_voucherType = true && that.isSetVoucherType();
11682
      if (this_present_voucherType || that_present_voucherType) {
11683
        if (!(this_present_voucherType && that_present_voucherType))
11684
          return false;
11685
        if (!this.voucherType.equals(that.voucherType))
11686
          return false;
11687
      }
11688
 
11689
      boolean this_present_amount = true;
11690
      boolean that_present_amount = true;
11691
      if (this_present_amount || that_present_amount) {
11692
        if (!(this_present_amount && that_present_amount))
11693
          return false;
11694
        if (this.amount != that.amount)
11695
          return false;
11696
      }
11697
 
11698
      return true;
11699
    }
11700
 
11701
    @Override
11702
    public int hashCode() {
11703
      return 0;
11704
    }
11705
 
11706
    public int compareTo(assignVoucher_args other) {
11707
      if (!getClass().equals(other.getClass())) {
11708
        return getClass().getName().compareTo(other.getClass().getName());
11709
      }
11710
 
11711
      int lastComparison = 0;
11712
      assignVoucher_args typedOther = (assignVoucher_args)other;
11713
 
11714
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
11715
      if (lastComparison != 0) {
11716
        return lastComparison;
11717
      }
11718
      if (isSetUserId()) {
11719
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
11720
        if (lastComparison != 0) {
11721
          return lastComparison;
11722
        }
11723
      }
11724
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
11725
      if (lastComparison != 0) {
11726
        return lastComparison;
11727
      }
11728
      if (isSetUserEmail()) {
11729
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
11730
        if (lastComparison != 0) {
11731
          return lastComparison;
11732
        }
11733
      }
11734
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
11735
      if (lastComparison != 0) {
11736
        return lastComparison;
11737
      }
11738
      if (isSetVoucherType()) {
11739
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
11740
        if (lastComparison != 0) {
11741
          return lastComparison;
11742
        }
11743
      }
11744
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
11745
      if (lastComparison != 0) {
11746
        return lastComparison;
11747
      }
11748
      if (isSetAmount()) {
11749
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
11750
        if (lastComparison != 0) {
11751
          return lastComparison;
11752
        }
11753
      }
11754
      return 0;
11755
    }
11756
 
11757
    public _Fields fieldForId(int fieldId) {
11758
      return _Fields.findByThriftId(fieldId);
11759
    }
11760
 
11761
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11762
      org.apache.thrift.protocol.TField field;
11763
      iprot.readStructBegin();
11764
      while (true)
11765
      {
11766
        field = iprot.readFieldBegin();
11767
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11768
          break;
11769
        }
11770
        switch (field.id) {
11771
          case 1: // USER_ID
11772
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11773
              this.userId = iprot.readI64();
11774
              setUserIdIsSet(true);
11775
            } else { 
11776
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11777
            }
11778
            break;
11779
          case 2: // USER_EMAIL
11780
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11781
              this.userEmail = iprot.readString();
11782
            } else { 
11783
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11784
            }
11785
            break;
11786
          case 3: // VOUCHER_TYPE
11787
            if (field.type == org.apache.thrift.protocol.TType.I32) {
11788
              this.voucherType = VoucherType.findByValue(iprot.readI32());
11789
            } else { 
11790
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11791
            }
11792
            break;
11793
          case 4: // AMOUNT
11794
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11795
              this.amount = iprot.readI64();
11796
              setAmountIsSet(true);
11797
            } else { 
11798
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11799
            }
11800
            break;
11801
          default:
11802
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11803
        }
11804
        iprot.readFieldEnd();
11805
      }
11806
      iprot.readStructEnd();
11807
      validate();
11808
    }
11809
 
11810
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11811
      validate();
11812
 
11813
      oprot.writeStructBegin(STRUCT_DESC);
11814
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
11815
      oprot.writeI64(this.userId);
11816
      oprot.writeFieldEnd();
11817
      if (this.userEmail != null) {
11818
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
11819
        oprot.writeString(this.userEmail);
11820
        oprot.writeFieldEnd();
11821
      }
11822
      if (this.voucherType != null) {
11823
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
11824
        oprot.writeI32(this.voucherType.getValue());
11825
        oprot.writeFieldEnd();
11826
      }
11827
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
11828
      oprot.writeI64(this.amount);
11829
      oprot.writeFieldEnd();
11830
      oprot.writeFieldStop();
11831
      oprot.writeStructEnd();
11832
    }
11833
 
11834
    @Override
11835
    public String toString() {
11836
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
11837
      boolean first = true;
11838
 
11839
      sb.append("userId:");
11840
      sb.append(this.userId);
11841
      first = false;
11842
      if (!first) sb.append(", ");
11843
      sb.append("userEmail:");
11844
      if (this.userEmail == null) {
11845
        sb.append("null");
11846
      } else {
11847
        sb.append(this.userEmail);
11848
      }
11849
      first = false;
11850
      if (!first) sb.append(", ");
11851
      sb.append("voucherType:");
11852
      if (this.voucherType == null) {
11853
        sb.append("null");
11854
      } else {
11855
        sb.append(this.voucherType);
11856
      }
11857
      first = false;
11858
      if (!first) sb.append(", ");
11859
      sb.append("amount:");
11860
      sb.append(this.amount);
11861
      first = false;
11862
      sb.append(")");
11863
      return sb.toString();
11864
    }
11865
 
11866
    public void validate() throws org.apache.thrift.TException {
11867
      // check for required fields
11868
    }
11869
 
11870
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11871
      try {
11872
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11873
      } catch (org.apache.thrift.TException te) {
11874
        throw new java.io.IOException(te);
11875
      }
11876
    }
11877
 
11878
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11879
      try {
11880
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11881
        __isset_bit_vector = new BitSet(1);
11882
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11883
      } catch (org.apache.thrift.TException te) {
11884
        throw new java.io.IOException(te);
11885
      }
11886
    }
11887
 
11888
  }
11889
 
11890
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
11891
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
11892
 
11893
    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);
11894
 
11895
    private Voucher success; // required
11896
 
11897
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11898
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11899
      SUCCESS((short)0, "success");
11900
 
11901
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11902
 
11903
      static {
11904
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11905
          byName.put(field.getFieldName(), field);
11906
        }
11907
      }
11908
 
11909
      /**
11910
       * Find the _Fields constant that matches fieldId, or null if its not found.
11911
       */
11912
      public static _Fields findByThriftId(int fieldId) {
11913
        switch(fieldId) {
11914
          case 0: // SUCCESS
11915
            return SUCCESS;
11916
          default:
11917
            return null;
11918
        }
11919
      }
11920
 
11921
      /**
11922
       * Find the _Fields constant that matches fieldId, throwing an exception
11923
       * if it is not found.
11924
       */
11925
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11926
        _Fields fields = findByThriftId(fieldId);
11927
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11928
        return fields;
11929
      }
11930
 
11931
      /**
11932
       * Find the _Fields constant that matches name, or null if its not found.
11933
       */
11934
      public static _Fields findByName(String name) {
11935
        return byName.get(name);
11936
      }
11937
 
11938
      private final short _thriftId;
11939
      private final String _fieldName;
11940
 
11941
      _Fields(short thriftId, String fieldName) {
11942
        _thriftId = thriftId;
11943
        _fieldName = fieldName;
11944
      }
11945
 
11946
      public short getThriftFieldId() {
11947
        return _thriftId;
11948
      }
11949
 
11950
      public String getFieldName() {
11951
        return _fieldName;
11952
      }
11953
    }
11954
 
11955
    // isset id assignments
11956
 
11957
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11958
    static {
11959
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11960
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11961
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
11962
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11963
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
11964
    }
11965
 
11966
    public assignVoucher_result() {
11967
    }
11968
 
11969
    public assignVoucher_result(
11970
      Voucher success)
11971
    {
11972
      this();
11973
      this.success = success;
11974
    }
11975
 
11976
    /**
11977
     * Performs a deep copy on <i>other</i>.
11978
     */
11979
    public assignVoucher_result(assignVoucher_result other) {
11980
      if (other.isSetSuccess()) {
11981
        this.success = new Voucher(other.success);
11982
      }
11983
    }
11984
 
11985
    public assignVoucher_result deepCopy() {
11986
      return new assignVoucher_result(this);
11987
    }
11988
 
11989
    @Override
11990
    public void clear() {
11991
      this.success = null;
11992
    }
11993
 
11994
    public Voucher getSuccess() {
11995
      return this.success;
11996
    }
11997
 
11998
    public void setSuccess(Voucher success) {
11999
      this.success = success;
12000
    }
12001
 
12002
    public void unsetSuccess() {
12003
      this.success = null;
12004
    }
12005
 
12006
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12007
    public boolean isSetSuccess() {
12008
      return this.success != null;
12009
    }
12010
 
12011
    public void setSuccessIsSet(boolean value) {
12012
      if (!value) {
12013
        this.success = null;
12014
      }
12015
    }
12016
 
12017
    public void setFieldValue(_Fields field, Object value) {
12018
      switch (field) {
12019
      case SUCCESS:
12020
        if (value == null) {
12021
          unsetSuccess();
12022
        } else {
12023
          setSuccess((Voucher)value);
12024
        }
12025
        break;
12026
 
12027
      }
12028
    }
12029
 
12030
    public Object getFieldValue(_Fields field) {
12031
      switch (field) {
12032
      case SUCCESS:
12033
        return getSuccess();
12034
 
12035
      }
12036
      throw new IllegalStateException();
12037
    }
12038
 
12039
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12040
    public boolean isSet(_Fields field) {
12041
      if (field == null) {
12042
        throw new IllegalArgumentException();
12043
      }
12044
 
12045
      switch (field) {
12046
      case SUCCESS:
12047
        return isSetSuccess();
12048
      }
12049
      throw new IllegalStateException();
12050
    }
12051
 
12052
    @Override
12053
    public boolean equals(Object that) {
12054
      if (that == null)
12055
        return false;
12056
      if (that instanceof assignVoucher_result)
12057
        return this.equals((assignVoucher_result)that);
12058
      return false;
12059
    }
12060
 
12061
    public boolean equals(assignVoucher_result that) {
12062
      if (that == null)
12063
        return false;
12064
 
12065
      boolean this_present_success = true && this.isSetSuccess();
12066
      boolean that_present_success = true && that.isSetSuccess();
12067
      if (this_present_success || that_present_success) {
12068
        if (!(this_present_success && that_present_success))
12069
          return false;
12070
        if (!this.success.equals(that.success))
12071
          return false;
12072
      }
12073
 
12074
      return true;
12075
    }
12076
 
12077
    @Override
12078
    public int hashCode() {
12079
      return 0;
12080
    }
12081
 
12082
    public int compareTo(assignVoucher_result other) {
12083
      if (!getClass().equals(other.getClass())) {
12084
        return getClass().getName().compareTo(other.getClass().getName());
12085
      }
12086
 
12087
      int lastComparison = 0;
12088
      assignVoucher_result typedOther = (assignVoucher_result)other;
12089
 
12090
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12091
      if (lastComparison != 0) {
12092
        return lastComparison;
12093
      }
12094
      if (isSetSuccess()) {
12095
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12096
        if (lastComparison != 0) {
12097
          return lastComparison;
12098
        }
12099
      }
12100
      return 0;
12101
    }
12102
 
12103
    public _Fields fieldForId(int fieldId) {
12104
      return _Fields.findByThriftId(fieldId);
12105
    }
12106
 
12107
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12108
      org.apache.thrift.protocol.TField field;
12109
      iprot.readStructBegin();
12110
      while (true)
12111
      {
12112
        field = iprot.readFieldBegin();
12113
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12114
          break;
12115
        }
12116
        switch (field.id) {
12117
          case 0: // SUCCESS
12118
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12119
              this.success = new Voucher();
12120
              this.success.read(iprot);
12121
            } else { 
12122
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12123
            }
12124
            break;
12125
          default:
12126
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12127
        }
12128
        iprot.readFieldEnd();
12129
      }
12130
      iprot.readStructEnd();
12131
      validate();
12132
    }
12133
 
12134
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12135
      oprot.writeStructBegin(STRUCT_DESC);
12136
 
12137
      if (this.isSetSuccess()) {
12138
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12139
        this.success.write(oprot);
12140
        oprot.writeFieldEnd();
12141
      }
12142
      oprot.writeFieldStop();
12143
      oprot.writeStructEnd();
12144
    }
12145
 
12146
    @Override
12147
    public String toString() {
12148
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
12149
      boolean first = true;
12150
 
12151
      sb.append("success:");
12152
      if (this.success == null) {
12153
        sb.append("null");
12154
      } else {
12155
        sb.append(this.success);
12156
      }
12157
      first = false;
12158
      sb.append(")");
12159
      return sb.toString();
12160
    }
12161
 
12162
    public void validate() throws org.apache.thrift.TException {
12163
      // check for required fields
12164
    }
12165
 
12166
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12167
      try {
12168
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12169
      } catch (org.apache.thrift.TException te) {
12170
        throw new java.io.IOException(te);
12171
      }
12172
    }
12173
 
12174
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12175
      try {
12176
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12177
      } catch (org.apache.thrift.TException te) {
12178
        throw new java.io.IOException(te);
12179
      }
12180
    }
12181
 
12182
  }
12183
 
12184
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
12185
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
12186
 
12187
    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);
12188
    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);
12189
 
12190
    private String voucherCode; // required
12191
    private long redeemedOn; // required
12192
 
12193
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12194
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12195
      VOUCHER_CODE((short)1, "voucherCode"),
12196
      REDEEMED_ON((short)2, "redeemedOn");
12197
 
12198
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12199
 
12200
      static {
12201
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12202
          byName.put(field.getFieldName(), field);
12203
        }
12204
      }
12205
 
12206
      /**
12207
       * Find the _Fields constant that matches fieldId, or null if its not found.
12208
       */
12209
      public static _Fields findByThriftId(int fieldId) {
12210
        switch(fieldId) {
12211
          case 1: // VOUCHER_CODE
12212
            return VOUCHER_CODE;
12213
          case 2: // REDEEMED_ON
12214
            return REDEEMED_ON;
12215
          default:
12216
            return null;
12217
        }
12218
      }
12219
 
12220
      /**
12221
       * Find the _Fields constant that matches fieldId, throwing an exception
12222
       * if it is not found.
12223
       */
12224
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12225
        _Fields fields = findByThriftId(fieldId);
12226
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12227
        return fields;
12228
      }
12229
 
12230
      /**
12231
       * Find the _Fields constant that matches name, or null if its not found.
12232
       */
12233
      public static _Fields findByName(String name) {
12234
        return byName.get(name);
12235
      }
12236
 
12237
      private final short _thriftId;
12238
      private final String _fieldName;
12239
 
12240
      _Fields(short thriftId, String fieldName) {
12241
        _thriftId = thriftId;
12242
        _fieldName = fieldName;
12243
      }
12244
 
12245
      public short getThriftFieldId() {
12246
        return _thriftId;
12247
      }
12248
 
12249
      public String getFieldName() {
12250
        return _fieldName;
12251
      }
12252
    }
12253
 
12254
    // isset id assignments
12255
    private static final int __REDEEMEDON_ISSET_ID = 0;
12256
    private BitSet __isset_bit_vector = new BitSet(1);
12257
 
12258
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12259
    static {
12260
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12261
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12262
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12263
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12264
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12265
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12266
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
12267
    }
12268
 
12269
    public markVoucherAsRedeemed_args() {
12270
    }
12271
 
12272
    public markVoucherAsRedeemed_args(
12273
      String voucherCode,
12274
      long redeemedOn)
12275
    {
12276
      this();
12277
      this.voucherCode = voucherCode;
12278
      this.redeemedOn = redeemedOn;
12279
      setRedeemedOnIsSet(true);
12280
    }
12281
 
12282
    /**
12283
     * Performs a deep copy on <i>other</i>.
12284
     */
12285
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
12286
      __isset_bit_vector.clear();
12287
      __isset_bit_vector.or(other.__isset_bit_vector);
12288
      if (other.isSetVoucherCode()) {
12289
        this.voucherCode = other.voucherCode;
12290
      }
12291
      this.redeemedOn = other.redeemedOn;
12292
    }
12293
 
12294
    public markVoucherAsRedeemed_args deepCopy() {
12295
      return new markVoucherAsRedeemed_args(this);
12296
    }
12297
 
12298
    @Override
12299
    public void clear() {
12300
      this.voucherCode = null;
12301
      setRedeemedOnIsSet(false);
12302
      this.redeemedOn = 0;
12303
    }
12304
 
12305
    public String getVoucherCode() {
12306
      return this.voucherCode;
12307
    }
12308
 
12309
    public void setVoucherCode(String voucherCode) {
12310
      this.voucherCode = voucherCode;
12311
    }
12312
 
12313
    public void unsetVoucherCode() {
12314
      this.voucherCode = null;
12315
    }
12316
 
12317
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
12318
    public boolean isSetVoucherCode() {
12319
      return this.voucherCode != null;
12320
    }
12321
 
12322
    public void setVoucherCodeIsSet(boolean value) {
12323
      if (!value) {
12324
        this.voucherCode = null;
12325
      }
12326
    }
12327
 
12328
    public long getRedeemedOn() {
12329
      return this.redeemedOn;
12330
    }
12331
 
12332
    public void setRedeemedOn(long redeemedOn) {
12333
      this.redeemedOn = redeemedOn;
12334
      setRedeemedOnIsSet(true);
12335
    }
12336
 
12337
    public void unsetRedeemedOn() {
12338
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
12339
    }
12340
 
12341
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
12342
    public boolean isSetRedeemedOn() {
12343
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
12344
    }
12345
 
12346
    public void setRedeemedOnIsSet(boolean value) {
12347
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
12348
    }
12349
 
12350
    public void setFieldValue(_Fields field, Object value) {
12351
      switch (field) {
12352
      case VOUCHER_CODE:
12353
        if (value == null) {
12354
          unsetVoucherCode();
12355
        } else {
12356
          setVoucherCode((String)value);
12357
        }
12358
        break;
12359
 
12360
      case REDEEMED_ON:
12361
        if (value == null) {
12362
          unsetRedeemedOn();
12363
        } else {
12364
          setRedeemedOn((Long)value);
12365
        }
12366
        break;
12367
 
12368
      }
12369
    }
12370
 
12371
    public Object getFieldValue(_Fields field) {
12372
      switch (field) {
12373
      case VOUCHER_CODE:
12374
        return getVoucherCode();
12375
 
12376
      case REDEEMED_ON:
12377
        return Long.valueOf(getRedeemedOn());
12378
 
12379
      }
12380
      throw new IllegalStateException();
12381
    }
12382
 
12383
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12384
    public boolean isSet(_Fields field) {
12385
      if (field == null) {
12386
        throw new IllegalArgumentException();
12387
      }
12388
 
12389
      switch (field) {
12390
      case VOUCHER_CODE:
12391
        return isSetVoucherCode();
12392
      case REDEEMED_ON:
12393
        return isSetRedeemedOn();
12394
      }
12395
      throw new IllegalStateException();
12396
    }
12397
 
12398
    @Override
12399
    public boolean equals(Object that) {
12400
      if (that == null)
12401
        return false;
12402
      if (that instanceof markVoucherAsRedeemed_args)
12403
        return this.equals((markVoucherAsRedeemed_args)that);
12404
      return false;
12405
    }
12406
 
12407
    public boolean equals(markVoucherAsRedeemed_args that) {
12408
      if (that == null)
12409
        return false;
12410
 
12411
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
12412
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
12413
      if (this_present_voucherCode || that_present_voucherCode) {
12414
        if (!(this_present_voucherCode && that_present_voucherCode))
12415
          return false;
12416
        if (!this.voucherCode.equals(that.voucherCode))
12417
          return false;
12418
      }
12419
 
12420
      boolean this_present_redeemedOn = true;
12421
      boolean that_present_redeemedOn = true;
12422
      if (this_present_redeemedOn || that_present_redeemedOn) {
12423
        if (!(this_present_redeemedOn && that_present_redeemedOn))
12424
          return false;
12425
        if (this.redeemedOn != that.redeemedOn)
12426
          return false;
12427
      }
12428
 
12429
      return true;
12430
    }
12431
 
12432
    @Override
12433
    public int hashCode() {
12434
      return 0;
12435
    }
12436
 
12437
    public int compareTo(markVoucherAsRedeemed_args other) {
12438
      if (!getClass().equals(other.getClass())) {
12439
        return getClass().getName().compareTo(other.getClass().getName());
12440
      }
12441
 
12442
      int lastComparison = 0;
12443
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
12444
 
12445
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
12446
      if (lastComparison != 0) {
12447
        return lastComparison;
12448
      }
12449
      if (isSetVoucherCode()) {
12450
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
12451
        if (lastComparison != 0) {
12452
          return lastComparison;
12453
        }
12454
      }
12455
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
12456
      if (lastComparison != 0) {
12457
        return lastComparison;
12458
      }
12459
      if (isSetRedeemedOn()) {
12460
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
12461
        if (lastComparison != 0) {
12462
          return lastComparison;
12463
        }
12464
      }
12465
      return 0;
12466
    }
12467
 
12468
    public _Fields fieldForId(int fieldId) {
12469
      return _Fields.findByThriftId(fieldId);
12470
    }
12471
 
12472
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12473
      org.apache.thrift.protocol.TField field;
12474
      iprot.readStructBegin();
12475
      while (true)
12476
      {
12477
        field = iprot.readFieldBegin();
12478
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12479
          break;
12480
        }
12481
        switch (field.id) {
12482
          case 1: // VOUCHER_CODE
12483
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12484
              this.voucherCode = iprot.readString();
12485
            } else { 
12486
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12487
            }
12488
            break;
12489
          case 2: // REDEEMED_ON
12490
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12491
              this.redeemedOn = iprot.readI64();
12492
              setRedeemedOnIsSet(true);
12493
            } else { 
12494
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12495
            }
12496
            break;
12497
          default:
12498
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12499
        }
12500
        iprot.readFieldEnd();
12501
      }
12502
      iprot.readStructEnd();
12503
      validate();
12504
    }
12505
 
12506
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12507
      validate();
12508
 
12509
      oprot.writeStructBegin(STRUCT_DESC);
12510
      if (this.voucherCode != null) {
12511
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
12512
        oprot.writeString(this.voucherCode);
12513
        oprot.writeFieldEnd();
12514
      }
12515
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
12516
      oprot.writeI64(this.redeemedOn);
12517
      oprot.writeFieldEnd();
12518
      oprot.writeFieldStop();
12519
      oprot.writeStructEnd();
12520
    }
12521
 
12522
    @Override
12523
    public String toString() {
12524
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
12525
      boolean first = true;
12526
 
12527
      sb.append("voucherCode:");
12528
      if (this.voucherCode == null) {
12529
        sb.append("null");
12530
      } else {
12531
        sb.append(this.voucherCode);
12532
      }
12533
      first = false;
12534
      if (!first) sb.append(", ");
12535
      sb.append("redeemedOn:");
12536
      sb.append(this.redeemedOn);
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
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
12557
        __isset_bit_vector = new BitSet(1);
12558
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12559
      } catch (org.apache.thrift.TException te) {
12560
        throw new java.io.IOException(te);
12561
      }
12562
    }
12563
 
12564
  }
12565
 
12566
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
12567
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
12568
 
12569
    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);
12570
 
12571
    private boolean success; // required
12572
 
12573
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12574
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12575
      SUCCESS((short)0, "success");
12576
 
12577
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12578
 
12579
      static {
12580
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12581
          byName.put(field.getFieldName(), field);
12582
        }
12583
      }
12584
 
12585
      /**
12586
       * Find the _Fields constant that matches fieldId, or null if its not found.
12587
       */
12588
      public static _Fields findByThriftId(int fieldId) {
12589
        switch(fieldId) {
12590
          case 0: // SUCCESS
12591
            return SUCCESS;
12592
          default:
12593
            return null;
12594
        }
12595
      }
12596
 
12597
      /**
12598
       * Find the _Fields constant that matches fieldId, throwing an exception
12599
       * if it is not found.
12600
       */
12601
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12602
        _Fields fields = findByThriftId(fieldId);
12603
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12604
        return fields;
12605
      }
12606
 
12607
      /**
12608
       * Find the _Fields constant that matches name, or null if its not found.
12609
       */
12610
      public static _Fields findByName(String name) {
12611
        return byName.get(name);
12612
      }
12613
 
12614
      private final short _thriftId;
12615
      private final String _fieldName;
12616
 
12617
      _Fields(short thriftId, String fieldName) {
12618
        _thriftId = thriftId;
12619
        _fieldName = fieldName;
12620
      }
12621
 
12622
      public short getThriftFieldId() {
12623
        return _thriftId;
12624
      }
12625
 
12626
      public String getFieldName() {
12627
        return _fieldName;
12628
      }
12629
    }
12630
 
12631
    // isset id assignments
12632
    private static final int __SUCCESS_ISSET_ID = 0;
12633
    private BitSet __isset_bit_vector = new BitSet(1);
12634
 
12635
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12636
    static {
12637
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12638
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12639
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
12640
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12641
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
12642
    }
12643
 
12644
    public markVoucherAsRedeemed_result() {
12645
    }
12646
 
12647
    public markVoucherAsRedeemed_result(
12648
      boolean success)
12649
    {
12650
      this();
12651
      this.success = success;
12652
      setSuccessIsSet(true);
12653
    }
12654
 
12655
    /**
12656
     * Performs a deep copy on <i>other</i>.
12657
     */
12658
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
12659
      __isset_bit_vector.clear();
12660
      __isset_bit_vector.or(other.__isset_bit_vector);
12661
      this.success = other.success;
12662
    }
12663
 
12664
    public markVoucherAsRedeemed_result deepCopy() {
12665
      return new markVoucherAsRedeemed_result(this);
12666
    }
12667
 
12668
    @Override
12669
    public void clear() {
12670
      setSuccessIsSet(false);
12671
      this.success = false;
12672
    }
12673
 
12674
    public boolean isSuccess() {
12675
      return this.success;
12676
    }
12677
 
12678
    public void setSuccess(boolean success) {
12679
      this.success = success;
12680
      setSuccessIsSet(true);
12681
    }
12682
 
12683
    public void unsetSuccess() {
12684
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
12685
    }
12686
 
12687
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12688
    public boolean isSetSuccess() {
12689
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
12690
    }
12691
 
12692
    public void setSuccessIsSet(boolean value) {
12693
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
12694
    }
12695
 
12696
    public void setFieldValue(_Fields field, Object value) {
12697
      switch (field) {
12698
      case SUCCESS:
12699
        if (value == null) {
12700
          unsetSuccess();
12701
        } else {
12702
          setSuccess((Boolean)value);
12703
        }
12704
        break;
12705
 
12706
      }
12707
    }
12708
 
12709
    public Object getFieldValue(_Fields field) {
12710
      switch (field) {
12711
      case SUCCESS:
12712
        return Boolean.valueOf(isSuccess());
12713
 
12714
      }
12715
      throw new IllegalStateException();
12716
    }
12717
 
12718
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12719
    public boolean isSet(_Fields field) {
12720
      if (field == null) {
12721
        throw new IllegalArgumentException();
12722
      }
12723
 
12724
      switch (field) {
12725
      case SUCCESS:
12726
        return isSetSuccess();
12727
      }
12728
      throw new IllegalStateException();
12729
    }
12730
 
12731
    @Override
12732
    public boolean equals(Object that) {
12733
      if (that == null)
12734
        return false;
12735
      if (that instanceof markVoucherAsRedeemed_result)
12736
        return this.equals((markVoucherAsRedeemed_result)that);
12737
      return false;
12738
    }
12739
 
12740
    public boolean equals(markVoucherAsRedeemed_result that) {
12741
      if (that == null)
12742
        return false;
12743
 
12744
      boolean this_present_success = true;
12745
      boolean that_present_success = true;
12746
      if (this_present_success || that_present_success) {
12747
        if (!(this_present_success && that_present_success))
12748
          return false;
12749
        if (this.success != that.success)
12750
          return false;
12751
      }
12752
 
12753
      return true;
12754
    }
12755
 
12756
    @Override
12757
    public int hashCode() {
12758
      return 0;
12759
    }
12760
 
12761
    public int compareTo(markVoucherAsRedeemed_result other) {
12762
      if (!getClass().equals(other.getClass())) {
12763
        return getClass().getName().compareTo(other.getClass().getName());
12764
      }
12765
 
12766
      int lastComparison = 0;
12767
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
12768
 
12769
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12770
      if (lastComparison != 0) {
12771
        return lastComparison;
12772
      }
12773
      if (isSetSuccess()) {
12774
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12775
        if (lastComparison != 0) {
12776
          return lastComparison;
12777
        }
12778
      }
12779
      return 0;
12780
    }
12781
 
12782
    public _Fields fieldForId(int fieldId) {
12783
      return _Fields.findByThriftId(fieldId);
12784
    }
12785
 
12786
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12787
      org.apache.thrift.protocol.TField field;
12788
      iprot.readStructBegin();
12789
      while (true)
12790
      {
12791
        field = iprot.readFieldBegin();
12792
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12793
          break;
12794
        }
12795
        switch (field.id) {
12796
          case 0: // SUCCESS
12797
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
12798
              this.success = iprot.readBool();
12799
              setSuccessIsSet(true);
12800
            } else { 
12801
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12802
            }
12803
            break;
12804
          default:
12805
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12806
        }
12807
        iprot.readFieldEnd();
12808
      }
12809
      iprot.readStructEnd();
12810
      validate();
12811
    }
12812
 
12813
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12814
      oprot.writeStructBegin(STRUCT_DESC);
12815
 
12816
      if (this.isSetSuccess()) {
12817
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12818
        oprot.writeBool(this.success);
12819
        oprot.writeFieldEnd();
12820
      }
12821
      oprot.writeFieldStop();
12822
      oprot.writeStructEnd();
12823
    }
12824
 
12825
    @Override
12826
    public String toString() {
12827
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
12828
      boolean first = true;
12829
 
12830
      sb.append("success:");
12831
      sb.append(this.success);
12832
      first = false;
12833
      sb.append(")");
12834
      return sb.toString();
12835
    }
12836
 
12837
    public void validate() throws org.apache.thrift.TException {
12838
      // check for required fields
12839
    }
12840
 
12841
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12842
      try {
12843
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12844
      } catch (org.apache.thrift.TException te) {
12845
        throw new java.io.IOException(te);
12846
      }
12847
    }
12848
 
12849
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12850
      try {
12851
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12852
      } catch (org.apache.thrift.TException te) {
12853
        throw new java.io.IOException(te);
12854
      }
12855
    }
12856
 
12857
  }
12858
 
1982 varun.gupt 12859
}