Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1982 varun.gupt 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1982 varun.gupt 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
3430 rajveer 18
import java.nio.ByteBuffer;
1982 varun.gupt 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PromotionService {
24
 
25
  /**
26
   * Promotion Service
27
   */
3374 rajveer 28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
1982 varun.gupt 29
 
3430 rajveer 30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 31
 
6301 amit.gupta 32
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
33
 
34
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
35
 
6356 amit.gupta 36
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException;
37
 
3430 rajveer 38
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 39
 
3430 rajveer 40
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3430 rajveer 44
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 45
 
6433 anupam.sin 46
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException;
47
 
3430 rajveer 48
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 49
 
3430 rajveer 50
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 51
 
3385 varun.gupt 52
    /**
53
     * Returns a list of active coupons
54
     */
3430 rajveer 55
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 56
 
57
    /**
6250 amit.gupta 58
     * Creates a coupon and returns couponcode if successfully created
59
     * 
60
     * @param promotionId
61
     * @param endOn
62
     * @param email
63
     * @param amount
6356 amit.gupta 64
     * @param isCod
6250 amit.gupta 65
     * @param usage
66
     */
6356 amit.gupta 67
    public String createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 68
 
69
    /**
3385 varun.gupt 70
     * Returns the count of successful payments done using a given coupon
71
     * 
72
     * @param couponCode
73
     */
3430 rajveer 74
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 75
 
76
    /**
77
     * Returns the doc string of the rule module
78
     * 
79
     * @param ruleName
80
     */
3430 rajveer 81
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 82
 
4189 varun.gupt 83
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
84
 
4494 varun.gupt 85
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
86
 
5469 rajveer 87
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
88
 
89
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
90
 
91
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
92
 
1982 varun.gupt 93
  }
94
 
3430 rajveer 95
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 96
 
3430 rajveer 97
    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 98
 
6301 amit.gupta 99
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
100
 
101
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
102
 
6356 amit.gupta 103
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
104
 
3430 rajveer 105
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
106
 
107
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
108
 
109
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
110
 
111
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
112
 
6433 anupam.sin 113
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
114
 
3430 rajveer 115
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
116
 
117
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
118
 
119
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
120
 
6356 amit.gupta 121
    public void createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 122
 
3430 rajveer 123
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
124
 
125
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
126
 
4189 varun.gupt 127
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
128
 
4494 varun.gupt 129
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
130
 
5469 rajveer 131
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
132
 
133
    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;
134
 
135
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
136
 
3430 rajveer 137
  }
138
 
139
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
140
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
141
      public Factory() {}
142
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
143
        return new Client(prot);
144
      }
145
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
146
        return new Client(iprot, oprot);
147
      }
1982 varun.gupt 148
    }
149
 
3430 rajveer 150
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 151
    {
3430 rajveer 152
      super(prot, prot);
1982 varun.gupt 153
    }
154
 
3430 rajveer 155
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
156
      super(iprot, oprot);
1982 varun.gupt 157
    }
158
 
3430 rajveer 159
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 160
    {
161
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
162
      recv_createPromotion();
163
    }
164
 
3430 rajveer 165
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 166
    {
167
      createPromotion_args args = new createPromotion_args();
3430 rajveer 168
      args.setName(name);
169
      args.setRuleExecutionSrc(ruleExecutionSrc);
170
      args.setStartOn(startOn);
171
      args.setEndOn(endOn);
172
      sendBase("createPromotion", args);
1982 varun.gupt 173
    }
174
 
3430 rajveer 175
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 176
    {
177
      createPromotion_result result = new createPromotion_result();
3430 rajveer 178
      receiveBase(result, "createPromotion");
1982 varun.gupt 179
      if (result.pex != null) {
180
        throw result.pex;
181
      }
182
      return;
183
    }
184
 
6301 amit.gupta 185
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
186
    {
187
      send_getCoupon(couponCode);
188
      return recv_getCoupon();
189
    }
190
 
191
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
192
    {
193
      getCoupon_args args = new getCoupon_args();
194
      args.setCouponCode(couponCode);
195
      sendBase("getCoupon", args);
196
    }
197
 
198
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
199
    {
200
      getCoupon_result result = new getCoupon_result();
201
      receiveBase(result, "getCoupon");
202
      if (result.isSetSuccess()) {
203
        return result.success;
204
      }
205
      if (result.pex != null) {
206
        throw result.pex;
207
      }
208
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
209
    }
210
 
211
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
212
    {
213
      send_isGiftVoucher(couponCode);
214
      return recv_isGiftVoucher();
215
    }
216
 
217
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
218
    {
219
      isGiftVoucher_args args = new isGiftVoucher_args();
220
      args.setCouponCode(couponCode);
221
      sendBase("isGiftVoucher", args);
222
    }
223
 
224
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
225
    {
226
      isGiftVoucher_result result = new isGiftVoucher_result();
227
      receiveBase(result, "isGiftVoucher");
228
      if (result.isSetSuccess()) {
229
        return result.success;
230
      }
231
      if (result.pex != null) {
232
        throw result.pex;
233
      }
234
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
235
    }
236
 
6356 amit.gupta 237
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
238
    {
239
      send_isCodApplicable(couponCode);
240
      return recv_isCodApplicable();
241
    }
242
 
243
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
244
    {
245
      isCodApplicable_args args = new isCodApplicable_args();
246
      args.setCouponCode(couponCode);
247
      sendBase("isCodApplicable", args);
248
    }
249
 
250
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
251
    {
252
      isCodApplicable_result result = new isCodApplicable_result();
253
      receiveBase(result, "isCodApplicable");
254
      if (result.isSetSuccess()) {
255
        return result.success;
256
      }
257
      if (result.pex != null) {
258
        throw result.pex;
259
      }
260
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
261
    }
262
 
3430 rajveer 263
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 264
    {
265
      send_getAllPromotions();
266
      return recv_getAllPromotions();
267
    }
268
 
3430 rajveer 269
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 270
    {
271
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 272
      sendBase("getAllPromotions", args);
1982 varun.gupt 273
    }
274
 
3430 rajveer 275
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 276
    {
277
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 278
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 279
      if (result.isSetSuccess()) {
280
        return result.success;
281
      }
282
      if (result.pex != null) {
283
        throw result.pex;
284
      }
3430 rajveer 285
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 286
    }
287
 
3430 rajveer 288
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 289
    {
290
      send_getPromotionById(promotionId);
291
      return recv_getPromotionById();
292
    }
293
 
3430 rajveer 294
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 295
    {
296
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 297
      args.setPromotionId(promotionId);
298
      sendBase("getPromotionById", args);
1982 varun.gupt 299
    }
300
 
3430 rajveer 301
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 302
    {
303
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 304
      receiveBase(result, "getPromotionById");
1982 varun.gupt 305
      if (result.isSetSuccess()) {
306
        return result.success;
307
      }
308
      if (result.pex != null) {
309
        throw result.pex;
310
      }
3430 rajveer 311
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 312
    }
313
 
3430 rajveer 314
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 315
    {
316
      send_generateCouponsForPromotion(promotionId, couponCode);
317
      recv_generateCouponsForPromotion();
318
    }
319
 
3430 rajveer 320
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 321
    {
322
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 323
      args.setPromotionId(promotionId);
324
      args.setCouponCode(couponCode);
325
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 326
    }
327
 
3430 rajveer 328
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 329
    {
330
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 331
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 332
      if (result.pex != null) {
333
        throw result.pex;
334
      }
335
      return;
336
    }
337
 
3430 rajveer 338
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 339
    {
340
      send_applyCoupon(couponCode, cartId);
341
      return recv_applyCoupon();
342
    }
343
 
3430 rajveer 344
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 345
    {
346
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 347
      args.setCouponCode(couponCode);
348
      args.setCartId(cartId);
349
      sendBase("applyCoupon", args);
1982 varun.gupt 350
    }
351
 
3430 rajveer 352
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 353
    {
354
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 355
      receiveBase(result, "applyCoupon");
1982 varun.gupt 356
      if (result.isSetSuccess()) {
357
        return result.success;
358
      }
359
      if (result.pex != null) {
360
        throw result.pex;
361
      }
3430 rajveer 362
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 363
    }
364
 
6433 anupam.sin 365
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
366
    {
367
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
368
      return recv_applyRechargeCoupon();
369
    }
370
 
371
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
372
    {
373
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
374
      args.setCouponCode(couponCode);
375
      args.setTotalAmount(totalAmount);
376
      args.setUserId(userId);
377
      sendBase("applyRechargeCoupon", args);
378
    }
379
 
380
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
381
    {
382
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
383
      receiveBase(result, "applyRechargeCoupon");
384
      if (result.isSetSuccess()) {
385
        return result.success;
386
      }
387
      if (result.pex != null) {
388
        throw result.pex;
389
      }
390
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
391
    }
392
 
3430 rajveer 393
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 394
    {
395
      send_trackCouponUsage(couponCode, transactionId, userId);
396
      recv_trackCouponUsage();
397
    }
398
 
3430 rajveer 399
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 400
    {
401
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 402
      args.setCouponCode(couponCode);
403
      args.setTransactionId(transactionId);
404
      args.setUserId(userId);
405
      sendBase("trackCouponUsage", args);
1982 varun.gupt 406
    }
407
 
3430 rajveer 408
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 409
    {
410
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 411
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 412
      if (result.pex != null) {
413
        throw result.pex;
414
      }
415
      return;
416
    }
417
 
3430 rajveer 418
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 419
    {
420
      send_getCouponUsageCountByUser(couponCode, userId);
421
      return recv_getCouponUsageCountByUser();
422
    }
423
 
3430 rajveer 424
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 425
    {
426
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 427
      args.setCouponCode(couponCode);
428
      args.setUserId(userId);
429
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 430
    }
431
 
3430 rajveer 432
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 433
    {
434
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 435
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 436
      if (result.isSetSuccess()) {
437
        return result.success;
438
      }
439
      if (result.pex != null) {
440
        throw result.pex;
441
      }
3430 rajveer 442
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 443
    }
444
 
3430 rajveer 445
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 446
    {
447
      send_getActiveCoupons();
448
      return recv_getActiveCoupons();
449
    }
450
 
3430 rajveer 451
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 452
    {
453
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 454
      sendBase("getActiveCoupons", args);
3385 varun.gupt 455
    }
456
 
3430 rajveer 457
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 458
    {
459
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 460
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 461
      if (result.isSetSuccess()) {
462
        return result.success;
463
      }
464
      if (result.pex != null) {
465
        throw result.pex;
466
      }
3430 rajveer 467
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 468
    }
469
 
6356 amit.gupta 470
    public String createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 471
    {
6356 amit.gupta 472
      send_createCoupon(promotionId, endOn, email, amount, isCod, usage);
6250 amit.gupta 473
      return recv_createCoupon();
474
    }
475
 
6356 amit.gupta 476
    public void send_createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage) throws org.apache.thrift.TException
6250 amit.gupta 477
    {
478
      createCoupon_args args = new createCoupon_args();
479
      args.setPromotionId(promotionId);
480
      args.setEndOn(endOn);
481
      args.setEmail(email);
482
      args.setAmount(amount);
6356 amit.gupta 483
      args.setIsCod(isCod);
6250 amit.gupta 484
      args.setUsage(usage);
485
      sendBase("createCoupon", args);
486
    }
487
 
488
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
489
    {
490
      createCoupon_result result = new createCoupon_result();
491
      receiveBase(result, "createCoupon");
492
      if (result.isSetSuccess()) {
493
        return result.success;
494
      }
495
      if (result.pex != null) {
496
        throw result.pex;
497
      }
498
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
499
    }
500
 
3430 rajveer 501
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 502
    {
503
      send_getSuccessfulPaymentCountForCoupon(couponCode);
504
      return recv_getSuccessfulPaymentCountForCoupon();
505
    }
506
 
3430 rajveer 507
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 508
    {
509
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 510
      args.setCouponCode(couponCode);
511
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 512
    }
513
 
3430 rajveer 514
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 515
    {
516
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 517
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 518
      if (result.isSetSuccess()) {
519
        return result.success;
520
      }
521
      if (result.pex != null) {
522
        throw result.pex;
523
      }
3430 rajveer 524
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 525
    }
526
 
3430 rajveer 527
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 528
    {
529
      send_getRuleDocString(ruleName);
530
      return recv_getRuleDocString();
531
    }
532
 
3430 rajveer 533
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 534
    {
535
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 536
      args.setRuleName(ruleName);
537
      sendBase("getRuleDocString", args);
3385 varun.gupt 538
    }
539
 
3430 rajveer 540
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 541
    {
542
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 543
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 544
      if (result.isSetSuccess()) {
545
        return result.success;
546
      }
3430 rajveer 547
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 548
    }
549
 
4189 varun.gupt 550
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
551
    {
552
      send_getItemDiscountMap(itemIds);
553
      return recv_getItemDiscountMap();
554
    }
555
 
556
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
557
    {
558
      getItemDiscountMap_args args = new getItemDiscountMap_args();
559
      args.setItemIds(itemIds);
560
      sendBase("getItemDiscountMap", args);
561
    }
562
 
563
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
564
    {
565
      getItemDiscountMap_result result = new getItemDiscountMap_result();
566
      receiveBase(result, "getItemDiscountMap");
567
      if (result.isSetSuccess()) {
568
        return result.success;
569
      }
570
      if (result.pex != null) {
571
        throw result.pex;
572
      }
573
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
574
    }
575
 
4494 varun.gupt 576
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
577
    {
578
      send_getDiscountsForEntity(entityId);
579
      return recv_getDiscountsForEntity();
580
    }
581
 
582
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
583
    {
584
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
585
      args.setEntityId(entityId);
586
      sendBase("getDiscountsForEntity", args);
587
    }
588
 
589
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
590
    {
591
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
592
      receiveBase(result, "getDiscountsForEntity");
593
      if (result.isSetSuccess()) {
594
        return result.success;
595
      }
596
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
597
    }
598
 
5469 rajveer 599
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
600
    {
601
      send_addVoucher(voucher);
602
      recv_addVoucher();
603
    }
604
 
605
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
606
    {
607
      addVoucher_args args = new addVoucher_args();
608
      args.setVoucher(voucher);
609
      sendBase("addVoucher", args);
610
    }
611
 
612
    public void recv_addVoucher() throws org.apache.thrift.TException
613
    {
614
      addVoucher_result result = new addVoucher_result();
615
      receiveBase(result, "addVoucher");
616
      return;
617
    }
618
 
619
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
620
    {
621
      send_assignVoucher(userId, userEmail, voucherType, amount);
622
      return recv_assignVoucher();
623
    }
624
 
625
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
626
    {
627
      assignVoucher_args args = new assignVoucher_args();
628
      args.setUserId(userId);
629
      args.setUserEmail(userEmail);
630
      args.setVoucherType(voucherType);
631
      args.setAmount(amount);
632
      sendBase("assignVoucher", args);
633
    }
634
 
635
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
636
    {
637
      assignVoucher_result result = new assignVoucher_result();
638
      receiveBase(result, "assignVoucher");
639
      if (result.isSetSuccess()) {
640
        return result.success;
641
      }
642
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
643
    }
644
 
645
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
646
    {
647
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
648
      return recv_markVoucherAsRedeemed();
649
    }
650
 
651
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
652
    {
653
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
654
      args.setVoucherCode(voucherCode);
655
      args.setRedeemedOn(redeemedOn);
656
      sendBase("markVoucherAsRedeemed", args);
657
    }
658
 
659
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
660
    {
661
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
662
      receiveBase(result, "markVoucherAsRedeemed");
663
      if (result.isSetSuccess()) {
664
        return result.success;
665
      }
666
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
667
    }
668
 
1982 varun.gupt 669
  }
3430 rajveer 670
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
671
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
672
      private org.apache.thrift.async.TAsyncClientManager clientManager;
673
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
674
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
675
        this.clientManager = clientManager;
676
        this.protocolFactory = protocolFactory;
677
      }
678
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
679
        return new AsyncClient(protocolFactory, clientManager, transport);
680
      }
1982 varun.gupt 681
    }
682
 
3430 rajveer 683
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
684
      super(protocolFactory, clientManager, transport);
685
    }
1982 varun.gupt 686
 
3430 rajveer 687
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
688
      checkReady();
689
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
690
      this.___currentMethod = method_call;
691
      ___manager.call(method_call);
1982 varun.gupt 692
    }
693
 
3430 rajveer 694
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
695
      private String name;
696
      private String ruleExecutionSrc;
697
      private long startOn;
698
      private long endOn;
699
      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 {
700
        super(client, protocolFactory, transport, resultHandler, false);
701
        this.name = name;
702
        this.ruleExecutionSrc = ruleExecutionSrc;
703
        this.startOn = startOn;
704
        this.endOn = endOn;
1982 varun.gupt 705
      }
706
 
3430 rajveer 707
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
708
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 709
        createPromotion_args args = new createPromotion_args();
3430 rajveer 710
        args.setName(name);
711
        args.setRuleExecutionSrc(ruleExecutionSrc);
712
        args.setStartOn(startOn);
713
        args.setEndOn(endOn);
714
        args.write(prot);
715
        prot.writeMessageEnd();
1982 varun.gupt 716
      }
717
 
3430 rajveer 718
      public void getResult() throws PromotionException, org.apache.thrift.TException {
719
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
720
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 721
        }
3430 rajveer 722
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
723
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
724
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 725
      }
3430 rajveer 726
    }
1982 varun.gupt 727
 
6301 amit.gupta 728
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
729
      checkReady();
730
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
731
      this.___currentMethod = method_call;
732
      ___manager.call(method_call);
733
    }
734
 
735
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
736
      private String couponCode;
737
      public getCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
738
        super(client, protocolFactory, transport, resultHandler, false);
739
        this.couponCode = couponCode;
740
      }
741
 
742
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
743
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
744
        getCoupon_args args = new getCoupon_args();
745
        args.setCouponCode(couponCode);
746
        args.write(prot);
747
        prot.writeMessageEnd();
748
      }
749
 
750
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
751
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
752
          throw new IllegalStateException("Method call not finished!");
753
        }
754
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
755
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
756
        return (new Client(prot)).recv_getCoupon();
757
      }
758
    }
759
 
760
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
761
      checkReady();
762
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
763
      this.___currentMethod = method_call;
764
      ___manager.call(method_call);
765
    }
766
 
767
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
768
      private String couponCode;
769
      public isGiftVoucher_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
770
        super(client, protocolFactory, transport, resultHandler, false);
771
        this.couponCode = couponCode;
772
      }
773
 
774
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
775
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
776
        isGiftVoucher_args args = new isGiftVoucher_args();
777
        args.setCouponCode(couponCode);
778
        args.write(prot);
779
        prot.writeMessageEnd();
780
      }
781
 
782
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
783
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
784
          throw new IllegalStateException("Method call not finished!");
785
        }
786
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
787
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
788
        return (new Client(prot)).recv_isGiftVoucher();
789
      }
790
    }
791
 
6356 amit.gupta 792
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
793
      checkReady();
794
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
795
      this.___currentMethod = method_call;
796
      ___manager.call(method_call);
797
    }
798
 
799
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
800
      private String couponCode;
801
      public isCodApplicable_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
802
        super(client, protocolFactory, transport, resultHandler, false);
803
        this.couponCode = couponCode;
804
      }
805
 
806
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
807
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
808
        isCodApplicable_args args = new isCodApplicable_args();
809
        args.setCouponCode(couponCode);
810
        args.write(prot);
811
        prot.writeMessageEnd();
812
      }
813
 
814
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
815
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
816
          throw new IllegalStateException("Method call not finished!");
817
        }
818
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
819
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
820
        return (new Client(prot)).recv_isCodApplicable();
821
      }
822
    }
823
 
3430 rajveer 824
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
825
      checkReady();
826
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
827
      this.___currentMethod = method_call;
828
      ___manager.call(method_call);
1982 varun.gupt 829
    }
830
 
3430 rajveer 831
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
832
      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 {
833
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 834
      }
835
 
3430 rajveer 836
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
837
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
838
        getAllPromotions_args args = new getAllPromotions_args();
839
        args.write(prot);
840
        prot.writeMessageEnd();
841
      }
1982 varun.gupt 842
 
3430 rajveer 843
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
844
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
845
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 846
        }
3430 rajveer 847
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
848
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
849
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 850
      }
3430 rajveer 851
    }
1982 varun.gupt 852
 
3430 rajveer 853
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
854
      checkReady();
855
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
856
      this.___currentMethod = method_call;
857
      ___manager.call(method_call);
1982 varun.gupt 858
    }
859
 
3430 rajveer 860
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
861
      private long promotionId;
862
      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 {
863
        super(client, protocolFactory, transport, resultHandler, false);
864
        this.promotionId = promotionId;
1982 varun.gupt 865
      }
866
 
3430 rajveer 867
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
868
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
869
        getPromotionById_args args = new getPromotionById_args();
870
        args.setPromotionId(promotionId);
871
        args.write(prot);
872
        prot.writeMessageEnd();
873
      }
1982 varun.gupt 874
 
3430 rajveer 875
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
876
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
877
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 878
        }
3430 rajveer 879
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
880
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
881
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 882
      }
3430 rajveer 883
    }
1982 varun.gupt 884
 
3430 rajveer 885
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
886
      checkReady();
887
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
888
      this.___currentMethod = method_call;
889
      ___manager.call(method_call);
1982 varun.gupt 890
    }
891
 
3430 rajveer 892
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
893
      private long promotionId;
894
      private String couponCode;
895
      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 {
896
        super(client, protocolFactory, transport, resultHandler, false);
897
        this.promotionId = promotionId;
898
        this.couponCode = couponCode;
1982 varun.gupt 899
      }
900
 
3430 rajveer 901
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
902
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
903
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
904
        args.setPromotionId(promotionId);
905
        args.setCouponCode(couponCode);
906
        args.write(prot);
907
        prot.writeMessageEnd();
3385 varun.gupt 908
      }
909
 
3430 rajveer 910
      public void getResult() throws PromotionException, org.apache.thrift.TException {
911
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
912
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 913
        }
3430 rajveer 914
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
915
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
916
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 917
      }
918
    }
919
 
3430 rajveer 920
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
921
      checkReady();
922
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
923
      this.___currentMethod = method_call;
924
      ___manager.call(method_call);
3385 varun.gupt 925
    }
926
 
3430 rajveer 927
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
928
      private String couponCode;
929
      private long cartId;
930
      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 {
931
        super(client, protocolFactory, transport, resultHandler, false);
932
        this.couponCode = couponCode;
933
        this.cartId = cartId;
1982 varun.gupt 934
      }
935
 
3430 rajveer 936
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
937
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
938
        applyCoupon_args args = new applyCoupon_args();
939
        args.setCouponCode(couponCode);
940
        args.setCartId(cartId);
941
        args.write(prot);
942
        prot.writeMessageEnd();
1982 varun.gupt 943
      }
944
 
3430 rajveer 945
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
946
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
947
          throw new IllegalStateException("Method call not finished!");
948
        }
949
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
950
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
951
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 952
      }
3430 rajveer 953
    }
1982 varun.gupt 954
 
6433 anupam.sin 955
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
956
      checkReady();
957
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
958
      this.___currentMethod = method_call;
959
      ___manager.call(method_call);
960
    }
961
 
962
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
963
      private String couponCode;
964
      private long totalAmount;
965
      private long userId;
966
      public applyRechargeCoupon_call(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_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 {
967
        super(client, protocolFactory, transport, resultHandler, false);
968
        this.couponCode = couponCode;
969
        this.totalAmount = totalAmount;
970
        this.userId = userId;
971
      }
972
 
973
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
974
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
975
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
976
        args.setCouponCode(couponCode);
977
        args.setTotalAmount(totalAmount);
978
        args.setUserId(userId);
979
        args.write(prot);
980
        prot.writeMessageEnd();
981
      }
982
 
983
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
984
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
985
          throw new IllegalStateException("Method call not finished!");
986
        }
987
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
988
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
989
        return (new Client(prot)).recv_applyRechargeCoupon();
990
      }
991
    }
992
 
3430 rajveer 993
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
994
      checkReady();
995
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
996
      this.___currentMethod = method_call;
997
      ___manager.call(method_call);
998
    }
1982 varun.gupt 999
 
3430 rajveer 1000
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1001
      private String couponCode;
1002
      private long transactionId;
1003
      private long userId;
1004
      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 {
1005
        super(client, protocolFactory, transport, resultHandler, false);
1006
        this.couponCode = couponCode;
1007
        this.transactionId = transactionId;
1008
        this.userId = userId;
1982 varun.gupt 1009
      }
1010
 
3430 rajveer 1011
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1012
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1013
        trackCouponUsage_args args = new trackCouponUsage_args();
1014
        args.setCouponCode(couponCode);
1015
        args.setTransactionId(transactionId);
1016
        args.setUserId(userId);
1017
        args.write(prot);
1018
        prot.writeMessageEnd();
1982 varun.gupt 1019
      }
1020
 
3430 rajveer 1021
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1022
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1023
          throw new IllegalStateException("Method call not finished!");
1024
        }
1025
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1026
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1027
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1028
      }
1029
    }
1030
 
3430 rajveer 1031
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1032
      checkReady();
1033
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1034
      this.___currentMethod = method_call;
1035
      ___manager.call(method_call);
1982 varun.gupt 1036
    }
1037
 
3430 rajveer 1038
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1039
      private String couponCode;
1040
      private long userId;
1041
      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 {
1042
        super(client, protocolFactory, transport, resultHandler, false);
1043
        this.couponCode = couponCode;
1044
        this.userId = userId;
1045
      }
1982 varun.gupt 1046
 
3430 rajveer 1047
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1048
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1049
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1050
        args.setCouponCode(couponCode);
1051
        args.setUserId(userId);
1052
        args.write(prot);
1053
        prot.writeMessageEnd();
1054
      }
1982 varun.gupt 1055
 
3430 rajveer 1056
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1057
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1058
          throw new IllegalStateException("Method call not finished!");
1059
        }
1060
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1061
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1062
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1063
      }
1982 varun.gupt 1064
    }
1065
 
3430 rajveer 1066
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1067
      checkReady();
1068
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1069
      this.___currentMethod = method_call;
1070
      ___manager.call(method_call);
1982 varun.gupt 1071
    }
1072
 
3430 rajveer 1073
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1074
      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 {
1075
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1076
      }
1077
 
3430 rajveer 1078
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1079
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1080
        getActiveCoupons_args args = new getActiveCoupons_args();
1081
        args.write(prot);
1082
        prot.writeMessageEnd();
1083
      }
1982 varun.gupt 1084
 
3430 rajveer 1085
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1086
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1087
          throw new IllegalStateException("Method call not finished!");
1088
        }
1089
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1090
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1091
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1092
      }
1093
    }
1094
 
6356 amit.gupta 1095
    public void createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1096
      checkReady();
6356 amit.gupta 1097
      createCoupon_call method_call = new createCoupon_call(promotionId, endOn, email, amount, isCod, usage, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1098
      this.___currentMethod = method_call;
1099
      ___manager.call(method_call);
1100
    }
1101
 
1102
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1103
      private long promotionId;
1104
      private long endOn;
1105
      private String email;
1106
      private long amount;
6356 amit.gupta 1107
      private boolean isCod;
6250 amit.gupta 1108
      private long usage;
6356 amit.gupta 1109
      public createCoupon_call(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
6250 amit.gupta 1110
        super(client, protocolFactory, transport, resultHandler, false);
1111
        this.promotionId = promotionId;
1112
        this.endOn = endOn;
1113
        this.email = email;
1114
        this.amount = amount;
6356 amit.gupta 1115
        this.isCod = isCod;
6250 amit.gupta 1116
        this.usage = usage;
1117
      }
1118
 
1119
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1120
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1121
        createCoupon_args args = new createCoupon_args();
1122
        args.setPromotionId(promotionId);
1123
        args.setEndOn(endOn);
1124
        args.setEmail(email);
1125
        args.setAmount(amount);
6356 amit.gupta 1126
        args.setIsCod(isCod);
6250 amit.gupta 1127
        args.setUsage(usage);
1128
        args.write(prot);
1129
        prot.writeMessageEnd();
1130
      }
1131
 
1132
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1133
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1134
          throw new IllegalStateException("Method call not finished!");
1135
        }
1136
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1137
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1138
        return (new Client(prot)).recv_createCoupon();
1139
      }
1140
    }
1141
 
3430 rajveer 1142
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1143
      checkReady();
1144
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1145
      this.___currentMethod = method_call;
1146
      ___manager.call(method_call);
1982 varun.gupt 1147
    }
1148
 
3430 rajveer 1149
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1150
      private String couponCode;
1151
      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 {
1152
        super(client, protocolFactory, transport, resultHandler, false);
1153
        this.couponCode = couponCode;
1982 varun.gupt 1154
      }
1155
 
3430 rajveer 1156
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1157
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1158
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1159
        args.setCouponCode(couponCode);
1160
        args.write(prot);
1161
        prot.writeMessageEnd();
1162
      }
1982 varun.gupt 1163
 
3430 rajveer 1164
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1165
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1166
          throw new IllegalStateException("Method call not finished!");
1167
        }
1168
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1169
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1170
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1171
      }
1982 varun.gupt 1172
    }
1173
 
3430 rajveer 1174
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1175
      checkReady();
1176
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1177
      this.___currentMethod = method_call;
1178
      ___manager.call(method_call);
1982 varun.gupt 1179
    }
1180
 
3430 rajveer 1181
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1182
      private String ruleName;
1183
      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 {
1184
        super(client, protocolFactory, transport, resultHandler, false);
1185
        this.ruleName = ruleName;
1186
      }
1982 varun.gupt 1187
 
3430 rajveer 1188
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1189
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1190
        getRuleDocString_args args = new getRuleDocString_args();
1191
        args.setRuleName(ruleName);
1192
        args.write(prot);
1193
        prot.writeMessageEnd();
1982 varun.gupt 1194
      }
1195
 
3430 rajveer 1196
      public String getResult() throws org.apache.thrift.TException {
1197
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1198
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1199
        }
3430 rajveer 1200
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1201
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1202
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1203
      }
1204
    }
1205
 
4189 varun.gupt 1206
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1207
      checkReady();
1208
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1209
      this.___currentMethod = method_call;
1210
      ___manager.call(method_call);
1211
    }
1212
 
1213
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1214
      private List<Long> itemIds;
1215
      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 {
1216
        super(client, protocolFactory, transport, resultHandler, false);
1217
        this.itemIds = itemIds;
1218
      }
1219
 
1220
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1221
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1222
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1223
        args.setItemIds(itemIds);
1224
        args.write(prot);
1225
        prot.writeMessageEnd();
1226
      }
1227
 
1228
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1229
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1230
          throw new IllegalStateException("Method call not finished!");
1231
        }
1232
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1233
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1234
        return (new Client(prot)).recv_getItemDiscountMap();
1235
      }
1236
    }
1237
 
4494 varun.gupt 1238
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1239
      checkReady();
1240
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1241
      this.___currentMethod = method_call;
1242
      ___manager.call(method_call);
1243
    }
1244
 
1245
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1246
      private long entityId;
1247
      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 {
1248
        super(client, protocolFactory, transport, resultHandler, false);
1249
        this.entityId = entityId;
1250
      }
1251
 
1252
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1253
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1254
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1255
        args.setEntityId(entityId);
1256
        args.write(prot);
1257
        prot.writeMessageEnd();
1258
      }
1259
 
1260
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1261
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1262
          throw new IllegalStateException("Method call not finished!");
1263
        }
1264
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1265
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1266
        return (new Client(prot)).recv_getDiscountsForEntity();
1267
      }
1268
    }
1269
 
5469 rajveer 1270
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1271
      checkReady();
1272
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1273
      this.___currentMethod = method_call;
1274
      ___manager.call(method_call);
1275
    }
1276
 
1277
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1278
      private Voucher voucher;
1279
      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 {
1280
        super(client, protocolFactory, transport, resultHandler, false);
1281
        this.voucher = voucher;
1282
      }
1283
 
1284
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1285
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1286
        addVoucher_args args = new addVoucher_args();
1287
        args.setVoucher(voucher);
1288
        args.write(prot);
1289
        prot.writeMessageEnd();
1290
      }
1291
 
1292
      public void getResult() throws org.apache.thrift.TException {
1293
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1294
          throw new IllegalStateException("Method call not finished!");
1295
        }
1296
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1297
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1298
        (new Client(prot)).recv_addVoucher();
1299
      }
1300
    }
1301
 
1302
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1303
      checkReady();
1304
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1305
      this.___currentMethod = method_call;
1306
      ___manager.call(method_call);
1307
    }
1308
 
1309
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1310
      private long userId;
1311
      private String userEmail;
1312
      private VoucherType voucherType;
1313
      private long amount;
1314
      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 {
1315
        super(client, protocolFactory, transport, resultHandler, false);
1316
        this.userId = userId;
1317
        this.userEmail = userEmail;
1318
        this.voucherType = voucherType;
1319
        this.amount = amount;
1320
      }
1321
 
1322
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1323
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1324
        assignVoucher_args args = new assignVoucher_args();
1325
        args.setUserId(userId);
1326
        args.setUserEmail(userEmail);
1327
        args.setVoucherType(voucherType);
1328
        args.setAmount(amount);
1329
        args.write(prot);
1330
        prot.writeMessageEnd();
1331
      }
1332
 
1333
      public Voucher getResult() throws org.apache.thrift.TException {
1334
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1335
          throw new IllegalStateException("Method call not finished!");
1336
        }
1337
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1338
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1339
        return (new Client(prot)).recv_assignVoucher();
1340
      }
1341
    }
1342
 
1343
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1344
      checkReady();
1345
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1346
      this.___currentMethod = method_call;
1347
      ___manager.call(method_call);
1348
    }
1349
 
1350
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1351
      private String voucherCode;
1352
      private long redeemedOn;
1353
      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 {
1354
        super(client, protocolFactory, transport, resultHandler, false);
1355
        this.voucherCode = voucherCode;
1356
        this.redeemedOn = redeemedOn;
1357
      }
1358
 
1359
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1360
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1361
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1362
        args.setVoucherCode(voucherCode);
1363
        args.setRedeemedOn(redeemedOn);
1364
        args.write(prot);
1365
        prot.writeMessageEnd();
1366
      }
1367
 
1368
      public boolean getResult() throws org.apache.thrift.TException {
1369
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1370
          throw new IllegalStateException("Method call not finished!");
1371
        }
1372
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1373
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1374
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1375
      }
1376
    }
1377
 
3430 rajveer 1378
  }
1982 varun.gupt 1379
 
3430 rajveer 1380
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1381
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1382
    public Processor(I iface) {
1383
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1384
    }
1385
 
3430 rajveer 1386
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1387
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1388
    }
1389
 
3430 rajveer 1390
    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) {
1391
      processMap.put("createPromotion", new createPromotion());
6301 amit.gupta 1392
      processMap.put("getCoupon", new getCoupon());
1393
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1394
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1395
      processMap.put("getAllPromotions", new getAllPromotions());
1396
      processMap.put("getPromotionById", new getPromotionById());
1397
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1398
      processMap.put("applyCoupon", new applyCoupon());
6433 anupam.sin 1399
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1400
      processMap.put("trackCouponUsage", new trackCouponUsage());
1401
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
1402
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1403
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1404
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1405
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1406
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1407
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1408
      processMap.put("addVoucher", new addVoucher());
1409
      processMap.put("assignVoucher", new assignVoucher());
1410
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1411
      return processMap;
1982 varun.gupt 1412
    }
1413
 
3430 rajveer 1414
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1415
      public createPromotion() {
1416
        super("createPromotion");
1417
      }
1982 varun.gupt 1418
 
3430 rajveer 1419
      protected createPromotion_args getEmptyArgsInstance() {
1420
        return new createPromotion_args();
1421
      }
1982 varun.gupt 1422
 
3430 rajveer 1423
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1424
        createPromotion_result result = new createPromotion_result();
1425
        try {
1426
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1427
        } catch (PromotionException pex) {
1428
          result.pex = pex;
1982 varun.gupt 1429
        }
3430 rajveer 1430
        return result;
1982 varun.gupt 1431
      }
3430 rajveer 1432
    }
1982 varun.gupt 1433
 
6301 amit.gupta 1434
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1435
      public getCoupon() {
1436
        super("getCoupon");
1437
      }
1438
 
1439
      protected getCoupon_args getEmptyArgsInstance() {
1440
        return new getCoupon_args();
1441
      }
1442
 
1443
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1444
        getCoupon_result result = new getCoupon_result();
1445
        try {
1446
          result.success = iface.getCoupon(args.couponCode);
1447
        } catch (PromotionException pex) {
1448
          result.pex = pex;
1449
        }
1450
        return result;
1451
      }
1452
    }
1453
 
1454
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1455
      public isGiftVoucher() {
1456
        super("isGiftVoucher");
1457
      }
1458
 
1459
      protected isGiftVoucher_args getEmptyArgsInstance() {
1460
        return new isGiftVoucher_args();
1461
      }
1462
 
1463
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1464
        isGiftVoucher_result result = new isGiftVoucher_result();
1465
        try {
1466
          result.success = iface.isGiftVoucher(args.couponCode);
1467
          result.setSuccessIsSet(true);
1468
        } catch (PromotionException pex) {
1469
          result.pex = pex;
1470
        }
1471
        return result;
1472
      }
1473
    }
1474
 
6356 amit.gupta 1475
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1476
      public isCodApplicable() {
1477
        super("isCodApplicable");
1478
      }
1479
 
1480
      protected isCodApplicable_args getEmptyArgsInstance() {
1481
        return new isCodApplicable_args();
1482
      }
1483
 
1484
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1485
        isCodApplicable_result result = new isCodApplicable_result();
1486
        try {
1487
          result.success = iface.isCodApplicable(args.couponCode);
1488
          result.setSuccessIsSet(true);
1489
        } catch (PromotionException pex) {
1490
          result.pex = pex;
1491
        }
1492
        return result;
1493
      }
1494
    }
1495
 
3430 rajveer 1496
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1497
      public getAllPromotions() {
1498
        super("getAllPromotions");
1982 varun.gupt 1499
      }
1500
 
3430 rajveer 1501
      protected getAllPromotions_args getEmptyArgsInstance() {
1502
        return new getAllPromotions_args();
1982 varun.gupt 1503
      }
1504
 
3430 rajveer 1505
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1506
        getAllPromotions_result result = new getAllPromotions_result();
1507
        try {
1508
          result.success = iface.getAllPromotions();
1509
        } catch (PromotionException pex) {
1510
          result.pex = pex;
1511
        }
1512
        return result;
1982 varun.gupt 1513
      }
3430 rajveer 1514
    }
1982 varun.gupt 1515
 
3430 rajveer 1516
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1517
      public getPromotionById() {
1518
        super("getPromotionById");
1982 varun.gupt 1519
      }
1520
 
3430 rajveer 1521
      protected getPromotionById_args getEmptyArgsInstance() {
1522
        return new getPromotionById_args();
1982 varun.gupt 1523
      }
1524
 
3430 rajveer 1525
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1526
        getPromotionById_result result = new getPromotionById_result();
1527
        try {
1528
          result.success = iface.getPromotionById(args.promotionId);
1529
        } catch (PromotionException pex) {
1530
          result.pex = pex;
1531
        }
1532
        return result;
1982 varun.gupt 1533
      }
1534
    }
1535
 
3430 rajveer 1536
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1537
      public generateCouponsForPromotion() {
1538
        super("generateCouponsForPromotion");
1539
      }
1982 varun.gupt 1540
 
3430 rajveer 1541
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1542
        return new generateCouponsForPromotion_args();
1543
      }
1982 varun.gupt 1544
 
3430 rajveer 1545
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1546
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1547
        try {
1548
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1549
        } catch (PromotionException pex) {
1550
          result.pex = pex;
1551
        }
1552
        return result;
1553
      }
1982 varun.gupt 1554
    }
1555
 
3430 rajveer 1556
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1557
      public applyCoupon() {
1558
        super("applyCoupon");
1559
      }
1982 varun.gupt 1560
 
3430 rajveer 1561
      protected applyCoupon_args getEmptyArgsInstance() {
1562
        return new applyCoupon_args();
1563
      }
1982 varun.gupt 1564
 
3430 rajveer 1565
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1566
        applyCoupon_result result = new applyCoupon_result();
1567
        try {
1568
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1569
        } catch (PromotionException pex) {
1570
          result.pex = pex;
1571
        }
1572
        return result;
1982 varun.gupt 1573
      }
1574
    }
1575
 
6433 anupam.sin 1576
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1577
      public applyRechargeCoupon() {
1578
        super("applyRechargeCoupon");
1579
      }
1580
 
1581
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1582
        return new applyRechargeCoupon_args();
1583
      }
1584
 
1585
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1586
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1587
        try {
1588
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1589
        } catch (PromotionException pex) {
1590
          result.pex = pex;
1591
        }
1592
        return result;
1593
      }
1594
    }
1595
 
3430 rajveer 1596
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1597
      public trackCouponUsage() {
1598
        super("trackCouponUsage");
1599
      }
1982 varun.gupt 1600
 
3430 rajveer 1601
      protected trackCouponUsage_args getEmptyArgsInstance() {
1602
        return new trackCouponUsage_args();
1982 varun.gupt 1603
      }
1604
 
3430 rajveer 1605
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1606
        trackCouponUsage_result result = new trackCouponUsage_result();
1607
        try {
1608
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1609
        } catch (PromotionException pex) {
1610
          result.pex = pex;
1611
        }
1612
        return result;
1613
      }
1982 varun.gupt 1614
    }
1615
 
3430 rajveer 1616
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1617
      public getCouponUsageCountByUser() {
1618
        super("getCouponUsageCountByUser");
1982 varun.gupt 1619
      }
1620
 
3430 rajveer 1621
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1622
        return new getCouponUsageCountByUser_args();
1623
      }
1982 varun.gupt 1624
 
3430 rajveer 1625
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1626
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1627
        try {
1628
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1629
          result.setSuccessIsSet(true);
1630
        } catch (PromotionException pex) {
1631
          result.pex = pex;
1632
        }
1633
        return result;
1634
      }
1982 varun.gupt 1635
    }
1636
 
3430 rajveer 1637
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1638
      public getActiveCoupons() {
1639
        super("getActiveCoupons");
1640
      }
1982 varun.gupt 1641
 
3430 rajveer 1642
      protected getActiveCoupons_args getEmptyArgsInstance() {
1643
        return new getActiveCoupons_args();
1644
      }
1982 varun.gupt 1645
 
3430 rajveer 1646
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1647
        getActiveCoupons_result result = new getActiveCoupons_result();
1648
        try {
1649
          result.success = iface.getActiveCoupons();
1650
        } catch (PromotionException pex) {
1651
          result.pex = pex;
1652
        }
1653
        return result;
1654
      }
1982 varun.gupt 1655
    }
1656
 
6250 amit.gupta 1657
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
1658
      public createCoupon() {
1659
        super("createCoupon");
1660
      }
1661
 
1662
      protected createCoupon_args getEmptyArgsInstance() {
1663
        return new createCoupon_args();
1664
      }
1665
 
1666
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
1667
        createCoupon_result result = new createCoupon_result();
1668
        try {
6356 amit.gupta 1669
          result.success = iface.createCoupon(args.promotionId, args.endOn, args.email, args.amount, args.isCod, args.usage);
6250 amit.gupta 1670
        } catch (PromotionException pex) {
1671
          result.pex = pex;
1672
        }
1673
        return result;
1674
      }
1675
    }
1676
 
3430 rajveer 1677
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1678
      public getSuccessfulPaymentCountForCoupon() {
1679
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1680
      }
1681
 
3430 rajveer 1682
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1683
        return new getSuccessfulPaymentCountForCoupon_args();
1684
      }
1982 varun.gupt 1685
 
3430 rajveer 1686
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1687
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1688
        try {
1689
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1690
          result.setSuccessIsSet(true);
1691
        } catch (PromotionException pex) {
1692
          result.pex = pex;
1982 varun.gupt 1693
        }
3430 rajveer 1694
        return result;
1982 varun.gupt 1695
      }
1696
    }
1697
 
3430 rajveer 1698
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1699
      public getRuleDocString() {
1700
        super("getRuleDocString");
1701
      }
1982 varun.gupt 1702
 
3430 rajveer 1703
      protected getRuleDocString_args getEmptyArgsInstance() {
1704
        return new getRuleDocString_args();
1705
      }
1982 varun.gupt 1706
 
3430 rajveer 1707
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1708
        getRuleDocString_result result = new getRuleDocString_result();
1709
        result.success = iface.getRuleDocString(args.ruleName);
1710
        return result;
1711
      }
1982 varun.gupt 1712
    }
1713
 
4189 varun.gupt 1714
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1715
      public getItemDiscountMap() {
1716
        super("getItemDiscountMap");
1717
      }
1718
 
1719
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1720
        return new getItemDiscountMap_args();
1721
      }
1722
 
1723
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1724
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1725
        try {
1726
          result.success = iface.getItemDiscountMap(args.itemIds);
1727
        } catch (PromotionException pex) {
1728
          result.pex = pex;
1729
        }
1730
        return result;
1731
      }
1732
    }
1733
 
4494 varun.gupt 1734
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1735
      public getDiscountsForEntity() {
1736
        super("getDiscountsForEntity");
1737
      }
1738
 
1739
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1740
        return new getDiscountsForEntity_args();
1741
      }
1742
 
1743
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1744
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1745
        result.success = iface.getDiscountsForEntity(args.entityId);
1746
        return result;
1747
      }
1748
    }
1749
 
5469 rajveer 1750
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
1751
      public addVoucher() {
1752
        super("addVoucher");
1753
      }
1754
 
1755
      protected addVoucher_args getEmptyArgsInstance() {
1756
        return new addVoucher_args();
1757
      }
1758
 
1759
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
1760
        addVoucher_result result = new addVoucher_result();
1761
        iface.addVoucher(args.voucher);
1762
        return result;
1763
      }
1764
    }
1765
 
1766
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
1767
      public assignVoucher() {
1768
        super("assignVoucher");
1769
      }
1770
 
1771
      protected assignVoucher_args getEmptyArgsInstance() {
1772
        return new assignVoucher_args();
1773
      }
1774
 
1775
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
1776
        assignVoucher_result result = new assignVoucher_result();
1777
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
1778
        return result;
1779
      }
1780
    }
1781
 
1782
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
1783
      public markVoucherAsRedeemed() {
1784
        super("markVoucherAsRedeemed");
1785
      }
1786
 
1787
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
1788
        return new markVoucherAsRedeemed_args();
1789
      }
1790
 
1791
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
1792
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
1793
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
1794
        result.setSuccessIsSet(true);
1795
        return result;
1796
      }
1797
    }
1798
 
1982 varun.gupt 1799
  }
1800
 
3430 rajveer 1801
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1802
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1803
 
3430 rajveer 1804
    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);
1805
    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);
1806
    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);
1807
    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 1808
 
3430 rajveer 1809
    private String name; // required
1810
    private String ruleExecutionSrc; // required
1811
    private long startOn; // required
1812
    private long endOn; // required
1982 varun.gupt 1813
 
1814
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1815
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1816
      NAME((short)1, "name"),
1817
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1818
      START_ON((short)3, "startOn"),
1819
      END_ON((short)4, "endOn");
1820
 
1821
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1822
 
1823
      static {
1824
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1825
          byName.put(field.getFieldName(), field);
1826
        }
1827
      }
1828
 
1829
      /**
1830
       * Find the _Fields constant that matches fieldId, or null if its not found.
1831
       */
1832
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1833
        switch(fieldId) {
1834
          case 1: // NAME
1835
            return NAME;
1836
          case 2: // RULE_EXECUTION_SRC
1837
            return RULE_EXECUTION_SRC;
1838
          case 3: // START_ON
1839
            return START_ON;
1840
          case 4: // END_ON
1841
            return END_ON;
1842
          default:
1843
            return null;
1844
        }
1982 varun.gupt 1845
      }
1846
 
1847
      /**
1848
       * Find the _Fields constant that matches fieldId, throwing an exception
1849
       * if it is not found.
1850
       */
1851
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1852
        _Fields fields = findByThriftId(fieldId);
1853
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1854
        return fields;
1855
      }
1856
 
1857
      /**
1858
       * Find the _Fields constant that matches name, or null if its not found.
1859
       */
1860
      public static _Fields findByName(String name) {
1861
        return byName.get(name);
1862
      }
1863
 
1864
      private final short _thriftId;
1865
      private final String _fieldName;
1866
 
1867
      _Fields(short thriftId, String fieldName) {
1868
        _thriftId = thriftId;
1869
        _fieldName = fieldName;
1870
      }
1871
 
1872
      public short getThriftFieldId() {
1873
        return _thriftId;
1874
      }
1875
 
1876
      public String getFieldName() {
1877
        return _fieldName;
1878
      }
1879
    }
1880
 
1881
    // isset id assignments
1882
    private static final int __STARTON_ISSET_ID = 0;
1883
    private static final int __ENDON_ISSET_ID = 1;
1884
    private BitSet __isset_bit_vector = new BitSet(2);
1885
 
3430 rajveer 1886
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1887
    static {
3430 rajveer 1888
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1889
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1890
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1891
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1892
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1893
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1894
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1895
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1896
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1897
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1898
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 1899
    }
1900
 
1901
    public createPromotion_args() {
1902
    }
1903
 
1904
    public createPromotion_args(
1905
      String name,
1906
      String ruleExecutionSrc,
1907
      long startOn,
1908
      long endOn)
1909
    {
1910
      this();
1911
      this.name = name;
1912
      this.ruleExecutionSrc = ruleExecutionSrc;
1913
      this.startOn = startOn;
1914
      setStartOnIsSet(true);
1915
      this.endOn = endOn;
1916
      setEndOnIsSet(true);
1917
    }
1918
 
1919
    /**
1920
     * Performs a deep copy on <i>other</i>.
1921
     */
1922
    public createPromotion_args(createPromotion_args other) {
1923
      __isset_bit_vector.clear();
1924
      __isset_bit_vector.or(other.__isset_bit_vector);
1925
      if (other.isSetName()) {
1926
        this.name = other.name;
1927
      }
1928
      if (other.isSetRuleExecutionSrc()) {
1929
        this.ruleExecutionSrc = other.ruleExecutionSrc;
1930
      }
1931
      this.startOn = other.startOn;
1932
      this.endOn = other.endOn;
1933
    }
1934
 
1935
    public createPromotion_args deepCopy() {
1936
      return new createPromotion_args(this);
1937
    }
1938
 
3430 rajveer 1939
    @Override
1940
    public void clear() {
1941
      this.name = null;
1942
      this.ruleExecutionSrc = null;
1943
      setStartOnIsSet(false);
1944
      this.startOn = 0;
1945
      setEndOnIsSet(false);
1946
      this.endOn = 0;
1982 varun.gupt 1947
    }
1948
 
1949
    public String getName() {
1950
      return this.name;
1951
    }
1952
 
3430 rajveer 1953
    public void setName(String name) {
1982 varun.gupt 1954
      this.name = name;
1955
    }
1956
 
1957
    public void unsetName() {
1958
      this.name = null;
1959
    }
1960
 
3430 rajveer 1961
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1962
    public boolean isSetName() {
1963
      return this.name != null;
1964
    }
1965
 
1966
    public void setNameIsSet(boolean value) {
1967
      if (!value) {
1968
        this.name = null;
1969
      }
1970
    }
1971
 
1972
    public String getRuleExecutionSrc() {
1973
      return this.ruleExecutionSrc;
1974
    }
1975
 
3430 rajveer 1976
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 1977
      this.ruleExecutionSrc = ruleExecutionSrc;
1978
    }
1979
 
1980
    public void unsetRuleExecutionSrc() {
1981
      this.ruleExecutionSrc = null;
1982
    }
1983
 
3430 rajveer 1984
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1985
    public boolean isSetRuleExecutionSrc() {
1986
      return this.ruleExecutionSrc != null;
1987
    }
1988
 
1989
    public void setRuleExecutionSrcIsSet(boolean value) {
1990
      if (!value) {
1991
        this.ruleExecutionSrc = null;
1992
      }
1993
    }
1994
 
1995
    public long getStartOn() {
1996
      return this.startOn;
1997
    }
1998
 
3430 rajveer 1999
    public void setStartOn(long startOn) {
1982 varun.gupt 2000
      this.startOn = startOn;
2001
      setStartOnIsSet(true);
2002
    }
2003
 
2004
    public void unsetStartOn() {
2005
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2006
    }
2007
 
3430 rajveer 2008
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2009
    public boolean isSetStartOn() {
2010
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2011
    }
2012
 
2013
    public void setStartOnIsSet(boolean value) {
2014
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2015
    }
2016
 
2017
    public long getEndOn() {
2018
      return this.endOn;
2019
    }
2020
 
3430 rajveer 2021
    public void setEndOn(long endOn) {
1982 varun.gupt 2022
      this.endOn = endOn;
2023
      setEndOnIsSet(true);
2024
    }
2025
 
2026
    public void unsetEndOn() {
2027
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2028
    }
2029
 
3430 rajveer 2030
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2031
    public boolean isSetEndOn() {
2032
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2033
    }
2034
 
2035
    public void setEndOnIsSet(boolean value) {
2036
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2037
    }
2038
 
2039
    public void setFieldValue(_Fields field, Object value) {
2040
      switch (field) {
2041
      case NAME:
2042
        if (value == null) {
2043
          unsetName();
2044
        } else {
2045
          setName((String)value);
2046
        }
2047
        break;
2048
 
2049
      case RULE_EXECUTION_SRC:
2050
        if (value == null) {
2051
          unsetRuleExecutionSrc();
2052
        } else {
2053
          setRuleExecutionSrc((String)value);
2054
        }
2055
        break;
2056
 
2057
      case START_ON:
2058
        if (value == null) {
2059
          unsetStartOn();
2060
        } else {
2061
          setStartOn((Long)value);
2062
        }
2063
        break;
2064
 
2065
      case END_ON:
2066
        if (value == null) {
2067
          unsetEndOn();
2068
        } else {
2069
          setEndOn((Long)value);
2070
        }
2071
        break;
2072
 
2073
      }
2074
    }
2075
 
2076
    public Object getFieldValue(_Fields field) {
2077
      switch (field) {
2078
      case NAME:
2079
        return getName();
2080
 
2081
      case RULE_EXECUTION_SRC:
2082
        return getRuleExecutionSrc();
2083
 
2084
      case START_ON:
3430 rajveer 2085
        return Long.valueOf(getStartOn());
1982 varun.gupt 2086
 
2087
      case END_ON:
3430 rajveer 2088
        return Long.valueOf(getEndOn());
1982 varun.gupt 2089
 
2090
      }
2091
      throw new IllegalStateException();
2092
    }
2093
 
3430 rajveer 2094
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2095
    public boolean isSet(_Fields field) {
2096
      if (field == null) {
2097
        throw new IllegalArgumentException();
2098
      }
1982 varun.gupt 2099
 
2100
      switch (field) {
2101
      case NAME:
2102
        return isSetName();
2103
      case RULE_EXECUTION_SRC:
2104
        return isSetRuleExecutionSrc();
2105
      case START_ON:
2106
        return isSetStartOn();
2107
      case END_ON:
2108
        return isSetEndOn();
2109
      }
2110
      throw new IllegalStateException();
2111
    }
2112
 
2113
    @Override
2114
    public boolean equals(Object that) {
2115
      if (that == null)
2116
        return false;
2117
      if (that instanceof createPromotion_args)
2118
        return this.equals((createPromotion_args)that);
2119
      return false;
2120
    }
2121
 
2122
    public boolean equals(createPromotion_args that) {
2123
      if (that == null)
2124
        return false;
2125
 
2126
      boolean this_present_name = true && this.isSetName();
2127
      boolean that_present_name = true && that.isSetName();
2128
      if (this_present_name || that_present_name) {
2129
        if (!(this_present_name && that_present_name))
2130
          return false;
2131
        if (!this.name.equals(that.name))
2132
          return false;
2133
      }
2134
 
2135
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2136
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2137
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2138
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2139
          return false;
2140
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2141
          return false;
2142
      }
2143
 
2144
      boolean this_present_startOn = true;
2145
      boolean that_present_startOn = true;
2146
      if (this_present_startOn || that_present_startOn) {
2147
        if (!(this_present_startOn && that_present_startOn))
2148
          return false;
2149
        if (this.startOn != that.startOn)
2150
          return false;
2151
      }
2152
 
2153
      boolean this_present_endOn = true;
2154
      boolean that_present_endOn = true;
2155
      if (this_present_endOn || that_present_endOn) {
2156
        if (!(this_present_endOn && that_present_endOn))
2157
          return false;
2158
        if (this.endOn != that.endOn)
2159
          return false;
2160
      }
2161
 
2162
      return true;
2163
    }
2164
 
2165
    @Override
2166
    public int hashCode() {
2167
      return 0;
2168
    }
2169
 
2170
    public int compareTo(createPromotion_args other) {
2171
      if (!getClass().equals(other.getClass())) {
2172
        return getClass().getName().compareTo(other.getClass().getName());
2173
      }
2174
 
2175
      int lastComparison = 0;
2176
      createPromotion_args typedOther = (createPromotion_args)other;
2177
 
3430 rajveer 2178
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2179
      if (lastComparison != 0) {
2180
        return lastComparison;
2181
      }
3430 rajveer 2182
      if (isSetName()) {
2183
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2184
        if (lastComparison != 0) {
2185
          return lastComparison;
2186
        }
1982 varun.gupt 2187
      }
3430 rajveer 2188
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2189
      if (lastComparison != 0) {
2190
        return lastComparison;
2191
      }
3430 rajveer 2192
      if (isSetRuleExecutionSrc()) {
2193
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2194
        if (lastComparison != 0) {
2195
          return lastComparison;
2196
        }
1982 varun.gupt 2197
      }
3430 rajveer 2198
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2199
      if (lastComparison != 0) {
2200
        return lastComparison;
2201
      }
3430 rajveer 2202
      if (isSetStartOn()) {
2203
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2204
        if (lastComparison != 0) {
2205
          return lastComparison;
2206
        }
1982 varun.gupt 2207
      }
3430 rajveer 2208
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2209
      if (lastComparison != 0) {
2210
        return lastComparison;
2211
      }
3430 rajveer 2212
      if (isSetEndOn()) {
2213
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2214
        if (lastComparison != 0) {
2215
          return lastComparison;
2216
        }
1982 varun.gupt 2217
      }
2218
      return 0;
2219
    }
2220
 
3430 rajveer 2221
    public _Fields fieldForId(int fieldId) {
2222
      return _Fields.findByThriftId(fieldId);
2223
    }
2224
 
2225
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2226
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2227
      iprot.readStructBegin();
2228
      while (true)
2229
      {
2230
        field = iprot.readFieldBegin();
3430 rajveer 2231
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2232
          break;
2233
        }
3430 rajveer 2234
        switch (field.id) {
2235
          case 1: // NAME
2236
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2237
              this.name = iprot.readString();
2238
            } else { 
2239
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2240
            }
2241
            break;
2242
          case 2: // RULE_EXECUTION_SRC
2243
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2244
              this.ruleExecutionSrc = iprot.readString();
2245
            } else { 
2246
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2247
            }
2248
            break;
2249
          case 3: // START_ON
2250
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2251
              this.startOn = iprot.readI64();
2252
              setStartOnIsSet(true);
2253
            } else { 
2254
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2255
            }
2256
            break;
2257
          case 4: // END_ON
2258
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2259
              this.endOn = iprot.readI64();
2260
              setEndOnIsSet(true);
2261
            } else { 
2262
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2263
            }
2264
            break;
2265
          default:
2266
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2267
        }
3430 rajveer 2268
        iprot.readFieldEnd();
1982 varun.gupt 2269
      }
2270
      iprot.readStructEnd();
2271
      validate();
2272
    }
2273
 
3430 rajveer 2274
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2275
      validate();
2276
 
2277
      oprot.writeStructBegin(STRUCT_DESC);
2278
      if (this.name != null) {
2279
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2280
        oprot.writeString(this.name);
2281
        oprot.writeFieldEnd();
2282
      }
2283
      if (this.ruleExecutionSrc != null) {
2284
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2285
        oprot.writeString(this.ruleExecutionSrc);
2286
        oprot.writeFieldEnd();
2287
      }
2288
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2289
      oprot.writeI64(this.startOn);
2290
      oprot.writeFieldEnd();
2291
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2292
      oprot.writeI64(this.endOn);
2293
      oprot.writeFieldEnd();
2294
      oprot.writeFieldStop();
2295
      oprot.writeStructEnd();
2296
    }
2297
 
2298
    @Override
2299
    public String toString() {
2300
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2301
      boolean first = true;
2302
 
2303
      sb.append("name:");
2304
      if (this.name == null) {
2305
        sb.append("null");
2306
      } else {
2307
        sb.append(this.name);
2308
      }
2309
      first = false;
2310
      if (!first) sb.append(", ");
2311
      sb.append("ruleExecutionSrc:");
2312
      if (this.ruleExecutionSrc == null) {
2313
        sb.append("null");
2314
      } else {
2315
        sb.append(this.ruleExecutionSrc);
2316
      }
2317
      first = false;
2318
      if (!first) sb.append(", ");
2319
      sb.append("startOn:");
2320
      sb.append(this.startOn);
2321
      first = false;
2322
      if (!first) sb.append(", ");
2323
      sb.append("endOn:");
2324
      sb.append(this.endOn);
2325
      first = false;
2326
      sb.append(")");
2327
      return sb.toString();
2328
    }
2329
 
3430 rajveer 2330
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2331
      // check for required fields
2332
    }
2333
 
3430 rajveer 2334
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2335
      try {
2336
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2337
      } catch (org.apache.thrift.TException te) {
2338
        throw new java.io.IOException(te);
2339
      }
2340
    }
2341
 
2342
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2343
      try {
2344
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2345
        __isset_bit_vector = new BitSet(1);
2346
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2347
      } catch (org.apache.thrift.TException te) {
2348
        throw new java.io.IOException(te);
2349
      }
2350
    }
2351
 
1982 varun.gupt 2352
  }
2353
 
3430 rajveer 2354
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2355
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2356
 
3430 rajveer 2357
    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 2358
 
3430 rajveer 2359
    private PromotionException pex; // required
1982 varun.gupt 2360
 
2361
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2362
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2363
      PEX((short)1, "pex");
2364
 
2365
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2366
 
2367
      static {
2368
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2369
          byName.put(field.getFieldName(), field);
2370
        }
2371
      }
2372
 
2373
      /**
2374
       * Find the _Fields constant that matches fieldId, or null if its not found.
2375
       */
2376
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2377
        switch(fieldId) {
2378
          case 1: // PEX
2379
            return PEX;
2380
          default:
2381
            return null;
2382
        }
1982 varun.gupt 2383
      }
2384
 
2385
      /**
2386
       * Find the _Fields constant that matches fieldId, throwing an exception
2387
       * if it is not found.
2388
       */
2389
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2390
        _Fields fields = findByThriftId(fieldId);
2391
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2392
        return fields;
2393
      }
2394
 
2395
      /**
2396
       * Find the _Fields constant that matches name, or null if its not found.
2397
       */
2398
      public static _Fields findByName(String name) {
2399
        return byName.get(name);
2400
      }
2401
 
2402
      private final short _thriftId;
2403
      private final String _fieldName;
2404
 
2405
      _Fields(short thriftId, String fieldName) {
2406
        _thriftId = thriftId;
2407
        _fieldName = fieldName;
2408
      }
2409
 
2410
      public short getThriftFieldId() {
2411
        return _thriftId;
2412
      }
2413
 
2414
      public String getFieldName() {
2415
        return _fieldName;
2416
      }
2417
    }
2418
 
2419
    // isset id assignments
2420
 
3430 rajveer 2421
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2422
    static {
3430 rajveer 2423
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2424
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2425
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2426
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2427
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2428
    }
2429
 
2430
    public createPromotion_result() {
2431
    }
2432
 
2433
    public createPromotion_result(
2434
      PromotionException pex)
2435
    {
2436
      this();
2437
      this.pex = pex;
2438
    }
2439
 
2440
    /**
2441
     * Performs a deep copy on <i>other</i>.
2442
     */
2443
    public createPromotion_result(createPromotion_result other) {
2444
      if (other.isSetPex()) {
2445
        this.pex = new PromotionException(other.pex);
2446
      }
2447
    }
2448
 
2449
    public createPromotion_result deepCopy() {
2450
      return new createPromotion_result(this);
2451
    }
2452
 
3430 rajveer 2453
    @Override
2454
    public void clear() {
2455
      this.pex = null;
1982 varun.gupt 2456
    }
2457
 
2458
    public PromotionException getPex() {
2459
      return this.pex;
2460
    }
2461
 
3430 rajveer 2462
    public void setPex(PromotionException pex) {
1982 varun.gupt 2463
      this.pex = pex;
2464
    }
2465
 
2466
    public void unsetPex() {
2467
      this.pex = null;
2468
    }
2469
 
3430 rajveer 2470
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2471
    public boolean isSetPex() {
2472
      return this.pex != null;
2473
    }
2474
 
2475
    public void setPexIsSet(boolean value) {
2476
      if (!value) {
2477
        this.pex = null;
2478
      }
2479
    }
2480
 
2481
    public void setFieldValue(_Fields field, Object value) {
2482
      switch (field) {
2483
      case PEX:
2484
        if (value == null) {
2485
          unsetPex();
2486
        } else {
2487
          setPex((PromotionException)value);
2488
        }
2489
        break;
2490
 
2491
      }
2492
    }
2493
 
2494
    public Object getFieldValue(_Fields field) {
2495
      switch (field) {
2496
      case PEX:
2497
        return getPex();
2498
 
2499
      }
2500
      throw new IllegalStateException();
2501
    }
2502
 
3430 rajveer 2503
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2504
    public boolean isSet(_Fields field) {
2505
      if (field == null) {
2506
        throw new IllegalArgumentException();
2507
      }
1982 varun.gupt 2508
 
2509
      switch (field) {
2510
      case PEX:
2511
        return isSetPex();
2512
      }
2513
      throw new IllegalStateException();
2514
    }
2515
 
2516
    @Override
2517
    public boolean equals(Object that) {
2518
      if (that == null)
2519
        return false;
2520
      if (that instanceof createPromotion_result)
2521
        return this.equals((createPromotion_result)that);
2522
      return false;
2523
    }
2524
 
2525
    public boolean equals(createPromotion_result that) {
2526
      if (that == null)
2527
        return false;
2528
 
2529
      boolean this_present_pex = true && this.isSetPex();
2530
      boolean that_present_pex = true && that.isSetPex();
2531
      if (this_present_pex || that_present_pex) {
2532
        if (!(this_present_pex && that_present_pex))
2533
          return false;
2534
        if (!this.pex.equals(that.pex))
2535
          return false;
2536
      }
2537
 
2538
      return true;
2539
    }
2540
 
2541
    @Override
2542
    public int hashCode() {
2543
      return 0;
2544
    }
2545
 
2546
    public int compareTo(createPromotion_result other) {
2547
      if (!getClass().equals(other.getClass())) {
2548
        return getClass().getName().compareTo(other.getClass().getName());
2549
      }
2550
 
2551
      int lastComparison = 0;
2552
      createPromotion_result typedOther = (createPromotion_result)other;
2553
 
3430 rajveer 2554
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2555
      if (lastComparison != 0) {
2556
        return lastComparison;
2557
      }
3430 rajveer 2558
      if (isSetPex()) {
2559
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2560
        if (lastComparison != 0) {
2561
          return lastComparison;
2562
        }
1982 varun.gupt 2563
      }
2564
      return 0;
2565
    }
2566
 
3430 rajveer 2567
    public _Fields fieldForId(int fieldId) {
2568
      return _Fields.findByThriftId(fieldId);
2569
    }
2570
 
2571
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2572
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2573
      iprot.readStructBegin();
2574
      while (true)
2575
      {
2576
        field = iprot.readFieldBegin();
3430 rajveer 2577
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2578
          break;
2579
        }
3430 rajveer 2580
        switch (field.id) {
2581
          case 1: // PEX
2582
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2583
              this.pex = new PromotionException();
2584
              this.pex.read(iprot);
2585
            } else { 
2586
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2587
            }
2588
            break;
2589
          default:
2590
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2591
        }
3430 rajveer 2592
        iprot.readFieldEnd();
1982 varun.gupt 2593
      }
2594
      iprot.readStructEnd();
2595
      validate();
2596
    }
2597
 
3430 rajveer 2598
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2599
      oprot.writeStructBegin(STRUCT_DESC);
2600
 
2601
      if (this.isSetPex()) {
2602
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2603
        this.pex.write(oprot);
2604
        oprot.writeFieldEnd();
2605
      }
2606
      oprot.writeFieldStop();
2607
      oprot.writeStructEnd();
2608
    }
2609
 
2610
    @Override
2611
    public String toString() {
2612
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2613
      boolean first = true;
2614
 
2615
      sb.append("pex:");
2616
      if (this.pex == null) {
2617
        sb.append("null");
2618
      } else {
2619
        sb.append(this.pex);
2620
      }
2621
      first = false;
2622
      sb.append(")");
2623
      return sb.toString();
2624
    }
2625
 
3430 rajveer 2626
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2627
      // check for required fields
2628
    }
2629
 
3430 rajveer 2630
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2631
      try {
2632
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2633
      } catch (org.apache.thrift.TException te) {
2634
        throw new java.io.IOException(te);
2635
      }
2636
    }
2637
 
2638
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2639
      try {
2640
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2641
      } catch (org.apache.thrift.TException te) {
2642
        throw new java.io.IOException(te);
2643
      }
2644
    }
2645
 
1982 varun.gupt 2646
  }
2647
 
6301 amit.gupta 2648
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
2649
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
2650
 
2651
    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);
2652
 
2653
    private String couponCode; // required
2654
 
2655
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2656
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2657
      COUPON_CODE((short)1, "couponCode");
2658
 
2659
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2660
 
2661
      static {
2662
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2663
          byName.put(field.getFieldName(), field);
2664
        }
2665
      }
2666
 
2667
      /**
2668
       * Find the _Fields constant that matches fieldId, or null if its not found.
2669
       */
2670
      public static _Fields findByThriftId(int fieldId) {
2671
        switch(fieldId) {
2672
          case 1: // COUPON_CODE
2673
            return COUPON_CODE;
2674
          default:
2675
            return null;
2676
        }
2677
      }
2678
 
2679
      /**
2680
       * Find the _Fields constant that matches fieldId, throwing an exception
2681
       * if it is not found.
2682
       */
2683
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2684
        _Fields fields = findByThriftId(fieldId);
2685
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2686
        return fields;
2687
      }
2688
 
2689
      /**
2690
       * Find the _Fields constant that matches name, or null if its not found.
2691
       */
2692
      public static _Fields findByName(String name) {
2693
        return byName.get(name);
2694
      }
2695
 
2696
      private final short _thriftId;
2697
      private final String _fieldName;
2698
 
2699
      _Fields(short thriftId, String fieldName) {
2700
        _thriftId = thriftId;
2701
        _fieldName = fieldName;
2702
      }
2703
 
2704
      public short getThriftFieldId() {
2705
        return _thriftId;
2706
      }
2707
 
2708
      public String getFieldName() {
2709
        return _fieldName;
2710
      }
2711
    }
2712
 
2713
    // isset id assignments
2714
 
2715
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2716
    static {
2717
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2718
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2719
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2720
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2721
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
2722
    }
2723
 
2724
    public getCoupon_args() {
2725
    }
2726
 
2727
    public getCoupon_args(
2728
      String couponCode)
2729
    {
2730
      this();
2731
      this.couponCode = couponCode;
2732
    }
2733
 
2734
    /**
2735
     * Performs a deep copy on <i>other</i>.
2736
     */
2737
    public getCoupon_args(getCoupon_args other) {
2738
      if (other.isSetCouponCode()) {
2739
        this.couponCode = other.couponCode;
2740
      }
2741
    }
2742
 
2743
    public getCoupon_args deepCopy() {
2744
      return new getCoupon_args(this);
2745
    }
2746
 
2747
    @Override
2748
    public void clear() {
2749
      this.couponCode = null;
2750
    }
2751
 
2752
    public String getCouponCode() {
2753
      return this.couponCode;
2754
    }
2755
 
2756
    public void setCouponCode(String couponCode) {
2757
      this.couponCode = couponCode;
2758
    }
2759
 
2760
    public void unsetCouponCode() {
2761
      this.couponCode = null;
2762
    }
2763
 
2764
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
2765
    public boolean isSetCouponCode() {
2766
      return this.couponCode != null;
2767
    }
2768
 
2769
    public void setCouponCodeIsSet(boolean value) {
2770
      if (!value) {
2771
        this.couponCode = null;
2772
      }
2773
    }
2774
 
2775
    public void setFieldValue(_Fields field, Object value) {
2776
      switch (field) {
2777
      case COUPON_CODE:
2778
        if (value == null) {
2779
          unsetCouponCode();
2780
        } else {
2781
          setCouponCode((String)value);
2782
        }
2783
        break;
2784
 
2785
      }
2786
    }
2787
 
2788
    public Object getFieldValue(_Fields field) {
2789
      switch (field) {
2790
      case COUPON_CODE:
2791
        return getCouponCode();
2792
 
2793
      }
2794
      throw new IllegalStateException();
2795
    }
2796
 
2797
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2798
    public boolean isSet(_Fields field) {
2799
      if (field == null) {
2800
        throw new IllegalArgumentException();
2801
      }
2802
 
2803
      switch (field) {
2804
      case COUPON_CODE:
2805
        return isSetCouponCode();
2806
      }
2807
      throw new IllegalStateException();
2808
    }
2809
 
2810
    @Override
2811
    public boolean equals(Object that) {
2812
      if (that == null)
2813
        return false;
2814
      if (that instanceof getCoupon_args)
2815
        return this.equals((getCoupon_args)that);
2816
      return false;
2817
    }
2818
 
2819
    public boolean equals(getCoupon_args that) {
2820
      if (that == null)
2821
        return false;
2822
 
2823
      boolean this_present_couponCode = true && this.isSetCouponCode();
2824
      boolean that_present_couponCode = true && that.isSetCouponCode();
2825
      if (this_present_couponCode || that_present_couponCode) {
2826
        if (!(this_present_couponCode && that_present_couponCode))
2827
          return false;
2828
        if (!this.couponCode.equals(that.couponCode))
2829
          return false;
2830
      }
2831
 
2832
      return true;
2833
    }
2834
 
2835
    @Override
2836
    public int hashCode() {
2837
      return 0;
2838
    }
2839
 
2840
    public int compareTo(getCoupon_args other) {
2841
      if (!getClass().equals(other.getClass())) {
2842
        return getClass().getName().compareTo(other.getClass().getName());
2843
      }
2844
 
2845
      int lastComparison = 0;
2846
      getCoupon_args typedOther = (getCoupon_args)other;
2847
 
2848
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
2849
      if (lastComparison != 0) {
2850
        return lastComparison;
2851
      }
2852
      if (isSetCouponCode()) {
2853
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
2854
        if (lastComparison != 0) {
2855
          return lastComparison;
2856
        }
2857
      }
2858
      return 0;
2859
    }
2860
 
2861
    public _Fields fieldForId(int fieldId) {
2862
      return _Fields.findByThriftId(fieldId);
2863
    }
2864
 
2865
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2866
      org.apache.thrift.protocol.TField field;
2867
      iprot.readStructBegin();
2868
      while (true)
2869
      {
2870
        field = iprot.readFieldBegin();
2871
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2872
          break;
2873
        }
2874
        switch (field.id) {
2875
          case 1: // COUPON_CODE
2876
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2877
              this.couponCode = iprot.readString();
2878
            } else { 
2879
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2880
            }
2881
            break;
2882
          default:
2883
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2884
        }
2885
        iprot.readFieldEnd();
2886
      }
2887
      iprot.readStructEnd();
2888
      validate();
2889
    }
2890
 
2891
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2892
      validate();
2893
 
2894
      oprot.writeStructBegin(STRUCT_DESC);
2895
      if (this.couponCode != null) {
2896
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
2897
        oprot.writeString(this.couponCode);
2898
        oprot.writeFieldEnd();
2899
      }
2900
      oprot.writeFieldStop();
2901
      oprot.writeStructEnd();
2902
    }
2903
 
2904
    @Override
2905
    public String toString() {
2906
      StringBuilder sb = new StringBuilder("getCoupon_args(");
2907
      boolean first = true;
2908
 
2909
      sb.append("couponCode:");
2910
      if (this.couponCode == null) {
2911
        sb.append("null");
2912
      } else {
2913
        sb.append(this.couponCode);
2914
      }
2915
      first = false;
2916
      sb.append(")");
2917
      return sb.toString();
2918
    }
2919
 
2920
    public void validate() throws org.apache.thrift.TException {
2921
      // check for required fields
2922
    }
2923
 
2924
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2925
      try {
2926
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2927
      } catch (org.apache.thrift.TException te) {
2928
        throw new java.io.IOException(te);
2929
      }
2930
    }
2931
 
2932
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2933
      try {
2934
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2935
      } catch (org.apache.thrift.TException te) {
2936
        throw new java.io.IOException(te);
2937
      }
2938
    }
2939
 
2940
  }
2941
 
2942
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
2943
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
2944
 
2945
    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);
2946
    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);
2947
 
2948
    private Coupon success; // required
2949
    private PromotionException pex; // required
2950
 
2951
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2952
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2953
      SUCCESS((short)0, "success"),
2954
      PEX((short)1, "pex");
2955
 
2956
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2957
 
2958
      static {
2959
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2960
          byName.put(field.getFieldName(), field);
2961
        }
2962
      }
2963
 
2964
      /**
2965
       * Find the _Fields constant that matches fieldId, or null if its not found.
2966
       */
2967
      public static _Fields findByThriftId(int fieldId) {
2968
        switch(fieldId) {
2969
          case 0: // SUCCESS
2970
            return SUCCESS;
2971
          case 1: // PEX
2972
            return PEX;
2973
          default:
2974
            return null;
2975
        }
2976
      }
2977
 
2978
      /**
2979
       * Find the _Fields constant that matches fieldId, throwing an exception
2980
       * if it is not found.
2981
       */
2982
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2983
        _Fields fields = findByThriftId(fieldId);
2984
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2985
        return fields;
2986
      }
2987
 
2988
      /**
2989
       * Find the _Fields constant that matches name, or null if its not found.
2990
       */
2991
      public static _Fields findByName(String name) {
2992
        return byName.get(name);
2993
      }
2994
 
2995
      private final short _thriftId;
2996
      private final String _fieldName;
2997
 
2998
      _Fields(short thriftId, String fieldName) {
2999
        _thriftId = thriftId;
3000
        _fieldName = fieldName;
3001
      }
3002
 
3003
      public short getThriftFieldId() {
3004
        return _thriftId;
3005
      }
3006
 
3007
      public String getFieldName() {
3008
        return _fieldName;
3009
      }
3010
    }
3011
 
3012
    // isset id assignments
3013
 
3014
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3015
    static {
3016
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3017
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3018
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
3019
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3020
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3021
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3022
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
3023
    }
3024
 
3025
    public getCoupon_result() {
3026
    }
3027
 
3028
    public getCoupon_result(
3029
      Coupon success,
3030
      PromotionException pex)
3031
    {
3032
      this();
3033
      this.success = success;
3034
      this.pex = pex;
3035
    }
3036
 
3037
    /**
3038
     * Performs a deep copy on <i>other</i>.
3039
     */
3040
    public getCoupon_result(getCoupon_result other) {
3041
      if (other.isSetSuccess()) {
3042
        this.success = new Coupon(other.success);
3043
      }
3044
      if (other.isSetPex()) {
3045
        this.pex = new PromotionException(other.pex);
3046
      }
3047
    }
3048
 
3049
    public getCoupon_result deepCopy() {
3050
      return new getCoupon_result(this);
3051
    }
3052
 
3053
    @Override
3054
    public void clear() {
3055
      this.success = null;
3056
      this.pex = null;
3057
    }
3058
 
3059
    public Coupon getSuccess() {
3060
      return this.success;
3061
    }
3062
 
3063
    public void setSuccess(Coupon success) {
3064
      this.success = success;
3065
    }
3066
 
3067
    public void unsetSuccess() {
3068
      this.success = null;
3069
    }
3070
 
3071
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3072
    public boolean isSetSuccess() {
3073
      return this.success != null;
3074
    }
3075
 
3076
    public void setSuccessIsSet(boolean value) {
3077
      if (!value) {
3078
        this.success = null;
3079
      }
3080
    }
3081
 
3082
    public PromotionException getPex() {
3083
      return this.pex;
3084
    }
3085
 
3086
    public void setPex(PromotionException pex) {
3087
      this.pex = pex;
3088
    }
3089
 
3090
    public void unsetPex() {
3091
      this.pex = null;
3092
    }
3093
 
3094
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3095
    public boolean isSetPex() {
3096
      return this.pex != null;
3097
    }
3098
 
3099
    public void setPexIsSet(boolean value) {
3100
      if (!value) {
3101
        this.pex = null;
3102
      }
3103
    }
3104
 
3105
    public void setFieldValue(_Fields field, Object value) {
3106
      switch (field) {
3107
      case SUCCESS:
3108
        if (value == null) {
3109
          unsetSuccess();
3110
        } else {
3111
          setSuccess((Coupon)value);
3112
        }
3113
        break;
3114
 
3115
      case PEX:
3116
        if (value == null) {
3117
          unsetPex();
3118
        } else {
3119
          setPex((PromotionException)value);
3120
        }
3121
        break;
3122
 
3123
      }
3124
    }
3125
 
3126
    public Object getFieldValue(_Fields field) {
3127
      switch (field) {
3128
      case SUCCESS:
3129
        return getSuccess();
3130
 
3131
      case PEX:
3132
        return getPex();
3133
 
3134
      }
3135
      throw new IllegalStateException();
3136
    }
3137
 
3138
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3139
    public boolean isSet(_Fields field) {
3140
      if (field == null) {
3141
        throw new IllegalArgumentException();
3142
      }
3143
 
3144
      switch (field) {
3145
      case SUCCESS:
3146
        return isSetSuccess();
3147
      case PEX:
3148
        return isSetPex();
3149
      }
3150
      throw new IllegalStateException();
3151
    }
3152
 
3153
    @Override
3154
    public boolean equals(Object that) {
3155
      if (that == null)
3156
        return false;
3157
      if (that instanceof getCoupon_result)
3158
        return this.equals((getCoupon_result)that);
3159
      return false;
3160
    }
3161
 
3162
    public boolean equals(getCoupon_result that) {
3163
      if (that == null)
3164
        return false;
3165
 
3166
      boolean this_present_success = true && this.isSetSuccess();
3167
      boolean that_present_success = true && that.isSetSuccess();
3168
      if (this_present_success || that_present_success) {
3169
        if (!(this_present_success && that_present_success))
3170
          return false;
3171
        if (!this.success.equals(that.success))
3172
          return false;
3173
      }
3174
 
3175
      boolean this_present_pex = true && this.isSetPex();
3176
      boolean that_present_pex = true && that.isSetPex();
3177
      if (this_present_pex || that_present_pex) {
3178
        if (!(this_present_pex && that_present_pex))
3179
          return false;
3180
        if (!this.pex.equals(that.pex))
3181
          return false;
3182
      }
3183
 
3184
      return true;
3185
    }
3186
 
3187
    @Override
3188
    public int hashCode() {
3189
      return 0;
3190
    }
3191
 
3192
    public int compareTo(getCoupon_result other) {
3193
      if (!getClass().equals(other.getClass())) {
3194
        return getClass().getName().compareTo(other.getClass().getName());
3195
      }
3196
 
3197
      int lastComparison = 0;
3198
      getCoupon_result typedOther = (getCoupon_result)other;
3199
 
3200
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3201
      if (lastComparison != 0) {
3202
        return lastComparison;
3203
      }
3204
      if (isSetSuccess()) {
3205
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3206
        if (lastComparison != 0) {
3207
          return lastComparison;
3208
        }
3209
      }
3210
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3211
      if (lastComparison != 0) {
3212
        return lastComparison;
3213
      }
3214
      if (isSetPex()) {
3215
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3216
        if (lastComparison != 0) {
3217
          return lastComparison;
3218
        }
3219
      }
3220
      return 0;
3221
    }
3222
 
3223
    public _Fields fieldForId(int fieldId) {
3224
      return _Fields.findByThriftId(fieldId);
3225
    }
3226
 
3227
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3228
      org.apache.thrift.protocol.TField field;
3229
      iprot.readStructBegin();
3230
      while (true)
3231
      {
3232
        field = iprot.readFieldBegin();
3233
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3234
          break;
3235
        }
3236
        switch (field.id) {
3237
          case 0: // SUCCESS
3238
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3239
              this.success = new Coupon();
3240
              this.success.read(iprot);
3241
            } else { 
3242
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3243
            }
3244
            break;
3245
          case 1: // PEX
3246
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3247
              this.pex = new PromotionException();
3248
              this.pex.read(iprot);
3249
            } else { 
3250
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3251
            }
3252
            break;
3253
          default:
3254
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3255
        }
3256
        iprot.readFieldEnd();
3257
      }
3258
      iprot.readStructEnd();
3259
      validate();
3260
    }
3261
 
3262
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3263
      oprot.writeStructBegin(STRUCT_DESC);
3264
 
3265
      if (this.isSetSuccess()) {
3266
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3267
        this.success.write(oprot);
3268
        oprot.writeFieldEnd();
3269
      } else if (this.isSetPex()) {
3270
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3271
        this.pex.write(oprot);
3272
        oprot.writeFieldEnd();
3273
      }
3274
      oprot.writeFieldStop();
3275
      oprot.writeStructEnd();
3276
    }
3277
 
3278
    @Override
3279
    public String toString() {
3280
      StringBuilder sb = new StringBuilder("getCoupon_result(");
3281
      boolean first = true;
3282
 
3283
      sb.append("success:");
3284
      if (this.success == null) {
3285
        sb.append("null");
3286
      } else {
3287
        sb.append(this.success);
3288
      }
3289
      first = false;
3290
      if (!first) sb.append(", ");
3291
      sb.append("pex:");
3292
      if (this.pex == null) {
3293
        sb.append("null");
3294
      } else {
3295
        sb.append(this.pex);
3296
      }
3297
      first = false;
3298
      sb.append(")");
3299
      return sb.toString();
3300
    }
3301
 
3302
    public void validate() throws org.apache.thrift.TException {
3303
      // check for required fields
3304
    }
3305
 
3306
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3307
      try {
3308
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3309
      } catch (org.apache.thrift.TException te) {
3310
        throw new java.io.IOException(te);
3311
      }
3312
    }
3313
 
3314
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3315
      try {
3316
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3317
      } catch (org.apache.thrift.TException te) {
3318
        throw new java.io.IOException(te);
3319
      }
3320
    }
3321
 
3322
  }
3323
 
3324
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
3325
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
3326
 
3327
    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);
3328
 
3329
    private String couponCode; // required
3330
 
3331
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3332
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3333
      COUPON_CODE((short)1, "couponCode");
3334
 
3335
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3336
 
3337
      static {
3338
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3339
          byName.put(field.getFieldName(), field);
3340
        }
3341
      }
3342
 
3343
      /**
3344
       * Find the _Fields constant that matches fieldId, or null if its not found.
3345
       */
3346
      public static _Fields findByThriftId(int fieldId) {
3347
        switch(fieldId) {
3348
          case 1: // COUPON_CODE
3349
            return COUPON_CODE;
3350
          default:
3351
            return null;
3352
        }
3353
      }
3354
 
3355
      /**
3356
       * Find the _Fields constant that matches fieldId, throwing an exception
3357
       * if it is not found.
3358
       */
3359
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3360
        _Fields fields = findByThriftId(fieldId);
3361
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3362
        return fields;
3363
      }
3364
 
3365
      /**
3366
       * Find the _Fields constant that matches name, or null if its not found.
3367
       */
3368
      public static _Fields findByName(String name) {
3369
        return byName.get(name);
3370
      }
3371
 
3372
      private final short _thriftId;
3373
      private final String _fieldName;
3374
 
3375
      _Fields(short thriftId, String fieldName) {
3376
        _thriftId = thriftId;
3377
        _fieldName = fieldName;
3378
      }
3379
 
3380
      public short getThriftFieldId() {
3381
        return _thriftId;
3382
      }
3383
 
3384
      public String getFieldName() {
3385
        return _fieldName;
3386
      }
3387
    }
3388
 
3389
    // isset id assignments
3390
 
3391
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3392
    static {
3393
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3394
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3395
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3396
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3397
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
3398
    }
3399
 
3400
    public isGiftVoucher_args() {
3401
    }
3402
 
3403
    public isGiftVoucher_args(
3404
      String couponCode)
3405
    {
3406
      this();
3407
      this.couponCode = couponCode;
3408
    }
3409
 
3410
    /**
3411
     * Performs a deep copy on <i>other</i>.
3412
     */
3413
    public isGiftVoucher_args(isGiftVoucher_args other) {
3414
      if (other.isSetCouponCode()) {
3415
        this.couponCode = other.couponCode;
3416
      }
3417
    }
3418
 
3419
    public isGiftVoucher_args deepCopy() {
3420
      return new isGiftVoucher_args(this);
3421
    }
3422
 
3423
    @Override
3424
    public void clear() {
3425
      this.couponCode = null;
3426
    }
3427
 
3428
    public String getCouponCode() {
3429
      return this.couponCode;
3430
    }
3431
 
3432
    public void setCouponCode(String couponCode) {
3433
      this.couponCode = couponCode;
3434
    }
3435
 
3436
    public void unsetCouponCode() {
3437
      this.couponCode = null;
3438
    }
3439
 
3440
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3441
    public boolean isSetCouponCode() {
3442
      return this.couponCode != null;
3443
    }
3444
 
3445
    public void setCouponCodeIsSet(boolean value) {
3446
      if (!value) {
3447
        this.couponCode = null;
3448
      }
3449
    }
3450
 
3451
    public void setFieldValue(_Fields field, Object value) {
3452
      switch (field) {
3453
      case COUPON_CODE:
3454
        if (value == null) {
3455
          unsetCouponCode();
3456
        } else {
3457
          setCouponCode((String)value);
3458
        }
3459
        break;
3460
 
3461
      }
3462
    }
3463
 
3464
    public Object getFieldValue(_Fields field) {
3465
      switch (field) {
3466
      case COUPON_CODE:
3467
        return getCouponCode();
3468
 
3469
      }
3470
      throw new IllegalStateException();
3471
    }
3472
 
3473
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3474
    public boolean isSet(_Fields field) {
3475
      if (field == null) {
3476
        throw new IllegalArgumentException();
3477
      }
3478
 
3479
      switch (field) {
3480
      case COUPON_CODE:
3481
        return isSetCouponCode();
3482
      }
3483
      throw new IllegalStateException();
3484
    }
3485
 
3486
    @Override
3487
    public boolean equals(Object that) {
3488
      if (that == null)
3489
        return false;
3490
      if (that instanceof isGiftVoucher_args)
3491
        return this.equals((isGiftVoucher_args)that);
3492
      return false;
3493
    }
3494
 
3495
    public boolean equals(isGiftVoucher_args that) {
3496
      if (that == null)
3497
        return false;
3498
 
3499
      boolean this_present_couponCode = true && this.isSetCouponCode();
3500
      boolean that_present_couponCode = true && that.isSetCouponCode();
3501
      if (this_present_couponCode || that_present_couponCode) {
3502
        if (!(this_present_couponCode && that_present_couponCode))
3503
          return false;
3504
        if (!this.couponCode.equals(that.couponCode))
3505
          return false;
3506
      }
3507
 
3508
      return true;
3509
    }
3510
 
3511
    @Override
3512
    public int hashCode() {
3513
      return 0;
3514
    }
3515
 
3516
    public int compareTo(isGiftVoucher_args other) {
3517
      if (!getClass().equals(other.getClass())) {
3518
        return getClass().getName().compareTo(other.getClass().getName());
3519
      }
3520
 
3521
      int lastComparison = 0;
3522
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
3523
 
3524
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3525
      if (lastComparison != 0) {
3526
        return lastComparison;
3527
      }
3528
      if (isSetCouponCode()) {
3529
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3530
        if (lastComparison != 0) {
3531
          return lastComparison;
3532
        }
3533
      }
3534
      return 0;
3535
    }
3536
 
3537
    public _Fields fieldForId(int fieldId) {
3538
      return _Fields.findByThriftId(fieldId);
3539
    }
3540
 
3541
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3542
      org.apache.thrift.protocol.TField field;
3543
      iprot.readStructBegin();
3544
      while (true)
3545
      {
3546
        field = iprot.readFieldBegin();
3547
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3548
          break;
3549
        }
3550
        switch (field.id) {
3551
          case 1: // COUPON_CODE
3552
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3553
              this.couponCode = iprot.readString();
3554
            } else { 
3555
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3556
            }
3557
            break;
3558
          default:
3559
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3560
        }
3561
        iprot.readFieldEnd();
3562
      }
3563
      iprot.readStructEnd();
3564
      validate();
3565
    }
3566
 
3567
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3568
      validate();
3569
 
3570
      oprot.writeStructBegin(STRUCT_DESC);
3571
      if (this.couponCode != null) {
3572
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3573
        oprot.writeString(this.couponCode);
3574
        oprot.writeFieldEnd();
3575
      }
3576
      oprot.writeFieldStop();
3577
      oprot.writeStructEnd();
3578
    }
3579
 
3580
    @Override
3581
    public String toString() {
3582
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
3583
      boolean first = true;
3584
 
3585
      sb.append("couponCode:");
3586
      if (this.couponCode == null) {
3587
        sb.append("null");
3588
      } else {
3589
        sb.append(this.couponCode);
3590
      }
3591
      first = false;
3592
      sb.append(")");
3593
      return sb.toString();
3594
    }
3595
 
3596
    public void validate() throws org.apache.thrift.TException {
3597
      // check for required fields
3598
    }
3599
 
3600
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3601
      try {
3602
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3603
      } catch (org.apache.thrift.TException te) {
3604
        throw new java.io.IOException(te);
3605
      }
3606
    }
3607
 
3608
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3609
      try {
3610
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3611
      } catch (org.apache.thrift.TException te) {
3612
        throw new java.io.IOException(te);
3613
      }
3614
    }
3615
 
3616
  }
3617
 
3618
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
3619
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
3620
 
3621
    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);
3622
    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);
3623
 
3624
    private boolean success; // required
3625
    private PromotionException pex; // required
3626
 
3627
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3628
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3629
      SUCCESS((short)0, "success"),
3630
      PEX((short)1, "pex");
3631
 
3632
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3633
 
3634
      static {
3635
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3636
          byName.put(field.getFieldName(), field);
3637
        }
3638
      }
3639
 
3640
      /**
3641
       * Find the _Fields constant that matches fieldId, or null if its not found.
3642
       */
3643
      public static _Fields findByThriftId(int fieldId) {
3644
        switch(fieldId) {
3645
          case 0: // SUCCESS
3646
            return SUCCESS;
3647
          case 1: // PEX
3648
            return PEX;
3649
          default:
3650
            return null;
3651
        }
3652
      }
3653
 
3654
      /**
3655
       * Find the _Fields constant that matches fieldId, throwing an exception
3656
       * if it is not found.
3657
       */
3658
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3659
        _Fields fields = findByThriftId(fieldId);
3660
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3661
        return fields;
3662
      }
3663
 
3664
      /**
3665
       * Find the _Fields constant that matches name, or null if its not found.
3666
       */
3667
      public static _Fields findByName(String name) {
3668
        return byName.get(name);
3669
      }
3670
 
3671
      private final short _thriftId;
3672
      private final String _fieldName;
3673
 
3674
      _Fields(short thriftId, String fieldName) {
3675
        _thriftId = thriftId;
3676
        _fieldName = fieldName;
3677
      }
3678
 
3679
      public short getThriftFieldId() {
3680
        return _thriftId;
3681
      }
3682
 
3683
      public String getFieldName() {
3684
        return _fieldName;
3685
      }
3686
    }
3687
 
3688
    // isset id assignments
3689
    private static final int __SUCCESS_ISSET_ID = 0;
3690
    private BitSet __isset_bit_vector = new BitSet(1);
3691
 
3692
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3693
    static {
3694
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3695
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3696
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
3697
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3698
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3699
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3700
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
3701
    }
3702
 
3703
    public isGiftVoucher_result() {
3704
    }
3705
 
3706
    public isGiftVoucher_result(
3707
      boolean success,
3708
      PromotionException pex)
3709
    {
3710
      this();
3711
      this.success = success;
3712
      setSuccessIsSet(true);
3713
      this.pex = pex;
3714
    }
3715
 
3716
    /**
3717
     * Performs a deep copy on <i>other</i>.
3718
     */
3719
    public isGiftVoucher_result(isGiftVoucher_result other) {
3720
      __isset_bit_vector.clear();
3721
      __isset_bit_vector.or(other.__isset_bit_vector);
3722
      this.success = other.success;
3723
      if (other.isSetPex()) {
3724
        this.pex = new PromotionException(other.pex);
3725
      }
3726
    }
3727
 
3728
    public isGiftVoucher_result deepCopy() {
3729
      return new isGiftVoucher_result(this);
3730
    }
3731
 
3732
    @Override
3733
    public void clear() {
3734
      setSuccessIsSet(false);
3735
      this.success = false;
3736
      this.pex = null;
3737
    }
3738
 
3739
    public boolean isSuccess() {
3740
      return this.success;
3741
    }
3742
 
3743
    public void setSuccess(boolean success) {
3744
      this.success = success;
3745
      setSuccessIsSet(true);
3746
    }
3747
 
3748
    public void unsetSuccess() {
3749
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3750
    }
3751
 
3752
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3753
    public boolean isSetSuccess() {
3754
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3755
    }
3756
 
3757
    public void setSuccessIsSet(boolean value) {
3758
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3759
    }
3760
 
3761
    public PromotionException getPex() {
3762
      return this.pex;
3763
    }
3764
 
3765
    public void setPex(PromotionException pex) {
3766
      this.pex = pex;
3767
    }
3768
 
3769
    public void unsetPex() {
3770
      this.pex = null;
3771
    }
3772
 
3773
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3774
    public boolean isSetPex() {
3775
      return this.pex != null;
3776
    }
3777
 
3778
    public void setPexIsSet(boolean value) {
3779
      if (!value) {
3780
        this.pex = null;
3781
      }
3782
    }
3783
 
3784
    public void setFieldValue(_Fields field, Object value) {
3785
      switch (field) {
3786
      case SUCCESS:
3787
        if (value == null) {
3788
          unsetSuccess();
3789
        } else {
3790
          setSuccess((Boolean)value);
3791
        }
3792
        break;
3793
 
3794
      case PEX:
3795
        if (value == null) {
3796
          unsetPex();
3797
        } else {
3798
          setPex((PromotionException)value);
3799
        }
3800
        break;
3801
 
3802
      }
3803
    }
3804
 
3805
    public Object getFieldValue(_Fields field) {
3806
      switch (field) {
3807
      case SUCCESS:
3808
        return Boolean.valueOf(isSuccess());
3809
 
3810
      case PEX:
3811
        return getPex();
3812
 
3813
      }
3814
      throw new IllegalStateException();
3815
    }
3816
 
3817
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3818
    public boolean isSet(_Fields field) {
3819
      if (field == null) {
3820
        throw new IllegalArgumentException();
3821
      }
3822
 
3823
      switch (field) {
3824
      case SUCCESS:
3825
        return isSetSuccess();
3826
      case PEX:
3827
        return isSetPex();
3828
      }
3829
      throw new IllegalStateException();
3830
    }
3831
 
3832
    @Override
3833
    public boolean equals(Object that) {
3834
      if (that == null)
3835
        return false;
3836
      if (that instanceof isGiftVoucher_result)
3837
        return this.equals((isGiftVoucher_result)that);
3838
      return false;
3839
    }
3840
 
3841
    public boolean equals(isGiftVoucher_result that) {
3842
      if (that == null)
3843
        return false;
3844
 
3845
      boolean this_present_success = true;
3846
      boolean that_present_success = true;
3847
      if (this_present_success || that_present_success) {
3848
        if (!(this_present_success && that_present_success))
3849
          return false;
3850
        if (this.success != that.success)
3851
          return false;
3852
      }
3853
 
3854
      boolean this_present_pex = true && this.isSetPex();
3855
      boolean that_present_pex = true && that.isSetPex();
3856
      if (this_present_pex || that_present_pex) {
3857
        if (!(this_present_pex && that_present_pex))
3858
          return false;
3859
        if (!this.pex.equals(that.pex))
3860
          return false;
3861
      }
3862
 
3863
      return true;
3864
    }
3865
 
3866
    @Override
3867
    public int hashCode() {
3868
      return 0;
3869
    }
3870
 
3871
    public int compareTo(isGiftVoucher_result other) {
3872
      if (!getClass().equals(other.getClass())) {
3873
        return getClass().getName().compareTo(other.getClass().getName());
3874
      }
3875
 
3876
      int lastComparison = 0;
3877
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
3878
 
3879
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3880
      if (lastComparison != 0) {
3881
        return lastComparison;
3882
      }
3883
      if (isSetSuccess()) {
3884
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3885
        if (lastComparison != 0) {
3886
          return lastComparison;
3887
        }
3888
      }
3889
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3890
      if (lastComparison != 0) {
3891
        return lastComparison;
3892
      }
3893
      if (isSetPex()) {
3894
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3895
        if (lastComparison != 0) {
3896
          return lastComparison;
3897
        }
3898
      }
3899
      return 0;
3900
    }
3901
 
3902
    public _Fields fieldForId(int fieldId) {
3903
      return _Fields.findByThriftId(fieldId);
3904
    }
3905
 
3906
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3907
      org.apache.thrift.protocol.TField field;
3908
      iprot.readStructBegin();
3909
      while (true)
3910
      {
3911
        field = iprot.readFieldBegin();
3912
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3913
          break;
3914
        }
3915
        switch (field.id) {
3916
          case 0: // SUCCESS
3917
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
3918
              this.success = iprot.readBool();
3919
              setSuccessIsSet(true);
3920
            } else { 
3921
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3922
            }
3923
            break;
3924
          case 1: // PEX
3925
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3926
              this.pex = new PromotionException();
3927
              this.pex.read(iprot);
3928
            } else { 
3929
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3930
            }
3931
            break;
3932
          default:
3933
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3934
        }
3935
        iprot.readFieldEnd();
3936
      }
3937
      iprot.readStructEnd();
3938
      validate();
3939
    }
3940
 
3941
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3942
      oprot.writeStructBegin(STRUCT_DESC);
3943
 
3944
      if (this.isSetSuccess()) {
3945
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3946
        oprot.writeBool(this.success);
3947
        oprot.writeFieldEnd();
3948
      } else if (this.isSetPex()) {
3949
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3950
        this.pex.write(oprot);
3951
        oprot.writeFieldEnd();
3952
      }
3953
      oprot.writeFieldStop();
3954
      oprot.writeStructEnd();
3955
    }
3956
 
3957
    @Override
3958
    public String toString() {
3959
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
3960
      boolean first = true;
3961
 
3962
      sb.append("success:");
3963
      sb.append(this.success);
3964
      first = false;
3965
      if (!first) sb.append(", ");
3966
      sb.append("pex:");
3967
      if (this.pex == null) {
3968
        sb.append("null");
3969
      } else {
3970
        sb.append(this.pex);
3971
      }
3972
      first = false;
3973
      sb.append(")");
3974
      return sb.toString();
3975
    }
3976
 
3977
    public void validate() throws org.apache.thrift.TException {
3978
      // check for required fields
3979
    }
3980
 
3981
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3982
      try {
3983
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3984
      } catch (org.apache.thrift.TException te) {
3985
        throw new java.io.IOException(te);
3986
      }
3987
    }
3988
 
3989
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3990
      try {
3991
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3992
      } catch (org.apache.thrift.TException te) {
3993
        throw new java.io.IOException(te);
3994
      }
3995
    }
3996
 
3997
  }
3998
 
6356 amit.gupta 3999
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
4000
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
4001
 
4002
    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);
4003
 
4004
    private String couponCode; // required
4005
 
4006
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4007
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4008
      COUPON_CODE((short)1, "couponCode");
4009
 
4010
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4011
 
4012
      static {
4013
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4014
          byName.put(field.getFieldName(), field);
4015
        }
4016
      }
4017
 
4018
      /**
4019
       * Find the _Fields constant that matches fieldId, or null if its not found.
4020
       */
4021
      public static _Fields findByThriftId(int fieldId) {
4022
        switch(fieldId) {
4023
          case 1: // COUPON_CODE
4024
            return COUPON_CODE;
4025
          default:
4026
            return null;
4027
        }
4028
      }
4029
 
4030
      /**
4031
       * Find the _Fields constant that matches fieldId, throwing an exception
4032
       * if it is not found.
4033
       */
4034
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4035
        _Fields fields = findByThriftId(fieldId);
4036
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4037
        return fields;
4038
      }
4039
 
4040
      /**
4041
       * Find the _Fields constant that matches name, or null if its not found.
4042
       */
4043
      public static _Fields findByName(String name) {
4044
        return byName.get(name);
4045
      }
4046
 
4047
      private final short _thriftId;
4048
      private final String _fieldName;
4049
 
4050
      _Fields(short thriftId, String fieldName) {
4051
        _thriftId = thriftId;
4052
        _fieldName = fieldName;
4053
      }
4054
 
4055
      public short getThriftFieldId() {
4056
        return _thriftId;
4057
      }
4058
 
4059
      public String getFieldName() {
4060
        return _fieldName;
4061
      }
4062
    }
4063
 
4064
    // isset id assignments
4065
 
4066
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4067
    static {
4068
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4069
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4070
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4071
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4072
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
4073
    }
4074
 
4075
    public isCodApplicable_args() {
4076
    }
4077
 
4078
    public isCodApplicable_args(
4079
      String couponCode)
4080
    {
4081
      this();
4082
      this.couponCode = couponCode;
4083
    }
4084
 
4085
    /**
4086
     * Performs a deep copy on <i>other</i>.
4087
     */
4088
    public isCodApplicable_args(isCodApplicable_args other) {
4089
      if (other.isSetCouponCode()) {
4090
        this.couponCode = other.couponCode;
4091
      }
4092
    }
4093
 
4094
    public isCodApplicable_args deepCopy() {
4095
      return new isCodApplicable_args(this);
4096
    }
4097
 
4098
    @Override
4099
    public void clear() {
4100
      this.couponCode = null;
4101
    }
4102
 
4103
    public String getCouponCode() {
4104
      return this.couponCode;
4105
    }
4106
 
4107
    public void setCouponCode(String couponCode) {
4108
      this.couponCode = couponCode;
4109
    }
4110
 
4111
    public void unsetCouponCode() {
4112
      this.couponCode = null;
4113
    }
4114
 
4115
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4116
    public boolean isSetCouponCode() {
4117
      return this.couponCode != null;
4118
    }
4119
 
4120
    public void setCouponCodeIsSet(boolean value) {
4121
      if (!value) {
4122
        this.couponCode = null;
4123
      }
4124
    }
4125
 
4126
    public void setFieldValue(_Fields field, Object value) {
4127
      switch (field) {
4128
      case COUPON_CODE:
4129
        if (value == null) {
4130
          unsetCouponCode();
4131
        } else {
4132
          setCouponCode((String)value);
4133
        }
4134
        break;
4135
 
4136
      }
4137
    }
4138
 
4139
    public Object getFieldValue(_Fields field) {
4140
      switch (field) {
4141
      case COUPON_CODE:
4142
        return getCouponCode();
4143
 
4144
      }
4145
      throw new IllegalStateException();
4146
    }
4147
 
4148
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4149
    public boolean isSet(_Fields field) {
4150
      if (field == null) {
4151
        throw new IllegalArgumentException();
4152
      }
4153
 
4154
      switch (field) {
4155
      case COUPON_CODE:
4156
        return isSetCouponCode();
4157
      }
4158
      throw new IllegalStateException();
4159
    }
4160
 
4161
    @Override
4162
    public boolean equals(Object that) {
4163
      if (that == null)
4164
        return false;
4165
      if (that instanceof isCodApplicable_args)
4166
        return this.equals((isCodApplicable_args)that);
4167
      return false;
4168
    }
4169
 
4170
    public boolean equals(isCodApplicable_args that) {
4171
      if (that == null)
4172
        return false;
4173
 
4174
      boolean this_present_couponCode = true && this.isSetCouponCode();
4175
      boolean that_present_couponCode = true && that.isSetCouponCode();
4176
      if (this_present_couponCode || that_present_couponCode) {
4177
        if (!(this_present_couponCode && that_present_couponCode))
4178
          return false;
4179
        if (!this.couponCode.equals(that.couponCode))
4180
          return false;
4181
      }
4182
 
4183
      return true;
4184
    }
4185
 
4186
    @Override
4187
    public int hashCode() {
4188
      return 0;
4189
    }
4190
 
4191
    public int compareTo(isCodApplicable_args other) {
4192
      if (!getClass().equals(other.getClass())) {
4193
        return getClass().getName().compareTo(other.getClass().getName());
4194
      }
4195
 
4196
      int lastComparison = 0;
4197
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
4198
 
4199
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4200
      if (lastComparison != 0) {
4201
        return lastComparison;
4202
      }
4203
      if (isSetCouponCode()) {
4204
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4205
        if (lastComparison != 0) {
4206
          return lastComparison;
4207
        }
4208
      }
4209
      return 0;
4210
    }
4211
 
4212
    public _Fields fieldForId(int fieldId) {
4213
      return _Fields.findByThriftId(fieldId);
4214
    }
4215
 
4216
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4217
      org.apache.thrift.protocol.TField field;
4218
      iprot.readStructBegin();
4219
      while (true)
4220
      {
4221
        field = iprot.readFieldBegin();
4222
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4223
          break;
4224
        }
4225
        switch (field.id) {
4226
          case 1: // COUPON_CODE
4227
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4228
              this.couponCode = iprot.readString();
4229
            } else { 
4230
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4231
            }
4232
            break;
4233
          default:
4234
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4235
        }
4236
        iprot.readFieldEnd();
4237
      }
4238
      iprot.readStructEnd();
4239
      validate();
4240
    }
4241
 
4242
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4243
      validate();
4244
 
4245
      oprot.writeStructBegin(STRUCT_DESC);
4246
      if (this.couponCode != null) {
4247
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4248
        oprot.writeString(this.couponCode);
4249
        oprot.writeFieldEnd();
4250
      }
4251
      oprot.writeFieldStop();
4252
      oprot.writeStructEnd();
4253
    }
4254
 
4255
    @Override
4256
    public String toString() {
4257
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
4258
      boolean first = true;
4259
 
4260
      sb.append("couponCode:");
4261
      if (this.couponCode == null) {
4262
        sb.append("null");
4263
      } else {
4264
        sb.append(this.couponCode);
4265
      }
4266
      first = false;
4267
      sb.append(")");
4268
      return sb.toString();
4269
    }
4270
 
4271
    public void validate() throws org.apache.thrift.TException {
4272
      // check for required fields
4273
    }
4274
 
4275
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4276
      try {
4277
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4278
      } catch (org.apache.thrift.TException te) {
4279
        throw new java.io.IOException(te);
4280
      }
4281
    }
4282
 
4283
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4284
      try {
4285
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4286
      } catch (org.apache.thrift.TException te) {
4287
        throw new java.io.IOException(te);
4288
      }
4289
    }
4290
 
4291
  }
4292
 
4293
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
4294
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
4295
 
4296
    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);
4297
    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);
4298
 
4299
    private boolean success; // required
4300
    private PromotionException pex; // required
4301
 
4302
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4303
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4304
      SUCCESS((short)0, "success"),
4305
      PEX((short)1, "pex");
4306
 
4307
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4308
 
4309
      static {
4310
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4311
          byName.put(field.getFieldName(), field);
4312
        }
4313
      }
4314
 
4315
      /**
4316
       * Find the _Fields constant that matches fieldId, or null if its not found.
4317
       */
4318
      public static _Fields findByThriftId(int fieldId) {
4319
        switch(fieldId) {
4320
          case 0: // SUCCESS
4321
            return SUCCESS;
4322
          case 1: // PEX
4323
            return PEX;
4324
          default:
4325
            return null;
4326
        }
4327
      }
4328
 
4329
      /**
4330
       * Find the _Fields constant that matches fieldId, throwing an exception
4331
       * if it is not found.
4332
       */
4333
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4334
        _Fields fields = findByThriftId(fieldId);
4335
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4336
        return fields;
4337
      }
4338
 
4339
      /**
4340
       * Find the _Fields constant that matches name, or null if its not found.
4341
       */
4342
      public static _Fields findByName(String name) {
4343
        return byName.get(name);
4344
      }
4345
 
4346
      private final short _thriftId;
4347
      private final String _fieldName;
4348
 
4349
      _Fields(short thriftId, String fieldName) {
4350
        _thriftId = thriftId;
4351
        _fieldName = fieldName;
4352
      }
4353
 
4354
      public short getThriftFieldId() {
4355
        return _thriftId;
4356
      }
4357
 
4358
      public String getFieldName() {
4359
        return _fieldName;
4360
      }
4361
    }
4362
 
4363
    // isset id assignments
4364
    private static final int __SUCCESS_ISSET_ID = 0;
4365
    private BitSet __isset_bit_vector = new BitSet(1);
4366
 
4367
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4368
    static {
4369
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4370
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4371
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4372
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4373
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4374
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4375
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
4376
    }
4377
 
4378
    public isCodApplicable_result() {
4379
    }
4380
 
4381
    public isCodApplicable_result(
4382
      boolean success,
4383
      PromotionException pex)
4384
    {
4385
      this();
4386
      this.success = success;
4387
      setSuccessIsSet(true);
4388
      this.pex = pex;
4389
    }
4390
 
4391
    /**
4392
     * Performs a deep copy on <i>other</i>.
4393
     */
4394
    public isCodApplicable_result(isCodApplicable_result other) {
4395
      __isset_bit_vector.clear();
4396
      __isset_bit_vector.or(other.__isset_bit_vector);
4397
      this.success = other.success;
4398
      if (other.isSetPex()) {
4399
        this.pex = new PromotionException(other.pex);
4400
      }
4401
    }
4402
 
4403
    public isCodApplicable_result deepCopy() {
4404
      return new isCodApplicable_result(this);
4405
    }
4406
 
4407
    @Override
4408
    public void clear() {
4409
      setSuccessIsSet(false);
4410
      this.success = false;
4411
      this.pex = null;
4412
    }
4413
 
4414
    public boolean isSuccess() {
4415
      return this.success;
4416
    }
4417
 
4418
    public void setSuccess(boolean success) {
4419
      this.success = success;
4420
      setSuccessIsSet(true);
4421
    }
4422
 
4423
    public void unsetSuccess() {
4424
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4425
    }
4426
 
4427
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4428
    public boolean isSetSuccess() {
4429
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4430
    }
4431
 
4432
    public void setSuccessIsSet(boolean value) {
4433
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4434
    }
4435
 
4436
    public PromotionException getPex() {
4437
      return this.pex;
4438
    }
4439
 
4440
    public void setPex(PromotionException pex) {
4441
      this.pex = pex;
4442
    }
4443
 
4444
    public void unsetPex() {
4445
      this.pex = null;
4446
    }
4447
 
4448
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4449
    public boolean isSetPex() {
4450
      return this.pex != null;
4451
    }
4452
 
4453
    public void setPexIsSet(boolean value) {
4454
      if (!value) {
4455
        this.pex = null;
4456
      }
4457
    }
4458
 
4459
    public void setFieldValue(_Fields field, Object value) {
4460
      switch (field) {
4461
      case SUCCESS:
4462
        if (value == null) {
4463
          unsetSuccess();
4464
        } else {
4465
          setSuccess((Boolean)value);
4466
        }
4467
        break;
4468
 
4469
      case PEX:
4470
        if (value == null) {
4471
          unsetPex();
4472
        } else {
4473
          setPex((PromotionException)value);
4474
        }
4475
        break;
4476
 
4477
      }
4478
    }
4479
 
4480
    public Object getFieldValue(_Fields field) {
4481
      switch (field) {
4482
      case SUCCESS:
4483
        return Boolean.valueOf(isSuccess());
4484
 
4485
      case PEX:
4486
        return getPex();
4487
 
4488
      }
4489
      throw new IllegalStateException();
4490
    }
4491
 
4492
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4493
    public boolean isSet(_Fields field) {
4494
      if (field == null) {
4495
        throw new IllegalArgumentException();
4496
      }
4497
 
4498
      switch (field) {
4499
      case SUCCESS:
4500
        return isSetSuccess();
4501
      case PEX:
4502
        return isSetPex();
4503
      }
4504
      throw new IllegalStateException();
4505
    }
4506
 
4507
    @Override
4508
    public boolean equals(Object that) {
4509
      if (that == null)
4510
        return false;
4511
      if (that instanceof isCodApplicable_result)
4512
        return this.equals((isCodApplicable_result)that);
4513
      return false;
4514
    }
4515
 
4516
    public boolean equals(isCodApplicable_result that) {
4517
      if (that == null)
4518
        return false;
4519
 
4520
      boolean this_present_success = true;
4521
      boolean that_present_success = true;
4522
      if (this_present_success || that_present_success) {
4523
        if (!(this_present_success && that_present_success))
4524
          return false;
4525
        if (this.success != that.success)
4526
          return false;
4527
      }
4528
 
4529
      boolean this_present_pex = true && this.isSetPex();
4530
      boolean that_present_pex = true && that.isSetPex();
4531
      if (this_present_pex || that_present_pex) {
4532
        if (!(this_present_pex && that_present_pex))
4533
          return false;
4534
        if (!this.pex.equals(that.pex))
4535
          return false;
4536
      }
4537
 
4538
      return true;
4539
    }
4540
 
4541
    @Override
4542
    public int hashCode() {
4543
      return 0;
4544
    }
4545
 
4546
    public int compareTo(isCodApplicable_result other) {
4547
      if (!getClass().equals(other.getClass())) {
4548
        return getClass().getName().compareTo(other.getClass().getName());
4549
      }
4550
 
4551
      int lastComparison = 0;
4552
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
4553
 
4554
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4555
      if (lastComparison != 0) {
4556
        return lastComparison;
4557
      }
4558
      if (isSetSuccess()) {
4559
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4560
        if (lastComparison != 0) {
4561
          return lastComparison;
4562
        }
4563
      }
4564
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4565
      if (lastComparison != 0) {
4566
        return lastComparison;
4567
      }
4568
      if (isSetPex()) {
4569
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4570
        if (lastComparison != 0) {
4571
          return lastComparison;
4572
        }
4573
      }
4574
      return 0;
4575
    }
4576
 
4577
    public _Fields fieldForId(int fieldId) {
4578
      return _Fields.findByThriftId(fieldId);
4579
    }
4580
 
4581
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4582
      org.apache.thrift.protocol.TField field;
4583
      iprot.readStructBegin();
4584
      while (true)
4585
      {
4586
        field = iprot.readFieldBegin();
4587
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4588
          break;
4589
        }
4590
        switch (field.id) {
4591
          case 0: // SUCCESS
4592
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4593
              this.success = iprot.readBool();
4594
              setSuccessIsSet(true);
4595
            } else { 
4596
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4597
            }
4598
            break;
4599
          case 1: // PEX
4600
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4601
              this.pex = new PromotionException();
4602
              this.pex.read(iprot);
4603
            } else { 
4604
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4605
            }
4606
            break;
4607
          default:
4608
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4609
        }
4610
        iprot.readFieldEnd();
4611
      }
4612
      iprot.readStructEnd();
4613
      validate();
4614
    }
4615
 
4616
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4617
      oprot.writeStructBegin(STRUCT_DESC);
4618
 
4619
      if (this.isSetSuccess()) {
4620
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4621
        oprot.writeBool(this.success);
4622
        oprot.writeFieldEnd();
4623
      } else if (this.isSetPex()) {
4624
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4625
        this.pex.write(oprot);
4626
        oprot.writeFieldEnd();
4627
      }
4628
      oprot.writeFieldStop();
4629
      oprot.writeStructEnd();
4630
    }
4631
 
4632
    @Override
4633
    public String toString() {
4634
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
4635
      boolean first = true;
4636
 
4637
      sb.append("success:");
4638
      sb.append(this.success);
4639
      first = false;
4640
      if (!first) sb.append(", ");
4641
      sb.append("pex:");
4642
      if (this.pex == null) {
4643
        sb.append("null");
4644
      } else {
4645
        sb.append(this.pex);
4646
      }
4647
      first = false;
4648
      sb.append(")");
4649
      return sb.toString();
4650
    }
4651
 
4652
    public void validate() throws org.apache.thrift.TException {
4653
      // check for required fields
4654
    }
4655
 
4656
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4657
      try {
4658
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4659
      } catch (org.apache.thrift.TException te) {
4660
        throw new java.io.IOException(te);
4661
      }
4662
    }
4663
 
4664
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4665
      try {
4666
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4667
      } catch (org.apache.thrift.TException te) {
4668
        throw new java.io.IOException(te);
4669
      }
4670
    }
4671
 
4672
  }
4673
 
3430 rajveer 4674
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
4675
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 4676
 
4677
 
4678
 
4679
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4680
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4681
;
4682
 
4683
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4684
 
4685
      static {
4686
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4687
          byName.put(field.getFieldName(), field);
4688
        }
4689
      }
4690
 
4691
      /**
4692
       * Find the _Fields constant that matches fieldId, or null if its not found.
4693
       */
4694
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4695
        switch(fieldId) {
4696
          default:
4697
            return null;
4698
        }
1982 varun.gupt 4699
      }
4700
 
4701
      /**
4702
       * Find the _Fields constant that matches fieldId, throwing an exception
4703
       * if it is not found.
4704
       */
4705
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4706
        _Fields fields = findByThriftId(fieldId);
4707
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4708
        return fields;
4709
      }
4710
 
4711
      /**
4712
       * Find the _Fields constant that matches name, or null if its not found.
4713
       */
4714
      public static _Fields findByName(String name) {
4715
        return byName.get(name);
4716
      }
4717
 
4718
      private final short _thriftId;
4719
      private final String _fieldName;
4720
 
4721
      _Fields(short thriftId, String fieldName) {
4722
        _thriftId = thriftId;
4723
        _fieldName = fieldName;
4724
      }
4725
 
4726
      public short getThriftFieldId() {
4727
        return _thriftId;
4728
      }
4729
 
4730
      public String getFieldName() {
4731
        return _fieldName;
4732
      }
4733
    }
3430 rajveer 4734
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4735
    static {
3430 rajveer 4736
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4737
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4738
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 4739
    }
4740
 
4741
    public getAllPromotions_args() {
4742
    }
4743
 
4744
    /**
4745
     * Performs a deep copy on <i>other</i>.
4746
     */
4747
    public getAllPromotions_args(getAllPromotions_args other) {
4748
    }
4749
 
4750
    public getAllPromotions_args deepCopy() {
4751
      return new getAllPromotions_args(this);
4752
    }
4753
 
3430 rajveer 4754
    @Override
4755
    public void clear() {
1982 varun.gupt 4756
    }
4757
 
4758
    public void setFieldValue(_Fields field, Object value) {
4759
      switch (field) {
4760
      }
4761
    }
4762
 
4763
    public Object getFieldValue(_Fields field) {
4764
      switch (field) {
4765
      }
4766
      throw new IllegalStateException();
4767
    }
4768
 
3430 rajveer 4769
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4770
    public boolean isSet(_Fields field) {
4771
      if (field == null) {
4772
        throw new IllegalArgumentException();
4773
      }
1982 varun.gupt 4774
 
4775
      switch (field) {
4776
      }
4777
      throw new IllegalStateException();
4778
    }
4779
 
4780
    @Override
4781
    public boolean equals(Object that) {
4782
      if (that == null)
4783
        return false;
4784
      if (that instanceof getAllPromotions_args)
4785
        return this.equals((getAllPromotions_args)that);
4786
      return false;
4787
    }
4788
 
4789
    public boolean equals(getAllPromotions_args that) {
4790
      if (that == null)
4791
        return false;
4792
 
4793
      return true;
4794
    }
4795
 
4796
    @Override
4797
    public int hashCode() {
4798
      return 0;
4799
    }
4800
 
4801
    public int compareTo(getAllPromotions_args other) {
4802
      if (!getClass().equals(other.getClass())) {
4803
        return getClass().getName().compareTo(other.getClass().getName());
4804
      }
4805
 
4806
      int lastComparison = 0;
4807
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
4808
 
4809
      return 0;
4810
    }
4811
 
3430 rajveer 4812
    public _Fields fieldForId(int fieldId) {
4813
      return _Fields.findByThriftId(fieldId);
4814
    }
4815
 
4816
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4817
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4818
      iprot.readStructBegin();
4819
      while (true)
4820
      {
4821
        field = iprot.readFieldBegin();
3430 rajveer 4822
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4823
          break;
4824
        }
3430 rajveer 4825
        switch (field.id) {
4826
          default:
4827
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4828
        }
3430 rajveer 4829
        iprot.readFieldEnd();
1982 varun.gupt 4830
      }
4831
      iprot.readStructEnd();
4832
      validate();
4833
    }
4834
 
3430 rajveer 4835
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4836
      validate();
4837
 
4838
      oprot.writeStructBegin(STRUCT_DESC);
4839
      oprot.writeFieldStop();
4840
      oprot.writeStructEnd();
4841
    }
4842
 
4843
    @Override
4844
    public String toString() {
4845
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
4846
      boolean first = true;
4847
 
4848
      sb.append(")");
4849
      return sb.toString();
4850
    }
4851
 
3430 rajveer 4852
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4853
      // check for required fields
4854
    }
4855
 
3430 rajveer 4856
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4857
      try {
4858
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4859
      } catch (org.apache.thrift.TException te) {
4860
        throw new java.io.IOException(te);
4861
      }
4862
    }
4863
 
4864
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4865
      try {
4866
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4867
      } catch (org.apache.thrift.TException te) {
4868
        throw new java.io.IOException(te);
4869
      }
4870
    }
4871
 
1982 varun.gupt 4872
  }
4873
 
3430 rajveer 4874
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
4875
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 4876
 
3430 rajveer 4877
    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);
4878
    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 4879
 
3430 rajveer 4880
    private List<Promotion> success; // required
4881
    private PromotionException pex; // required
1982 varun.gupt 4882
 
4883
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4884
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4885
      SUCCESS((short)0, "success"),
4886
      PEX((short)1, "pex");
4887
 
4888
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4889
 
4890
      static {
4891
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4892
          byName.put(field.getFieldName(), field);
4893
        }
4894
      }
4895
 
4896
      /**
4897
       * Find the _Fields constant that matches fieldId, or null if its not found.
4898
       */
4899
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4900
        switch(fieldId) {
4901
          case 0: // SUCCESS
4902
            return SUCCESS;
4903
          case 1: // PEX
4904
            return PEX;
4905
          default:
4906
            return null;
4907
        }
1982 varun.gupt 4908
      }
4909
 
4910
      /**
4911
       * Find the _Fields constant that matches fieldId, throwing an exception
4912
       * if it is not found.
4913
       */
4914
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4915
        _Fields fields = findByThriftId(fieldId);
4916
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4917
        return fields;
4918
      }
4919
 
4920
      /**
4921
       * Find the _Fields constant that matches name, or null if its not found.
4922
       */
4923
      public static _Fields findByName(String name) {
4924
        return byName.get(name);
4925
      }
4926
 
4927
      private final short _thriftId;
4928
      private final String _fieldName;
4929
 
4930
      _Fields(short thriftId, String fieldName) {
4931
        _thriftId = thriftId;
4932
        _fieldName = fieldName;
4933
      }
4934
 
4935
      public short getThriftFieldId() {
4936
        return _thriftId;
4937
      }
4938
 
4939
      public String getFieldName() {
4940
        return _fieldName;
4941
      }
4942
    }
4943
 
4944
    // isset id assignments
4945
 
3430 rajveer 4946
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4947
    static {
3430 rajveer 4948
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4949
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4950
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
4951
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
4952
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4953
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4954
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4955
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 4956
    }
4957
 
4958
    public getAllPromotions_result() {
4959
    }
4960
 
4961
    public getAllPromotions_result(
4962
      List<Promotion> success,
4963
      PromotionException pex)
4964
    {
4965
      this();
4966
      this.success = success;
4967
      this.pex = pex;
4968
    }
4969
 
4970
    /**
4971
     * Performs a deep copy on <i>other</i>.
4972
     */
4973
    public getAllPromotions_result(getAllPromotions_result other) {
4974
      if (other.isSetSuccess()) {
4975
        List<Promotion> __this__success = new ArrayList<Promotion>();
4976
        for (Promotion other_element : other.success) {
4977
          __this__success.add(new Promotion(other_element));
4978
        }
4979
        this.success = __this__success;
4980
      }
4981
      if (other.isSetPex()) {
4982
        this.pex = new PromotionException(other.pex);
4983
      }
4984
    }
4985
 
4986
    public getAllPromotions_result deepCopy() {
4987
      return new getAllPromotions_result(this);
4988
    }
4989
 
3430 rajveer 4990
    @Override
4991
    public void clear() {
4992
      this.success = null;
4993
      this.pex = null;
1982 varun.gupt 4994
    }
4995
 
4996
    public int getSuccessSize() {
4997
      return (this.success == null) ? 0 : this.success.size();
4998
    }
4999
 
5000
    public java.util.Iterator<Promotion> getSuccessIterator() {
5001
      return (this.success == null) ? null : this.success.iterator();
5002
    }
5003
 
5004
    public void addToSuccess(Promotion elem) {
5005
      if (this.success == null) {
5006
        this.success = new ArrayList<Promotion>();
5007
      }
5008
      this.success.add(elem);
5009
    }
5010
 
5011
    public List<Promotion> getSuccess() {
5012
      return this.success;
5013
    }
5014
 
3430 rajveer 5015
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 5016
      this.success = success;
5017
    }
5018
 
5019
    public void unsetSuccess() {
5020
      this.success = null;
5021
    }
5022
 
3430 rajveer 5023
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5024
    public boolean isSetSuccess() {
5025
      return this.success != null;
5026
    }
5027
 
5028
    public void setSuccessIsSet(boolean value) {
5029
      if (!value) {
5030
        this.success = null;
5031
      }
5032
    }
5033
 
5034
    public PromotionException getPex() {
5035
      return this.pex;
5036
    }
5037
 
3430 rajveer 5038
    public void setPex(PromotionException pex) {
1982 varun.gupt 5039
      this.pex = pex;
5040
    }
5041
 
5042
    public void unsetPex() {
5043
      this.pex = null;
5044
    }
5045
 
3430 rajveer 5046
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5047
    public boolean isSetPex() {
5048
      return this.pex != null;
5049
    }
5050
 
5051
    public void setPexIsSet(boolean value) {
5052
      if (!value) {
5053
        this.pex = null;
5054
      }
5055
    }
5056
 
5057
    public void setFieldValue(_Fields field, Object value) {
5058
      switch (field) {
5059
      case SUCCESS:
5060
        if (value == null) {
5061
          unsetSuccess();
5062
        } else {
5063
          setSuccess((List<Promotion>)value);
5064
        }
5065
        break;
5066
 
5067
      case PEX:
5068
        if (value == null) {
5069
          unsetPex();
5070
        } else {
5071
          setPex((PromotionException)value);
5072
        }
5073
        break;
5074
 
5075
      }
5076
    }
5077
 
5078
    public Object getFieldValue(_Fields field) {
5079
      switch (field) {
5080
      case SUCCESS:
5081
        return getSuccess();
5082
 
5083
      case PEX:
5084
        return getPex();
5085
 
5086
      }
5087
      throw new IllegalStateException();
5088
    }
5089
 
3430 rajveer 5090
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5091
    public boolean isSet(_Fields field) {
5092
      if (field == null) {
5093
        throw new IllegalArgumentException();
5094
      }
1982 varun.gupt 5095
 
5096
      switch (field) {
5097
      case SUCCESS:
5098
        return isSetSuccess();
5099
      case PEX:
5100
        return isSetPex();
5101
      }
5102
      throw new IllegalStateException();
5103
    }
5104
 
5105
    @Override
5106
    public boolean equals(Object that) {
5107
      if (that == null)
5108
        return false;
5109
      if (that instanceof getAllPromotions_result)
5110
        return this.equals((getAllPromotions_result)that);
5111
      return false;
5112
    }
5113
 
5114
    public boolean equals(getAllPromotions_result that) {
5115
      if (that == null)
5116
        return false;
5117
 
5118
      boolean this_present_success = true && this.isSetSuccess();
5119
      boolean that_present_success = true && that.isSetSuccess();
5120
      if (this_present_success || that_present_success) {
5121
        if (!(this_present_success && that_present_success))
5122
          return false;
5123
        if (!this.success.equals(that.success))
5124
          return false;
5125
      }
5126
 
5127
      boolean this_present_pex = true && this.isSetPex();
5128
      boolean that_present_pex = true && that.isSetPex();
5129
      if (this_present_pex || that_present_pex) {
5130
        if (!(this_present_pex && that_present_pex))
5131
          return false;
5132
        if (!this.pex.equals(that.pex))
5133
          return false;
5134
      }
5135
 
5136
      return true;
5137
    }
5138
 
5139
    @Override
5140
    public int hashCode() {
5141
      return 0;
5142
    }
5143
 
5144
    public int compareTo(getAllPromotions_result other) {
5145
      if (!getClass().equals(other.getClass())) {
5146
        return getClass().getName().compareTo(other.getClass().getName());
5147
      }
5148
 
5149
      int lastComparison = 0;
5150
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
5151
 
3430 rajveer 5152
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5153
      if (lastComparison != 0) {
5154
        return lastComparison;
5155
      }
3430 rajveer 5156
      if (isSetSuccess()) {
5157
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5158
        if (lastComparison != 0) {
5159
          return lastComparison;
5160
        }
1982 varun.gupt 5161
      }
3430 rajveer 5162
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5163
      if (lastComparison != 0) {
5164
        return lastComparison;
5165
      }
3430 rajveer 5166
      if (isSetPex()) {
5167
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5168
        if (lastComparison != 0) {
5169
          return lastComparison;
5170
        }
1982 varun.gupt 5171
      }
5172
      return 0;
5173
    }
5174
 
3430 rajveer 5175
    public _Fields fieldForId(int fieldId) {
5176
      return _Fields.findByThriftId(fieldId);
5177
    }
5178
 
5179
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5180
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5181
      iprot.readStructBegin();
5182
      while (true)
5183
      {
5184
        field = iprot.readFieldBegin();
3430 rajveer 5185
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5186
          break;
5187
        }
3430 rajveer 5188
        switch (field.id) {
5189
          case 0: // SUCCESS
5190
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
5191
              {
5327 rajveer 5192
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
5193
                this.success = new ArrayList<Promotion>(_list12.size);
5194
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 5195
                {
5327 rajveer 5196
                  Promotion _elem14; // required
5197
                  _elem14 = new Promotion();
5198
                  _elem14.read(iprot);
5199
                  this.success.add(_elem14);
1982 varun.gupt 5200
                }
3430 rajveer 5201
                iprot.readListEnd();
1982 varun.gupt 5202
              }
3430 rajveer 5203
            } else { 
5204
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5205
            }
5206
            break;
5207
          case 1: // PEX
5208
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5209
              this.pex = new PromotionException();
5210
              this.pex.read(iprot);
5211
            } else { 
5212
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5213
            }
5214
            break;
5215
          default:
5216
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5217
        }
3430 rajveer 5218
        iprot.readFieldEnd();
1982 varun.gupt 5219
      }
5220
      iprot.readStructEnd();
5221
      validate();
5222
    }
5223
 
3430 rajveer 5224
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5225
      oprot.writeStructBegin(STRUCT_DESC);
5226
 
5227
      if (this.isSetSuccess()) {
5228
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5229
        {
3430 rajveer 5230
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 5231
          for (Promotion _iter15 : this.success)
1982 varun.gupt 5232
          {
5327 rajveer 5233
            _iter15.write(oprot);
1982 varun.gupt 5234
          }
5235
          oprot.writeListEnd();
5236
        }
5237
        oprot.writeFieldEnd();
5238
      } else if (this.isSetPex()) {
5239
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5240
        this.pex.write(oprot);
5241
        oprot.writeFieldEnd();
5242
      }
5243
      oprot.writeFieldStop();
5244
      oprot.writeStructEnd();
5245
    }
5246
 
5247
    @Override
5248
    public String toString() {
5249
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
5250
      boolean first = true;
5251
 
5252
      sb.append("success:");
5253
      if (this.success == null) {
5254
        sb.append("null");
5255
      } else {
5256
        sb.append(this.success);
5257
      }
5258
      first = false;
5259
      if (!first) sb.append(", ");
5260
      sb.append("pex:");
5261
      if (this.pex == null) {
5262
        sb.append("null");
5263
      } else {
5264
        sb.append(this.pex);
5265
      }
5266
      first = false;
5267
      sb.append(")");
5268
      return sb.toString();
5269
    }
5270
 
3430 rajveer 5271
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5272
      // check for required fields
5273
    }
5274
 
3430 rajveer 5275
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5276
      try {
5277
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5278
      } catch (org.apache.thrift.TException te) {
5279
        throw new java.io.IOException(te);
5280
      }
5281
    }
5282
 
5283
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5284
      try {
5285
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5286
      } catch (org.apache.thrift.TException te) {
5287
        throw new java.io.IOException(te);
5288
      }
5289
    }
5290
 
1982 varun.gupt 5291
  }
5292
 
3430 rajveer 5293
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
5294
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 5295
 
3430 rajveer 5296
    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 5297
 
3430 rajveer 5298
    private long promotionId; // required
1982 varun.gupt 5299
 
5300
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5301
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5302
      PROMOTION_ID((short)1, "promotionId");
5303
 
5304
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5305
 
5306
      static {
5307
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5308
          byName.put(field.getFieldName(), field);
5309
        }
5310
      }
5311
 
5312
      /**
5313
       * Find the _Fields constant that matches fieldId, or null if its not found.
5314
       */
5315
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5316
        switch(fieldId) {
5317
          case 1: // PROMOTION_ID
5318
            return PROMOTION_ID;
5319
          default:
5320
            return null;
5321
        }
1982 varun.gupt 5322
      }
5323
 
5324
      /**
5325
       * Find the _Fields constant that matches fieldId, throwing an exception
5326
       * if it is not found.
5327
       */
5328
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5329
        _Fields fields = findByThriftId(fieldId);
5330
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5331
        return fields;
5332
      }
5333
 
5334
      /**
5335
       * Find the _Fields constant that matches name, or null if its not found.
5336
       */
5337
      public static _Fields findByName(String name) {
5338
        return byName.get(name);
5339
      }
5340
 
5341
      private final short _thriftId;
5342
      private final String _fieldName;
5343
 
5344
      _Fields(short thriftId, String fieldName) {
5345
        _thriftId = thriftId;
5346
        _fieldName = fieldName;
5347
      }
5348
 
5349
      public short getThriftFieldId() {
5350
        return _thriftId;
5351
      }
5352
 
5353
      public String getFieldName() {
5354
        return _fieldName;
5355
      }
5356
    }
5357
 
5358
    // isset id assignments
5359
    private static final int __PROMOTIONID_ISSET_ID = 0;
5360
    private BitSet __isset_bit_vector = new BitSet(1);
5361
 
3430 rajveer 5362
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5363
    static {
3430 rajveer 5364
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5365
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5366
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5367
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5368
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 5369
    }
5370
 
5371
    public getPromotionById_args() {
5372
    }
5373
 
5374
    public getPromotionById_args(
5375
      long promotionId)
5376
    {
5377
      this();
5378
      this.promotionId = promotionId;
5379
      setPromotionIdIsSet(true);
5380
    }
5381
 
5382
    /**
5383
     * Performs a deep copy on <i>other</i>.
5384
     */
5385
    public getPromotionById_args(getPromotionById_args other) {
5386
      __isset_bit_vector.clear();
5387
      __isset_bit_vector.or(other.__isset_bit_vector);
5388
      this.promotionId = other.promotionId;
5389
    }
5390
 
5391
    public getPromotionById_args deepCopy() {
5392
      return new getPromotionById_args(this);
5393
    }
5394
 
3430 rajveer 5395
    @Override
5396
    public void clear() {
5397
      setPromotionIdIsSet(false);
5398
      this.promotionId = 0;
1982 varun.gupt 5399
    }
5400
 
5401
    public long getPromotionId() {
5402
      return this.promotionId;
5403
    }
5404
 
3430 rajveer 5405
    public void setPromotionId(long promotionId) {
1982 varun.gupt 5406
      this.promotionId = promotionId;
5407
      setPromotionIdIsSet(true);
5408
    }
5409
 
5410
    public void unsetPromotionId() {
5411
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
5412
    }
5413
 
3430 rajveer 5414
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5415
    public boolean isSetPromotionId() {
5416
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
5417
    }
5418
 
5419
    public void setPromotionIdIsSet(boolean value) {
5420
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
5421
    }
5422
 
5423
    public void setFieldValue(_Fields field, Object value) {
5424
      switch (field) {
5425
      case PROMOTION_ID:
5426
        if (value == null) {
5427
          unsetPromotionId();
5428
        } else {
5429
          setPromotionId((Long)value);
5430
        }
5431
        break;
5432
 
5433
      }
5434
    }
5435
 
5436
    public Object getFieldValue(_Fields field) {
5437
      switch (field) {
5438
      case PROMOTION_ID:
3430 rajveer 5439
        return Long.valueOf(getPromotionId());
1982 varun.gupt 5440
 
5441
      }
5442
      throw new IllegalStateException();
5443
    }
5444
 
3430 rajveer 5445
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5446
    public boolean isSet(_Fields field) {
5447
      if (field == null) {
5448
        throw new IllegalArgumentException();
5449
      }
1982 varun.gupt 5450
 
5451
      switch (field) {
5452
      case PROMOTION_ID:
5453
        return isSetPromotionId();
5454
      }
5455
      throw new IllegalStateException();
5456
    }
5457
 
5458
    @Override
5459
    public boolean equals(Object that) {
5460
      if (that == null)
5461
        return false;
5462
      if (that instanceof getPromotionById_args)
5463
        return this.equals((getPromotionById_args)that);
5464
      return false;
5465
    }
5466
 
5467
    public boolean equals(getPromotionById_args that) {
5468
      if (that == null)
5469
        return false;
5470
 
5471
      boolean this_present_promotionId = true;
5472
      boolean that_present_promotionId = true;
5473
      if (this_present_promotionId || that_present_promotionId) {
5474
        if (!(this_present_promotionId && that_present_promotionId))
5475
          return false;
5476
        if (this.promotionId != that.promotionId)
5477
          return false;
5478
      }
5479
 
5480
      return true;
5481
    }
5482
 
5483
    @Override
5484
    public int hashCode() {
5485
      return 0;
5486
    }
5487
 
5488
    public int compareTo(getPromotionById_args other) {
5489
      if (!getClass().equals(other.getClass())) {
5490
        return getClass().getName().compareTo(other.getClass().getName());
5491
      }
5492
 
5493
      int lastComparison = 0;
5494
      getPromotionById_args typedOther = (getPromotionById_args)other;
5495
 
3430 rajveer 5496
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 5497
      if (lastComparison != 0) {
5498
        return lastComparison;
5499
      }
3430 rajveer 5500
      if (isSetPromotionId()) {
5501
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
5502
        if (lastComparison != 0) {
5503
          return lastComparison;
5504
        }
1982 varun.gupt 5505
      }
5506
      return 0;
5507
    }
5508
 
3430 rajveer 5509
    public _Fields fieldForId(int fieldId) {
5510
      return _Fields.findByThriftId(fieldId);
5511
    }
5512
 
5513
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5514
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5515
      iprot.readStructBegin();
5516
      while (true)
5517
      {
5518
        field = iprot.readFieldBegin();
3430 rajveer 5519
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5520
          break;
5521
        }
3430 rajveer 5522
        switch (field.id) {
5523
          case 1: // PROMOTION_ID
5524
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5525
              this.promotionId = iprot.readI64();
5526
              setPromotionIdIsSet(true);
5527
            } else { 
5528
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5529
            }
5530
            break;
5531
          default:
5532
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5533
        }
3430 rajveer 5534
        iprot.readFieldEnd();
1982 varun.gupt 5535
      }
5536
      iprot.readStructEnd();
5537
      validate();
5538
    }
5539
 
3430 rajveer 5540
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5541
      validate();
5542
 
5543
      oprot.writeStructBegin(STRUCT_DESC);
5544
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
5545
      oprot.writeI64(this.promotionId);
5546
      oprot.writeFieldEnd();
5547
      oprot.writeFieldStop();
5548
      oprot.writeStructEnd();
5549
    }
5550
 
5551
    @Override
5552
    public String toString() {
5553
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
5554
      boolean first = true;
5555
 
5556
      sb.append("promotionId:");
5557
      sb.append(this.promotionId);
5558
      first = false;
5559
      sb.append(")");
5560
      return sb.toString();
5561
    }
5562
 
3430 rajveer 5563
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5564
      // check for required fields
5565
    }
5566
 
3430 rajveer 5567
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5568
      try {
5569
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5570
      } catch (org.apache.thrift.TException te) {
5571
        throw new java.io.IOException(te);
5572
      }
5573
    }
5574
 
5575
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5576
      try {
5577
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5578
        __isset_bit_vector = new BitSet(1);
5579
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5580
      } catch (org.apache.thrift.TException te) {
5581
        throw new java.io.IOException(te);
5582
      }
5583
    }
5584
 
1982 varun.gupt 5585
  }
5586
 
3430 rajveer 5587
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
5588
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 5589
 
3430 rajveer 5590
    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);
5591
    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 5592
 
3430 rajveer 5593
    private Promotion success; // required
5594
    private PromotionException pex; // required
1982 varun.gupt 5595
 
5596
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5597
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5598
      SUCCESS((short)0, "success"),
5599
      PEX((short)1, "pex");
5600
 
5601
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5602
 
5603
      static {
5604
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5605
          byName.put(field.getFieldName(), field);
5606
        }
5607
      }
5608
 
5609
      /**
5610
       * Find the _Fields constant that matches fieldId, or null if its not found.
5611
       */
5612
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5613
        switch(fieldId) {
5614
          case 0: // SUCCESS
5615
            return SUCCESS;
5616
          case 1: // PEX
5617
            return PEX;
5618
          default:
5619
            return null;
5620
        }
1982 varun.gupt 5621
      }
5622
 
5623
      /**
5624
       * Find the _Fields constant that matches fieldId, throwing an exception
5625
       * if it is not found.
5626
       */
5627
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5628
        _Fields fields = findByThriftId(fieldId);
5629
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5630
        return fields;
5631
      }
5632
 
5633
      /**
5634
       * Find the _Fields constant that matches name, or null if its not found.
5635
       */
5636
      public static _Fields findByName(String name) {
5637
        return byName.get(name);
5638
      }
5639
 
5640
      private final short _thriftId;
5641
      private final String _fieldName;
5642
 
5643
      _Fields(short thriftId, String fieldName) {
5644
        _thriftId = thriftId;
5645
        _fieldName = fieldName;
5646
      }
5647
 
5648
      public short getThriftFieldId() {
5649
        return _thriftId;
5650
      }
5651
 
5652
      public String getFieldName() {
5653
        return _fieldName;
5654
      }
5655
    }
5656
 
5657
    // isset id assignments
5658
 
3430 rajveer 5659
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5660
    static {
3430 rajveer 5661
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5662
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5663
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
5664
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5665
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5666
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5667
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 5668
    }
5669
 
5670
    public getPromotionById_result() {
5671
    }
5672
 
5673
    public getPromotionById_result(
5674
      Promotion success,
5675
      PromotionException pex)
5676
    {
5677
      this();
5678
      this.success = success;
5679
      this.pex = pex;
5680
    }
5681
 
5682
    /**
5683
     * Performs a deep copy on <i>other</i>.
5684
     */
5685
    public getPromotionById_result(getPromotionById_result other) {
5686
      if (other.isSetSuccess()) {
5687
        this.success = new Promotion(other.success);
5688
      }
5689
      if (other.isSetPex()) {
5690
        this.pex = new PromotionException(other.pex);
5691
      }
5692
    }
5693
 
5694
    public getPromotionById_result deepCopy() {
5695
      return new getPromotionById_result(this);
5696
    }
5697
 
3430 rajveer 5698
    @Override
5699
    public void clear() {
5700
      this.success = null;
5701
      this.pex = null;
1982 varun.gupt 5702
    }
5703
 
5704
    public Promotion getSuccess() {
5705
      return this.success;
5706
    }
5707
 
3430 rajveer 5708
    public void setSuccess(Promotion success) {
1982 varun.gupt 5709
      this.success = success;
5710
    }
5711
 
5712
    public void unsetSuccess() {
5713
      this.success = null;
5714
    }
5715
 
3430 rajveer 5716
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5717
    public boolean isSetSuccess() {
5718
      return this.success != null;
5719
    }
5720
 
5721
    public void setSuccessIsSet(boolean value) {
5722
      if (!value) {
5723
        this.success = null;
5724
      }
5725
    }
5726
 
5727
    public PromotionException getPex() {
5728
      return this.pex;
5729
    }
5730
 
3430 rajveer 5731
    public void setPex(PromotionException pex) {
1982 varun.gupt 5732
      this.pex = pex;
5733
    }
5734
 
5735
    public void unsetPex() {
5736
      this.pex = null;
5737
    }
5738
 
3430 rajveer 5739
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5740
    public boolean isSetPex() {
5741
      return this.pex != null;
5742
    }
5743
 
5744
    public void setPexIsSet(boolean value) {
5745
      if (!value) {
5746
        this.pex = null;
5747
      }
5748
    }
5749
 
5750
    public void setFieldValue(_Fields field, Object value) {
5751
      switch (field) {
5752
      case SUCCESS:
5753
        if (value == null) {
5754
          unsetSuccess();
5755
        } else {
5756
          setSuccess((Promotion)value);
5757
        }
5758
        break;
5759
 
5760
      case PEX:
5761
        if (value == null) {
5762
          unsetPex();
5763
        } else {
5764
          setPex((PromotionException)value);
5765
        }
5766
        break;
5767
 
5768
      }
5769
    }
5770
 
5771
    public Object getFieldValue(_Fields field) {
5772
      switch (field) {
5773
      case SUCCESS:
5774
        return getSuccess();
5775
 
5776
      case PEX:
5777
        return getPex();
5778
 
5779
      }
5780
      throw new IllegalStateException();
5781
    }
5782
 
3430 rajveer 5783
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5784
    public boolean isSet(_Fields field) {
5785
      if (field == null) {
5786
        throw new IllegalArgumentException();
5787
      }
1982 varun.gupt 5788
 
5789
      switch (field) {
5790
      case SUCCESS:
5791
        return isSetSuccess();
5792
      case PEX:
5793
        return isSetPex();
5794
      }
5795
      throw new IllegalStateException();
5796
    }
5797
 
5798
    @Override
5799
    public boolean equals(Object that) {
5800
      if (that == null)
5801
        return false;
5802
      if (that instanceof getPromotionById_result)
5803
        return this.equals((getPromotionById_result)that);
5804
      return false;
5805
    }
5806
 
5807
    public boolean equals(getPromotionById_result that) {
5808
      if (that == null)
5809
        return false;
5810
 
5811
      boolean this_present_success = true && this.isSetSuccess();
5812
      boolean that_present_success = true && that.isSetSuccess();
5813
      if (this_present_success || that_present_success) {
5814
        if (!(this_present_success && that_present_success))
5815
          return false;
5816
        if (!this.success.equals(that.success))
5817
          return false;
5818
      }
5819
 
5820
      boolean this_present_pex = true && this.isSetPex();
5821
      boolean that_present_pex = true && that.isSetPex();
5822
      if (this_present_pex || that_present_pex) {
5823
        if (!(this_present_pex && that_present_pex))
5824
          return false;
5825
        if (!this.pex.equals(that.pex))
5826
          return false;
5827
      }
5828
 
5829
      return true;
5830
    }
5831
 
5832
    @Override
5833
    public int hashCode() {
5834
      return 0;
5835
    }
5836
 
5837
    public int compareTo(getPromotionById_result other) {
5838
      if (!getClass().equals(other.getClass())) {
5839
        return getClass().getName().compareTo(other.getClass().getName());
5840
      }
5841
 
5842
      int lastComparison = 0;
5843
      getPromotionById_result typedOther = (getPromotionById_result)other;
5844
 
3430 rajveer 5845
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5846
      if (lastComparison != 0) {
5847
        return lastComparison;
5848
      }
3430 rajveer 5849
      if (isSetSuccess()) {
5850
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5851
        if (lastComparison != 0) {
5852
          return lastComparison;
5853
        }
1982 varun.gupt 5854
      }
3430 rajveer 5855
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5856
      if (lastComparison != 0) {
5857
        return lastComparison;
5858
      }
3430 rajveer 5859
      if (isSetPex()) {
5860
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5861
        if (lastComparison != 0) {
5862
          return lastComparison;
5863
        }
1982 varun.gupt 5864
      }
5865
      return 0;
5866
    }
5867
 
3430 rajveer 5868
    public _Fields fieldForId(int fieldId) {
5869
      return _Fields.findByThriftId(fieldId);
5870
    }
5871
 
5872
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5873
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5874
      iprot.readStructBegin();
5875
      while (true)
5876
      {
5877
        field = iprot.readFieldBegin();
3430 rajveer 5878
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5879
          break;
5880
        }
3430 rajveer 5881
        switch (field.id) {
5882
          case 0: // SUCCESS
5883
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5884
              this.success = new Promotion();
5885
              this.success.read(iprot);
5886
            } else { 
5887
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5888
            }
5889
            break;
5890
          case 1: // PEX
5891
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5892
              this.pex = new PromotionException();
5893
              this.pex.read(iprot);
5894
            } else { 
5895
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5896
            }
5897
            break;
5898
          default:
5899
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5900
        }
3430 rajveer 5901
        iprot.readFieldEnd();
1982 varun.gupt 5902
      }
5903
      iprot.readStructEnd();
5904
      validate();
5905
    }
5906
 
3430 rajveer 5907
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5908
      oprot.writeStructBegin(STRUCT_DESC);
5909
 
5910
      if (this.isSetSuccess()) {
5911
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5912
        this.success.write(oprot);
5913
        oprot.writeFieldEnd();
5914
      } else if (this.isSetPex()) {
5915
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5916
        this.pex.write(oprot);
5917
        oprot.writeFieldEnd();
5918
      }
5919
      oprot.writeFieldStop();
5920
      oprot.writeStructEnd();
5921
    }
5922
 
5923
    @Override
5924
    public String toString() {
5925
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
5926
      boolean first = true;
5927
 
5928
      sb.append("success:");
5929
      if (this.success == null) {
5930
        sb.append("null");
5931
      } else {
5932
        sb.append(this.success);
5933
      }
5934
      first = false;
5935
      if (!first) sb.append(", ");
5936
      sb.append("pex:");
5937
      if (this.pex == null) {
5938
        sb.append("null");
5939
      } else {
5940
        sb.append(this.pex);
5941
      }
5942
      first = false;
5943
      sb.append(")");
5944
      return sb.toString();
5945
    }
5946
 
3430 rajveer 5947
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5948
      // check for required fields
5949
    }
5950
 
3430 rajveer 5951
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5952
      try {
5953
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5954
      } catch (org.apache.thrift.TException te) {
5955
        throw new java.io.IOException(te);
5956
      }
5957
    }
5958
 
5959
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5960
      try {
5961
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5962
      } catch (org.apache.thrift.TException te) {
5963
        throw new java.io.IOException(te);
5964
      }
5965
    }
5966
 
1982 varun.gupt 5967
  }
5968
 
3430 rajveer 5969
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
5970
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 5971
 
3430 rajveer 5972
    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);
5973
    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 5974
 
3430 rajveer 5975
    private long promotionId; // required
5976
    private String couponCode; // required
1982 varun.gupt 5977
 
5978
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5979
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5980
      PROMOTION_ID((short)1, "promotionId"),
5981
      COUPON_CODE((short)2, "couponCode");
5982
 
5983
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5984
 
5985
      static {
5986
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5987
          byName.put(field.getFieldName(), field);
5988
        }
5989
      }
5990
 
5991
      /**
5992
       * Find the _Fields constant that matches fieldId, or null if its not found.
5993
       */
5994
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5995
        switch(fieldId) {
5996
          case 1: // PROMOTION_ID
5997
            return PROMOTION_ID;
5998
          case 2: // COUPON_CODE
5999
            return COUPON_CODE;
6000
          default:
6001
            return null;
6002
        }
1982 varun.gupt 6003
      }
6004
 
6005
      /**
6006
       * Find the _Fields constant that matches fieldId, throwing an exception
6007
       * if it is not found.
6008
       */
6009
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6010
        _Fields fields = findByThriftId(fieldId);
6011
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6012
        return fields;
6013
      }
6014
 
6015
      /**
6016
       * Find the _Fields constant that matches name, or null if its not found.
6017
       */
6018
      public static _Fields findByName(String name) {
6019
        return byName.get(name);
6020
      }
6021
 
6022
      private final short _thriftId;
6023
      private final String _fieldName;
6024
 
6025
      _Fields(short thriftId, String fieldName) {
6026
        _thriftId = thriftId;
6027
        _fieldName = fieldName;
6028
      }
6029
 
6030
      public short getThriftFieldId() {
6031
        return _thriftId;
6032
      }
6033
 
6034
      public String getFieldName() {
6035
        return _fieldName;
6036
      }
6037
    }
6038
 
6039
    // isset id assignments
6040
    private static final int __PROMOTIONID_ISSET_ID = 0;
6041
    private BitSet __isset_bit_vector = new BitSet(1);
6042
 
3430 rajveer 6043
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6044
    static {
3430 rajveer 6045
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6046
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6047
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6048
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6049
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6050
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6051
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 6052
    }
6053
 
6054
    public generateCouponsForPromotion_args() {
6055
    }
6056
 
6057
    public generateCouponsForPromotion_args(
6058
      long promotionId,
6059
      String couponCode)
6060
    {
6061
      this();
6062
      this.promotionId = promotionId;
6063
      setPromotionIdIsSet(true);
6064
      this.couponCode = couponCode;
6065
    }
6066
 
6067
    /**
6068
     * Performs a deep copy on <i>other</i>.
6069
     */
6070
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
6071
      __isset_bit_vector.clear();
6072
      __isset_bit_vector.or(other.__isset_bit_vector);
6073
      this.promotionId = other.promotionId;
6074
      if (other.isSetCouponCode()) {
6075
        this.couponCode = other.couponCode;
6076
      }
6077
    }
6078
 
6079
    public generateCouponsForPromotion_args deepCopy() {
6080
      return new generateCouponsForPromotion_args(this);
6081
    }
6082
 
3430 rajveer 6083
    @Override
6084
    public void clear() {
6085
      setPromotionIdIsSet(false);
6086
      this.promotionId = 0;
6087
      this.couponCode = null;
1982 varun.gupt 6088
    }
6089
 
6090
    public long getPromotionId() {
6091
      return this.promotionId;
6092
    }
6093
 
3430 rajveer 6094
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6095
      this.promotionId = promotionId;
6096
      setPromotionIdIsSet(true);
6097
    }
6098
 
6099
    public void unsetPromotionId() {
6100
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6101
    }
6102
 
3430 rajveer 6103
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6104
    public boolean isSetPromotionId() {
6105
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6106
    }
6107
 
6108
    public void setPromotionIdIsSet(boolean value) {
6109
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6110
    }
6111
 
6112
    public String getCouponCode() {
6113
      return this.couponCode;
6114
    }
6115
 
3430 rajveer 6116
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6117
      this.couponCode = couponCode;
6118
    }
6119
 
6120
    public void unsetCouponCode() {
6121
      this.couponCode = null;
6122
    }
6123
 
3430 rajveer 6124
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6125
    public boolean isSetCouponCode() {
6126
      return this.couponCode != null;
6127
    }
6128
 
6129
    public void setCouponCodeIsSet(boolean value) {
6130
      if (!value) {
6131
        this.couponCode = null;
6132
      }
6133
    }
6134
 
6135
    public void setFieldValue(_Fields field, Object value) {
6136
      switch (field) {
6137
      case PROMOTION_ID:
6138
        if (value == null) {
6139
          unsetPromotionId();
6140
        } else {
6141
          setPromotionId((Long)value);
6142
        }
6143
        break;
6144
 
6145
      case COUPON_CODE:
6146
        if (value == null) {
6147
          unsetCouponCode();
6148
        } else {
6149
          setCouponCode((String)value);
6150
        }
6151
        break;
6152
 
6153
      }
6154
    }
6155
 
6156
    public Object getFieldValue(_Fields field) {
6157
      switch (field) {
6158
      case PROMOTION_ID:
3430 rajveer 6159
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6160
 
6161
      case COUPON_CODE:
6162
        return getCouponCode();
6163
 
6164
      }
6165
      throw new IllegalStateException();
6166
    }
6167
 
3430 rajveer 6168
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6169
    public boolean isSet(_Fields field) {
6170
      if (field == null) {
6171
        throw new IllegalArgumentException();
6172
      }
1982 varun.gupt 6173
 
6174
      switch (field) {
6175
      case PROMOTION_ID:
6176
        return isSetPromotionId();
6177
      case COUPON_CODE:
6178
        return isSetCouponCode();
6179
      }
6180
      throw new IllegalStateException();
6181
    }
6182
 
6183
    @Override
6184
    public boolean equals(Object that) {
6185
      if (that == null)
6186
        return false;
6187
      if (that instanceof generateCouponsForPromotion_args)
6188
        return this.equals((generateCouponsForPromotion_args)that);
6189
      return false;
6190
    }
6191
 
6192
    public boolean equals(generateCouponsForPromotion_args that) {
6193
      if (that == null)
6194
        return false;
6195
 
6196
      boolean this_present_promotionId = true;
6197
      boolean that_present_promotionId = true;
6198
      if (this_present_promotionId || that_present_promotionId) {
6199
        if (!(this_present_promotionId && that_present_promotionId))
6200
          return false;
6201
        if (this.promotionId != that.promotionId)
6202
          return false;
6203
      }
6204
 
6205
      boolean this_present_couponCode = true && this.isSetCouponCode();
6206
      boolean that_present_couponCode = true && that.isSetCouponCode();
6207
      if (this_present_couponCode || that_present_couponCode) {
6208
        if (!(this_present_couponCode && that_present_couponCode))
6209
          return false;
6210
        if (!this.couponCode.equals(that.couponCode))
6211
          return false;
6212
      }
6213
 
6214
      return true;
6215
    }
6216
 
6217
    @Override
6218
    public int hashCode() {
6219
      return 0;
6220
    }
6221
 
6222
    public int compareTo(generateCouponsForPromotion_args other) {
6223
      if (!getClass().equals(other.getClass())) {
6224
        return getClass().getName().compareTo(other.getClass().getName());
6225
      }
6226
 
6227
      int lastComparison = 0;
6228
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
6229
 
3430 rajveer 6230
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6231
      if (lastComparison != 0) {
6232
        return lastComparison;
6233
      }
3430 rajveer 6234
      if (isSetPromotionId()) {
6235
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6236
        if (lastComparison != 0) {
6237
          return lastComparison;
6238
        }
1982 varun.gupt 6239
      }
3430 rajveer 6240
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6241
      if (lastComparison != 0) {
6242
        return lastComparison;
6243
      }
3430 rajveer 6244
      if (isSetCouponCode()) {
6245
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6246
        if (lastComparison != 0) {
6247
          return lastComparison;
6248
        }
1982 varun.gupt 6249
      }
6250
      return 0;
6251
    }
6252
 
3430 rajveer 6253
    public _Fields fieldForId(int fieldId) {
6254
      return _Fields.findByThriftId(fieldId);
6255
    }
6256
 
6257
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6258
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6259
      iprot.readStructBegin();
6260
      while (true)
6261
      {
6262
        field = iprot.readFieldBegin();
3430 rajveer 6263
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6264
          break;
6265
        }
3430 rajveer 6266
        switch (field.id) {
6267
          case 1: // PROMOTION_ID
6268
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6269
              this.promotionId = iprot.readI64();
6270
              setPromotionIdIsSet(true);
6271
            } else { 
6272
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6273
            }
6274
            break;
6275
          case 2: // COUPON_CODE
6276
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6277
              this.couponCode = iprot.readString();
6278
            } else { 
6279
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6280
            }
6281
            break;
6282
          default:
6283
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6284
        }
3430 rajveer 6285
        iprot.readFieldEnd();
1982 varun.gupt 6286
      }
6287
      iprot.readStructEnd();
6288
      validate();
6289
    }
6290
 
3430 rajveer 6291
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6292
      validate();
6293
 
6294
      oprot.writeStructBegin(STRUCT_DESC);
6295
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6296
      oprot.writeI64(this.promotionId);
6297
      oprot.writeFieldEnd();
6298
      if (this.couponCode != null) {
6299
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6300
        oprot.writeString(this.couponCode);
6301
        oprot.writeFieldEnd();
6302
      }
6303
      oprot.writeFieldStop();
6304
      oprot.writeStructEnd();
6305
    }
6306
 
6307
    @Override
6308
    public String toString() {
6309
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
6310
      boolean first = true;
6311
 
6312
      sb.append("promotionId:");
6313
      sb.append(this.promotionId);
6314
      first = false;
6315
      if (!first) sb.append(", ");
6316
      sb.append("couponCode:");
6317
      if (this.couponCode == null) {
6318
        sb.append("null");
6319
      } else {
6320
        sb.append(this.couponCode);
6321
      }
6322
      first = false;
6323
      sb.append(")");
6324
      return sb.toString();
6325
    }
6326
 
3430 rajveer 6327
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6328
      // check for required fields
6329
    }
6330
 
3430 rajveer 6331
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6332
      try {
6333
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6334
      } catch (org.apache.thrift.TException te) {
6335
        throw new java.io.IOException(te);
6336
      }
6337
    }
6338
 
6339
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6340
      try {
6341
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6342
        __isset_bit_vector = new BitSet(1);
6343
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6344
      } catch (org.apache.thrift.TException te) {
6345
        throw new java.io.IOException(te);
6346
      }
6347
    }
6348
 
1982 varun.gupt 6349
  }
6350
 
3430 rajveer 6351
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
6352
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 6353
 
3430 rajveer 6354
    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 6355
 
3430 rajveer 6356
    private PromotionException pex; // required
1982 varun.gupt 6357
 
6358
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6359
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6360
      PEX((short)1, "pex");
6361
 
6362
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6363
 
6364
      static {
6365
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6366
          byName.put(field.getFieldName(), field);
6367
        }
6368
      }
6369
 
6370
      /**
6371
       * Find the _Fields constant that matches fieldId, or null if its not found.
6372
       */
6373
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6374
        switch(fieldId) {
6375
          case 1: // PEX
6376
            return PEX;
6377
          default:
6378
            return null;
6379
        }
1982 varun.gupt 6380
      }
6381
 
6382
      /**
6383
       * Find the _Fields constant that matches fieldId, throwing an exception
6384
       * if it is not found.
6385
       */
6386
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6387
        _Fields fields = findByThriftId(fieldId);
6388
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6389
        return fields;
6390
      }
6391
 
6392
      /**
6393
       * Find the _Fields constant that matches name, or null if its not found.
6394
       */
6395
      public static _Fields findByName(String name) {
6396
        return byName.get(name);
6397
      }
6398
 
6399
      private final short _thriftId;
6400
      private final String _fieldName;
6401
 
6402
      _Fields(short thriftId, String fieldName) {
6403
        _thriftId = thriftId;
6404
        _fieldName = fieldName;
6405
      }
6406
 
6407
      public short getThriftFieldId() {
6408
        return _thriftId;
6409
      }
6410
 
6411
      public String getFieldName() {
6412
        return _fieldName;
6413
      }
6414
    }
6415
 
6416
    // isset id assignments
6417
 
3430 rajveer 6418
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6419
    static {
3430 rajveer 6420
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6421
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6422
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6423
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6424
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 6425
    }
6426
 
6427
    public generateCouponsForPromotion_result() {
6428
    }
6429
 
6430
    public generateCouponsForPromotion_result(
6431
      PromotionException pex)
6432
    {
6433
      this();
6434
      this.pex = pex;
6435
    }
6436
 
6437
    /**
6438
     * Performs a deep copy on <i>other</i>.
6439
     */
6440
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
6441
      if (other.isSetPex()) {
6442
        this.pex = new PromotionException(other.pex);
6443
      }
6444
    }
6445
 
6446
    public generateCouponsForPromotion_result deepCopy() {
6447
      return new generateCouponsForPromotion_result(this);
6448
    }
6449
 
3430 rajveer 6450
    @Override
6451
    public void clear() {
6452
      this.pex = null;
1982 varun.gupt 6453
    }
6454
 
6455
    public PromotionException getPex() {
6456
      return this.pex;
6457
    }
6458
 
3430 rajveer 6459
    public void setPex(PromotionException pex) {
1982 varun.gupt 6460
      this.pex = pex;
6461
    }
6462
 
6463
    public void unsetPex() {
6464
      this.pex = null;
6465
    }
6466
 
3430 rajveer 6467
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6468
    public boolean isSetPex() {
6469
      return this.pex != null;
6470
    }
6471
 
6472
    public void setPexIsSet(boolean value) {
6473
      if (!value) {
6474
        this.pex = null;
6475
      }
6476
    }
6477
 
6478
    public void setFieldValue(_Fields field, Object value) {
6479
      switch (field) {
6480
      case PEX:
6481
        if (value == null) {
6482
          unsetPex();
6483
        } else {
6484
          setPex((PromotionException)value);
6485
        }
6486
        break;
6487
 
6488
      }
6489
    }
6490
 
6491
    public Object getFieldValue(_Fields field) {
6492
      switch (field) {
6493
      case PEX:
6494
        return getPex();
6495
 
6496
      }
6497
      throw new IllegalStateException();
6498
    }
6499
 
3430 rajveer 6500
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6501
    public boolean isSet(_Fields field) {
6502
      if (field == null) {
6503
        throw new IllegalArgumentException();
6504
      }
1982 varun.gupt 6505
 
6506
      switch (field) {
6507
      case PEX:
6508
        return isSetPex();
6509
      }
6510
      throw new IllegalStateException();
6511
    }
6512
 
6513
    @Override
6514
    public boolean equals(Object that) {
6515
      if (that == null)
6516
        return false;
6517
      if (that instanceof generateCouponsForPromotion_result)
6518
        return this.equals((generateCouponsForPromotion_result)that);
6519
      return false;
6520
    }
6521
 
6522
    public boolean equals(generateCouponsForPromotion_result that) {
6523
      if (that == null)
6524
        return false;
6525
 
6526
      boolean this_present_pex = true && this.isSetPex();
6527
      boolean that_present_pex = true && that.isSetPex();
6528
      if (this_present_pex || that_present_pex) {
6529
        if (!(this_present_pex && that_present_pex))
6530
          return false;
6531
        if (!this.pex.equals(that.pex))
6532
          return false;
6533
      }
6534
 
6535
      return true;
6536
    }
6537
 
6538
    @Override
6539
    public int hashCode() {
6540
      return 0;
6541
    }
6542
 
6543
    public int compareTo(generateCouponsForPromotion_result other) {
6544
      if (!getClass().equals(other.getClass())) {
6545
        return getClass().getName().compareTo(other.getClass().getName());
6546
      }
6547
 
6548
      int lastComparison = 0;
6549
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
6550
 
3430 rajveer 6551
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6552
      if (lastComparison != 0) {
6553
        return lastComparison;
6554
      }
3430 rajveer 6555
      if (isSetPex()) {
6556
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6557
        if (lastComparison != 0) {
6558
          return lastComparison;
6559
        }
1982 varun.gupt 6560
      }
6561
      return 0;
6562
    }
6563
 
3430 rajveer 6564
    public _Fields fieldForId(int fieldId) {
6565
      return _Fields.findByThriftId(fieldId);
6566
    }
6567
 
6568
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6569
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6570
      iprot.readStructBegin();
6571
      while (true)
6572
      {
6573
        field = iprot.readFieldBegin();
3430 rajveer 6574
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6575
          break;
6576
        }
3430 rajveer 6577
        switch (field.id) {
6578
          case 1: // PEX
6579
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6580
              this.pex = new PromotionException();
6581
              this.pex.read(iprot);
6582
            } else { 
6583
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6584
            }
6585
            break;
6586
          default:
6587
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6588
        }
3430 rajveer 6589
        iprot.readFieldEnd();
1982 varun.gupt 6590
      }
6591
      iprot.readStructEnd();
6592
      validate();
6593
    }
6594
 
3430 rajveer 6595
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6596
      oprot.writeStructBegin(STRUCT_DESC);
6597
 
6598
      if (this.isSetPex()) {
6599
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6600
        this.pex.write(oprot);
6601
        oprot.writeFieldEnd();
6602
      }
6603
      oprot.writeFieldStop();
6604
      oprot.writeStructEnd();
6605
    }
6606
 
6607
    @Override
6608
    public String toString() {
6609
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
6610
      boolean first = true;
6611
 
6612
      sb.append("pex:");
6613
      if (this.pex == null) {
6614
        sb.append("null");
6615
      } else {
6616
        sb.append(this.pex);
6617
      }
6618
      first = false;
6619
      sb.append(")");
6620
      return sb.toString();
6621
    }
6622
 
3430 rajveer 6623
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6624
      // check for required fields
6625
    }
6626
 
3430 rajveer 6627
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6628
      try {
6629
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6630
      } catch (org.apache.thrift.TException te) {
6631
        throw new java.io.IOException(te);
6632
      }
6633
    }
6634
 
6635
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6636
      try {
6637
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6638
      } catch (org.apache.thrift.TException te) {
6639
        throw new java.io.IOException(te);
6640
      }
6641
    }
6642
 
1982 varun.gupt 6643
  }
6644
 
3430 rajveer 6645
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
6646
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 6647
 
3430 rajveer 6648
    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);
6649
    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 6650
 
3430 rajveer 6651
    private String couponCode; // required
6652
    private long cartId; // required
1982 varun.gupt 6653
 
6654
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6655
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6656
      COUPON_CODE((short)1, "couponCode"),
6657
      CART_ID((short)2, "cartId");
6658
 
6659
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6660
 
6661
      static {
6662
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6663
          byName.put(field.getFieldName(), field);
6664
        }
6665
      }
6666
 
6667
      /**
6668
       * Find the _Fields constant that matches fieldId, or null if its not found.
6669
       */
6670
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6671
        switch(fieldId) {
6672
          case 1: // COUPON_CODE
6673
            return COUPON_CODE;
6674
          case 2: // CART_ID
6675
            return CART_ID;
6676
          default:
6677
            return null;
6678
        }
1982 varun.gupt 6679
      }
6680
 
6681
      /**
6682
       * Find the _Fields constant that matches fieldId, throwing an exception
6683
       * if it is not found.
6684
       */
6685
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6686
        _Fields fields = findByThriftId(fieldId);
6687
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6688
        return fields;
6689
      }
6690
 
6691
      /**
6692
       * Find the _Fields constant that matches name, or null if its not found.
6693
       */
6694
      public static _Fields findByName(String name) {
6695
        return byName.get(name);
6696
      }
6697
 
6698
      private final short _thriftId;
6699
      private final String _fieldName;
6700
 
6701
      _Fields(short thriftId, String fieldName) {
6702
        _thriftId = thriftId;
6703
        _fieldName = fieldName;
6704
      }
6705
 
6706
      public short getThriftFieldId() {
6707
        return _thriftId;
6708
      }
6709
 
6710
      public String getFieldName() {
6711
        return _fieldName;
6712
      }
6713
    }
6714
 
6715
    // isset id assignments
6716
    private static final int __CARTID_ISSET_ID = 0;
6717
    private BitSet __isset_bit_vector = new BitSet(1);
6718
 
3430 rajveer 6719
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6720
    static {
3430 rajveer 6721
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6722
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6723
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6724
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6725
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6726
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6727
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 6728
    }
6729
 
6730
    public applyCoupon_args() {
6731
    }
6732
 
6733
    public applyCoupon_args(
6734
      String couponCode,
6735
      long cartId)
6736
    {
6737
      this();
6738
      this.couponCode = couponCode;
6739
      this.cartId = cartId;
6740
      setCartIdIsSet(true);
6741
    }
6742
 
6743
    /**
6744
     * Performs a deep copy on <i>other</i>.
6745
     */
6746
    public applyCoupon_args(applyCoupon_args other) {
6747
      __isset_bit_vector.clear();
6748
      __isset_bit_vector.or(other.__isset_bit_vector);
6749
      if (other.isSetCouponCode()) {
6750
        this.couponCode = other.couponCode;
6751
      }
6752
      this.cartId = other.cartId;
6753
    }
6754
 
6755
    public applyCoupon_args deepCopy() {
6756
      return new applyCoupon_args(this);
6757
    }
6758
 
3430 rajveer 6759
    @Override
6760
    public void clear() {
6761
      this.couponCode = null;
6762
      setCartIdIsSet(false);
6763
      this.cartId = 0;
1982 varun.gupt 6764
    }
6765
 
6766
    public String getCouponCode() {
6767
      return this.couponCode;
6768
    }
6769
 
3430 rajveer 6770
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6771
      this.couponCode = couponCode;
6772
    }
6773
 
6774
    public void unsetCouponCode() {
6775
      this.couponCode = null;
6776
    }
6777
 
3430 rajveer 6778
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6779
    public boolean isSetCouponCode() {
6780
      return this.couponCode != null;
6781
    }
6782
 
6783
    public void setCouponCodeIsSet(boolean value) {
6784
      if (!value) {
6785
        this.couponCode = null;
6786
      }
6787
    }
6788
 
6789
    public long getCartId() {
6790
      return this.cartId;
6791
    }
6792
 
3430 rajveer 6793
    public void setCartId(long cartId) {
1982 varun.gupt 6794
      this.cartId = cartId;
6795
      setCartIdIsSet(true);
6796
    }
6797
 
6798
    public void unsetCartId() {
6799
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
6800
    }
6801
 
3430 rajveer 6802
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6803
    public boolean isSetCartId() {
6804
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
6805
    }
6806
 
6807
    public void setCartIdIsSet(boolean value) {
6808
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
6809
    }
6810
 
6811
    public void setFieldValue(_Fields field, Object value) {
6812
      switch (field) {
6813
      case COUPON_CODE:
6814
        if (value == null) {
6815
          unsetCouponCode();
6816
        } else {
6817
          setCouponCode((String)value);
6818
        }
6819
        break;
6820
 
6821
      case CART_ID:
6822
        if (value == null) {
6823
          unsetCartId();
6824
        } else {
6825
          setCartId((Long)value);
6826
        }
6827
        break;
6828
 
6829
      }
6830
    }
6831
 
6832
    public Object getFieldValue(_Fields field) {
6833
      switch (field) {
6834
      case COUPON_CODE:
6835
        return getCouponCode();
6836
 
6837
      case CART_ID:
3430 rajveer 6838
        return Long.valueOf(getCartId());
1982 varun.gupt 6839
 
6840
      }
6841
      throw new IllegalStateException();
6842
    }
6843
 
3430 rajveer 6844
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6845
    public boolean isSet(_Fields field) {
6846
      if (field == null) {
6847
        throw new IllegalArgumentException();
6848
      }
1982 varun.gupt 6849
 
6850
      switch (field) {
6851
      case COUPON_CODE:
6852
        return isSetCouponCode();
6853
      case CART_ID:
6854
        return isSetCartId();
6855
      }
6856
      throw new IllegalStateException();
6857
    }
6858
 
6859
    @Override
6860
    public boolean equals(Object that) {
6861
      if (that == null)
6862
        return false;
6863
      if (that instanceof applyCoupon_args)
6864
        return this.equals((applyCoupon_args)that);
6865
      return false;
6866
    }
6867
 
6868
    public boolean equals(applyCoupon_args that) {
6869
      if (that == null)
6870
        return false;
6871
 
6872
      boolean this_present_couponCode = true && this.isSetCouponCode();
6873
      boolean that_present_couponCode = true && that.isSetCouponCode();
6874
      if (this_present_couponCode || that_present_couponCode) {
6875
        if (!(this_present_couponCode && that_present_couponCode))
6876
          return false;
6877
        if (!this.couponCode.equals(that.couponCode))
6878
          return false;
6879
      }
6880
 
6881
      boolean this_present_cartId = true;
6882
      boolean that_present_cartId = true;
6883
      if (this_present_cartId || that_present_cartId) {
6884
        if (!(this_present_cartId && that_present_cartId))
6885
          return false;
6886
        if (this.cartId != that.cartId)
6887
          return false;
6888
      }
6889
 
6890
      return true;
6891
    }
6892
 
6893
    @Override
6894
    public int hashCode() {
6895
      return 0;
6896
    }
6897
 
6898
    public int compareTo(applyCoupon_args other) {
6899
      if (!getClass().equals(other.getClass())) {
6900
        return getClass().getName().compareTo(other.getClass().getName());
6901
      }
6902
 
6903
      int lastComparison = 0;
6904
      applyCoupon_args typedOther = (applyCoupon_args)other;
6905
 
3430 rajveer 6906
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6907
      if (lastComparison != 0) {
6908
        return lastComparison;
6909
      }
3430 rajveer 6910
      if (isSetCouponCode()) {
6911
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6912
        if (lastComparison != 0) {
6913
          return lastComparison;
6914
        }
1982 varun.gupt 6915
      }
3430 rajveer 6916
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 6917
      if (lastComparison != 0) {
6918
        return lastComparison;
6919
      }
3430 rajveer 6920
      if (isSetCartId()) {
6921
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
6922
        if (lastComparison != 0) {
6923
          return lastComparison;
6924
        }
1982 varun.gupt 6925
      }
6926
      return 0;
6927
    }
6928
 
3430 rajveer 6929
    public _Fields fieldForId(int fieldId) {
6930
      return _Fields.findByThriftId(fieldId);
6931
    }
6932
 
6933
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6934
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6935
      iprot.readStructBegin();
6936
      while (true)
6937
      {
6938
        field = iprot.readFieldBegin();
3430 rajveer 6939
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6940
          break;
6941
        }
3430 rajveer 6942
        switch (field.id) {
6943
          case 1: // COUPON_CODE
6944
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6945
              this.couponCode = iprot.readString();
6946
            } else { 
6947
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6948
            }
6949
            break;
6950
          case 2: // CART_ID
6951
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6952
              this.cartId = iprot.readI64();
6953
              setCartIdIsSet(true);
6954
            } else { 
6955
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6956
            }
6957
            break;
6958
          default:
6959
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6960
        }
3430 rajveer 6961
        iprot.readFieldEnd();
1982 varun.gupt 6962
      }
6963
      iprot.readStructEnd();
6964
      validate();
6965
    }
6966
 
3430 rajveer 6967
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6968
      validate();
6969
 
6970
      oprot.writeStructBegin(STRUCT_DESC);
6971
      if (this.couponCode != null) {
6972
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6973
        oprot.writeString(this.couponCode);
6974
        oprot.writeFieldEnd();
6975
      }
6976
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
6977
      oprot.writeI64(this.cartId);
6978
      oprot.writeFieldEnd();
6979
      oprot.writeFieldStop();
6980
      oprot.writeStructEnd();
6981
    }
6982
 
6983
    @Override
6984
    public String toString() {
6985
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
6986
      boolean first = true;
6987
 
6988
      sb.append("couponCode:");
6989
      if (this.couponCode == null) {
6990
        sb.append("null");
6991
      } else {
6992
        sb.append(this.couponCode);
6993
      }
6994
      first = false;
6995
      if (!first) sb.append(", ");
6996
      sb.append("cartId:");
6997
      sb.append(this.cartId);
6998
      first = false;
6999
      sb.append(")");
7000
      return sb.toString();
7001
    }
7002
 
3430 rajveer 7003
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7004
      // check for required fields
7005
    }
7006
 
3430 rajveer 7007
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7008
      try {
7009
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7010
      } catch (org.apache.thrift.TException te) {
7011
        throw new java.io.IOException(te);
7012
      }
7013
    }
7014
 
7015
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7016
      try {
7017
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7018
        __isset_bit_vector = new BitSet(1);
7019
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7020
      } catch (org.apache.thrift.TException te) {
7021
        throw new java.io.IOException(te);
7022
      }
7023
    }
7024
 
1982 varun.gupt 7025
  }
7026
 
3430 rajveer 7027
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7028
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 7029
 
3430 rajveer 7030
    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);
7031
    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 7032
 
3430 rajveer 7033
    private Cart success; // required
7034
    private PromotionException pex; // required
1982 varun.gupt 7035
 
7036
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7037
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7038
      SUCCESS((short)0, "success"),
7039
      PEX((short)1, "pex");
7040
 
7041
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7042
 
7043
      static {
7044
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7045
          byName.put(field.getFieldName(), field);
7046
        }
7047
      }
7048
 
7049
      /**
7050
       * Find the _Fields constant that matches fieldId, or null if its not found.
7051
       */
7052
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7053
        switch(fieldId) {
7054
          case 0: // SUCCESS
7055
            return SUCCESS;
7056
          case 1: // PEX
7057
            return PEX;
7058
          default:
7059
            return null;
7060
        }
1982 varun.gupt 7061
      }
7062
 
7063
      /**
7064
       * Find the _Fields constant that matches fieldId, throwing an exception
7065
       * if it is not found.
7066
       */
7067
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7068
        _Fields fields = findByThriftId(fieldId);
7069
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7070
        return fields;
7071
      }
7072
 
7073
      /**
7074
       * Find the _Fields constant that matches name, or null if its not found.
7075
       */
7076
      public static _Fields findByName(String name) {
7077
        return byName.get(name);
7078
      }
7079
 
7080
      private final short _thriftId;
7081
      private final String _fieldName;
7082
 
7083
      _Fields(short thriftId, String fieldName) {
7084
        _thriftId = thriftId;
7085
        _fieldName = fieldName;
7086
      }
7087
 
7088
      public short getThriftFieldId() {
7089
        return _thriftId;
7090
      }
7091
 
7092
      public String getFieldName() {
7093
        return _fieldName;
7094
      }
7095
    }
7096
 
7097
    // isset id assignments
7098
 
3430 rajveer 7099
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7100
    static {
3430 rajveer 7101
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7102
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7103
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
7104
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7105
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7106
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7107
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 7108
    }
7109
 
7110
    public applyCoupon_result() {
7111
    }
7112
 
7113
    public applyCoupon_result(
7114
      Cart success,
7115
      PromotionException pex)
7116
    {
7117
      this();
7118
      this.success = success;
7119
      this.pex = pex;
7120
    }
7121
 
7122
    /**
7123
     * Performs a deep copy on <i>other</i>.
7124
     */
7125
    public applyCoupon_result(applyCoupon_result other) {
7126
      if (other.isSetSuccess()) {
7127
        this.success = new Cart(other.success);
7128
      }
7129
      if (other.isSetPex()) {
7130
        this.pex = new PromotionException(other.pex);
7131
      }
7132
    }
7133
 
7134
    public applyCoupon_result deepCopy() {
7135
      return new applyCoupon_result(this);
7136
    }
7137
 
3430 rajveer 7138
    @Override
7139
    public void clear() {
7140
      this.success = null;
7141
      this.pex = null;
1982 varun.gupt 7142
    }
7143
 
7144
    public Cart getSuccess() {
7145
      return this.success;
7146
    }
7147
 
3430 rajveer 7148
    public void setSuccess(Cart success) {
1982 varun.gupt 7149
      this.success = success;
7150
    }
7151
 
7152
    public void unsetSuccess() {
7153
      this.success = null;
7154
    }
7155
 
3430 rajveer 7156
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7157
    public boolean isSetSuccess() {
7158
      return this.success != null;
7159
    }
7160
 
7161
    public void setSuccessIsSet(boolean value) {
7162
      if (!value) {
7163
        this.success = null;
7164
      }
7165
    }
7166
 
7167
    public PromotionException getPex() {
7168
      return this.pex;
7169
    }
7170
 
3430 rajveer 7171
    public void setPex(PromotionException pex) {
1982 varun.gupt 7172
      this.pex = pex;
7173
    }
7174
 
7175
    public void unsetPex() {
7176
      this.pex = null;
7177
    }
7178
 
3430 rajveer 7179
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7180
    public boolean isSetPex() {
7181
      return this.pex != null;
7182
    }
7183
 
7184
    public void setPexIsSet(boolean value) {
7185
      if (!value) {
7186
        this.pex = null;
7187
      }
7188
    }
7189
 
7190
    public void setFieldValue(_Fields field, Object value) {
7191
      switch (field) {
7192
      case SUCCESS:
7193
        if (value == null) {
7194
          unsetSuccess();
7195
        } else {
7196
          setSuccess((Cart)value);
7197
        }
7198
        break;
7199
 
7200
      case PEX:
7201
        if (value == null) {
7202
          unsetPex();
7203
        } else {
7204
          setPex((PromotionException)value);
7205
        }
7206
        break;
7207
 
7208
      }
7209
    }
7210
 
7211
    public Object getFieldValue(_Fields field) {
7212
      switch (field) {
7213
      case SUCCESS:
7214
        return getSuccess();
7215
 
7216
      case PEX:
7217
        return getPex();
7218
 
7219
      }
7220
      throw new IllegalStateException();
7221
    }
7222
 
3430 rajveer 7223
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7224
    public boolean isSet(_Fields field) {
7225
      if (field == null) {
7226
        throw new IllegalArgumentException();
7227
      }
1982 varun.gupt 7228
 
7229
      switch (field) {
7230
      case SUCCESS:
7231
        return isSetSuccess();
7232
      case PEX:
7233
        return isSetPex();
7234
      }
7235
      throw new IllegalStateException();
7236
    }
7237
 
7238
    @Override
7239
    public boolean equals(Object that) {
7240
      if (that == null)
7241
        return false;
7242
      if (that instanceof applyCoupon_result)
7243
        return this.equals((applyCoupon_result)that);
7244
      return false;
7245
    }
7246
 
7247
    public boolean equals(applyCoupon_result that) {
7248
      if (that == null)
7249
        return false;
7250
 
7251
      boolean this_present_success = true && this.isSetSuccess();
7252
      boolean that_present_success = true && that.isSetSuccess();
7253
      if (this_present_success || that_present_success) {
7254
        if (!(this_present_success && that_present_success))
7255
          return false;
7256
        if (!this.success.equals(that.success))
7257
          return false;
7258
      }
7259
 
7260
      boolean this_present_pex = true && this.isSetPex();
7261
      boolean that_present_pex = true && that.isSetPex();
7262
      if (this_present_pex || that_present_pex) {
7263
        if (!(this_present_pex && that_present_pex))
7264
          return false;
7265
        if (!this.pex.equals(that.pex))
7266
          return false;
7267
      }
7268
 
7269
      return true;
7270
    }
7271
 
7272
    @Override
7273
    public int hashCode() {
7274
      return 0;
7275
    }
7276
 
7277
    public int compareTo(applyCoupon_result other) {
7278
      if (!getClass().equals(other.getClass())) {
7279
        return getClass().getName().compareTo(other.getClass().getName());
7280
      }
7281
 
7282
      int lastComparison = 0;
7283
      applyCoupon_result typedOther = (applyCoupon_result)other;
7284
 
3430 rajveer 7285
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 7286
      if (lastComparison != 0) {
7287
        return lastComparison;
7288
      }
3430 rajveer 7289
      if (isSetSuccess()) {
7290
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7291
        if (lastComparison != 0) {
7292
          return lastComparison;
7293
        }
1982 varun.gupt 7294
      }
3430 rajveer 7295
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7296
      if (lastComparison != 0) {
7297
        return lastComparison;
7298
      }
3430 rajveer 7299
      if (isSetPex()) {
7300
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7301
        if (lastComparison != 0) {
7302
          return lastComparison;
7303
        }
1982 varun.gupt 7304
      }
7305
      return 0;
7306
    }
7307
 
3430 rajveer 7308
    public _Fields fieldForId(int fieldId) {
7309
      return _Fields.findByThriftId(fieldId);
7310
    }
7311
 
7312
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7313
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7314
      iprot.readStructBegin();
7315
      while (true)
7316
      {
7317
        field = iprot.readFieldBegin();
3430 rajveer 7318
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7319
          break;
7320
        }
3430 rajveer 7321
        switch (field.id) {
7322
          case 0: // SUCCESS
7323
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7324
              this.success = new Cart();
7325
              this.success.read(iprot);
7326
            } else { 
7327
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7328
            }
7329
            break;
7330
          case 1: // PEX
7331
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7332
              this.pex = new PromotionException();
7333
              this.pex.read(iprot);
7334
            } else { 
7335
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7336
            }
7337
            break;
7338
          default:
7339
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7340
        }
3430 rajveer 7341
        iprot.readFieldEnd();
1982 varun.gupt 7342
      }
7343
      iprot.readStructEnd();
7344
      validate();
7345
    }
7346
 
3430 rajveer 7347
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7348
      oprot.writeStructBegin(STRUCT_DESC);
7349
 
7350
      if (this.isSetSuccess()) {
7351
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7352
        this.success.write(oprot);
7353
        oprot.writeFieldEnd();
7354
      } else if (this.isSetPex()) {
7355
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7356
        this.pex.write(oprot);
7357
        oprot.writeFieldEnd();
7358
      }
7359
      oprot.writeFieldStop();
7360
      oprot.writeStructEnd();
7361
    }
7362
 
7363
    @Override
7364
    public String toString() {
7365
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
7366
      boolean first = true;
7367
 
7368
      sb.append("success:");
7369
      if (this.success == null) {
7370
        sb.append("null");
7371
      } else {
7372
        sb.append(this.success);
7373
      }
7374
      first = false;
7375
      if (!first) sb.append(", ");
7376
      sb.append("pex:");
7377
      if (this.pex == null) {
7378
        sb.append("null");
7379
      } else {
7380
        sb.append(this.pex);
7381
      }
7382
      first = false;
7383
      sb.append(")");
7384
      return sb.toString();
7385
    }
7386
 
3430 rajveer 7387
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7388
      // check for required fields
7389
    }
7390
 
3430 rajveer 7391
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7392
      try {
7393
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7394
      } catch (org.apache.thrift.TException te) {
7395
        throw new java.io.IOException(te);
7396
      }
7397
    }
7398
 
7399
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7400
      try {
7401
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7402
      } catch (org.apache.thrift.TException te) {
7403
        throw new java.io.IOException(te);
7404
      }
7405
    }
7406
 
1982 varun.gupt 7407
  }
7408
 
6433 anupam.sin 7409
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7410
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
7411
 
7412
    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);
7413
    private static final org.apache.thrift.protocol.TField TOTAL_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("totalAmount", org.apache.thrift.protocol.TType.I64, (short)2);
7414
    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);
7415
 
7416
    private String couponCode; // required
7417
    private long totalAmount; // required
7418
    private long userId; // required
7419
 
7420
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7421
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7422
      COUPON_CODE((short)1, "couponCode"),
7423
      TOTAL_AMOUNT((short)2, "totalAmount"),
7424
      USER_ID((short)3, "userId");
7425
 
7426
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7427
 
7428
      static {
7429
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7430
          byName.put(field.getFieldName(), field);
7431
        }
7432
      }
7433
 
7434
      /**
7435
       * Find the _Fields constant that matches fieldId, or null if its not found.
7436
       */
7437
      public static _Fields findByThriftId(int fieldId) {
7438
        switch(fieldId) {
7439
          case 1: // COUPON_CODE
7440
            return COUPON_CODE;
7441
          case 2: // TOTAL_AMOUNT
7442
            return TOTAL_AMOUNT;
7443
          case 3: // USER_ID
7444
            return USER_ID;
7445
          default:
7446
            return null;
7447
        }
7448
      }
7449
 
7450
      /**
7451
       * Find the _Fields constant that matches fieldId, throwing an exception
7452
       * if it is not found.
7453
       */
7454
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7455
        _Fields fields = findByThriftId(fieldId);
7456
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7457
        return fields;
7458
      }
7459
 
7460
      /**
7461
       * Find the _Fields constant that matches name, or null if its not found.
7462
       */
7463
      public static _Fields findByName(String name) {
7464
        return byName.get(name);
7465
      }
7466
 
7467
      private final short _thriftId;
7468
      private final String _fieldName;
7469
 
7470
      _Fields(short thriftId, String fieldName) {
7471
        _thriftId = thriftId;
7472
        _fieldName = fieldName;
7473
      }
7474
 
7475
      public short getThriftFieldId() {
7476
        return _thriftId;
7477
      }
7478
 
7479
      public String getFieldName() {
7480
        return _fieldName;
7481
      }
7482
    }
7483
 
7484
    // isset id assignments
7485
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
7486
    private static final int __USERID_ISSET_ID = 1;
7487
    private BitSet __isset_bit_vector = new BitSet(2);
7488
 
7489
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7490
    static {
7491
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7492
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7493
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7494
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7495
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7496
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7497
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7498
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7499
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
7500
    }
7501
 
7502
    public applyRechargeCoupon_args() {
7503
    }
7504
 
7505
    public applyRechargeCoupon_args(
7506
      String couponCode,
7507
      long totalAmount,
7508
      long userId)
7509
    {
7510
      this();
7511
      this.couponCode = couponCode;
7512
      this.totalAmount = totalAmount;
7513
      setTotalAmountIsSet(true);
7514
      this.userId = userId;
7515
      setUserIdIsSet(true);
7516
    }
7517
 
7518
    /**
7519
     * Performs a deep copy on <i>other</i>.
7520
     */
7521
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
7522
      __isset_bit_vector.clear();
7523
      __isset_bit_vector.or(other.__isset_bit_vector);
7524
      if (other.isSetCouponCode()) {
7525
        this.couponCode = other.couponCode;
7526
      }
7527
      this.totalAmount = other.totalAmount;
7528
      this.userId = other.userId;
7529
    }
7530
 
7531
    public applyRechargeCoupon_args deepCopy() {
7532
      return new applyRechargeCoupon_args(this);
7533
    }
7534
 
7535
    @Override
7536
    public void clear() {
7537
      this.couponCode = null;
7538
      setTotalAmountIsSet(false);
7539
      this.totalAmount = 0;
7540
      setUserIdIsSet(false);
7541
      this.userId = 0;
7542
    }
7543
 
7544
    public String getCouponCode() {
7545
      return this.couponCode;
7546
    }
7547
 
7548
    public void setCouponCode(String couponCode) {
7549
      this.couponCode = couponCode;
7550
    }
7551
 
7552
    public void unsetCouponCode() {
7553
      this.couponCode = null;
7554
    }
7555
 
7556
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
7557
    public boolean isSetCouponCode() {
7558
      return this.couponCode != null;
7559
    }
7560
 
7561
    public void setCouponCodeIsSet(boolean value) {
7562
      if (!value) {
7563
        this.couponCode = null;
7564
      }
7565
    }
7566
 
7567
    public long getTotalAmount() {
7568
      return this.totalAmount;
7569
    }
7570
 
7571
    public void setTotalAmount(long totalAmount) {
7572
      this.totalAmount = totalAmount;
7573
      setTotalAmountIsSet(true);
7574
    }
7575
 
7576
    public void unsetTotalAmount() {
7577
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
7578
    }
7579
 
7580
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
7581
    public boolean isSetTotalAmount() {
7582
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
7583
    }
7584
 
7585
    public void setTotalAmountIsSet(boolean value) {
7586
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
7587
    }
7588
 
7589
    public long getUserId() {
7590
      return this.userId;
7591
    }
7592
 
7593
    public void setUserId(long userId) {
7594
      this.userId = userId;
7595
      setUserIdIsSet(true);
7596
    }
7597
 
7598
    public void unsetUserId() {
7599
      __isset_bit_vector.clear(__USERID_ISSET_ID);
7600
    }
7601
 
7602
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
7603
    public boolean isSetUserId() {
7604
      return __isset_bit_vector.get(__USERID_ISSET_ID);
7605
    }
7606
 
7607
    public void setUserIdIsSet(boolean value) {
7608
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
7609
    }
7610
 
7611
    public void setFieldValue(_Fields field, Object value) {
7612
      switch (field) {
7613
      case COUPON_CODE:
7614
        if (value == null) {
7615
          unsetCouponCode();
7616
        } else {
7617
          setCouponCode((String)value);
7618
        }
7619
        break;
7620
 
7621
      case TOTAL_AMOUNT:
7622
        if (value == null) {
7623
          unsetTotalAmount();
7624
        } else {
7625
          setTotalAmount((Long)value);
7626
        }
7627
        break;
7628
 
7629
      case USER_ID:
7630
        if (value == null) {
7631
          unsetUserId();
7632
        } else {
7633
          setUserId((Long)value);
7634
        }
7635
        break;
7636
 
7637
      }
7638
    }
7639
 
7640
    public Object getFieldValue(_Fields field) {
7641
      switch (field) {
7642
      case COUPON_CODE:
7643
        return getCouponCode();
7644
 
7645
      case TOTAL_AMOUNT:
7646
        return Long.valueOf(getTotalAmount());
7647
 
7648
      case USER_ID:
7649
        return Long.valueOf(getUserId());
7650
 
7651
      }
7652
      throw new IllegalStateException();
7653
    }
7654
 
7655
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7656
    public boolean isSet(_Fields field) {
7657
      if (field == null) {
7658
        throw new IllegalArgumentException();
7659
      }
7660
 
7661
      switch (field) {
7662
      case COUPON_CODE:
7663
        return isSetCouponCode();
7664
      case TOTAL_AMOUNT:
7665
        return isSetTotalAmount();
7666
      case USER_ID:
7667
        return isSetUserId();
7668
      }
7669
      throw new IllegalStateException();
7670
    }
7671
 
7672
    @Override
7673
    public boolean equals(Object that) {
7674
      if (that == null)
7675
        return false;
7676
      if (that instanceof applyRechargeCoupon_args)
7677
        return this.equals((applyRechargeCoupon_args)that);
7678
      return false;
7679
    }
7680
 
7681
    public boolean equals(applyRechargeCoupon_args that) {
7682
      if (that == null)
7683
        return false;
7684
 
7685
      boolean this_present_couponCode = true && this.isSetCouponCode();
7686
      boolean that_present_couponCode = true && that.isSetCouponCode();
7687
      if (this_present_couponCode || that_present_couponCode) {
7688
        if (!(this_present_couponCode && that_present_couponCode))
7689
          return false;
7690
        if (!this.couponCode.equals(that.couponCode))
7691
          return false;
7692
      }
7693
 
7694
      boolean this_present_totalAmount = true;
7695
      boolean that_present_totalAmount = true;
7696
      if (this_present_totalAmount || that_present_totalAmount) {
7697
        if (!(this_present_totalAmount && that_present_totalAmount))
7698
          return false;
7699
        if (this.totalAmount != that.totalAmount)
7700
          return false;
7701
      }
7702
 
7703
      boolean this_present_userId = true;
7704
      boolean that_present_userId = true;
7705
      if (this_present_userId || that_present_userId) {
7706
        if (!(this_present_userId && that_present_userId))
7707
          return false;
7708
        if (this.userId != that.userId)
7709
          return false;
7710
      }
7711
 
7712
      return true;
7713
    }
7714
 
7715
    @Override
7716
    public int hashCode() {
7717
      return 0;
7718
    }
7719
 
7720
    public int compareTo(applyRechargeCoupon_args other) {
7721
      if (!getClass().equals(other.getClass())) {
7722
        return getClass().getName().compareTo(other.getClass().getName());
7723
      }
7724
 
7725
      int lastComparison = 0;
7726
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
7727
 
7728
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
7729
      if (lastComparison != 0) {
7730
        return lastComparison;
7731
      }
7732
      if (isSetCouponCode()) {
7733
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7734
        if (lastComparison != 0) {
7735
          return lastComparison;
7736
        }
7737
      }
7738
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
7739
      if (lastComparison != 0) {
7740
        return lastComparison;
7741
      }
7742
      if (isSetTotalAmount()) {
7743
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
7744
        if (lastComparison != 0) {
7745
          return lastComparison;
7746
        }
7747
      }
7748
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
7749
      if (lastComparison != 0) {
7750
        return lastComparison;
7751
      }
7752
      if (isSetUserId()) {
7753
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
7754
        if (lastComparison != 0) {
7755
          return lastComparison;
7756
        }
7757
      }
7758
      return 0;
7759
    }
7760
 
7761
    public _Fields fieldForId(int fieldId) {
7762
      return _Fields.findByThriftId(fieldId);
7763
    }
7764
 
7765
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7766
      org.apache.thrift.protocol.TField field;
7767
      iprot.readStructBegin();
7768
      while (true)
7769
      {
7770
        field = iprot.readFieldBegin();
7771
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7772
          break;
7773
        }
7774
        switch (field.id) {
7775
          case 1: // COUPON_CODE
7776
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7777
              this.couponCode = iprot.readString();
7778
            } else { 
7779
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7780
            }
7781
            break;
7782
          case 2: // TOTAL_AMOUNT
7783
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7784
              this.totalAmount = iprot.readI64();
7785
              setTotalAmountIsSet(true);
7786
            } else { 
7787
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7788
            }
7789
            break;
7790
          case 3: // USER_ID
7791
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7792
              this.userId = iprot.readI64();
7793
              setUserIdIsSet(true);
7794
            } else { 
7795
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7796
            }
7797
            break;
7798
          default:
7799
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7800
        }
7801
        iprot.readFieldEnd();
7802
      }
7803
      iprot.readStructEnd();
7804
      validate();
7805
    }
7806
 
7807
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7808
      validate();
7809
 
7810
      oprot.writeStructBegin(STRUCT_DESC);
7811
      if (this.couponCode != null) {
7812
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7813
        oprot.writeString(this.couponCode);
7814
        oprot.writeFieldEnd();
7815
      }
7816
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
7817
      oprot.writeI64(this.totalAmount);
7818
      oprot.writeFieldEnd();
7819
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
7820
      oprot.writeI64(this.userId);
7821
      oprot.writeFieldEnd();
7822
      oprot.writeFieldStop();
7823
      oprot.writeStructEnd();
7824
    }
7825
 
7826
    @Override
7827
    public String toString() {
7828
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
7829
      boolean first = true;
7830
 
7831
      sb.append("couponCode:");
7832
      if (this.couponCode == null) {
7833
        sb.append("null");
7834
      } else {
7835
        sb.append(this.couponCode);
7836
      }
7837
      first = false;
7838
      if (!first) sb.append(", ");
7839
      sb.append("totalAmount:");
7840
      sb.append(this.totalAmount);
7841
      first = false;
7842
      if (!first) sb.append(", ");
7843
      sb.append("userId:");
7844
      sb.append(this.userId);
7845
      first = false;
7846
      sb.append(")");
7847
      return sb.toString();
7848
    }
7849
 
7850
    public void validate() throws org.apache.thrift.TException {
7851
      // check for required fields
7852
    }
7853
 
7854
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7855
      try {
7856
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7857
      } catch (org.apache.thrift.TException te) {
7858
        throw new java.io.IOException(te);
7859
      }
7860
    }
7861
 
7862
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7863
      try {
7864
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7865
        __isset_bit_vector = new BitSet(1);
7866
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7867
      } catch (org.apache.thrift.TException te) {
7868
        throw new java.io.IOException(te);
7869
      }
7870
    }
7871
 
7872
  }
7873
 
7874
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7875
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
7876
 
7877
    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);
7878
    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);
7879
 
7880
    private Map<Long,String> success; // required
7881
    private PromotionException pex; // required
7882
 
7883
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7884
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7885
      SUCCESS((short)0, "success"),
7886
      PEX((short)1, "pex");
7887
 
7888
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7889
 
7890
      static {
7891
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7892
          byName.put(field.getFieldName(), field);
7893
        }
7894
      }
7895
 
7896
      /**
7897
       * Find the _Fields constant that matches fieldId, or null if its not found.
7898
       */
7899
      public static _Fields findByThriftId(int fieldId) {
7900
        switch(fieldId) {
7901
          case 0: // SUCCESS
7902
            return SUCCESS;
7903
          case 1: // PEX
7904
            return PEX;
7905
          default:
7906
            return null;
7907
        }
7908
      }
7909
 
7910
      /**
7911
       * Find the _Fields constant that matches fieldId, throwing an exception
7912
       * if it is not found.
7913
       */
7914
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7915
        _Fields fields = findByThriftId(fieldId);
7916
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7917
        return fields;
7918
      }
7919
 
7920
      /**
7921
       * Find the _Fields constant that matches name, or null if its not found.
7922
       */
7923
      public static _Fields findByName(String name) {
7924
        return byName.get(name);
7925
      }
7926
 
7927
      private final short _thriftId;
7928
      private final String _fieldName;
7929
 
7930
      _Fields(short thriftId, String fieldName) {
7931
        _thriftId = thriftId;
7932
        _fieldName = fieldName;
7933
      }
7934
 
7935
      public short getThriftFieldId() {
7936
        return _thriftId;
7937
      }
7938
 
7939
      public String getFieldName() {
7940
        return _fieldName;
7941
      }
7942
    }
7943
 
7944
    // isset id assignments
7945
 
7946
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7947
    static {
7948
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7949
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7950
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
7951
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
7952
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
7953
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7954
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7955
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7956
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
7957
    }
7958
 
7959
    public applyRechargeCoupon_result() {
7960
    }
7961
 
7962
    public applyRechargeCoupon_result(
7963
      Map<Long,String> success,
7964
      PromotionException pex)
7965
    {
7966
      this();
7967
      this.success = success;
7968
      this.pex = pex;
7969
    }
7970
 
7971
    /**
7972
     * Performs a deep copy on <i>other</i>.
7973
     */
7974
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
7975
      if (other.isSetSuccess()) {
7976
        Map<Long,String> __this__success = new HashMap<Long,String>();
7977
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
7978
 
7979
          Long other_element_key = other_element.getKey();
7980
          String other_element_value = other_element.getValue();
7981
 
7982
          Long __this__success_copy_key = other_element_key;
7983
 
7984
          String __this__success_copy_value = other_element_value;
7985
 
7986
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
7987
        }
7988
        this.success = __this__success;
7989
      }
7990
      if (other.isSetPex()) {
7991
        this.pex = new PromotionException(other.pex);
7992
      }
7993
    }
7994
 
7995
    public applyRechargeCoupon_result deepCopy() {
7996
      return new applyRechargeCoupon_result(this);
7997
    }
7998
 
7999
    @Override
8000
    public void clear() {
8001
      this.success = null;
8002
      this.pex = null;
8003
    }
8004
 
8005
    public int getSuccessSize() {
8006
      return (this.success == null) ? 0 : this.success.size();
8007
    }
8008
 
8009
    public void putToSuccess(long key, String val) {
8010
      if (this.success == null) {
8011
        this.success = new HashMap<Long,String>();
8012
      }
8013
      this.success.put(key, val);
8014
    }
8015
 
8016
    public Map<Long,String> getSuccess() {
8017
      return this.success;
8018
    }
8019
 
8020
    public void setSuccess(Map<Long,String> success) {
8021
      this.success = success;
8022
    }
8023
 
8024
    public void unsetSuccess() {
8025
      this.success = null;
8026
    }
8027
 
8028
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8029
    public boolean isSetSuccess() {
8030
      return this.success != null;
8031
    }
8032
 
8033
    public void setSuccessIsSet(boolean value) {
8034
      if (!value) {
8035
        this.success = null;
8036
      }
8037
    }
8038
 
8039
    public PromotionException getPex() {
8040
      return this.pex;
8041
    }
8042
 
8043
    public void setPex(PromotionException pex) {
8044
      this.pex = pex;
8045
    }
8046
 
8047
    public void unsetPex() {
8048
      this.pex = null;
8049
    }
8050
 
8051
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8052
    public boolean isSetPex() {
8053
      return this.pex != null;
8054
    }
8055
 
8056
    public void setPexIsSet(boolean value) {
8057
      if (!value) {
8058
        this.pex = null;
8059
      }
8060
    }
8061
 
8062
    public void setFieldValue(_Fields field, Object value) {
8063
      switch (field) {
8064
      case SUCCESS:
8065
        if (value == null) {
8066
          unsetSuccess();
8067
        } else {
8068
          setSuccess((Map<Long,String>)value);
8069
        }
8070
        break;
8071
 
8072
      case PEX:
8073
        if (value == null) {
8074
          unsetPex();
8075
        } else {
8076
          setPex((PromotionException)value);
8077
        }
8078
        break;
8079
 
8080
      }
8081
    }
8082
 
8083
    public Object getFieldValue(_Fields field) {
8084
      switch (field) {
8085
      case SUCCESS:
8086
        return getSuccess();
8087
 
8088
      case PEX:
8089
        return getPex();
8090
 
8091
      }
8092
      throw new IllegalStateException();
8093
    }
8094
 
8095
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8096
    public boolean isSet(_Fields field) {
8097
      if (field == null) {
8098
        throw new IllegalArgumentException();
8099
      }
8100
 
8101
      switch (field) {
8102
      case SUCCESS:
8103
        return isSetSuccess();
8104
      case PEX:
8105
        return isSetPex();
8106
      }
8107
      throw new IllegalStateException();
8108
    }
8109
 
8110
    @Override
8111
    public boolean equals(Object that) {
8112
      if (that == null)
8113
        return false;
8114
      if (that instanceof applyRechargeCoupon_result)
8115
        return this.equals((applyRechargeCoupon_result)that);
8116
      return false;
8117
    }
8118
 
8119
    public boolean equals(applyRechargeCoupon_result that) {
8120
      if (that == null)
8121
        return false;
8122
 
8123
      boolean this_present_success = true && this.isSetSuccess();
8124
      boolean that_present_success = true && that.isSetSuccess();
8125
      if (this_present_success || that_present_success) {
8126
        if (!(this_present_success && that_present_success))
8127
          return false;
8128
        if (!this.success.equals(that.success))
8129
          return false;
8130
      }
8131
 
8132
      boolean this_present_pex = true && this.isSetPex();
8133
      boolean that_present_pex = true && that.isSetPex();
8134
      if (this_present_pex || that_present_pex) {
8135
        if (!(this_present_pex && that_present_pex))
8136
          return false;
8137
        if (!this.pex.equals(that.pex))
8138
          return false;
8139
      }
8140
 
8141
      return true;
8142
    }
8143
 
8144
    @Override
8145
    public int hashCode() {
8146
      return 0;
8147
    }
8148
 
8149
    public int compareTo(applyRechargeCoupon_result other) {
8150
      if (!getClass().equals(other.getClass())) {
8151
        return getClass().getName().compareTo(other.getClass().getName());
8152
      }
8153
 
8154
      int lastComparison = 0;
8155
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
8156
 
8157
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8158
      if (lastComparison != 0) {
8159
        return lastComparison;
8160
      }
8161
      if (isSetSuccess()) {
8162
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8163
        if (lastComparison != 0) {
8164
          return lastComparison;
8165
        }
8166
      }
8167
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
8168
      if (lastComparison != 0) {
8169
        return lastComparison;
8170
      }
8171
      if (isSetPex()) {
8172
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8173
        if (lastComparison != 0) {
8174
          return lastComparison;
8175
        }
8176
      }
8177
      return 0;
8178
    }
8179
 
8180
    public _Fields fieldForId(int fieldId) {
8181
      return _Fields.findByThriftId(fieldId);
8182
    }
8183
 
8184
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8185
      org.apache.thrift.protocol.TField field;
8186
      iprot.readStructBegin();
8187
      while (true)
8188
      {
8189
        field = iprot.readFieldBegin();
8190
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8191
          break;
8192
        }
8193
        switch (field.id) {
8194
          case 0: // SUCCESS
8195
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
8196
              {
8197
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
8198
                this.success = new HashMap<Long,String>(2*_map16.size);
8199
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
8200
                {
8201
                  long _key18; // required
8202
                  String _val19; // required
8203
                  _key18 = iprot.readI64();
8204
                  _val19 = iprot.readString();
8205
                  this.success.put(_key18, _val19);
8206
                }
8207
                iprot.readMapEnd();
8208
              }
8209
            } else { 
8210
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8211
            }
8212
            break;
8213
          case 1: // PEX
8214
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8215
              this.pex = new PromotionException();
8216
              this.pex.read(iprot);
8217
            } else { 
8218
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8219
            }
8220
            break;
8221
          default:
8222
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8223
        }
8224
        iprot.readFieldEnd();
8225
      }
8226
      iprot.readStructEnd();
8227
      validate();
8228
    }
8229
 
8230
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8231
      oprot.writeStructBegin(STRUCT_DESC);
8232
 
8233
      if (this.isSetSuccess()) {
8234
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8235
        {
8236
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
8237
          for (Map.Entry<Long, String> _iter20 : this.success.entrySet())
8238
          {
8239
            oprot.writeI64(_iter20.getKey());
8240
            oprot.writeString(_iter20.getValue());
8241
          }
8242
          oprot.writeMapEnd();
8243
        }
8244
        oprot.writeFieldEnd();
8245
      } else if (this.isSetPex()) {
8246
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8247
        this.pex.write(oprot);
8248
        oprot.writeFieldEnd();
8249
      }
8250
      oprot.writeFieldStop();
8251
      oprot.writeStructEnd();
8252
    }
8253
 
8254
    @Override
8255
    public String toString() {
8256
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
8257
      boolean first = true;
8258
 
8259
      sb.append("success:");
8260
      if (this.success == null) {
8261
        sb.append("null");
8262
      } else {
8263
        sb.append(this.success);
8264
      }
8265
      first = false;
8266
      if (!first) sb.append(", ");
8267
      sb.append("pex:");
8268
      if (this.pex == null) {
8269
        sb.append("null");
8270
      } else {
8271
        sb.append(this.pex);
8272
      }
8273
      first = false;
8274
      sb.append(")");
8275
      return sb.toString();
8276
    }
8277
 
8278
    public void validate() throws org.apache.thrift.TException {
8279
      // check for required fields
8280
    }
8281
 
8282
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8283
      try {
8284
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8285
      } catch (org.apache.thrift.TException te) {
8286
        throw new java.io.IOException(te);
8287
      }
8288
    }
8289
 
8290
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8291
      try {
8292
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8293
      } catch (org.apache.thrift.TException te) {
8294
        throw new java.io.IOException(te);
8295
      }
8296
    }
8297
 
8298
  }
8299
 
3430 rajveer 8300
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
8301
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 8302
 
3430 rajveer 8303
    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);
8304
    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);
8305
    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 8306
 
3430 rajveer 8307
    private String couponCode; // required
8308
    private long transactionId; // required
8309
    private long userId; // required
1982 varun.gupt 8310
 
8311
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8312
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8313
      COUPON_CODE((short)1, "couponCode"),
8314
      TRANSACTION_ID((short)2, "transactionId"),
8315
      USER_ID((short)3, "userId");
8316
 
8317
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8318
 
8319
      static {
8320
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8321
          byName.put(field.getFieldName(), field);
8322
        }
8323
      }
8324
 
8325
      /**
8326
       * Find the _Fields constant that matches fieldId, or null if its not found.
8327
       */
8328
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8329
        switch(fieldId) {
8330
          case 1: // COUPON_CODE
8331
            return COUPON_CODE;
8332
          case 2: // TRANSACTION_ID
8333
            return TRANSACTION_ID;
8334
          case 3: // USER_ID
8335
            return USER_ID;
8336
          default:
8337
            return null;
8338
        }
1982 varun.gupt 8339
      }
8340
 
8341
      /**
8342
       * Find the _Fields constant that matches fieldId, throwing an exception
8343
       * if it is not found.
8344
       */
8345
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8346
        _Fields fields = findByThriftId(fieldId);
8347
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8348
        return fields;
8349
      }
8350
 
8351
      /**
8352
       * Find the _Fields constant that matches name, or null if its not found.
8353
       */
8354
      public static _Fields findByName(String name) {
8355
        return byName.get(name);
8356
      }
8357
 
8358
      private final short _thriftId;
8359
      private final String _fieldName;
8360
 
8361
      _Fields(short thriftId, String fieldName) {
8362
        _thriftId = thriftId;
8363
        _fieldName = fieldName;
8364
      }
8365
 
8366
      public short getThriftFieldId() {
8367
        return _thriftId;
8368
      }
8369
 
8370
      public String getFieldName() {
8371
        return _fieldName;
8372
      }
8373
    }
8374
 
8375
    // isset id assignments
8376
    private static final int __TRANSACTIONID_ISSET_ID = 0;
8377
    private static final int __USERID_ISSET_ID = 1;
8378
    private BitSet __isset_bit_vector = new BitSet(2);
8379
 
3430 rajveer 8380
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8381
    static {
3430 rajveer 8382
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8383
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8384
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8385
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8386
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8387
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8388
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8389
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8390
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 8391
    }
8392
 
8393
    public trackCouponUsage_args() {
8394
    }
8395
 
8396
    public trackCouponUsage_args(
8397
      String couponCode,
8398
      long transactionId,
8399
      long userId)
8400
    {
8401
      this();
8402
      this.couponCode = couponCode;
8403
      this.transactionId = transactionId;
8404
      setTransactionIdIsSet(true);
8405
      this.userId = userId;
8406
      setUserIdIsSet(true);
8407
    }
8408
 
8409
    /**
8410
     * Performs a deep copy on <i>other</i>.
8411
     */
8412
    public trackCouponUsage_args(trackCouponUsage_args other) {
8413
      __isset_bit_vector.clear();
8414
      __isset_bit_vector.or(other.__isset_bit_vector);
8415
      if (other.isSetCouponCode()) {
8416
        this.couponCode = other.couponCode;
8417
      }
8418
      this.transactionId = other.transactionId;
8419
      this.userId = other.userId;
8420
    }
8421
 
8422
    public trackCouponUsage_args deepCopy() {
8423
      return new trackCouponUsage_args(this);
8424
    }
8425
 
3430 rajveer 8426
    @Override
8427
    public void clear() {
8428
      this.couponCode = null;
8429
      setTransactionIdIsSet(false);
8430
      this.transactionId = 0;
8431
      setUserIdIsSet(false);
8432
      this.userId = 0;
1982 varun.gupt 8433
    }
8434
 
8435
    public String getCouponCode() {
8436
      return this.couponCode;
8437
    }
8438
 
3430 rajveer 8439
    public void setCouponCode(String couponCode) {
1982 varun.gupt 8440
      this.couponCode = couponCode;
8441
    }
8442
 
8443
    public void unsetCouponCode() {
8444
      this.couponCode = null;
8445
    }
8446
 
3430 rajveer 8447
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8448
    public boolean isSetCouponCode() {
8449
      return this.couponCode != null;
8450
    }
8451
 
8452
    public void setCouponCodeIsSet(boolean value) {
8453
      if (!value) {
8454
        this.couponCode = null;
8455
      }
8456
    }
8457
 
8458
    public long getTransactionId() {
8459
      return this.transactionId;
8460
    }
8461
 
3430 rajveer 8462
    public void setTransactionId(long transactionId) {
1982 varun.gupt 8463
      this.transactionId = transactionId;
8464
      setTransactionIdIsSet(true);
8465
    }
8466
 
8467
    public void unsetTransactionId() {
8468
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
8469
    }
8470
 
3430 rajveer 8471
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8472
    public boolean isSetTransactionId() {
8473
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
8474
    }
8475
 
8476
    public void setTransactionIdIsSet(boolean value) {
8477
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
8478
    }
8479
 
8480
    public long getUserId() {
8481
      return this.userId;
8482
    }
8483
 
3430 rajveer 8484
    public void setUserId(long userId) {
1982 varun.gupt 8485
      this.userId = userId;
8486
      setUserIdIsSet(true);
8487
    }
8488
 
8489
    public void unsetUserId() {
8490
      __isset_bit_vector.clear(__USERID_ISSET_ID);
8491
    }
8492
 
3430 rajveer 8493
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8494
    public boolean isSetUserId() {
8495
      return __isset_bit_vector.get(__USERID_ISSET_ID);
8496
    }
8497
 
8498
    public void setUserIdIsSet(boolean value) {
8499
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
8500
    }
8501
 
8502
    public void setFieldValue(_Fields field, Object value) {
8503
      switch (field) {
8504
      case COUPON_CODE:
8505
        if (value == null) {
8506
          unsetCouponCode();
8507
        } else {
8508
          setCouponCode((String)value);
8509
        }
8510
        break;
8511
 
8512
      case TRANSACTION_ID:
8513
        if (value == null) {
8514
          unsetTransactionId();
8515
        } else {
8516
          setTransactionId((Long)value);
8517
        }
8518
        break;
8519
 
8520
      case USER_ID:
8521
        if (value == null) {
8522
          unsetUserId();
8523
        } else {
8524
          setUserId((Long)value);
8525
        }
8526
        break;
8527
 
8528
      }
8529
    }
8530
 
8531
    public Object getFieldValue(_Fields field) {
8532
      switch (field) {
8533
      case COUPON_CODE:
8534
        return getCouponCode();
8535
 
8536
      case TRANSACTION_ID:
3430 rajveer 8537
        return Long.valueOf(getTransactionId());
1982 varun.gupt 8538
 
8539
      case USER_ID:
3430 rajveer 8540
        return Long.valueOf(getUserId());
1982 varun.gupt 8541
 
8542
      }
8543
      throw new IllegalStateException();
8544
    }
8545
 
3430 rajveer 8546
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8547
    public boolean isSet(_Fields field) {
8548
      if (field == null) {
8549
        throw new IllegalArgumentException();
8550
      }
1982 varun.gupt 8551
 
8552
      switch (field) {
8553
      case COUPON_CODE:
8554
        return isSetCouponCode();
8555
      case TRANSACTION_ID:
8556
        return isSetTransactionId();
8557
      case USER_ID:
8558
        return isSetUserId();
8559
      }
8560
      throw new IllegalStateException();
8561
    }
8562
 
8563
    @Override
8564
    public boolean equals(Object that) {
8565
      if (that == null)
8566
        return false;
8567
      if (that instanceof trackCouponUsage_args)
8568
        return this.equals((trackCouponUsage_args)that);
8569
      return false;
8570
    }
8571
 
8572
    public boolean equals(trackCouponUsage_args that) {
8573
      if (that == null)
8574
        return false;
8575
 
8576
      boolean this_present_couponCode = true && this.isSetCouponCode();
8577
      boolean that_present_couponCode = true && that.isSetCouponCode();
8578
      if (this_present_couponCode || that_present_couponCode) {
8579
        if (!(this_present_couponCode && that_present_couponCode))
8580
          return false;
8581
        if (!this.couponCode.equals(that.couponCode))
8582
          return false;
8583
      }
8584
 
8585
      boolean this_present_transactionId = true;
8586
      boolean that_present_transactionId = true;
8587
      if (this_present_transactionId || that_present_transactionId) {
8588
        if (!(this_present_transactionId && that_present_transactionId))
8589
          return false;
8590
        if (this.transactionId != that.transactionId)
8591
          return false;
8592
      }
8593
 
8594
      boolean this_present_userId = true;
8595
      boolean that_present_userId = true;
8596
      if (this_present_userId || that_present_userId) {
8597
        if (!(this_present_userId && that_present_userId))
8598
          return false;
8599
        if (this.userId != that.userId)
8600
          return false;
8601
      }
8602
 
8603
      return true;
8604
    }
8605
 
8606
    @Override
8607
    public int hashCode() {
8608
      return 0;
8609
    }
8610
 
8611
    public int compareTo(trackCouponUsage_args other) {
8612
      if (!getClass().equals(other.getClass())) {
8613
        return getClass().getName().compareTo(other.getClass().getName());
8614
      }
8615
 
8616
      int lastComparison = 0;
8617
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
8618
 
3430 rajveer 8619
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 8620
      if (lastComparison != 0) {
8621
        return lastComparison;
8622
      }
3430 rajveer 8623
      if (isSetCouponCode()) {
8624
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8625
        if (lastComparison != 0) {
8626
          return lastComparison;
8627
        }
1982 varun.gupt 8628
      }
3430 rajveer 8629
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 8630
      if (lastComparison != 0) {
8631
        return lastComparison;
8632
      }
3430 rajveer 8633
      if (isSetTransactionId()) {
8634
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
8635
        if (lastComparison != 0) {
8636
          return lastComparison;
8637
        }
1982 varun.gupt 8638
      }
3430 rajveer 8639
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 8640
      if (lastComparison != 0) {
8641
        return lastComparison;
8642
      }
3430 rajveer 8643
      if (isSetUserId()) {
8644
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
8645
        if (lastComparison != 0) {
8646
          return lastComparison;
8647
        }
1982 varun.gupt 8648
      }
8649
      return 0;
8650
    }
8651
 
3430 rajveer 8652
    public _Fields fieldForId(int fieldId) {
8653
      return _Fields.findByThriftId(fieldId);
8654
    }
8655
 
8656
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8657
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8658
      iprot.readStructBegin();
8659
      while (true)
8660
      {
8661
        field = iprot.readFieldBegin();
3430 rajveer 8662
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8663
          break;
8664
        }
3430 rajveer 8665
        switch (field.id) {
8666
          case 1: // COUPON_CODE
8667
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8668
              this.couponCode = iprot.readString();
8669
            } else { 
8670
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8671
            }
8672
            break;
8673
          case 2: // TRANSACTION_ID
8674
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8675
              this.transactionId = iprot.readI64();
8676
              setTransactionIdIsSet(true);
8677
            } else { 
8678
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8679
            }
8680
            break;
8681
          case 3: // USER_ID
8682
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8683
              this.userId = iprot.readI64();
8684
              setUserIdIsSet(true);
8685
            } else { 
8686
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8687
            }
8688
            break;
8689
          default:
8690
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8691
        }
3430 rajveer 8692
        iprot.readFieldEnd();
1982 varun.gupt 8693
      }
8694
      iprot.readStructEnd();
8695
      validate();
8696
    }
8697
 
3430 rajveer 8698
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8699
      validate();
8700
 
8701
      oprot.writeStructBegin(STRUCT_DESC);
8702
      if (this.couponCode != null) {
8703
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8704
        oprot.writeString(this.couponCode);
8705
        oprot.writeFieldEnd();
8706
      }
8707
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
8708
      oprot.writeI64(this.transactionId);
8709
      oprot.writeFieldEnd();
8710
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
8711
      oprot.writeI64(this.userId);
8712
      oprot.writeFieldEnd();
8713
      oprot.writeFieldStop();
8714
      oprot.writeStructEnd();
8715
    }
8716
 
8717
    @Override
8718
    public String toString() {
8719
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
8720
      boolean first = true;
8721
 
8722
      sb.append("couponCode:");
8723
      if (this.couponCode == null) {
8724
        sb.append("null");
8725
      } else {
8726
        sb.append(this.couponCode);
8727
      }
8728
      first = false;
8729
      if (!first) sb.append(", ");
8730
      sb.append("transactionId:");
8731
      sb.append(this.transactionId);
8732
      first = false;
8733
      if (!first) sb.append(", ");
8734
      sb.append("userId:");
8735
      sb.append(this.userId);
8736
      first = false;
8737
      sb.append(")");
8738
      return sb.toString();
8739
    }
8740
 
3430 rajveer 8741
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8742
      // check for required fields
8743
    }
8744
 
3430 rajveer 8745
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8746
      try {
8747
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8748
      } catch (org.apache.thrift.TException te) {
8749
        throw new java.io.IOException(te);
8750
      }
8751
    }
8752
 
8753
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8754
      try {
8755
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8756
        __isset_bit_vector = new BitSet(1);
8757
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8758
      } catch (org.apache.thrift.TException te) {
8759
        throw new java.io.IOException(te);
8760
      }
8761
    }
8762
 
1982 varun.gupt 8763
  }
8764
 
3430 rajveer 8765
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
8766
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 8767
 
3430 rajveer 8768
    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 8769
 
3430 rajveer 8770
    private PromotionException pex; // required
1982 varun.gupt 8771
 
8772
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8773
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8774
      PEX((short)1, "pex");
8775
 
8776
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8777
 
8778
      static {
8779
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8780
          byName.put(field.getFieldName(), field);
8781
        }
8782
      }
8783
 
8784
      /**
8785
       * Find the _Fields constant that matches fieldId, or null if its not found.
8786
       */
8787
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8788
        switch(fieldId) {
8789
          case 1: // PEX
8790
            return PEX;
8791
          default:
8792
            return null;
8793
        }
1982 varun.gupt 8794
      }
8795
 
8796
      /**
8797
       * Find the _Fields constant that matches fieldId, throwing an exception
8798
       * if it is not found.
8799
       */
8800
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8801
        _Fields fields = findByThriftId(fieldId);
8802
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8803
        return fields;
8804
      }
8805
 
8806
      /**
8807
       * Find the _Fields constant that matches name, or null if its not found.
8808
       */
8809
      public static _Fields findByName(String name) {
8810
        return byName.get(name);
8811
      }
8812
 
8813
      private final short _thriftId;
8814
      private final String _fieldName;
8815
 
8816
      _Fields(short thriftId, String fieldName) {
8817
        _thriftId = thriftId;
8818
        _fieldName = fieldName;
8819
      }
8820
 
8821
      public short getThriftFieldId() {
8822
        return _thriftId;
8823
      }
8824
 
8825
      public String getFieldName() {
8826
        return _fieldName;
8827
      }
8828
    }
8829
 
8830
    // isset id assignments
8831
 
3430 rajveer 8832
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8833
    static {
3430 rajveer 8834
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8835
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8836
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8837
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8838
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 8839
    }
8840
 
8841
    public trackCouponUsage_result() {
8842
    }
8843
 
8844
    public trackCouponUsage_result(
8845
      PromotionException pex)
8846
    {
8847
      this();
8848
      this.pex = pex;
8849
    }
8850
 
8851
    /**
8852
     * Performs a deep copy on <i>other</i>.
8853
     */
8854
    public trackCouponUsage_result(trackCouponUsage_result other) {
8855
      if (other.isSetPex()) {
8856
        this.pex = new PromotionException(other.pex);
8857
      }
8858
    }
8859
 
8860
    public trackCouponUsage_result deepCopy() {
8861
      return new trackCouponUsage_result(this);
8862
    }
8863
 
3430 rajveer 8864
    @Override
8865
    public void clear() {
8866
      this.pex = null;
1982 varun.gupt 8867
    }
8868
 
8869
    public PromotionException getPex() {
8870
      return this.pex;
8871
    }
8872
 
3430 rajveer 8873
    public void setPex(PromotionException pex) {
1982 varun.gupt 8874
      this.pex = pex;
8875
    }
8876
 
8877
    public void unsetPex() {
8878
      this.pex = null;
8879
    }
8880
 
3430 rajveer 8881
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8882
    public boolean isSetPex() {
8883
      return this.pex != null;
8884
    }
8885
 
8886
    public void setPexIsSet(boolean value) {
8887
      if (!value) {
8888
        this.pex = null;
8889
      }
8890
    }
8891
 
8892
    public void setFieldValue(_Fields field, Object value) {
8893
      switch (field) {
8894
      case PEX:
8895
        if (value == null) {
8896
          unsetPex();
8897
        } else {
8898
          setPex((PromotionException)value);
8899
        }
8900
        break;
8901
 
8902
      }
8903
    }
8904
 
8905
    public Object getFieldValue(_Fields field) {
8906
      switch (field) {
8907
      case PEX:
8908
        return getPex();
8909
 
8910
      }
8911
      throw new IllegalStateException();
8912
    }
8913
 
3430 rajveer 8914
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8915
    public boolean isSet(_Fields field) {
8916
      if (field == null) {
8917
        throw new IllegalArgumentException();
8918
      }
1982 varun.gupt 8919
 
8920
      switch (field) {
8921
      case PEX:
8922
        return isSetPex();
8923
      }
8924
      throw new IllegalStateException();
8925
    }
8926
 
8927
    @Override
8928
    public boolean equals(Object that) {
8929
      if (that == null)
8930
        return false;
8931
      if (that instanceof trackCouponUsage_result)
8932
        return this.equals((trackCouponUsage_result)that);
8933
      return false;
8934
    }
8935
 
8936
    public boolean equals(trackCouponUsage_result that) {
8937
      if (that == null)
8938
        return false;
8939
 
8940
      boolean this_present_pex = true && this.isSetPex();
8941
      boolean that_present_pex = true && that.isSetPex();
8942
      if (this_present_pex || that_present_pex) {
8943
        if (!(this_present_pex && that_present_pex))
8944
          return false;
8945
        if (!this.pex.equals(that.pex))
8946
          return false;
8947
      }
8948
 
8949
      return true;
8950
    }
8951
 
8952
    @Override
8953
    public int hashCode() {
8954
      return 0;
8955
    }
8956
 
8957
    public int compareTo(trackCouponUsage_result other) {
8958
      if (!getClass().equals(other.getClass())) {
8959
        return getClass().getName().compareTo(other.getClass().getName());
8960
      }
8961
 
8962
      int lastComparison = 0;
8963
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
8964
 
3430 rajveer 8965
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 8966
      if (lastComparison != 0) {
8967
        return lastComparison;
8968
      }
3430 rajveer 8969
      if (isSetPex()) {
8970
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8971
        if (lastComparison != 0) {
8972
          return lastComparison;
8973
        }
1982 varun.gupt 8974
      }
8975
      return 0;
8976
    }
8977
 
3430 rajveer 8978
    public _Fields fieldForId(int fieldId) {
8979
      return _Fields.findByThriftId(fieldId);
8980
    }
8981
 
8982
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8983
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8984
      iprot.readStructBegin();
8985
      while (true)
8986
      {
8987
        field = iprot.readFieldBegin();
3430 rajveer 8988
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8989
          break;
8990
        }
3430 rajveer 8991
        switch (field.id) {
8992
          case 1: // PEX
8993
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8994
              this.pex = new PromotionException();
8995
              this.pex.read(iprot);
8996
            } else { 
8997
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8998
            }
8999
            break;
9000
          default:
9001
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9002
        }
3430 rajveer 9003
        iprot.readFieldEnd();
1982 varun.gupt 9004
      }
9005
      iprot.readStructEnd();
9006
      validate();
9007
    }
9008
 
3430 rajveer 9009
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9010
      oprot.writeStructBegin(STRUCT_DESC);
9011
 
9012
      if (this.isSetPex()) {
9013
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9014
        this.pex.write(oprot);
9015
        oprot.writeFieldEnd();
9016
      }
9017
      oprot.writeFieldStop();
9018
      oprot.writeStructEnd();
9019
    }
9020
 
9021
    @Override
9022
    public String toString() {
9023
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
9024
      boolean first = true;
9025
 
9026
      sb.append("pex:");
9027
      if (this.pex == null) {
9028
        sb.append("null");
9029
      } else {
9030
        sb.append(this.pex);
9031
      }
9032
      first = false;
9033
      sb.append(")");
9034
      return sb.toString();
9035
    }
9036
 
3430 rajveer 9037
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9038
      // check for required fields
9039
    }
9040
 
3430 rajveer 9041
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9042
      try {
9043
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9044
      } catch (org.apache.thrift.TException te) {
9045
        throw new java.io.IOException(te);
9046
      }
9047
    }
9048
 
9049
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9050
      try {
9051
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9052
      } catch (org.apache.thrift.TException te) {
9053
        throw new java.io.IOException(te);
9054
      }
9055
    }
9056
 
1982 varun.gupt 9057
  }
9058
 
3430 rajveer 9059
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
9060
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 9061
 
3430 rajveer 9062
    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);
9063
    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 9064
 
3430 rajveer 9065
    private String couponCode; // required
9066
    private long userId; // required
1982 varun.gupt 9067
 
9068
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9069
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9070
      COUPON_CODE((short)1, "couponCode"),
9071
      USER_ID((short)2, "userId");
9072
 
9073
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9074
 
9075
      static {
9076
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9077
          byName.put(field.getFieldName(), field);
9078
        }
9079
      }
9080
 
9081
      /**
9082
       * Find the _Fields constant that matches fieldId, or null if its not found.
9083
       */
9084
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9085
        switch(fieldId) {
9086
          case 1: // COUPON_CODE
9087
            return COUPON_CODE;
9088
          case 2: // USER_ID
9089
            return USER_ID;
9090
          default:
9091
            return null;
9092
        }
1982 varun.gupt 9093
      }
9094
 
9095
      /**
9096
       * Find the _Fields constant that matches fieldId, throwing an exception
9097
       * if it is not found.
9098
       */
9099
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9100
        _Fields fields = findByThriftId(fieldId);
9101
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9102
        return fields;
9103
      }
9104
 
9105
      /**
9106
       * Find the _Fields constant that matches name, or null if its not found.
9107
       */
9108
      public static _Fields findByName(String name) {
9109
        return byName.get(name);
9110
      }
9111
 
9112
      private final short _thriftId;
9113
      private final String _fieldName;
9114
 
9115
      _Fields(short thriftId, String fieldName) {
9116
        _thriftId = thriftId;
9117
        _fieldName = fieldName;
9118
      }
9119
 
9120
      public short getThriftFieldId() {
9121
        return _thriftId;
9122
      }
9123
 
9124
      public String getFieldName() {
9125
        return _fieldName;
9126
      }
9127
    }
9128
 
9129
    // isset id assignments
9130
    private static final int __USERID_ISSET_ID = 0;
9131
    private BitSet __isset_bit_vector = new BitSet(1);
9132
 
3430 rajveer 9133
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9134
    static {
3430 rajveer 9135
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9136
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9137
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9138
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9139
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9140
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9141
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 9142
    }
9143
 
9144
    public getCouponUsageCountByUser_args() {
9145
    }
9146
 
9147
    public getCouponUsageCountByUser_args(
9148
      String couponCode,
9149
      long userId)
9150
    {
9151
      this();
9152
      this.couponCode = couponCode;
9153
      this.userId = userId;
9154
      setUserIdIsSet(true);
9155
    }
9156
 
9157
    /**
9158
     * Performs a deep copy on <i>other</i>.
9159
     */
9160
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
9161
      __isset_bit_vector.clear();
9162
      __isset_bit_vector.or(other.__isset_bit_vector);
9163
      if (other.isSetCouponCode()) {
9164
        this.couponCode = other.couponCode;
9165
      }
9166
      this.userId = other.userId;
9167
    }
9168
 
9169
    public getCouponUsageCountByUser_args deepCopy() {
9170
      return new getCouponUsageCountByUser_args(this);
9171
    }
9172
 
3430 rajveer 9173
    @Override
9174
    public void clear() {
9175
      this.couponCode = null;
9176
      setUserIdIsSet(false);
9177
      this.userId = 0;
1982 varun.gupt 9178
    }
9179
 
9180
    public String getCouponCode() {
9181
      return this.couponCode;
9182
    }
9183
 
3430 rajveer 9184
    public void setCouponCode(String couponCode) {
1982 varun.gupt 9185
      this.couponCode = couponCode;
9186
    }
9187
 
9188
    public void unsetCouponCode() {
9189
      this.couponCode = null;
9190
    }
9191
 
3430 rajveer 9192
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9193
    public boolean isSetCouponCode() {
9194
      return this.couponCode != null;
9195
    }
9196
 
9197
    public void setCouponCodeIsSet(boolean value) {
9198
      if (!value) {
9199
        this.couponCode = null;
9200
      }
9201
    }
9202
 
9203
    public long getUserId() {
9204
      return this.userId;
9205
    }
9206
 
3430 rajveer 9207
    public void setUserId(long userId) {
1982 varun.gupt 9208
      this.userId = userId;
9209
      setUserIdIsSet(true);
9210
    }
9211
 
9212
    public void unsetUserId() {
9213
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9214
    }
9215
 
3430 rajveer 9216
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9217
    public boolean isSetUserId() {
9218
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9219
    }
9220
 
9221
    public void setUserIdIsSet(boolean value) {
9222
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9223
    }
9224
 
9225
    public void setFieldValue(_Fields field, Object value) {
9226
      switch (field) {
9227
      case COUPON_CODE:
9228
        if (value == null) {
9229
          unsetCouponCode();
9230
        } else {
9231
          setCouponCode((String)value);
9232
        }
9233
        break;
9234
 
9235
      case USER_ID:
9236
        if (value == null) {
9237
          unsetUserId();
9238
        } else {
9239
          setUserId((Long)value);
9240
        }
9241
        break;
9242
 
9243
      }
9244
    }
9245
 
9246
    public Object getFieldValue(_Fields field) {
9247
      switch (field) {
9248
      case COUPON_CODE:
9249
        return getCouponCode();
9250
 
9251
      case USER_ID:
3430 rajveer 9252
        return Long.valueOf(getUserId());
1982 varun.gupt 9253
 
9254
      }
9255
      throw new IllegalStateException();
9256
    }
9257
 
3430 rajveer 9258
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9259
    public boolean isSet(_Fields field) {
9260
      if (field == null) {
9261
        throw new IllegalArgumentException();
9262
      }
1982 varun.gupt 9263
 
9264
      switch (field) {
9265
      case COUPON_CODE:
9266
        return isSetCouponCode();
9267
      case USER_ID:
9268
        return isSetUserId();
9269
      }
9270
      throw new IllegalStateException();
9271
    }
9272
 
9273
    @Override
9274
    public boolean equals(Object that) {
9275
      if (that == null)
9276
        return false;
9277
      if (that instanceof getCouponUsageCountByUser_args)
9278
        return this.equals((getCouponUsageCountByUser_args)that);
9279
      return false;
9280
    }
9281
 
9282
    public boolean equals(getCouponUsageCountByUser_args that) {
9283
      if (that == null)
9284
        return false;
9285
 
9286
      boolean this_present_couponCode = true && this.isSetCouponCode();
9287
      boolean that_present_couponCode = true && that.isSetCouponCode();
9288
      if (this_present_couponCode || that_present_couponCode) {
9289
        if (!(this_present_couponCode && that_present_couponCode))
9290
          return false;
9291
        if (!this.couponCode.equals(that.couponCode))
9292
          return false;
9293
      }
9294
 
9295
      boolean this_present_userId = true;
9296
      boolean that_present_userId = true;
9297
      if (this_present_userId || that_present_userId) {
9298
        if (!(this_present_userId && that_present_userId))
9299
          return false;
9300
        if (this.userId != that.userId)
9301
          return false;
9302
      }
9303
 
9304
      return true;
9305
    }
9306
 
9307
    @Override
9308
    public int hashCode() {
9309
      return 0;
9310
    }
9311
 
9312
    public int compareTo(getCouponUsageCountByUser_args other) {
9313
      if (!getClass().equals(other.getClass())) {
9314
        return getClass().getName().compareTo(other.getClass().getName());
9315
      }
9316
 
9317
      int lastComparison = 0;
9318
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
9319
 
3430 rajveer 9320
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 9321
      if (lastComparison != 0) {
9322
        return lastComparison;
9323
      }
3430 rajveer 9324
      if (isSetCouponCode()) {
9325
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9326
        if (lastComparison != 0) {
9327
          return lastComparison;
9328
        }
1982 varun.gupt 9329
      }
3430 rajveer 9330
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 9331
      if (lastComparison != 0) {
9332
        return lastComparison;
9333
      }
3430 rajveer 9334
      if (isSetUserId()) {
9335
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9336
        if (lastComparison != 0) {
9337
          return lastComparison;
9338
        }
1982 varun.gupt 9339
      }
9340
      return 0;
9341
    }
9342
 
3430 rajveer 9343
    public _Fields fieldForId(int fieldId) {
9344
      return _Fields.findByThriftId(fieldId);
9345
    }
9346
 
9347
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9348
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9349
      iprot.readStructBegin();
9350
      while (true)
9351
      {
9352
        field = iprot.readFieldBegin();
3430 rajveer 9353
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9354
          break;
9355
        }
3430 rajveer 9356
        switch (field.id) {
9357
          case 1: // COUPON_CODE
9358
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9359
              this.couponCode = iprot.readString();
9360
            } else { 
9361
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9362
            }
9363
            break;
9364
          case 2: // USER_ID
9365
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9366
              this.userId = iprot.readI64();
9367
              setUserIdIsSet(true);
9368
            } else { 
9369
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9370
            }
9371
            break;
9372
          default:
9373
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9374
        }
3430 rajveer 9375
        iprot.readFieldEnd();
1982 varun.gupt 9376
      }
9377
      iprot.readStructEnd();
9378
      validate();
9379
    }
9380
 
3430 rajveer 9381
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9382
      validate();
9383
 
9384
      oprot.writeStructBegin(STRUCT_DESC);
9385
      if (this.couponCode != null) {
9386
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9387
        oprot.writeString(this.couponCode);
9388
        oprot.writeFieldEnd();
9389
      }
9390
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9391
      oprot.writeI64(this.userId);
9392
      oprot.writeFieldEnd();
9393
      oprot.writeFieldStop();
9394
      oprot.writeStructEnd();
9395
    }
9396
 
9397
    @Override
9398
    public String toString() {
9399
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
9400
      boolean first = true;
9401
 
9402
      sb.append("couponCode:");
9403
      if (this.couponCode == null) {
9404
        sb.append("null");
9405
      } else {
9406
        sb.append(this.couponCode);
9407
      }
9408
      first = false;
9409
      if (!first) sb.append(", ");
9410
      sb.append("userId:");
9411
      sb.append(this.userId);
9412
      first = false;
9413
      sb.append(")");
9414
      return sb.toString();
9415
    }
9416
 
3430 rajveer 9417
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9418
      // check for required fields
9419
    }
9420
 
3430 rajveer 9421
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9422
      try {
9423
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9424
      } catch (org.apache.thrift.TException te) {
9425
        throw new java.io.IOException(te);
9426
      }
9427
    }
9428
 
9429
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9430
      try {
9431
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9432
        __isset_bit_vector = new BitSet(1);
9433
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9434
      } catch (org.apache.thrift.TException te) {
9435
        throw new java.io.IOException(te);
9436
      }
9437
    }
9438
 
1982 varun.gupt 9439
  }
9440
 
3430 rajveer 9441
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
9442
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 9443
 
3430 rajveer 9444
    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);
9445
    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 9446
 
3430 rajveer 9447
    private long success; // required
9448
    private PromotionException pex; // required
1982 varun.gupt 9449
 
9450
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9451
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9452
      SUCCESS((short)0, "success"),
9453
      PEX((short)1, "pex");
9454
 
9455
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9456
 
9457
      static {
9458
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9459
          byName.put(field.getFieldName(), field);
9460
        }
9461
      }
9462
 
9463
      /**
9464
       * Find the _Fields constant that matches fieldId, or null if its not found.
9465
       */
9466
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9467
        switch(fieldId) {
9468
          case 0: // SUCCESS
9469
            return SUCCESS;
9470
          case 1: // PEX
9471
            return PEX;
9472
          default:
9473
            return null;
9474
        }
1982 varun.gupt 9475
      }
9476
 
9477
      /**
9478
       * Find the _Fields constant that matches fieldId, throwing an exception
9479
       * if it is not found.
9480
       */
9481
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9482
        _Fields fields = findByThriftId(fieldId);
9483
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9484
        return fields;
9485
      }
9486
 
9487
      /**
9488
       * Find the _Fields constant that matches name, or null if its not found.
9489
       */
9490
      public static _Fields findByName(String name) {
9491
        return byName.get(name);
9492
      }
9493
 
9494
      private final short _thriftId;
9495
      private final String _fieldName;
9496
 
9497
      _Fields(short thriftId, String fieldName) {
9498
        _thriftId = thriftId;
9499
        _fieldName = fieldName;
9500
      }
9501
 
9502
      public short getThriftFieldId() {
9503
        return _thriftId;
9504
      }
9505
 
9506
      public String getFieldName() {
9507
        return _fieldName;
9508
      }
9509
    }
9510
 
9511
    // isset id assignments
9512
    private static final int __SUCCESS_ISSET_ID = 0;
9513
    private BitSet __isset_bit_vector = new BitSet(1);
9514
 
3430 rajveer 9515
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9516
    static {
3430 rajveer 9517
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9518
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9519
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9520
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9521
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9522
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9523
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 9524
    }
9525
 
9526
    public getCouponUsageCountByUser_result() {
9527
    }
9528
 
9529
    public getCouponUsageCountByUser_result(
9530
      long success,
9531
      PromotionException pex)
9532
    {
9533
      this();
9534
      this.success = success;
9535
      setSuccessIsSet(true);
9536
      this.pex = pex;
9537
    }
9538
 
9539
    /**
9540
     * Performs a deep copy on <i>other</i>.
9541
     */
9542
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
9543
      __isset_bit_vector.clear();
9544
      __isset_bit_vector.or(other.__isset_bit_vector);
9545
      this.success = other.success;
9546
      if (other.isSetPex()) {
9547
        this.pex = new PromotionException(other.pex);
9548
      }
9549
    }
9550
 
9551
    public getCouponUsageCountByUser_result deepCopy() {
9552
      return new getCouponUsageCountByUser_result(this);
9553
    }
9554
 
3430 rajveer 9555
    @Override
9556
    public void clear() {
9557
      setSuccessIsSet(false);
9558
      this.success = 0;
9559
      this.pex = null;
1982 varun.gupt 9560
    }
9561
 
9562
    public long getSuccess() {
9563
      return this.success;
9564
    }
9565
 
3430 rajveer 9566
    public void setSuccess(long success) {
1982 varun.gupt 9567
      this.success = success;
9568
      setSuccessIsSet(true);
9569
    }
9570
 
9571
    public void unsetSuccess() {
9572
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
9573
    }
9574
 
3430 rajveer 9575
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9576
    public boolean isSetSuccess() {
9577
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
9578
    }
9579
 
9580
    public void setSuccessIsSet(boolean value) {
9581
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
9582
    }
9583
 
9584
    public PromotionException getPex() {
9585
      return this.pex;
9586
    }
9587
 
3430 rajveer 9588
    public void setPex(PromotionException pex) {
1982 varun.gupt 9589
      this.pex = pex;
9590
    }
9591
 
9592
    public void unsetPex() {
9593
      this.pex = null;
9594
    }
9595
 
3430 rajveer 9596
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9597
    public boolean isSetPex() {
9598
      return this.pex != null;
9599
    }
9600
 
9601
    public void setPexIsSet(boolean value) {
9602
      if (!value) {
9603
        this.pex = null;
9604
      }
9605
    }
9606
 
9607
    public void setFieldValue(_Fields field, Object value) {
9608
      switch (field) {
9609
      case SUCCESS:
9610
        if (value == null) {
9611
          unsetSuccess();
9612
        } else {
9613
          setSuccess((Long)value);
9614
        }
9615
        break;
9616
 
9617
      case PEX:
9618
        if (value == null) {
9619
          unsetPex();
9620
        } else {
9621
          setPex((PromotionException)value);
9622
        }
9623
        break;
9624
 
9625
      }
9626
    }
9627
 
9628
    public Object getFieldValue(_Fields field) {
9629
      switch (field) {
9630
      case SUCCESS:
3430 rajveer 9631
        return Long.valueOf(getSuccess());
1982 varun.gupt 9632
 
9633
      case PEX:
9634
        return getPex();
9635
 
9636
      }
9637
      throw new IllegalStateException();
9638
    }
9639
 
3430 rajveer 9640
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9641
    public boolean isSet(_Fields field) {
9642
      if (field == null) {
9643
        throw new IllegalArgumentException();
9644
      }
1982 varun.gupt 9645
 
9646
      switch (field) {
9647
      case SUCCESS:
9648
        return isSetSuccess();
9649
      case PEX:
9650
        return isSetPex();
9651
      }
9652
      throw new IllegalStateException();
9653
    }
9654
 
9655
    @Override
9656
    public boolean equals(Object that) {
9657
      if (that == null)
9658
        return false;
9659
      if (that instanceof getCouponUsageCountByUser_result)
9660
        return this.equals((getCouponUsageCountByUser_result)that);
9661
      return false;
9662
    }
9663
 
9664
    public boolean equals(getCouponUsageCountByUser_result that) {
9665
      if (that == null)
9666
        return false;
9667
 
9668
      boolean this_present_success = true;
9669
      boolean that_present_success = true;
9670
      if (this_present_success || that_present_success) {
9671
        if (!(this_present_success && that_present_success))
9672
          return false;
9673
        if (this.success != that.success)
9674
          return false;
9675
      }
9676
 
9677
      boolean this_present_pex = true && this.isSetPex();
9678
      boolean that_present_pex = true && that.isSetPex();
9679
      if (this_present_pex || that_present_pex) {
9680
        if (!(this_present_pex && that_present_pex))
9681
          return false;
9682
        if (!this.pex.equals(that.pex))
9683
          return false;
9684
      }
9685
 
9686
      return true;
9687
    }
9688
 
9689
    @Override
9690
    public int hashCode() {
9691
      return 0;
9692
    }
9693
 
9694
    public int compareTo(getCouponUsageCountByUser_result other) {
9695
      if (!getClass().equals(other.getClass())) {
9696
        return getClass().getName().compareTo(other.getClass().getName());
9697
      }
9698
 
9699
      int lastComparison = 0;
9700
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
9701
 
3430 rajveer 9702
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 9703
      if (lastComparison != 0) {
9704
        return lastComparison;
9705
      }
3430 rajveer 9706
      if (isSetSuccess()) {
9707
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9708
        if (lastComparison != 0) {
9709
          return lastComparison;
9710
        }
1982 varun.gupt 9711
      }
3430 rajveer 9712
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 9713
      if (lastComparison != 0) {
9714
        return lastComparison;
9715
      }
3430 rajveer 9716
      if (isSetPex()) {
9717
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9718
        if (lastComparison != 0) {
9719
          return lastComparison;
9720
        }
1982 varun.gupt 9721
      }
9722
      return 0;
9723
    }
9724
 
3430 rajveer 9725
    public _Fields fieldForId(int fieldId) {
9726
      return _Fields.findByThriftId(fieldId);
9727
    }
9728
 
9729
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9730
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9731
      iprot.readStructBegin();
9732
      while (true)
9733
      {
9734
        field = iprot.readFieldBegin();
3430 rajveer 9735
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9736
          break;
9737
        }
3430 rajveer 9738
        switch (field.id) {
9739
          case 0: // SUCCESS
9740
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9741
              this.success = iprot.readI64();
9742
              setSuccessIsSet(true);
9743
            } else { 
9744
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9745
            }
9746
            break;
9747
          case 1: // PEX
9748
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9749
              this.pex = new PromotionException();
9750
              this.pex.read(iprot);
9751
            } else { 
9752
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9753
            }
9754
            break;
9755
          default:
9756
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9757
        }
3430 rajveer 9758
        iprot.readFieldEnd();
1982 varun.gupt 9759
      }
9760
      iprot.readStructEnd();
9761
      validate();
9762
    }
9763
 
3430 rajveer 9764
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9765
      oprot.writeStructBegin(STRUCT_DESC);
9766
 
9767
      if (this.isSetSuccess()) {
9768
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9769
        oprot.writeI64(this.success);
9770
        oprot.writeFieldEnd();
9771
      } else if (this.isSetPex()) {
9772
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9773
        this.pex.write(oprot);
9774
        oprot.writeFieldEnd();
9775
      }
9776
      oprot.writeFieldStop();
9777
      oprot.writeStructEnd();
9778
    }
9779
 
9780
    @Override
9781
    public String toString() {
9782
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
9783
      boolean first = true;
9784
 
9785
      sb.append("success:");
9786
      sb.append(this.success);
9787
      first = false;
9788
      if (!first) sb.append(", ");
9789
      sb.append("pex:");
9790
      if (this.pex == null) {
9791
        sb.append("null");
9792
      } else {
9793
        sb.append(this.pex);
9794
      }
9795
      first = false;
9796
      sb.append(")");
9797
      return sb.toString();
9798
    }
9799
 
3430 rajveer 9800
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9801
      // check for required fields
9802
    }
9803
 
3430 rajveer 9804
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9805
      try {
9806
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9807
      } catch (org.apache.thrift.TException te) {
9808
        throw new java.io.IOException(te);
9809
      }
9810
    }
9811
 
9812
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9813
      try {
9814
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9815
      } catch (org.apache.thrift.TException te) {
9816
        throw new java.io.IOException(te);
9817
      }
9818
    }
9819
 
1982 varun.gupt 9820
  }
9821
 
3430 rajveer 9822
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
9823
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 9824
 
9825
 
9826
 
9827
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9828
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 9829
;
9830
 
9831
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9832
 
9833
      static {
9834
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9835
          byName.put(field.getFieldName(), field);
9836
        }
9837
      }
9838
 
9839
      /**
9840
       * Find the _Fields constant that matches fieldId, or null if its not found.
9841
       */
9842
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9843
        switch(fieldId) {
9844
          default:
9845
            return null;
9846
        }
3385 varun.gupt 9847
      }
9848
 
9849
      /**
9850
       * Find the _Fields constant that matches fieldId, throwing an exception
9851
       * if it is not found.
9852
       */
9853
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9854
        _Fields fields = findByThriftId(fieldId);
9855
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9856
        return fields;
9857
      }
9858
 
9859
      /**
9860
       * Find the _Fields constant that matches name, or null if its not found.
9861
       */
9862
      public static _Fields findByName(String name) {
9863
        return byName.get(name);
9864
      }
9865
 
9866
      private final short _thriftId;
9867
      private final String _fieldName;
9868
 
9869
      _Fields(short thriftId, String fieldName) {
9870
        _thriftId = thriftId;
9871
        _fieldName = fieldName;
9872
      }
9873
 
9874
      public short getThriftFieldId() {
9875
        return _thriftId;
9876
      }
9877
 
9878
      public String getFieldName() {
9879
        return _fieldName;
9880
      }
9881
    }
3430 rajveer 9882
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 9883
    static {
3430 rajveer 9884
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9885
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9886
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 9887
    }
9888
 
9889
    public getActiveCoupons_args() {
9890
    }
9891
 
9892
    /**
9893
     * Performs a deep copy on <i>other</i>.
9894
     */
9895
    public getActiveCoupons_args(getActiveCoupons_args other) {
9896
    }
9897
 
9898
    public getActiveCoupons_args deepCopy() {
9899
      return new getActiveCoupons_args(this);
9900
    }
9901
 
3430 rajveer 9902
    @Override
9903
    public void clear() {
3385 varun.gupt 9904
    }
9905
 
9906
    public void setFieldValue(_Fields field, Object value) {
9907
      switch (field) {
9908
      }
9909
    }
9910
 
9911
    public Object getFieldValue(_Fields field) {
9912
      switch (field) {
9913
      }
9914
      throw new IllegalStateException();
9915
    }
9916
 
3430 rajveer 9917
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9918
    public boolean isSet(_Fields field) {
9919
      if (field == null) {
9920
        throw new IllegalArgumentException();
9921
      }
3385 varun.gupt 9922
 
9923
      switch (field) {
9924
      }
9925
      throw new IllegalStateException();
9926
    }
9927
 
9928
    @Override
9929
    public boolean equals(Object that) {
9930
      if (that == null)
9931
        return false;
9932
      if (that instanceof getActiveCoupons_args)
9933
        return this.equals((getActiveCoupons_args)that);
9934
      return false;
9935
    }
9936
 
9937
    public boolean equals(getActiveCoupons_args that) {
9938
      if (that == null)
9939
        return false;
9940
 
9941
      return true;
9942
    }
9943
 
9944
    @Override
9945
    public int hashCode() {
9946
      return 0;
9947
    }
9948
 
9949
    public int compareTo(getActiveCoupons_args other) {
9950
      if (!getClass().equals(other.getClass())) {
9951
        return getClass().getName().compareTo(other.getClass().getName());
9952
      }
9953
 
9954
      int lastComparison = 0;
9955
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
9956
 
9957
      return 0;
9958
    }
9959
 
3430 rajveer 9960
    public _Fields fieldForId(int fieldId) {
9961
      return _Fields.findByThriftId(fieldId);
9962
    }
9963
 
9964
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9965
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 9966
      iprot.readStructBegin();
9967
      while (true)
9968
      {
9969
        field = iprot.readFieldBegin();
3430 rajveer 9970
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 9971
          break;
9972
        }
3430 rajveer 9973
        switch (field.id) {
9974
          default:
9975
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 9976
        }
3430 rajveer 9977
        iprot.readFieldEnd();
3385 varun.gupt 9978
      }
9979
      iprot.readStructEnd();
9980
      validate();
9981
    }
9982
 
3430 rajveer 9983
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 9984
      validate();
9985
 
9986
      oprot.writeStructBegin(STRUCT_DESC);
9987
      oprot.writeFieldStop();
9988
      oprot.writeStructEnd();
9989
    }
9990
 
9991
    @Override
9992
    public String toString() {
9993
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
9994
      boolean first = true;
9995
 
9996
      sb.append(")");
9997
      return sb.toString();
9998
    }
9999
 
3430 rajveer 10000
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 10001
      // check for required fields
10002
    }
10003
 
3430 rajveer 10004
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10005
      try {
10006
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10007
      } catch (org.apache.thrift.TException te) {
10008
        throw new java.io.IOException(te);
10009
      }
10010
    }
10011
 
10012
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10013
      try {
10014
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10015
      } catch (org.apache.thrift.TException te) {
10016
        throw new java.io.IOException(te);
10017
      }
10018
    }
10019
 
3385 varun.gupt 10020
  }
10021
 
3430 rajveer 10022
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
10023
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 10024
 
3430 rajveer 10025
    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);
10026
    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 10027
 
3430 rajveer 10028
    private List<Coupon> success; // required
10029
    private PromotionException pex; // required
3385 varun.gupt 10030
 
10031
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10032
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 10033
      SUCCESS((short)0, "success"),
10034
      PEX((short)1, "pex");
10035
 
10036
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10037
 
10038
      static {
10039
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10040
          byName.put(field.getFieldName(), field);
10041
        }
10042
      }
10043
 
10044
      /**
10045
       * Find the _Fields constant that matches fieldId, or null if its not found.
10046
       */
10047
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10048
        switch(fieldId) {
10049
          case 0: // SUCCESS
10050
            return SUCCESS;
10051
          case 1: // PEX
10052
            return PEX;
10053
          default:
10054
            return null;
10055
        }
3385 varun.gupt 10056
      }
10057
 
10058
      /**
10059
       * Find the _Fields constant that matches fieldId, throwing an exception
10060
       * if it is not found.
10061
       */
10062
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10063
        _Fields fields = findByThriftId(fieldId);
10064
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10065
        return fields;
10066
      }
10067
 
10068
      /**
10069
       * Find the _Fields constant that matches name, or null if its not found.
10070
       */
10071
      public static _Fields findByName(String name) {
10072
        return byName.get(name);
10073
      }
10074
 
10075
      private final short _thriftId;
10076
      private final String _fieldName;
10077
 
10078
      _Fields(short thriftId, String fieldName) {
10079
        _thriftId = thriftId;
10080
        _fieldName = fieldName;
10081
      }
10082
 
10083
      public short getThriftFieldId() {
10084
        return _thriftId;
10085
      }
10086
 
10087
      public String getFieldName() {
10088
        return _fieldName;
10089
      }
10090
    }
10091
 
10092
    // isset id assignments
10093
 
3430 rajveer 10094
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 10095
    static {
3430 rajveer 10096
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10097
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10098
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
10099
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
10100
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10101
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10102
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10103
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 10104
    }
10105
 
10106
    public getActiveCoupons_result() {
10107
    }
10108
 
10109
    public getActiveCoupons_result(
10110
      List<Coupon> success,
10111
      PromotionException pex)
10112
    {
10113
      this();
10114
      this.success = success;
10115
      this.pex = pex;
10116
    }
10117
 
10118
    /**
10119
     * Performs a deep copy on <i>other</i>.
10120
     */
10121
    public getActiveCoupons_result(getActiveCoupons_result other) {
10122
      if (other.isSetSuccess()) {
10123
        List<Coupon> __this__success = new ArrayList<Coupon>();
10124
        for (Coupon other_element : other.success) {
10125
          __this__success.add(new Coupon(other_element));
10126
        }
10127
        this.success = __this__success;
10128
      }
10129
      if (other.isSetPex()) {
10130
        this.pex = new PromotionException(other.pex);
10131
      }
10132
    }
10133
 
10134
    public getActiveCoupons_result deepCopy() {
10135
      return new getActiveCoupons_result(this);
10136
    }
10137
 
3430 rajveer 10138
    @Override
10139
    public void clear() {
10140
      this.success = null;
10141
      this.pex = null;
3385 varun.gupt 10142
    }
10143
 
10144
    public int getSuccessSize() {
10145
      return (this.success == null) ? 0 : this.success.size();
10146
    }
10147
 
10148
    public java.util.Iterator<Coupon> getSuccessIterator() {
10149
      return (this.success == null) ? null : this.success.iterator();
10150
    }
10151
 
10152
    public void addToSuccess(Coupon elem) {
10153
      if (this.success == null) {
10154
        this.success = new ArrayList<Coupon>();
10155
      }
10156
      this.success.add(elem);
10157
    }
10158
 
10159
    public List<Coupon> getSuccess() {
10160
      return this.success;
10161
    }
10162
 
3430 rajveer 10163
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 10164
      this.success = success;
10165
    }
10166
 
10167
    public void unsetSuccess() {
10168
      this.success = null;
10169
    }
10170
 
3430 rajveer 10171
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 10172
    public boolean isSetSuccess() {
10173
      return this.success != null;
10174
    }
10175
 
10176
    public void setSuccessIsSet(boolean value) {
10177
      if (!value) {
10178
        this.success = null;
10179
      }
10180
    }
10181
 
10182
    public PromotionException getPex() {
10183
      return this.pex;
10184
    }
10185
 
3430 rajveer 10186
    public void setPex(PromotionException pex) {
3385 varun.gupt 10187
      this.pex = pex;
10188
    }
10189
 
10190
    public void unsetPex() {
10191
      this.pex = null;
10192
    }
10193
 
3430 rajveer 10194
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 10195
    public boolean isSetPex() {
10196
      return this.pex != null;
10197
    }
10198
 
10199
    public void setPexIsSet(boolean value) {
10200
      if (!value) {
10201
        this.pex = null;
10202
      }
10203
    }
10204
 
10205
    public void setFieldValue(_Fields field, Object value) {
10206
      switch (field) {
10207
      case SUCCESS:
10208
        if (value == null) {
10209
          unsetSuccess();
10210
        } else {
10211
          setSuccess((List<Coupon>)value);
10212
        }
10213
        break;
10214
 
10215
      case PEX:
10216
        if (value == null) {
10217
          unsetPex();
10218
        } else {
10219
          setPex((PromotionException)value);
10220
        }
10221
        break;
10222
 
10223
      }
10224
    }
10225
 
10226
    public Object getFieldValue(_Fields field) {
10227
      switch (field) {
10228
      case SUCCESS:
10229
        return getSuccess();
10230
 
10231
      case PEX:
10232
        return getPex();
10233
 
10234
      }
10235
      throw new IllegalStateException();
10236
    }
10237
 
3430 rajveer 10238
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10239
    public boolean isSet(_Fields field) {
10240
      if (field == null) {
10241
        throw new IllegalArgumentException();
10242
      }
3385 varun.gupt 10243
 
10244
      switch (field) {
10245
      case SUCCESS:
10246
        return isSetSuccess();
10247
      case PEX:
10248
        return isSetPex();
10249
      }
10250
      throw new IllegalStateException();
10251
    }
10252
 
10253
    @Override
10254
    public boolean equals(Object that) {
10255
      if (that == null)
10256
        return false;
10257
      if (that instanceof getActiveCoupons_result)
10258
        return this.equals((getActiveCoupons_result)that);
10259
      return false;
10260
    }
10261
 
10262
    public boolean equals(getActiveCoupons_result that) {
10263
      if (that == null)
10264
        return false;
10265
 
10266
      boolean this_present_success = true && this.isSetSuccess();
10267
      boolean that_present_success = true && that.isSetSuccess();
10268
      if (this_present_success || that_present_success) {
10269
        if (!(this_present_success && that_present_success))
10270
          return false;
10271
        if (!this.success.equals(that.success))
10272
          return false;
10273
      }
10274
 
10275
      boolean this_present_pex = true && this.isSetPex();
10276
      boolean that_present_pex = true && that.isSetPex();
10277
      if (this_present_pex || that_present_pex) {
10278
        if (!(this_present_pex && that_present_pex))
10279
          return false;
10280
        if (!this.pex.equals(that.pex))
10281
          return false;
10282
      }
10283
 
10284
      return true;
10285
    }
10286
 
10287
    @Override
10288
    public int hashCode() {
10289
      return 0;
10290
    }
10291
 
10292
    public int compareTo(getActiveCoupons_result other) {
10293
      if (!getClass().equals(other.getClass())) {
10294
        return getClass().getName().compareTo(other.getClass().getName());
10295
      }
10296
 
10297
      int lastComparison = 0;
10298
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
10299
 
3430 rajveer 10300
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 10301
      if (lastComparison != 0) {
10302
        return lastComparison;
10303
      }
3430 rajveer 10304
      if (isSetSuccess()) {
10305
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10306
        if (lastComparison != 0) {
10307
          return lastComparison;
10308
        }
3385 varun.gupt 10309
      }
3430 rajveer 10310
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 10311
      if (lastComparison != 0) {
10312
        return lastComparison;
10313
      }
3430 rajveer 10314
      if (isSetPex()) {
10315
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10316
        if (lastComparison != 0) {
10317
          return lastComparison;
10318
        }
3385 varun.gupt 10319
      }
10320
      return 0;
10321
    }
10322
 
3430 rajveer 10323
    public _Fields fieldForId(int fieldId) {
10324
      return _Fields.findByThriftId(fieldId);
10325
    }
10326
 
10327
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10328
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 10329
      iprot.readStructBegin();
10330
      while (true)
10331
      {
10332
        field = iprot.readFieldBegin();
3430 rajveer 10333
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 10334
          break;
10335
        }
3430 rajveer 10336
        switch (field.id) {
10337
          case 0: // SUCCESS
10338
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
10339
              {
6433 anupam.sin 10340
                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
10341
                this.success = new ArrayList<Coupon>(_list21.size);
10342
                for (int _i22 = 0; _i22 < _list21.size; ++_i22)
3385 varun.gupt 10343
                {
6433 anupam.sin 10344
                  Coupon _elem23; // required
10345
                  _elem23 = new Coupon();
10346
                  _elem23.read(iprot);
10347
                  this.success.add(_elem23);
3385 varun.gupt 10348
                }
3430 rajveer 10349
                iprot.readListEnd();
3385 varun.gupt 10350
              }
3430 rajveer 10351
            } else { 
10352
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10353
            }
10354
            break;
10355
          case 1: // PEX
10356
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10357
              this.pex = new PromotionException();
10358
              this.pex.read(iprot);
10359
            } else { 
10360
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10361
            }
10362
            break;
10363
          default:
10364
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 10365
        }
3430 rajveer 10366
        iprot.readFieldEnd();
3385 varun.gupt 10367
      }
10368
      iprot.readStructEnd();
10369
      validate();
10370
    }
10371
 
3430 rajveer 10372
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 10373
      oprot.writeStructBegin(STRUCT_DESC);
10374
 
10375
      if (this.isSetSuccess()) {
10376
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10377
        {
3430 rajveer 10378
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6433 anupam.sin 10379
          for (Coupon _iter24 : this.success)
3385 varun.gupt 10380
          {
6433 anupam.sin 10381
            _iter24.write(oprot);
3385 varun.gupt 10382
          }
10383
          oprot.writeListEnd();
10384
        }
10385
        oprot.writeFieldEnd();
10386
      } else if (this.isSetPex()) {
10387
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10388
        this.pex.write(oprot);
10389
        oprot.writeFieldEnd();
10390
      }
10391
      oprot.writeFieldStop();
10392
      oprot.writeStructEnd();
10393
    }
10394
 
10395
    @Override
10396
    public String toString() {
10397
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
10398
      boolean first = true;
10399
 
10400
      sb.append("success:");
10401
      if (this.success == null) {
10402
        sb.append("null");
10403
      } else {
10404
        sb.append(this.success);
10405
      }
10406
      first = false;
10407
      if (!first) sb.append(", ");
10408
      sb.append("pex:");
10409
      if (this.pex == null) {
10410
        sb.append("null");
10411
      } else {
10412
        sb.append(this.pex);
10413
      }
10414
      first = false;
10415
      sb.append(")");
10416
      return sb.toString();
10417
    }
10418
 
3430 rajveer 10419
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 10420
      // check for required fields
10421
    }
10422
 
3430 rajveer 10423
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10424
      try {
10425
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10426
      } catch (org.apache.thrift.TException te) {
10427
        throw new java.io.IOException(te);
10428
      }
10429
    }
10430
 
10431
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10432
      try {
10433
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10434
      } catch (org.apache.thrift.TException te) {
10435
        throw new java.io.IOException(te);
10436
      }
10437
    }
10438
 
3385 varun.gupt 10439
  }
10440
 
6250 amit.gupta 10441
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
10442
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
10443
 
10444
    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);
10445
    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);
10446
    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);
10447
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)4);
6356 amit.gupta 10448
    private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)5);
10449
    private static final org.apache.thrift.protocol.TField USAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("usage", org.apache.thrift.protocol.TType.I64, (short)6);
6250 amit.gupta 10450
 
10451
    private long promotionId; // required
10452
    private long endOn; // required
10453
    private String email; // required
10454
    private long amount; // required
6356 amit.gupta 10455
    private boolean isCod; // required
6250 amit.gupta 10456
    private long usage; // required
10457
 
10458
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10459
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10460
      PROMOTION_ID((short)1, "promotionId"),
10461
      END_ON((short)2, "endOn"),
10462
      EMAIL((short)3, "email"),
10463
      AMOUNT((short)4, "amount"),
6356 amit.gupta 10464
      IS_COD((short)5, "isCod"),
10465
      USAGE((short)6, "usage");
6250 amit.gupta 10466
 
10467
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10468
 
10469
      static {
10470
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10471
          byName.put(field.getFieldName(), field);
10472
        }
10473
      }
10474
 
10475
      /**
10476
       * Find the _Fields constant that matches fieldId, or null if its not found.
10477
       */
10478
      public static _Fields findByThriftId(int fieldId) {
10479
        switch(fieldId) {
10480
          case 1: // PROMOTION_ID
10481
            return PROMOTION_ID;
10482
          case 2: // END_ON
10483
            return END_ON;
10484
          case 3: // EMAIL
10485
            return EMAIL;
10486
          case 4: // AMOUNT
10487
            return AMOUNT;
6356 amit.gupta 10488
          case 5: // IS_COD
10489
            return IS_COD;
10490
          case 6: // USAGE
6250 amit.gupta 10491
            return USAGE;
10492
          default:
10493
            return null;
10494
        }
10495
      }
10496
 
10497
      /**
10498
       * Find the _Fields constant that matches fieldId, throwing an exception
10499
       * if it is not found.
10500
       */
10501
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10502
        _Fields fields = findByThriftId(fieldId);
10503
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10504
        return fields;
10505
      }
10506
 
10507
      /**
10508
       * Find the _Fields constant that matches name, or null if its not found.
10509
       */
10510
      public static _Fields findByName(String name) {
10511
        return byName.get(name);
10512
      }
10513
 
10514
      private final short _thriftId;
10515
      private final String _fieldName;
10516
 
10517
      _Fields(short thriftId, String fieldName) {
10518
        _thriftId = thriftId;
10519
        _fieldName = fieldName;
10520
      }
10521
 
10522
      public short getThriftFieldId() {
10523
        return _thriftId;
10524
      }
10525
 
10526
      public String getFieldName() {
10527
        return _fieldName;
10528
      }
10529
    }
10530
 
10531
    // isset id assignments
10532
    private static final int __PROMOTIONID_ISSET_ID = 0;
10533
    private static final int __ENDON_ISSET_ID = 1;
10534
    private static final int __AMOUNT_ISSET_ID = 2;
6356 amit.gupta 10535
    private static final int __ISCOD_ISSET_ID = 3;
10536
    private static final int __USAGE_ISSET_ID = 4;
10537
    private BitSet __isset_bit_vector = new BitSet(5);
6250 amit.gupta 10538
 
10539
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10540
    static {
10541
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10542
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10543
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10544
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10545
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10546
      tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10547
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10548
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10549
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6356 amit.gupta 10550
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10551
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6250 amit.gupta 10552
      tmpMap.put(_Fields.USAGE, new org.apache.thrift.meta_data.FieldMetaData("usage", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10553
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10554
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10555
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
10556
    }
10557
 
10558
    public createCoupon_args() {
10559
    }
10560
 
10561
    public createCoupon_args(
10562
      long promotionId,
10563
      long endOn,
10564
      String email,
10565
      long amount,
6356 amit.gupta 10566
      boolean isCod,
6250 amit.gupta 10567
      long usage)
10568
    {
10569
      this();
10570
      this.promotionId = promotionId;
10571
      setPromotionIdIsSet(true);
10572
      this.endOn = endOn;
10573
      setEndOnIsSet(true);
10574
      this.email = email;
10575
      this.amount = amount;
10576
      setAmountIsSet(true);
6356 amit.gupta 10577
      this.isCod = isCod;
10578
      setIsCodIsSet(true);
6250 amit.gupta 10579
      this.usage = usage;
10580
      setUsageIsSet(true);
10581
    }
10582
 
10583
    /**
10584
     * Performs a deep copy on <i>other</i>.
10585
     */
10586
    public createCoupon_args(createCoupon_args other) {
10587
      __isset_bit_vector.clear();
10588
      __isset_bit_vector.or(other.__isset_bit_vector);
10589
      this.promotionId = other.promotionId;
10590
      this.endOn = other.endOn;
10591
      if (other.isSetEmail()) {
10592
        this.email = other.email;
10593
      }
10594
      this.amount = other.amount;
6356 amit.gupta 10595
      this.isCod = other.isCod;
6250 amit.gupta 10596
      this.usage = other.usage;
10597
    }
10598
 
10599
    public createCoupon_args deepCopy() {
10600
      return new createCoupon_args(this);
10601
    }
10602
 
10603
    @Override
10604
    public void clear() {
10605
      setPromotionIdIsSet(false);
10606
      this.promotionId = 0;
10607
      setEndOnIsSet(false);
10608
      this.endOn = 0;
10609
      this.email = null;
10610
      setAmountIsSet(false);
10611
      this.amount = 0;
6356 amit.gupta 10612
      setIsCodIsSet(false);
10613
      this.isCod = false;
6250 amit.gupta 10614
      setUsageIsSet(false);
10615
      this.usage = 0;
10616
    }
10617
 
10618
    public long getPromotionId() {
10619
      return this.promotionId;
10620
    }
10621
 
10622
    public void setPromotionId(long promotionId) {
10623
      this.promotionId = promotionId;
10624
      setPromotionIdIsSet(true);
10625
    }
10626
 
10627
    public void unsetPromotionId() {
10628
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
10629
    }
10630
 
10631
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
10632
    public boolean isSetPromotionId() {
10633
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
10634
    }
10635
 
10636
    public void setPromotionIdIsSet(boolean value) {
10637
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
10638
    }
10639
 
10640
    public long getEndOn() {
10641
      return this.endOn;
10642
    }
10643
 
10644
    public void setEndOn(long endOn) {
10645
      this.endOn = endOn;
10646
      setEndOnIsSet(true);
10647
    }
10648
 
10649
    public void unsetEndOn() {
10650
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
10651
    }
10652
 
10653
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
10654
    public boolean isSetEndOn() {
10655
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
10656
    }
10657
 
10658
    public void setEndOnIsSet(boolean value) {
10659
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
10660
    }
10661
 
10662
    public String getEmail() {
10663
      return this.email;
10664
    }
10665
 
10666
    public void setEmail(String email) {
10667
      this.email = email;
10668
    }
10669
 
10670
    public void unsetEmail() {
10671
      this.email = null;
10672
    }
10673
 
10674
    /** Returns true if field email is set (has been assigned a value) and false otherwise */
10675
    public boolean isSetEmail() {
10676
      return this.email != null;
10677
    }
10678
 
10679
    public void setEmailIsSet(boolean value) {
10680
      if (!value) {
10681
        this.email = null;
10682
      }
10683
    }
10684
 
10685
    public long getAmount() {
10686
      return this.amount;
10687
    }
10688
 
10689
    public void setAmount(long amount) {
10690
      this.amount = amount;
10691
      setAmountIsSet(true);
10692
    }
10693
 
10694
    public void unsetAmount() {
10695
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
10696
    }
10697
 
10698
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
10699
    public boolean isSetAmount() {
10700
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
10701
    }
10702
 
10703
    public void setAmountIsSet(boolean value) {
10704
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
10705
    }
10706
 
6356 amit.gupta 10707
    public boolean isIsCod() {
10708
      return this.isCod;
10709
    }
10710
 
10711
    public void setIsCod(boolean isCod) {
10712
      this.isCod = isCod;
10713
      setIsCodIsSet(true);
10714
    }
10715
 
10716
    public void unsetIsCod() {
10717
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
10718
    }
10719
 
10720
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
10721
    public boolean isSetIsCod() {
10722
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
10723
    }
10724
 
10725
    public void setIsCodIsSet(boolean value) {
10726
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
10727
    }
10728
 
6250 amit.gupta 10729
    public long getUsage() {
10730
      return this.usage;
10731
    }
10732
 
10733
    public void setUsage(long usage) {
10734
      this.usage = usage;
10735
      setUsageIsSet(true);
10736
    }
10737
 
10738
    public void unsetUsage() {
10739
      __isset_bit_vector.clear(__USAGE_ISSET_ID);
10740
    }
10741
 
10742
    /** Returns true if field usage is set (has been assigned a value) and false otherwise */
10743
    public boolean isSetUsage() {
10744
      return __isset_bit_vector.get(__USAGE_ISSET_ID);
10745
    }
10746
 
10747
    public void setUsageIsSet(boolean value) {
10748
      __isset_bit_vector.set(__USAGE_ISSET_ID, value);
10749
    }
10750
 
10751
    public void setFieldValue(_Fields field, Object value) {
10752
      switch (field) {
10753
      case PROMOTION_ID:
10754
        if (value == null) {
10755
          unsetPromotionId();
10756
        } else {
10757
          setPromotionId((Long)value);
10758
        }
10759
        break;
10760
 
10761
      case END_ON:
10762
        if (value == null) {
10763
          unsetEndOn();
10764
        } else {
10765
          setEndOn((Long)value);
10766
        }
10767
        break;
10768
 
10769
      case EMAIL:
10770
        if (value == null) {
10771
          unsetEmail();
10772
        } else {
10773
          setEmail((String)value);
10774
        }
10775
        break;
10776
 
10777
      case AMOUNT:
10778
        if (value == null) {
10779
          unsetAmount();
10780
        } else {
10781
          setAmount((Long)value);
10782
        }
10783
        break;
10784
 
6356 amit.gupta 10785
      case IS_COD:
10786
        if (value == null) {
10787
          unsetIsCod();
10788
        } else {
10789
          setIsCod((Boolean)value);
10790
        }
10791
        break;
10792
 
6250 amit.gupta 10793
      case USAGE:
10794
        if (value == null) {
10795
          unsetUsage();
10796
        } else {
10797
          setUsage((Long)value);
10798
        }
10799
        break;
10800
 
10801
      }
10802
    }
10803
 
10804
    public Object getFieldValue(_Fields field) {
10805
      switch (field) {
10806
      case PROMOTION_ID:
10807
        return Long.valueOf(getPromotionId());
10808
 
10809
      case END_ON:
10810
        return Long.valueOf(getEndOn());
10811
 
10812
      case EMAIL:
10813
        return getEmail();
10814
 
10815
      case AMOUNT:
10816
        return Long.valueOf(getAmount());
10817
 
6356 amit.gupta 10818
      case IS_COD:
10819
        return Boolean.valueOf(isIsCod());
10820
 
6250 amit.gupta 10821
      case USAGE:
10822
        return Long.valueOf(getUsage());
10823
 
10824
      }
10825
      throw new IllegalStateException();
10826
    }
10827
 
10828
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10829
    public boolean isSet(_Fields field) {
10830
      if (field == null) {
10831
        throw new IllegalArgumentException();
10832
      }
10833
 
10834
      switch (field) {
10835
      case PROMOTION_ID:
10836
        return isSetPromotionId();
10837
      case END_ON:
10838
        return isSetEndOn();
10839
      case EMAIL:
10840
        return isSetEmail();
10841
      case AMOUNT:
10842
        return isSetAmount();
6356 amit.gupta 10843
      case IS_COD:
10844
        return isSetIsCod();
6250 amit.gupta 10845
      case USAGE:
10846
        return isSetUsage();
10847
      }
10848
      throw new IllegalStateException();
10849
    }
10850
 
10851
    @Override
10852
    public boolean equals(Object that) {
10853
      if (that == null)
10854
        return false;
10855
      if (that instanceof createCoupon_args)
10856
        return this.equals((createCoupon_args)that);
10857
      return false;
10858
    }
10859
 
10860
    public boolean equals(createCoupon_args that) {
10861
      if (that == null)
10862
        return false;
10863
 
10864
      boolean this_present_promotionId = true;
10865
      boolean that_present_promotionId = true;
10866
      if (this_present_promotionId || that_present_promotionId) {
10867
        if (!(this_present_promotionId && that_present_promotionId))
10868
          return false;
10869
        if (this.promotionId != that.promotionId)
10870
          return false;
10871
      }
10872
 
10873
      boolean this_present_endOn = true;
10874
      boolean that_present_endOn = true;
10875
      if (this_present_endOn || that_present_endOn) {
10876
        if (!(this_present_endOn && that_present_endOn))
10877
          return false;
10878
        if (this.endOn != that.endOn)
10879
          return false;
10880
      }
10881
 
10882
      boolean this_present_email = true && this.isSetEmail();
10883
      boolean that_present_email = true && that.isSetEmail();
10884
      if (this_present_email || that_present_email) {
10885
        if (!(this_present_email && that_present_email))
10886
          return false;
10887
        if (!this.email.equals(that.email))
10888
          return false;
10889
      }
10890
 
10891
      boolean this_present_amount = true;
10892
      boolean that_present_amount = true;
10893
      if (this_present_amount || that_present_amount) {
10894
        if (!(this_present_amount && that_present_amount))
10895
          return false;
10896
        if (this.amount != that.amount)
10897
          return false;
10898
      }
10899
 
6356 amit.gupta 10900
      boolean this_present_isCod = true;
10901
      boolean that_present_isCod = true;
10902
      if (this_present_isCod || that_present_isCod) {
10903
        if (!(this_present_isCod && that_present_isCod))
10904
          return false;
10905
        if (this.isCod != that.isCod)
10906
          return false;
10907
      }
10908
 
6250 amit.gupta 10909
      boolean this_present_usage = true;
10910
      boolean that_present_usage = true;
10911
      if (this_present_usage || that_present_usage) {
10912
        if (!(this_present_usage && that_present_usage))
10913
          return false;
10914
        if (this.usage != that.usage)
10915
          return false;
10916
      }
10917
 
10918
      return true;
10919
    }
10920
 
10921
    @Override
10922
    public int hashCode() {
10923
      return 0;
10924
    }
10925
 
10926
    public int compareTo(createCoupon_args other) {
10927
      if (!getClass().equals(other.getClass())) {
10928
        return getClass().getName().compareTo(other.getClass().getName());
10929
      }
10930
 
10931
      int lastComparison = 0;
10932
      createCoupon_args typedOther = (createCoupon_args)other;
10933
 
10934
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
10935
      if (lastComparison != 0) {
10936
        return lastComparison;
10937
      }
10938
      if (isSetPromotionId()) {
10939
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
10940
        if (lastComparison != 0) {
10941
          return lastComparison;
10942
        }
10943
      }
10944
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
10945
      if (lastComparison != 0) {
10946
        return lastComparison;
10947
      }
10948
      if (isSetEndOn()) {
10949
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
10950
        if (lastComparison != 0) {
10951
          return lastComparison;
10952
        }
10953
      }
10954
      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
10955
      if (lastComparison != 0) {
10956
        return lastComparison;
10957
      }
10958
      if (isSetEmail()) {
10959
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
10960
        if (lastComparison != 0) {
10961
          return lastComparison;
10962
        }
10963
      }
10964
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
10965
      if (lastComparison != 0) {
10966
        return lastComparison;
10967
      }
10968
      if (isSetAmount()) {
10969
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
10970
        if (lastComparison != 0) {
10971
          return lastComparison;
10972
        }
10973
      }
6356 amit.gupta 10974
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
10975
      if (lastComparison != 0) {
10976
        return lastComparison;
10977
      }
10978
      if (isSetIsCod()) {
10979
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
10980
        if (lastComparison != 0) {
10981
          return lastComparison;
10982
        }
10983
      }
6250 amit.gupta 10984
      lastComparison = Boolean.valueOf(isSetUsage()).compareTo(typedOther.isSetUsage());
10985
      if (lastComparison != 0) {
10986
        return lastComparison;
10987
      }
10988
      if (isSetUsage()) {
10989
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usage, typedOther.usage);
10990
        if (lastComparison != 0) {
10991
          return lastComparison;
10992
        }
10993
      }
10994
      return 0;
10995
    }
10996
 
10997
    public _Fields fieldForId(int fieldId) {
10998
      return _Fields.findByThriftId(fieldId);
10999
    }
11000
 
11001
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11002
      org.apache.thrift.protocol.TField field;
11003
      iprot.readStructBegin();
11004
      while (true)
11005
      {
11006
        field = iprot.readFieldBegin();
11007
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11008
          break;
11009
        }
11010
        switch (field.id) {
11011
          case 1: // PROMOTION_ID
11012
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11013
              this.promotionId = iprot.readI64();
11014
              setPromotionIdIsSet(true);
11015
            } else { 
11016
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11017
            }
11018
            break;
11019
          case 2: // END_ON
11020
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11021
              this.endOn = iprot.readI64();
11022
              setEndOnIsSet(true);
11023
            } else { 
11024
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11025
            }
11026
            break;
11027
          case 3: // EMAIL
11028
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11029
              this.email = iprot.readString();
11030
            } else { 
11031
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11032
            }
11033
            break;
11034
          case 4: // AMOUNT
11035
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11036
              this.amount = iprot.readI64();
11037
              setAmountIsSet(true);
11038
            } else { 
11039
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11040
            }
11041
            break;
6356 amit.gupta 11042
          case 5: // IS_COD
11043
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
11044
              this.isCod = iprot.readBool();
11045
              setIsCodIsSet(true);
11046
            } else { 
11047
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11048
            }
11049
            break;
11050
          case 6: // USAGE
6250 amit.gupta 11051
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11052
              this.usage = iprot.readI64();
11053
              setUsageIsSet(true);
11054
            } else { 
11055
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11056
            }
11057
            break;
11058
          default:
11059
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11060
        }
11061
        iprot.readFieldEnd();
11062
      }
11063
      iprot.readStructEnd();
11064
      validate();
11065
    }
11066
 
11067
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11068
      validate();
11069
 
11070
      oprot.writeStructBegin(STRUCT_DESC);
11071
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
11072
      oprot.writeI64(this.promotionId);
11073
      oprot.writeFieldEnd();
11074
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
11075
      oprot.writeI64(this.endOn);
11076
      oprot.writeFieldEnd();
11077
      if (this.email != null) {
11078
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
11079
        oprot.writeString(this.email);
11080
        oprot.writeFieldEnd();
11081
      }
11082
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
11083
      oprot.writeI64(this.amount);
11084
      oprot.writeFieldEnd();
6356 amit.gupta 11085
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
11086
      oprot.writeBool(this.isCod);
11087
      oprot.writeFieldEnd();
6250 amit.gupta 11088
      oprot.writeFieldBegin(USAGE_FIELD_DESC);
11089
      oprot.writeI64(this.usage);
11090
      oprot.writeFieldEnd();
11091
      oprot.writeFieldStop();
11092
      oprot.writeStructEnd();
11093
    }
11094
 
11095
    @Override
11096
    public String toString() {
11097
      StringBuilder sb = new StringBuilder("createCoupon_args(");
11098
      boolean first = true;
11099
 
11100
      sb.append("promotionId:");
11101
      sb.append(this.promotionId);
11102
      first = false;
11103
      if (!first) sb.append(", ");
11104
      sb.append("endOn:");
11105
      sb.append(this.endOn);
11106
      first = false;
11107
      if (!first) sb.append(", ");
11108
      sb.append("email:");
11109
      if (this.email == null) {
11110
        sb.append("null");
11111
      } else {
11112
        sb.append(this.email);
11113
      }
11114
      first = false;
11115
      if (!first) sb.append(", ");
11116
      sb.append("amount:");
11117
      sb.append(this.amount);
11118
      first = false;
11119
      if (!first) sb.append(", ");
6356 amit.gupta 11120
      sb.append("isCod:");
11121
      sb.append(this.isCod);
11122
      first = false;
11123
      if (!first) sb.append(", ");
6250 amit.gupta 11124
      sb.append("usage:");
11125
      sb.append(this.usage);
11126
      first = false;
11127
      sb.append(")");
11128
      return sb.toString();
11129
    }
11130
 
11131
    public void validate() throws org.apache.thrift.TException {
11132
      // check for required fields
11133
    }
11134
 
11135
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11136
      try {
11137
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11138
      } catch (org.apache.thrift.TException te) {
11139
        throw new java.io.IOException(te);
11140
      }
11141
    }
11142
 
11143
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11144
      try {
11145
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11146
      } catch (org.apache.thrift.TException te) {
11147
        throw new java.io.IOException(te);
11148
      }
11149
    }
11150
 
11151
  }
11152
 
11153
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
11154
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
11155
 
11156
    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);
11157
    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);
11158
 
11159
    private String success; // required
11160
    private PromotionException pex; // required
11161
 
11162
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11163
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11164
      SUCCESS((short)0, "success"),
11165
      PEX((short)1, "pex");
11166
 
11167
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11168
 
11169
      static {
11170
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11171
          byName.put(field.getFieldName(), field);
11172
        }
11173
      }
11174
 
11175
      /**
11176
       * Find the _Fields constant that matches fieldId, or null if its not found.
11177
       */
11178
      public static _Fields findByThriftId(int fieldId) {
11179
        switch(fieldId) {
11180
          case 0: // SUCCESS
11181
            return SUCCESS;
11182
          case 1: // PEX
11183
            return PEX;
11184
          default:
11185
            return null;
11186
        }
11187
      }
11188
 
11189
      /**
11190
       * Find the _Fields constant that matches fieldId, throwing an exception
11191
       * if it is not found.
11192
       */
11193
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11194
        _Fields fields = findByThriftId(fieldId);
11195
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11196
        return fields;
11197
      }
11198
 
11199
      /**
11200
       * Find the _Fields constant that matches name, or null if its not found.
11201
       */
11202
      public static _Fields findByName(String name) {
11203
        return byName.get(name);
11204
      }
11205
 
11206
      private final short _thriftId;
11207
      private final String _fieldName;
11208
 
11209
      _Fields(short thriftId, String fieldName) {
11210
        _thriftId = thriftId;
11211
        _fieldName = fieldName;
11212
      }
11213
 
11214
      public short getThriftFieldId() {
11215
        return _thriftId;
11216
      }
11217
 
11218
      public String getFieldName() {
11219
        return _fieldName;
11220
      }
11221
    }
11222
 
11223
    // isset id assignments
11224
 
11225
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11226
    static {
11227
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11228
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11229
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
11230
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11231
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11232
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11233
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
11234
    }
11235
 
11236
    public createCoupon_result() {
11237
    }
11238
 
11239
    public createCoupon_result(
11240
      String success,
11241
      PromotionException pex)
11242
    {
11243
      this();
11244
      this.success = success;
11245
      this.pex = pex;
11246
    }
11247
 
11248
    /**
11249
     * Performs a deep copy on <i>other</i>.
11250
     */
11251
    public createCoupon_result(createCoupon_result other) {
11252
      if (other.isSetSuccess()) {
11253
        this.success = other.success;
11254
      }
11255
      if (other.isSetPex()) {
11256
        this.pex = new PromotionException(other.pex);
11257
      }
11258
    }
11259
 
11260
    public createCoupon_result deepCopy() {
11261
      return new createCoupon_result(this);
11262
    }
11263
 
11264
    @Override
11265
    public void clear() {
11266
      this.success = null;
11267
      this.pex = null;
11268
    }
11269
 
11270
    public String getSuccess() {
11271
      return this.success;
11272
    }
11273
 
11274
    public void setSuccess(String success) {
11275
      this.success = success;
11276
    }
11277
 
11278
    public void unsetSuccess() {
11279
      this.success = null;
11280
    }
11281
 
11282
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
11283
    public boolean isSetSuccess() {
11284
      return this.success != null;
11285
    }
11286
 
11287
    public void setSuccessIsSet(boolean value) {
11288
      if (!value) {
11289
        this.success = null;
11290
      }
11291
    }
11292
 
11293
    public PromotionException getPex() {
11294
      return this.pex;
11295
    }
11296
 
11297
    public void setPex(PromotionException pex) {
11298
      this.pex = pex;
11299
    }
11300
 
11301
    public void unsetPex() {
11302
      this.pex = null;
11303
    }
11304
 
11305
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
11306
    public boolean isSetPex() {
11307
      return this.pex != null;
11308
    }
11309
 
11310
    public void setPexIsSet(boolean value) {
11311
      if (!value) {
11312
        this.pex = null;
11313
      }
11314
    }
11315
 
11316
    public void setFieldValue(_Fields field, Object value) {
11317
      switch (field) {
11318
      case SUCCESS:
11319
        if (value == null) {
11320
          unsetSuccess();
11321
        } else {
11322
          setSuccess((String)value);
11323
        }
11324
        break;
11325
 
11326
      case PEX:
11327
        if (value == null) {
11328
          unsetPex();
11329
        } else {
11330
          setPex((PromotionException)value);
11331
        }
11332
        break;
11333
 
11334
      }
11335
    }
11336
 
11337
    public Object getFieldValue(_Fields field) {
11338
      switch (field) {
11339
      case SUCCESS:
11340
        return getSuccess();
11341
 
11342
      case PEX:
11343
        return getPex();
11344
 
11345
      }
11346
      throw new IllegalStateException();
11347
    }
11348
 
11349
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11350
    public boolean isSet(_Fields field) {
11351
      if (field == null) {
11352
        throw new IllegalArgumentException();
11353
      }
11354
 
11355
      switch (field) {
11356
      case SUCCESS:
11357
        return isSetSuccess();
11358
      case PEX:
11359
        return isSetPex();
11360
      }
11361
      throw new IllegalStateException();
11362
    }
11363
 
11364
    @Override
11365
    public boolean equals(Object that) {
11366
      if (that == null)
11367
        return false;
11368
      if (that instanceof createCoupon_result)
11369
        return this.equals((createCoupon_result)that);
11370
      return false;
11371
    }
11372
 
11373
    public boolean equals(createCoupon_result that) {
11374
      if (that == null)
11375
        return false;
11376
 
11377
      boolean this_present_success = true && this.isSetSuccess();
11378
      boolean that_present_success = true && that.isSetSuccess();
11379
      if (this_present_success || that_present_success) {
11380
        if (!(this_present_success && that_present_success))
11381
          return false;
11382
        if (!this.success.equals(that.success))
11383
          return false;
11384
      }
11385
 
11386
      boolean this_present_pex = true && this.isSetPex();
11387
      boolean that_present_pex = true && that.isSetPex();
11388
      if (this_present_pex || that_present_pex) {
11389
        if (!(this_present_pex && that_present_pex))
11390
          return false;
11391
        if (!this.pex.equals(that.pex))
11392
          return false;
11393
      }
11394
 
11395
      return true;
11396
    }
11397
 
11398
    @Override
11399
    public int hashCode() {
11400
      return 0;
11401
    }
11402
 
11403
    public int compareTo(createCoupon_result other) {
11404
      if (!getClass().equals(other.getClass())) {
11405
        return getClass().getName().compareTo(other.getClass().getName());
11406
      }
11407
 
11408
      int lastComparison = 0;
11409
      createCoupon_result typedOther = (createCoupon_result)other;
11410
 
11411
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
11412
      if (lastComparison != 0) {
11413
        return lastComparison;
11414
      }
11415
      if (isSetSuccess()) {
11416
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11417
        if (lastComparison != 0) {
11418
          return lastComparison;
11419
        }
11420
      }
11421
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
11422
      if (lastComparison != 0) {
11423
        return lastComparison;
11424
      }
11425
      if (isSetPex()) {
11426
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11427
        if (lastComparison != 0) {
11428
          return lastComparison;
11429
        }
11430
      }
11431
      return 0;
11432
    }
11433
 
11434
    public _Fields fieldForId(int fieldId) {
11435
      return _Fields.findByThriftId(fieldId);
11436
    }
11437
 
11438
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11439
      org.apache.thrift.protocol.TField field;
11440
      iprot.readStructBegin();
11441
      while (true)
11442
      {
11443
        field = iprot.readFieldBegin();
11444
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11445
          break;
11446
        }
11447
        switch (field.id) {
11448
          case 0: // SUCCESS
11449
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11450
              this.success = iprot.readString();
11451
            } else { 
11452
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11453
            }
11454
            break;
11455
          case 1: // PEX
11456
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11457
              this.pex = new PromotionException();
11458
              this.pex.read(iprot);
11459
            } else { 
11460
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11461
            }
11462
            break;
11463
          default:
11464
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11465
        }
11466
        iprot.readFieldEnd();
11467
      }
11468
      iprot.readStructEnd();
11469
      validate();
11470
    }
11471
 
11472
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11473
      oprot.writeStructBegin(STRUCT_DESC);
11474
 
11475
      if (this.isSetSuccess()) {
11476
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11477
        oprot.writeString(this.success);
11478
        oprot.writeFieldEnd();
11479
      } else if (this.isSetPex()) {
11480
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11481
        this.pex.write(oprot);
11482
        oprot.writeFieldEnd();
11483
      }
11484
      oprot.writeFieldStop();
11485
      oprot.writeStructEnd();
11486
    }
11487
 
11488
    @Override
11489
    public String toString() {
11490
      StringBuilder sb = new StringBuilder("createCoupon_result(");
11491
      boolean first = true;
11492
 
11493
      sb.append("success:");
11494
      if (this.success == null) {
11495
        sb.append("null");
11496
      } else {
11497
        sb.append(this.success);
11498
      }
11499
      first = false;
11500
      if (!first) sb.append(", ");
11501
      sb.append("pex:");
11502
      if (this.pex == null) {
11503
        sb.append("null");
11504
      } else {
11505
        sb.append(this.pex);
11506
      }
11507
      first = false;
11508
      sb.append(")");
11509
      return sb.toString();
11510
    }
11511
 
11512
    public void validate() throws org.apache.thrift.TException {
11513
      // check for required fields
11514
    }
11515
 
11516
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11517
      try {
11518
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11519
      } catch (org.apache.thrift.TException te) {
11520
        throw new java.io.IOException(te);
11521
      }
11522
    }
11523
 
11524
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11525
      try {
11526
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11527
      } catch (org.apache.thrift.TException te) {
11528
        throw new java.io.IOException(te);
11529
      }
11530
    }
11531
 
11532
  }
11533
 
3430 rajveer 11534
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
11535
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 11536
 
3430 rajveer 11537
    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 11538
 
3430 rajveer 11539
    private String couponCode; // required
3385 varun.gupt 11540
 
11541
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11542
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11543
      COUPON_CODE((short)1, "couponCode");
11544
 
11545
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11546
 
11547
      static {
11548
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11549
          byName.put(field.getFieldName(), field);
11550
        }
11551
      }
11552
 
11553
      /**
11554
       * Find the _Fields constant that matches fieldId, or null if its not found.
11555
       */
11556
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11557
        switch(fieldId) {
11558
          case 1: // COUPON_CODE
11559
            return COUPON_CODE;
11560
          default:
11561
            return null;
11562
        }
3385 varun.gupt 11563
      }
11564
 
11565
      /**
11566
       * Find the _Fields constant that matches fieldId, throwing an exception
11567
       * if it is not found.
11568
       */
11569
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11570
        _Fields fields = findByThriftId(fieldId);
11571
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11572
        return fields;
11573
      }
11574
 
11575
      /**
11576
       * Find the _Fields constant that matches name, or null if its not found.
11577
       */
11578
      public static _Fields findByName(String name) {
11579
        return byName.get(name);
11580
      }
11581
 
11582
      private final short _thriftId;
11583
      private final String _fieldName;
11584
 
11585
      _Fields(short thriftId, String fieldName) {
11586
        _thriftId = thriftId;
11587
        _fieldName = fieldName;
11588
      }
11589
 
11590
      public short getThriftFieldId() {
11591
        return _thriftId;
11592
      }
11593
 
11594
      public String getFieldName() {
11595
        return _fieldName;
11596
      }
11597
    }
11598
 
11599
    // isset id assignments
11600
 
3430 rajveer 11601
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11602
    static {
3430 rajveer 11603
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11604
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11605
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
11606
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11607
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 11608
    }
11609
 
11610
    public getSuccessfulPaymentCountForCoupon_args() {
11611
    }
11612
 
11613
    public getSuccessfulPaymentCountForCoupon_args(
11614
      String couponCode)
11615
    {
11616
      this();
11617
      this.couponCode = couponCode;
11618
    }
11619
 
11620
    /**
11621
     * Performs a deep copy on <i>other</i>.
11622
     */
11623
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
11624
      if (other.isSetCouponCode()) {
11625
        this.couponCode = other.couponCode;
11626
      }
11627
    }
11628
 
11629
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
11630
      return new getSuccessfulPaymentCountForCoupon_args(this);
11631
    }
11632
 
3430 rajveer 11633
    @Override
11634
    public void clear() {
11635
      this.couponCode = null;
3385 varun.gupt 11636
    }
11637
 
11638
    public String getCouponCode() {
11639
      return this.couponCode;
11640
    }
11641
 
3430 rajveer 11642
    public void setCouponCode(String couponCode) {
3385 varun.gupt 11643
      this.couponCode = couponCode;
11644
    }
11645
 
11646
    public void unsetCouponCode() {
11647
      this.couponCode = null;
11648
    }
11649
 
3430 rajveer 11650
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11651
    public boolean isSetCouponCode() {
11652
      return this.couponCode != null;
11653
    }
11654
 
11655
    public void setCouponCodeIsSet(boolean value) {
11656
      if (!value) {
11657
        this.couponCode = null;
11658
      }
11659
    }
11660
 
11661
    public void setFieldValue(_Fields field, Object value) {
11662
      switch (field) {
11663
      case COUPON_CODE:
11664
        if (value == null) {
11665
          unsetCouponCode();
11666
        } else {
11667
          setCouponCode((String)value);
11668
        }
11669
        break;
11670
 
11671
      }
11672
    }
11673
 
11674
    public Object getFieldValue(_Fields field) {
11675
      switch (field) {
11676
      case COUPON_CODE:
11677
        return getCouponCode();
11678
 
11679
      }
11680
      throw new IllegalStateException();
11681
    }
11682
 
3430 rajveer 11683
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11684
    public boolean isSet(_Fields field) {
11685
      if (field == null) {
11686
        throw new IllegalArgumentException();
11687
      }
3385 varun.gupt 11688
 
11689
      switch (field) {
11690
      case COUPON_CODE:
11691
        return isSetCouponCode();
11692
      }
11693
      throw new IllegalStateException();
11694
    }
11695
 
11696
    @Override
11697
    public boolean equals(Object that) {
11698
      if (that == null)
11699
        return false;
11700
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
11701
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
11702
      return false;
11703
    }
11704
 
11705
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
11706
      if (that == null)
11707
        return false;
11708
 
11709
      boolean this_present_couponCode = true && this.isSetCouponCode();
11710
      boolean that_present_couponCode = true && that.isSetCouponCode();
11711
      if (this_present_couponCode || that_present_couponCode) {
11712
        if (!(this_present_couponCode && that_present_couponCode))
11713
          return false;
11714
        if (!this.couponCode.equals(that.couponCode))
11715
          return false;
11716
      }
11717
 
11718
      return true;
11719
    }
11720
 
11721
    @Override
11722
    public int hashCode() {
11723
      return 0;
11724
    }
11725
 
11726
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
11727
      if (!getClass().equals(other.getClass())) {
11728
        return getClass().getName().compareTo(other.getClass().getName());
11729
      }
11730
 
11731
      int lastComparison = 0;
11732
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
11733
 
3430 rajveer 11734
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 11735
      if (lastComparison != 0) {
11736
        return lastComparison;
11737
      }
3430 rajveer 11738
      if (isSetCouponCode()) {
11739
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
11740
        if (lastComparison != 0) {
11741
          return lastComparison;
11742
        }
3385 varun.gupt 11743
      }
11744
      return 0;
11745
    }
11746
 
3430 rajveer 11747
    public _Fields fieldForId(int fieldId) {
11748
      return _Fields.findByThriftId(fieldId);
11749
    }
11750
 
11751
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11752
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11753
      iprot.readStructBegin();
11754
      while (true)
11755
      {
11756
        field = iprot.readFieldBegin();
3430 rajveer 11757
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11758
          break;
11759
        }
3430 rajveer 11760
        switch (field.id) {
11761
          case 1: // COUPON_CODE
11762
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11763
              this.couponCode = iprot.readString();
11764
            } else { 
11765
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11766
            }
11767
            break;
11768
          default:
11769
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11770
        }
3430 rajveer 11771
        iprot.readFieldEnd();
3385 varun.gupt 11772
      }
11773
      iprot.readStructEnd();
11774
      validate();
11775
    }
11776
 
3430 rajveer 11777
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11778
      validate();
11779
 
11780
      oprot.writeStructBegin(STRUCT_DESC);
11781
      if (this.couponCode != null) {
11782
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
11783
        oprot.writeString(this.couponCode);
11784
        oprot.writeFieldEnd();
11785
      }
11786
      oprot.writeFieldStop();
11787
      oprot.writeStructEnd();
11788
    }
11789
 
11790
    @Override
11791
    public String toString() {
11792
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
11793
      boolean first = true;
11794
 
11795
      sb.append("couponCode:");
11796
      if (this.couponCode == null) {
11797
        sb.append("null");
11798
      } else {
11799
        sb.append(this.couponCode);
11800
      }
11801
      first = false;
11802
      sb.append(")");
11803
      return sb.toString();
11804
    }
11805
 
3430 rajveer 11806
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11807
      // check for required fields
11808
    }
11809
 
3430 rajveer 11810
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11811
      try {
11812
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11813
      } catch (org.apache.thrift.TException te) {
11814
        throw new java.io.IOException(te);
11815
      }
11816
    }
11817
 
11818
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11819
      try {
11820
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11821
      } catch (org.apache.thrift.TException te) {
11822
        throw new java.io.IOException(te);
11823
      }
11824
    }
11825
 
3385 varun.gupt 11826
  }
11827
 
3430 rajveer 11828
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
11829
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 11830
 
3430 rajveer 11831
    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);
11832
    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 11833
 
3430 rajveer 11834
    private long success; // required
11835
    private PromotionException pex; // required
3385 varun.gupt 11836
 
11837
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11838
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11839
      SUCCESS((short)0, "success"),
11840
      PEX((short)1, "pex");
11841
 
11842
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11843
 
11844
      static {
11845
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11846
          byName.put(field.getFieldName(), field);
11847
        }
11848
      }
11849
 
11850
      /**
11851
       * Find the _Fields constant that matches fieldId, or null if its not found.
11852
       */
11853
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11854
        switch(fieldId) {
11855
          case 0: // SUCCESS
11856
            return SUCCESS;
11857
          case 1: // PEX
11858
            return PEX;
11859
          default:
11860
            return null;
11861
        }
3385 varun.gupt 11862
      }
11863
 
11864
      /**
11865
       * Find the _Fields constant that matches fieldId, throwing an exception
11866
       * if it is not found.
11867
       */
11868
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11869
        _Fields fields = findByThriftId(fieldId);
11870
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11871
        return fields;
11872
      }
11873
 
11874
      /**
11875
       * Find the _Fields constant that matches name, or null if its not found.
11876
       */
11877
      public static _Fields findByName(String name) {
11878
        return byName.get(name);
11879
      }
11880
 
11881
      private final short _thriftId;
11882
      private final String _fieldName;
11883
 
11884
      _Fields(short thriftId, String fieldName) {
11885
        _thriftId = thriftId;
11886
        _fieldName = fieldName;
11887
      }
11888
 
11889
      public short getThriftFieldId() {
11890
        return _thriftId;
11891
      }
11892
 
11893
      public String getFieldName() {
11894
        return _fieldName;
11895
      }
11896
    }
11897
 
11898
    // isset id assignments
11899
    private static final int __SUCCESS_ISSET_ID = 0;
11900
    private BitSet __isset_bit_vector = new BitSet(1);
11901
 
3430 rajveer 11902
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11903
    static {
3430 rajveer 11904
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11905
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11906
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11907
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11908
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11909
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11910
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 11911
    }
11912
 
11913
    public getSuccessfulPaymentCountForCoupon_result() {
11914
    }
11915
 
11916
    public getSuccessfulPaymentCountForCoupon_result(
11917
      long success,
11918
      PromotionException pex)
11919
    {
11920
      this();
11921
      this.success = success;
11922
      setSuccessIsSet(true);
11923
      this.pex = pex;
11924
    }
11925
 
11926
    /**
11927
     * Performs a deep copy on <i>other</i>.
11928
     */
11929
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
11930
      __isset_bit_vector.clear();
11931
      __isset_bit_vector.or(other.__isset_bit_vector);
11932
      this.success = other.success;
11933
      if (other.isSetPex()) {
11934
        this.pex = new PromotionException(other.pex);
11935
      }
11936
    }
11937
 
11938
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
11939
      return new getSuccessfulPaymentCountForCoupon_result(this);
11940
    }
11941
 
3430 rajveer 11942
    @Override
11943
    public void clear() {
11944
      setSuccessIsSet(false);
11945
      this.success = 0;
11946
      this.pex = null;
3385 varun.gupt 11947
    }
11948
 
11949
    public long getSuccess() {
11950
      return this.success;
11951
    }
11952
 
3430 rajveer 11953
    public void setSuccess(long success) {
3385 varun.gupt 11954
      this.success = success;
11955
      setSuccessIsSet(true);
11956
    }
11957
 
11958
    public void unsetSuccess() {
11959
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
11960
    }
11961
 
3430 rajveer 11962
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11963
    public boolean isSetSuccess() {
11964
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
11965
    }
11966
 
11967
    public void setSuccessIsSet(boolean value) {
11968
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
11969
    }
11970
 
11971
    public PromotionException getPex() {
11972
      return this.pex;
11973
    }
11974
 
3430 rajveer 11975
    public void setPex(PromotionException pex) {
3385 varun.gupt 11976
      this.pex = pex;
11977
    }
11978
 
11979
    public void unsetPex() {
11980
      this.pex = null;
11981
    }
11982
 
3430 rajveer 11983
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11984
    public boolean isSetPex() {
11985
      return this.pex != null;
11986
    }
11987
 
11988
    public void setPexIsSet(boolean value) {
11989
      if (!value) {
11990
        this.pex = null;
11991
      }
11992
    }
11993
 
11994
    public void setFieldValue(_Fields field, Object value) {
11995
      switch (field) {
11996
      case SUCCESS:
11997
        if (value == null) {
11998
          unsetSuccess();
11999
        } else {
12000
          setSuccess((Long)value);
12001
        }
12002
        break;
12003
 
12004
      case PEX:
12005
        if (value == null) {
12006
          unsetPex();
12007
        } else {
12008
          setPex((PromotionException)value);
12009
        }
12010
        break;
12011
 
12012
      }
12013
    }
12014
 
12015
    public Object getFieldValue(_Fields field) {
12016
      switch (field) {
12017
      case SUCCESS:
3430 rajveer 12018
        return Long.valueOf(getSuccess());
3385 varun.gupt 12019
 
12020
      case PEX:
12021
        return getPex();
12022
 
12023
      }
12024
      throw new IllegalStateException();
12025
    }
12026
 
3430 rajveer 12027
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12028
    public boolean isSet(_Fields field) {
12029
      if (field == null) {
12030
        throw new IllegalArgumentException();
12031
      }
3385 varun.gupt 12032
 
12033
      switch (field) {
12034
      case SUCCESS:
12035
        return isSetSuccess();
12036
      case PEX:
12037
        return isSetPex();
12038
      }
12039
      throw new IllegalStateException();
12040
    }
12041
 
12042
    @Override
12043
    public boolean equals(Object that) {
12044
      if (that == null)
12045
        return false;
12046
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
12047
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
12048
      return false;
12049
    }
12050
 
12051
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
12052
      if (that == null)
12053
        return false;
12054
 
12055
      boolean this_present_success = true;
12056
      boolean that_present_success = true;
12057
      if (this_present_success || that_present_success) {
12058
        if (!(this_present_success && that_present_success))
12059
          return false;
12060
        if (this.success != that.success)
12061
          return false;
12062
      }
12063
 
12064
      boolean this_present_pex = true && this.isSetPex();
12065
      boolean that_present_pex = true && that.isSetPex();
12066
      if (this_present_pex || that_present_pex) {
12067
        if (!(this_present_pex && that_present_pex))
12068
          return false;
12069
        if (!this.pex.equals(that.pex))
12070
          return false;
12071
      }
12072
 
12073
      return true;
12074
    }
12075
 
12076
    @Override
12077
    public int hashCode() {
12078
      return 0;
12079
    }
12080
 
12081
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
12082
      if (!getClass().equals(other.getClass())) {
12083
        return getClass().getName().compareTo(other.getClass().getName());
12084
      }
12085
 
12086
      int lastComparison = 0;
12087
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
12088
 
3430 rajveer 12089
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 12090
      if (lastComparison != 0) {
12091
        return lastComparison;
12092
      }
3430 rajveer 12093
      if (isSetSuccess()) {
12094
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12095
        if (lastComparison != 0) {
12096
          return lastComparison;
12097
        }
3385 varun.gupt 12098
      }
3430 rajveer 12099
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 12100
      if (lastComparison != 0) {
12101
        return lastComparison;
12102
      }
3430 rajveer 12103
      if (isSetPex()) {
12104
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12105
        if (lastComparison != 0) {
12106
          return lastComparison;
12107
        }
3385 varun.gupt 12108
      }
12109
      return 0;
12110
    }
12111
 
3430 rajveer 12112
    public _Fields fieldForId(int fieldId) {
12113
      return _Fields.findByThriftId(fieldId);
12114
    }
12115
 
12116
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12117
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 12118
      iprot.readStructBegin();
12119
      while (true)
12120
      {
12121
        field = iprot.readFieldBegin();
3430 rajveer 12122
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 12123
          break;
12124
        }
3430 rajveer 12125
        switch (field.id) {
12126
          case 0: // SUCCESS
12127
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12128
              this.success = iprot.readI64();
12129
              setSuccessIsSet(true);
12130
            } else { 
12131
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12132
            }
12133
            break;
12134
          case 1: // PEX
12135
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12136
              this.pex = new PromotionException();
12137
              this.pex.read(iprot);
12138
            } else { 
12139
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12140
            }
12141
            break;
12142
          default:
12143
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 12144
        }
3430 rajveer 12145
        iprot.readFieldEnd();
3385 varun.gupt 12146
      }
12147
      iprot.readStructEnd();
12148
      validate();
12149
    }
12150
 
3430 rajveer 12151
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 12152
      oprot.writeStructBegin(STRUCT_DESC);
12153
 
12154
      if (this.isSetSuccess()) {
12155
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12156
        oprot.writeI64(this.success);
12157
        oprot.writeFieldEnd();
12158
      } else if (this.isSetPex()) {
12159
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12160
        this.pex.write(oprot);
12161
        oprot.writeFieldEnd();
12162
      }
12163
      oprot.writeFieldStop();
12164
      oprot.writeStructEnd();
12165
    }
12166
 
12167
    @Override
12168
    public String toString() {
12169
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
12170
      boolean first = true;
12171
 
12172
      sb.append("success:");
12173
      sb.append(this.success);
12174
      first = false;
12175
      if (!first) sb.append(", ");
12176
      sb.append("pex:");
12177
      if (this.pex == null) {
12178
        sb.append("null");
12179
      } else {
12180
        sb.append(this.pex);
12181
      }
12182
      first = false;
12183
      sb.append(")");
12184
      return sb.toString();
12185
    }
12186
 
3430 rajveer 12187
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 12188
      // check for required fields
12189
    }
12190
 
3430 rajveer 12191
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12192
      try {
12193
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12194
      } catch (org.apache.thrift.TException te) {
12195
        throw new java.io.IOException(te);
12196
      }
12197
    }
12198
 
12199
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12200
      try {
12201
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12202
      } catch (org.apache.thrift.TException te) {
12203
        throw new java.io.IOException(te);
12204
      }
12205
    }
12206
 
3385 varun.gupt 12207
  }
12208
 
3430 rajveer 12209
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
12210
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 12211
 
3430 rajveer 12212
    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 12213
 
3430 rajveer 12214
    private String ruleName; // required
3385 varun.gupt 12215
 
12216
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 12217
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 12218
      RULE_NAME((short)1, "ruleName");
12219
 
12220
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12221
 
12222
      static {
12223
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12224
          byName.put(field.getFieldName(), field);
12225
        }
12226
      }
12227
 
12228
      /**
12229
       * Find the _Fields constant that matches fieldId, or null if its not found.
12230
       */
12231
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 12232
        switch(fieldId) {
12233
          case 1: // RULE_NAME
12234
            return RULE_NAME;
12235
          default:
12236
            return null;
12237
        }
3385 varun.gupt 12238
      }
12239
 
12240
      /**
12241
       * Find the _Fields constant that matches fieldId, throwing an exception
12242
       * if it is not found.
12243
       */
12244
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12245
        _Fields fields = findByThriftId(fieldId);
12246
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12247
        return fields;
12248
      }
12249
 
12250
      /**
12251
       * Find the _Fields constant that matches name, or null if its not found.
12252
       */
12253
      public static _Fields findByName(String name) {
12254
        return byName.get(name);
12255
      }
12256
 
12257
      private final short _thriftId;
12258
      private final String _fieldName;
12259
 
12260
      _Fields(short thriftId, String fieldName) {
12261
        _thriftId = thriftId;
12262
        _fieldName = fieldName;
12263
      }
12264
 
12265
      public short getThriftFieldId() {
12266
        return _thriftId;
12267
      }
12268
 
12269
      public String getFieldName() {
12270
        return _fieldName;
12271
      }
12272
    }
12273
 
12274
    // isset id assignments
12275
 
3430 rajveer 12276
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 12277
    static {
3430 rajveer 12278
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12279
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12280
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12281
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12282
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 12283
    }
12284
 
12285
    public getRuleDocString_args() {
12286
    }
12287
 
12288
    public getRuleDocString_args(
12289
      String ruleName)
12290
    {
12291
      this();
12292
      this.ruleName = ruleName;
12293
    }
12294
 
12295
    /**
12296
     * Performs a deep copy on <i>other</i>.
12297
     */
12298
    public getRuleDocString_args(getRuleDocString_args other) {
12299
      if (other.isSetRuleName()) {
12300
        this.ruleName = other.ruleName;
12301
      }
12302
    }
12303
 
12304
    public getRuleDocString_args deepCopy() {
12305
      return new getRuleDocString_args(this);
12306
    }
12307
 
3430 rajveer 12308
    @Override
12309
    public void clear() {
12310
      this.ruleName = null;
3385 varun.gupt 12311
    }
12312
 
12313
    public String getRuleName() {
12314
      return this.ruleName;
12315
    }
12316
 
3430 rajveer 12317
    public void setRuleName(String ruleName) {
3385 varun.gupt 12318
      this.ruleName = ruleName;
12319
    }
12320
 
12321
    public void unsetRuleName() {
12322
      this.ruleName = null;
12323
    }
12324
 
3430 rajveer 12325
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 12326
    public boolean isSetRuleName() {
12327
      return this.ruleName != null;
12328
    }
12329
 
12330
    public void setRuleNameIsSet(boolean value) {
12331
      if (!value) {
12332
        this.ruleName = null;
12333
      }
12334
    }
12335
 
12336
    public void setFieldValue(_Fields field, Object value) {
12337
      switch (field) {
12338
      case RULE_NAME:
12339
        if (value == null) {
12340
          unsetRuleName();
12341
        } else {
12342
          setRuleName((String)value);
12343
        }
12344
        break;
12345
 
12346
      }
12347
    }
12348
 
12349
    public Object getFieldValue(_Fields field) {
12350
      switch (field) {
12351
      case RULE_NAME:
12352
        return getRuleName();
12353
 
12354
      }
12355
      throw new IllegalStateException();
12356
    }
12357
 
3430 rajveer 12358
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12359
    public boolean isSet(_Fields field) {
12360
      if (field == null) {
12361
        throw new IllegalArgumentException();
12362
      }
3385 varun.gupt 12363
 
12364
      switch (field) {
12365
      case RULE_NAME:
12366
        return isSetRuleName();
12367
      }
12368
      throw new IllegalStateException();
12369
    }
12370
 
12371
    @Override
12372
    public boolean equals(Object that) {
12373
      if (that == null)
12374
        return false;
12375
      if (that instanceof getRuleDocString_args)
12376
        return this.equals((getRuleDocString_args)that);
12377
      return false;
12378
    }
12379
 
12380
    public boolean equals(getRuleDocString_args that) {
12381
      if (that == null)
12382
        return false;
12383
 
12384
      boolean this_present_ruleName = true && this.isSetRuleName();
12385
      boolean that_present_ruleName = true && that.isSetRuleName();
12386
      if (this_present_ruleName || that_present_ruleName) {
12387
        if (!(this_present_ruleName && that_present_ruleName))
12388
          return false;
12389
        if (!this.ruleName.equals(that.ruleName))
12390
          return false;
12391
      }
12392
 
12393
      return true;
12394
    }
12395
 
12396
    @Override
12397
    public int hashCode() {
12398
      return 0;
12399
    }
12400
 
12401
    public int compareTo(getRuleDocString_args other) {
12402
      if (!getClass().equals(other.getClass())) {
12403
        return getClass().getName().compareTo(other.getClass().getName());
12404
      }
12405
 
12406
      int lastComparison = 0;
12407
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
12408
 
3430 rajveer 12409
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 12410
      if (lastComparison != 0) {
12411
        return lastComparison;
12412
      }
3430 rajveer 12413
      if (isSetRuleName()) {
12414
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
12415
        if (lastComparison != 0) {
12416
          return lastComparison;
12417
        }
3385 varun.gupt 12418
      }
12419
      return 0;
12420
    }
12421
 
3430 rajveer 12422
    public _Fields fieldForId(int fieldId) {
12423
      return _Fields.findByThriftId(fieldId);
12424
    }
12425
 
12426
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12427
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 12428
      iprot.readStructBegin();
12429
      while (true)
12430
      {
12431
        field = iprot.readFieldBegin();
3430 rajveer 12432
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 12433
          break;
12434
        }
3430 rajveer 12435
        switch (field.id) {
12436
          case 1: // RULE_NAME
12437
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12438
              this.ruleName = iprot.readString();
12439
            } else { 
12440
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12441
            }
12442
            break;
12443
          default:
12444
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 12445
        }
3430 rajveer 12446
        iprot.readFieldEnd();
3385 varun.gupt 12447
      }
12448
      iprot.readStructEnd();
12449
      validate();
12450
    }
12451
 
3430 rajveer 12452
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 12453
      validate();
12454
 
12455
      oprot.writeStructBegin(STRUCT_DESC);
12456
      if (this.ruleName != null) {
12457
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
12458
        oprot.writeString(this.ruleName);
12459
        oprot.writeFieldEnd();
12460
      }
12461
      oprot.writeFieldStop();
12462
      oprot.writeStructEnd();
12463
    }
12464
 
12465
    @Override
12466
    public String toString() {
12467
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
12468
      boolean first = true;
12469
 
12470
      sb.append("ruleName:");
12471
      if (this.ruleName == null) {
12472
        sb.append("null");
12473
      } else {
12474
        sb.append(this.ruleName);
12475
      }
12476
      first = false;
12477
      sb.append(")");
12478
      return sb.toString();
12479
    }
12480
 
3430 rajveer 12481
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 12482
      // check for required fields
12483
    }
12484
 
3430 rajveer 12485
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12486
      try {
12487
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12488
      } catch (org.apache.thrift.TException te) {
12489
        throw new java.io.IOException(te);
12490
      }
12491
    }
12492
 
12493
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12494
      try {
12495
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12496
      } catch (org.apache.thrift.TException te) {
12497
        throw new java.io.IOException(te);
12498
      }
12499
    }
12500
 
3385 varun.gupt 12501
  }
12502
 
3430 rajveer 12503
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
12504
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 12505
 
3430 rajveer 12506
    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 12507
 
3430 rajveer 12508
    private String success; // required
3385 varun.gupt 12509
 
12510
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 12511
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 12512
      SUCCESS((short)0, "success");
12513
 
12514
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12515
 
12516
      static {
12517
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12518
          byName.put(field.getFieldName(), field);
12519
        }
12520
      }
12521
 
12522
      /**
12523
       * Find the _Fields constant that matches fieldId, or null if its not found.
12524
       */
12525
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 12526
        switch(fieldId) {
12527
          case 0: // SUCCESS
12528
            return SUCCESS;
12529
          default:
12530
            return null;
12531
        }
3385 varun.gupt 12532
      }
12533
 
12534
      /**
12535
       * Find the _Fields constant that matches fieldId, throwing an exception
12536
       * if it is not found.
12537
       */
12538
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12539
        _Fields fields = findByThriftId(fieldId);
12540
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12541
        return fields;
12542
      }
12543
 
12544
      /**
12545
       * Find the _Fields constant that matches name, or null if its not found.
12546
       */
12547
      public static _Fields findByName(String name) {
12548
        return byName.get(name);
12549
      }
12550
 
12551
      private final short _thriftId;
12552
      private final String _fieldName;
12553
 
12554
      _Fields(short thriftId, String fieldName) {
12555
        _thriftId = thriftId;
12556
        _fieldName = fieldName;
12557
      }
12558
 
12559
      public short getThriftFieldId() {
12560
        return _thriftId;
12561
      }
12562
 
12563
      public String getFieldName() {
12564
        return _fieldName;
12565
      }
12566
    }
12567
 
12568
    // isset id assignments
12569
 
3430 rajveer 12570
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 12571
    static {
3430 rajveer 12572
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12573
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12574
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12575
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12576
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 12577
    }
12578
 
12579
    public getRuleDocString_result() {
12580
    }
12581
 
12582
    public getRuleDocString_result(
12583
      String success)
12584
    {
12585
      this();
12586
      this.success = success;
12587
    }
12588
 
12589
    /**
12590
     * Performs a deep copy on <i>other</i>.
12591
     */
12592
    public getRuleDocString_result(getRuleDocString_result other) {
12593
      if (other.isSetSuccess()) {
12594
        this.success = other.success;
12595
      }
12596
    }
12597
 
12598
    public getRuleDocString_result deepCopy() {
12599
      return new getRuleDocString_result(this);
12600
    }
12601
 
3430 rajveer 12602
    @Override
12603
    public void clear() {
12604
      this.success = null;
3385 varun.gupt 12605
    }
12606
 
12607
    public String getSuccess() {
12608
      return this.success;
12609
    }
12610
 
3430 rajveer 12611
    public void setSuccess(String success) {
3385 varun.gupt 12612
      this.success = success;
12613
    }
12614
 
12615
    public void unsetSuccess() {
12616
      this.success = null;
12617
    }
12618
 
3430 rajveer 12619
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 12620
    public boolean isSetSuccess() {
12621
      return this.success != null;
12622
    }
12623
 
12624
    public void setSuccessIsSet(boolean value) {
12625
      if (!value) {
12626
        this.success = null;
12627
      }
12628
    }
12629
 
12630
    public void setFieldValue(_Fields field, Object value) {
12631
      switch (field) {
12632
      case SUCCESS:
12633
        if (value == null) {
12634
          unsetSuccess();
12635
        } else {
12636
          setSuccess((String)value);
12637
        }
12638
        break;
12639
 
12640
      }
12641
    }
12642
 
12643
    public Object getFieldValue(_Fields field) {
12644
      switch (field) {
12645
      case SUCCESS:
12646
        return getSuccess();
12647
 
12648
      }
12649
      throw new IllegalStateException();
12650
    }
12651
 
3430 rajveer 12652
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12653
    public boolean isSet(_Fields field) {
12654
      if (field == null) {
12655
        throw new IllegalArgumentException();
12656
      }
3385 varun.gupt 12657
 
12658
      switch (field) {
12659
      case SUCCESS:
12660
        return isSetSuccess();
12661
      }
12662
      throw new IllegalStateException();
12663
    }
12664
 
12665
    @Override
12666
    public boolean equals(Object that) {
12667
      if (that == null)
12668
        return false;
12669
      if (that instanceof getRuleDocString_result)
12670
        return this.equals((getRuleDocString_result)that);
12671
      return false;
12672
    }
12673
 
12674
    public boolean equals(getRuleDocString_result that) {
12675
      if (that == null)
12676
        return false;
12677
 
12678
      boolean this_present_success = true && this.isSetSuccess();
12679
      boolean that_present_success = true && that.isSetSuccess();
12680
      if (this_present_success || that_present_success) {
12681
        if (!(this_present_success && that_present_success))
12682
          return false;
12683
        if (!this.success.equals(that.success))
12684
          return false;
12685
      }
12686
 
12687
      return true;
12688
    }
12689
 
12690
    @Override
12691
    public int hashCode() {
12692
      return 0;
12693
    }
12694
 
12695
    public int compareTo(getRuleDocString_result other) {
12696
      if (!getClass().equals(other.getClass())) {
12697
        return getClass().getName().compareTo(other.getClass().getName());
12698
      }
12699
 
12700
      int lastComparison = 0;
12701
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
12702
 
3430 rajveer 12703
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 12704
      if (lastComparison != 0) {
12705
        return lastComparison;
12706
      }
3430 rajveer 12707
      if (isSetSuccess()) {
12708
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12709
        if (lastComparison != 0) {
12710
          return lastComparison;
12711
        }
3385 varun.gupt 12712
      }
12713
      return 0;
12714
    }
12715
 
3430 rajveer 12716
    public _Fields fieldForId(int fieldId) {
12717
      return _Fields.findByThriftId(fieldId);
12718
    }
12719
 
12720
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12721
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 12722
      iprot.readStructBegin();
12723
      while (true)
12724
      {
12725
        field = iprot.readFieldBegin();
3430 rajveer 12726
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 12727
          break;
12728
        }
3430 rajveer 12729
        switch (field.id) {
12730
          case 0: // SUCCESS
12731
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12732
              this.success = iprot.readString();
12733
            } else { 
12734
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12735
            }
12736
            break;
12737
          default:
12738
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 12739
        }
3430 rajveer 12740
        iprot.readFieldEnd();
3385 varun.gupt 12741
      }
12742
      iprot.readStructEnd();
12743
      validate();
12744
    }
12745
 
3430 rajveer 12746
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 12747
      oprot.writeStructBegin(STRUCT_DESC);
12748
 
12749
      if (this.isSetSuccess()) {
12750
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12751
        oprot.writeString(this.success);
12752
        oprot.writeFieldEnd();
12753
      }
12754
      oprot.writeFieldStop();
12755
      oprot.writeStructEnd();
12756
    }
12757
 
12758
    @Override
12759
    public String toString() {
12760
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
12761
      boolean first = true;
12762
 
12763
      sb.append("success:");
12764
      if (this.success == null) {
12765
        sb.append("null");
12766
      } else {
12767
        sb.append(this.success);
12768
      }
12769
      first = false;
12770
      sb.append(")");
12771
      return sb.toString();
12772
    }
12773
 
3430 rajveer 12774
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 12775
      // check for required fields
12776
    }
12777
 
3430 rajveer 12778
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12779
      try {
12780
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12781
      } catch (org.apache.thrift.TException te) {
12782
        throw new java.io.IOException(te);
12783
      }
12784
    }
12785
 
12786
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12787
      try {
12788
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12789
      } catch (org.apache.thrift.TException te) {
12790
        throw new java.io.IOException(te);
12791
      }
12792
    }
12793
 
3385 varun.gupt 12794
  }
12795
 
4189 varun.gupt 12796
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
12797
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
12798
 
12799
    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);
12800
 
12801
    private List<Long> itemIds; // required
12802
 
12803
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12804
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12805
      ITEM_IDS((short)1, "itemIds");
12806
 
12807
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12808
 
12809
      static {
12810
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12811
          byName.put(field.getFieldName(), field);
12812
        }
12813
      }
12814
 
12815
      /**
12816
       * Find the _Fields constant that matches fieldId, or null if its not found.
12817
       */
12818
      public static _Fields findByThriftId(int fieldId) {
12819
        switch(fieldId) {
12820
          case 1: // ITEM_IDS
12821
            return ITEM_IDS;
12822
          default:
12823
            return null;
12824
        }
12825
      }
12826
 
12827
      /**
12828
       * Find the _Fields constant that matches fieldId, throwing an exception
12829
       * if it is not found.
12830
       */
12831
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12832
        _Fields fields = findByThriftId(fieldId);
12833
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12834
        return fields;
12835
      }
12836
 
12837
      /**
12838
       * Find the _Fields constant that matches name, or null if its not found.
12839
       */
12840
      public static _Fields findByName(String name) {
12841
        return byName.get(name);
12842
      }
12843
 
12844
      private final short _thriftId;
12845
      private final String _fieldName;
12846
 
12847
      _Fields(short thriftId, String fieldName) {
12848
        _thriftId = thriftId;
12849
        _fieldName = fieldName;
12850
      }
12851
 
12852
      public short getThriftFieldId() {
12853
        return _thriftId;
12854
      }
12855
 
12856
      public String getFieldName() {
12857
        return _fieldName;
12858
      }
12859
    }
12860
 
12861
    // isset id assignments
12862
 
12863
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12864
    static {
12865
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12866
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12867
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
12868
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
12869
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12870
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
12871
    }
12872
 
12873
    public getItemDiscountMap_args() {
12874
    }
12875
 
12876
    public getItemDiscountMap_args(
12877
      List<Long> itemIds)
12878
    {
12879
      this();
12880
      this.itemIds = itemIds;
12881
    }
12882
 
12883
    /**
12884
     * Performs a deep copy on <i>other</i>.
12885
     */
12886
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
12887
      if (other.isSetItemIds()) {
12888
        List<Long> __this__itemIds = new ArrayList<Long>();
12889
        for (Long other_element : other.itemIds) {
12890
          __this__itemIds.add(other_element);
12891
        }
12892
        this.itemIds = __this__itemIds;
12893
      }
12894
    }
12895
 
12896
    public getItemDiscountMap_args deepCopy() {
12897
      return new getItemDiscountMap_args(this);
12898
    }
12899
 
12900
    @Override
12901
    public void clear() {
12902
      this.itemIds = null;
12903
    }
12904
 
12905
    public int getItemIdsSize() {
12906
      return (this.itemIds == null) ? 0 : this.itemIds.size();
12907
    }
12908
 
12909
    public java.util.Iterator<Long> getItemIdsIterator() {
12910
      return (this.itemIds == null) ? null : this.itemIds.iterator();
12911
    }
12912
 
12913
    public void addToItemIds(long elem) {
12914
      if (this.itemIds == null) {
12915
        this.itemIds = new ArrayList<Long>();
12916
      }
12917
      this.itemIds.add(elem);
12918
    }
12919
 
12920
    public List<Long> getItemIds() {
12921
      return this.itemIds;
12922
    }
12923
 
12924
    public void setItemIds(List<Long> itemIds) {
12925
      this.itemIds = itemIds;
12926
    }
12927
 
12928
    public void unsetItemIds() {
12929
      this.itemIds = null;
12930
    }
12931
 
12932
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
12933
    public boolean isSetItemIds() {
12934
      return this.itemIds != null;
12935
    }
12936
 
12937
    public void setItemIdsIsSet(boolean value) {
12938
      if (!value) {
12939
        this.itemIds = null;
12940
      }
12941
    }
12942
 
12943
    public void setFieldValue(_Fields field, Object value) {
12944
      switch (field) {
12945
      case ITEM_IDS:
12946
        if (value == null) {
12947
          unsetItemIds();
12948
        } else {
12949
          setItemIds((List<Long>)value);
12950
        }
12951
        break;
12952
 
12953
      }
12954
    }
12955
 
12956
    public Object getFieldValue(_Fields field) {
12957
      switch (field) {
12958
      case ITEM_IDS:
12959
        return getItemIds();
12960
 
12961
      }
12962
      throw new IllegalStateException();
12963
    }
12964
 
12965
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12966
    public boolean isSet(_Fields field) {
12967
      if (field == null) {
12968
        throw new IllegalArgumentException();
12969
      }
12970
 
12971
      switch (field) {
12972
      case ITEM_IDS:
12973
        return isSetItemIds();
12974
      }
12975
      throw new IllegalStateException();
12976
    }
12977
 
12978
    @Override
12979
    public boolean equals(Object that) {
12980
      if (that == null)
12981
        return false;
12982
      if (that instanceof getItemDiscountMap_args)
12983
        return this.equals((getItemDiscountMap_args)that);
12984
      return false;
12985
    }
12986
 
12987
    public boolean equals(getItemDiscountMap_args that) {
12988
      if (that == null)
12989
        return false;
12990
 
12991
      boolean this_present_itemIds = true && this.isSetItemIds();
12992
      boolean that_present_itemIds = true && that.isSetItemIds();
12993
      if (this_present_itemIds || that_present_itemIds) {
12994
        if (!(this_present_itemIds && that_present_itemIds))
12995
          return false;
12996
        if (!this.itemIds.equals(that.itemIds))
12997
          return false;
12998
      }
12999
 
13000
      return true;
13001
    }
13002
 
13003
    @Override
13004
    public int hashCode() {
13005
      return 0;
13006
    }
13007
 
13008
    public int compareTo(getItemDiscountMap_args other) {
13009
      if (!getClass().equals(other.getClass())) {
13010
        return getClass().getName().compareTo(other.getClass().getName());
13011
      }
13012
 
13013
      int lastComparison = 0;
13014
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
13015
 
13016
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
13017
      if (lastComparison != 0) {
13018
        return lastComparison;
13019
      }
13020
      if (isSetItemIds()) {
13021
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
13022
        if (lastComparison != 0) {
13023
          return lastComparison;
13024
        }
13025
      }
13026
      return 0;
13027
    }
13028
 
13029
    public _Fields fieldForId(int fieldId) {
13030
      return _Fields.findByThriftId(fieldId);
13031
    }
13032
 
13033
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13034
      org.apache.thrift.protocol.TField field;
13035
      iprot.readStructBegin();
13036
      while (true)
13037
      {
13038
        field = iprot.readFieldBegin();
13039
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13040
          break;
13041
        }
13042
        switch (field.id) {
13043
          case 1: // ITEM_IDS
13044
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13045
              {
6433 anupam.sin 13046
                org.apache.thrift.protocol.TList _list25 = iprot.readListBegin();
13047
                this.itemIds = new ArrayList<Long>(_list25.size);
13048
                for (int _i26 = 0; _i26 < _list25.size; ++_i26)
4189 varun.gupt 13049
                {
6433 anupam.sin 13050
                  long _elem27; // required
13051
                  _elem27 = iprot.readI64();
13052
                  this.itemIds.add(_elem27);
4189 varun.gupt 13053
                }
13054
                iprot.readListEnd();
13055
              }
13056
            } else { 
13057
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13058
            }
13059
            break;
13060
          default:
13061
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13062
        }
13063
        iprot.readFieldEnd();
13064
      }
13065
      iprot.readStructEnd();
13066
      validate();
13067
    }
13068
 
13069
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13070
      validate();
13071
 
13072
      oprot.writeStructBegin(STRUCT_DESC);
13073
      if (this.itemIds != null) {
13074
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
13075
        {
13076
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
6433 anupam.sin 13077
          for (long _iter28 : this.itemIds)
4189 varun.gupt 13078
          {
6433 anupam.sin 13079
            oprot.writeI64(_iter28);
4189 varun.gupt 13080
          }
13081
          oprot.writeListEnd();
13082
        }
13083
        oprot.writeFieldEnd();
13084
      }
13085
      oprot.writeFieldStop();
13086
      oprot.writeStructEnd();
13087
    }
13088
 
13089
    @Override
13090
    public String toString() {
13091
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
13092
      boolean first = true;
13093
 
13094
      sb.append("itemIds:");
13095
      if (this.itemIds == null) {
13096
        sb.append("null");
13097
      } else {
13098
        sb.append(this.itemIds);
13099
      }
13100
      first = false;
13101
      sb.append(")");
13102
      return sb.toString();
13103
    }
13104
 
13105
    public void validate() throws org.apache.thrift.TException {
13106
      // check for required fields
13107
    }
13108
 
13109
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13110
      try {
13111
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13112
      } catch (org.apache.thrift.TException te) {
13113
        throw new java.io.IOException(te);
13114
      }
13115
    }
13116
 
13117
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13118
      try {
13119
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13120
      } catch (org.apache.thrift.TException te) {
13121
        throw new java.io.IOException(te);
13122
      }
13123
    }
13124
 
13125
  }
13126
 
13127
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
13128
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
13129
 
13130
    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);
13131
    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);
13132
 
13133
    private List<ItemCouponDiscount> success; // required
13134
    private PromotionException pex; // required
13135
 
13136
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13137
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13138
      SUCCESS((short)0, "success"),
13139
      PEX((short)1, "pex");
13140
 
13141
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13142
 
13143
      static {
13144
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13145
          byName.put(field.getFieldName(), field);
13146
        }
13147
      }
13148
 
13149
      /**
13150
       * Find the _Fields constant that matches fieldId, or null if its not found.
13151
       */
13152
      public static _Fields findByThriftId(int fieldId) {
13153
        switch(fieldId) {
13154
          case 0: // SUCCESS
13155
            return SUCCESS;
13156
          case 1: // PEX
13157
            return PEX;
13158
          default:
13159
            return null;
13160
        }
13161
      }
13162
 
13163
      /**
13164
       * Find the _Fields constant that matches fieldId, throwing an exception
13165
       * if it is not found.
13166
       */
13167
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13168
        _Fields fields = findByThriftId(fieldId);
13169
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13170
        return fields;
13171
      }
13172
 
13173
      /**
13174
       * Find the _Fields constant that matches name, or null if its not found.
13175
       */
13176
      public static _Fields findByName(String name) {
13177
        return byName.get(name);
13178
      }
13179
 
13180
      private final short _thriftId;
13181
      private final String _fieldName;
13182
 
13183
      _Fields(short thriftId, String fieldName) {
13184
        _thriftId = thriftId;
13185
        _fieldName = fieldName;
13186
      }
13187
 
13188
      public short getThriftFieldId() {
13189
        return _thriftId;
13190
      }
13191
 
13192
      public String getFieldName() {
13193
        return _fieldName;
13194
      }
13195
    }
13196
 
13197
    // isset id assignments
13198
 
13199
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13200
    static {
13201
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13202
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13203
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13204
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
13205
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13206
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13207
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13208
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
13209
    }
13210
 
13211
    public getItemDiscountMap_result() {
13212
    }
13213
 
13214
    public getItemDiscountMap_result(
13215
      List<ItemCouponDiscount> success,
13216
      PromotionException pex)
13217
    {
13218
      this();
13219
      this.success = success;
13220
      this.pex = pex;
13221
    }
13222
 
13223
    /**
13224
     * Performs a deep copy on <i>other</i>.
13225
     */
13226
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
13227
      if (other.isSetSuccess()) {
13228
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
13229
        for (ItemCouponDiscount other_element : other.success) {
13230
          __this__success.add(new ItemCouponDiscount(other_element));
13231
        }
13232
        this.success = __this__success;
13233
      }
13234
      if (other.isSetPex()) {
13235
        this.pex = new PromotionException(other.pex);
13236
      }
13237
    }
13238
 
13239
    public getItemDiscountMap_result deepCopy() {
13240
      return new getItemDiscountMap_result(this);
13241
    }
13242
 
13243
    @Override
13244
    public void clear() {
13245
      this.success = null;
13246
      this.pex = null;
13247
    }
13248
 
13249
    public int getSuccessSize() {
13250
      return (this.success == null) ? 0 : this.success.size();
13251
    }
13252
 
13253
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
13254
      return (this.success == null) ? null : this.success.iterator();
13255
    }
13256
 
13257
    public void addToSuccess(ItemCouponDiscount elem) {
13258
      if (this.success == null) {
13259
        this.success = new ArrayList<ItemCouponDiscount>();
13260
      }
13261
      this.success.add(elem);
13262
    }
13263
 
13264
    public List<ItemCouponDiscount> getSuccess() {
13265
      return this.success;
13266
    }
13267
 
13268
    public void setSuccess(List<ItemCouponDiscount> success) {
13269
      this.success = success;
13270
    }
13271
 
13272
    public void unsetSuccess() {
13273
      this.success = null;
13274
    }
13275
 
13276
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13277
    public boolean isSetSuccess() {
13278
      return this.success != null;
13279
    }
13280
 
13281
    public void setSuccessIsSet(boolean value) {
13282
      if (!value) {
13283
        this.success = null;
13284
      }
13285
    }
13286
 
13287
    public PromotionException getPex() {
13288
      return this.pex;
13289
    }
13290
 
13291
    public void setPex(PromotionException pex) {
13292
      this.pex = pex;
13293
    }
13294
 
13295
    public void unsetPex() {
13296
      this.pex = null;
13297
    }
13298
 
13299
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
13300
    public boolean isSetPex() {
13301
      return this.pex != null;
13302
    }
13303
 
13304
    public void setPexIsSet(boolean value) {
13305
      if (!value) {
13306
        this.pex = null;
13307
      }
13308
    }
13309
 
13310
    public void setFieldValue(_Fields field, Object value) {
13311
      switch (field) {
13312
      case SUCCESS:
13313
        if (value == null) {
13314
          unsetSuccess();
13315
        } else {
13316
          setSuccess((List<ItemCouponDiscount>)value);
13317
        }
13318
        break;
13319
 
13320
      case PEX:
13321
        if (value == null) {
13322
          unsetPex();
13323
        } else {
13324
          setPex((PromotionException)value);
13325
        }
13326
        break;
13327
 
13328
      }
13329
    }
13330
 
13331
    public Object getFieldValue(_Fields field) {
13332
      switch (field) {
13333
      case SUCCESS:
13334
        return getSuccess();
13335
 
13336
      case PEX:
13337
        return getPex();
13338
 
13339
      }
13340
      throw new IllegalStateException();
13341
    }
13342
 
13343
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13344
    public boolean isSet(_Fields field) {
13345
      if (field == null) {
13346
        throw new IllegalArgumentException();
13347
      }
13348
 
13349
      switch (field) {
13350
      case SUCCESS:
13351
        return isSetSuccess();
13352
      case PEX:
13353
        return isSetPex();
13354
      }
13355
      throw new IllegalStateException();
13356
    }
13357
 
13358
    @Override
13359
    public boolean equals(Object that) {
13360
      if (that == null)
13361
        return false;
13362
      if (that instanceof getItemDiscountMap_result)
13363
        return this.equals((getItemDiscountMap_result)that);
13364
      return false;
13365
    }
13366
 
13367
    public boolean equals(getItemDiscountMap_result that) {
13368
      if (that == null)
13369
        return false;
13370
 
13371
      boolean this_present_success = true && this.isSetSuccess();
13372
      boolean that_present_success = true && that.isSetSuccess();
13373
      if (this_present_success || that_present_success) {
13374
        if (!(this_present_success && that_present_success))
13375
          return false;
13376
        if (!this.success.equals(that.success))
13377
          return false;
13378
      }
13379
 
13380
      boolean this_present_pex = true && this.isSetPex();
13381
      boolean that_present_pex = true && that.isSetPex();
13382
      if (this_present_pex || that_present_pex) {
13383
        if (!(this_present_pex && that_present_pex))
13384
          return false;
13385
        if (!this.pex.equals(that.pex))
13386
          return false;
13387
      }
13388
 
13389
      return true;
13390
    }
13391
 
13392
    @Override
13393
    public int hashCode() {
13394
      return 0;
13395
    }
13396
 
13397
    public int compareTo(getItemDiscountMap_result other) {
13398
      if (!getClass().equals(other.getClass())) {
13399
        return getClass().getName().compareTo(other.getClass().getName());
13400
      }
13401
 
13402
      int lastComparison = 0;
13403
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
13404
 
13405
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
13406
      if (lastComparison != 0) {
13407
        return lastComparison;
13408
      }
13409
      if (isSetSuccess()) {
13410
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13411
        if (lastComparison != 0) {
13412
          return lastComparison;
13413
        }
13414
      }
13415
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
13416
      if (lastComparison != 0) {
13417
        return lastComparison;
13418
      }
13419
      if (isSetPex()) {
13420
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13421
        if (lastComparison != 0) {
13422
          return lastComparison;
13423
        }
13424
      }
13425
      return 0;
13426
    }
13427
 
13428
    public _Fields fieldForId(int fieldId) {
13429
      return _Fields.findByThriftId(fieldId);
13430
    }
13431
 
13432
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13433
      org.apache.thrift.protocol.TField field;
13434
      iprot.readStructBegin();
13435
      while (true)
13436
      {
13437
        field = iprot.readFieldBegin();
13438
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13439
          break;
13440
        }
13441
        switch (field.id) {
13442
          case 0: // SUCCESS
13443
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13444
              {
6433 anupam.sin 13445
                org.apache.thrift.protocol.TList _list29 = iprot.readListBegin();
13446
                this.success = new ArrayList<ItemCouponDiscount>(_list29.size);
13447
                for (int _i30 = 0; _i30 < _list29.size; ++_i30)
4189 varun.gupt 13448
                {
6433 anupam.sin 13449
                  ItemCouponDiscount _elem31; // required
13450
                  _elem31 = new ItemCouponDiscount();
13451
                  _elem31.read(iprot);
13452
                  this.success.add(_elem31);
4189 varun.gupt 13453
                }
13454
                iprot.readListEnd();
13455
              }
13456
            } else { 
13457
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13458
            }
13459
            break;
13460
          case 1: // PEX
13461
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13462
              this.pex = new PromotionException();
13463
              this.pex.read(iprot);
13464
            } else { 
13465
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13466
            }
13467
            break;
13468
          default:
13469
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13470
        }
13471
        iprot.readFieldEnd();
13472
      }
13473
      iprot.readStructEnd();
13474
      validate();
13475
    }
13476
 
13477
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13478
      oprot.writeStructBegin(STRUCT_DESC);
13479
 
13480
      if (this.isSetSuccess()) {
13481
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13482
        {
13483
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6433 anupam.sin 13484
          for (ItemCouponDiscount _iter32 : this.success)
4189 varun.gupt 13485
          {
6433 anupam.sin 13486
            _iter32.write(oprot);
4189 varun.gupt 13487
          }
13488
          oprot.writeListEnd();
13489
        }
13490
        oprot.writeFieldEnd();
13491
      } else if (this.isSetPex()) {
13492
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13493
        this.pex.write(oprot);
13494
        oprot.writeFieldEnd();
13495
      }
13496
      oprot.writeFieldStop();
13497
      oprot.writeStructEnd();
13498
    }
13499
 
13500
    @Override
13501
    public String toString() {
13502
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
13503
      boolean first = true;
13504
 
13505
      sb.append("success:");
13506
      if (this.success == null) {
13507
        sb.append("null");
13508
      } else {
13509
        sb.append(this.success);
13510
      }
13511
      first = false;
13512
      if (!first) sb.append(", ");
13513
      sb.append("pex:");
13514
      if (this.pex == null) {
13515
        sb.append("null");
13516
      } else {
13517
        sb.append(this.pex);
13518
      }
13519
      first = false;
13520
      sb.append(")");
13521
      return sb.toString();
13522
    }
13523
 
13524
    public void validate() throws org.apache.thrift.TException {
13525
      // check for required fields
13526
    }
13527
 
13528
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13529
      try {
13530
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13531
      } catch (org.apache.thrift.TException te) {
13532
        throw new java.io.IOException(te);
13533
      }
13534
    }
13535
 
13536
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13537
      try {
13538
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13539
      } catch (org.apache.thrift.TException te) {
13540
        throw new java.io.IOException(te);
13541
      }
13542
    }
13543
 
13544
  }
13545
 
4494 varun.gupt 13546
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
13547
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
13548
 
13549
    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);
13550
 
13551
    private long entityId; // required
13552
 
13553
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13554
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13555
      ENTITY_ID((short)1, "entityId");
13556
 
13557
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13558
 
13559
      static {
13560
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13561
          byName.put(field.getFieldName(), field);
13562
        }
13563
      }
13564
 
13565
      /**
13566
       * Find the _Fields constant that matches fieldId, or null if its not found.
13567
       */
13568
      public static _Fields findByThriftId(int fieldId) {
13569
        switch(fieldId) {
13570
          case 1: // ENTITY_ID
13571
            return ENTITY_ID;
13572
          default:
13573
            return null;
13574
        }
13575
      }
13576
 
13577
      /**
13578
       * Find the _Fields constant that matches fieldId, throwing an exception
13579
       * if it is not found.
13580
       */
13581
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13582
        _Fields fields = findByThriftId(fieldId);
13583
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13584
        return fields;
13585
      }
13586
 
13587
      /**
13588
       * Find the _Fields constant that matches name, or null if its not found.
13589
       */
13590
      public static _Fields findByName(String name) {
13591
        return byName.get(name);
13592
      }
13593
 
13594
      private final short _thriftId;
13595
      private final String _fieldName;
13596
 
13597
      _Fields(short thriftId, String fieldName) {
13598
        _thriftId = thriftId;
13599
        _fieldName = fieldName;
13600
      }
13601
 
13602
      public short getThriftFieldId() {
13603
        return _thriftId;
13604
      }
13605
 
13606
      public String getFieldName() {
13607
        return _fieldName;
13608
      }
13609
    }
13610
 
13611
    // isset id assignments
13612
    private static final int __ENTITYID_ISSET_ID = 0;
13613
    private BitSet __isset_bit_vector = new BitSet(1);
13614
 
13615
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13616
    static {
13617
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13618
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13619
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13620
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13621
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
13622
    }
13623
 
13624
    public getDiscountsForEntity_args() {
13625
    }
13626
 
13627
    public getDiscountsForEntity_args(
13628
      long entityId)
13629
    {
13630
      this();
13631
      this.entityId = entityId;
13632
      setEntityIdIsSet(true);
13633
    }
13634
 
13635
    /**
13636
     * Performs a deep copy on <i>other</i>.
13637
     */
13638
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
13639
      __isset_bit_vector.clear();
13640
      __isset_bit_vector.or(other.__isset_bit_vector);
13641
      this.entityId = other.entityId;
13642
    }
13643
 
13644
    public getDiscountsForEntity_args deepCopy() {
13645
      return new getDiscountsForEntity_args(this);
13646
    }
13647
 
13648
    @Override
13649
    public void clear() {
13650
      setEntityIdIsSet(false);
13651
      this.entityId = 0;
13652
    }
13653
 
13654
    public long getEntityId() {
13655
      return this.entityId;
13656
    }
13657
 
13658
    public void setEntityId(long entityId) {
13659
      this.entityId = entityId;
13660
      setEntityIdIsSet(true);
13661
    }
13662
 
13663
    public void unsetEntityId() {
13664
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
13665
    }
13666
 
13667
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
13668
    public boolean isSetEntityId() {
13669
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
13670
    }
13671
 
13672
    public void setEntityIdIsSet(boolean value) {
13673
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
13674
    }
13675
 
13676
    public void setFieldValue(_Fields field, Object value) {
13677
      switch (field) {
13678
      case ENTITY_ID:
13679
        if (value == null) {
13680
          unsetEntityId();
13681
        } else {
13682
          setEntityId((Long)value);
13683
        }
13684
        break;
13685
 
13686
      }
13687
    }
13688
 
13689
    public Object getFieldValue(_Fields field) {
13690
      switch (field) {
13691
      case ENTITY_ID:
13692
        return Long.valueOf(getEntityId());
13693
 
13694
      }
13695
      throw new IllegalStateException();
13696
    }
13697
 
13698
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13699
    public boolean isSet(_Fields field) {
13700
      if (field == null) {
13701
        throw new IllegalArgumentException();
13702
      }
13703
 
13704
      switch (field) {
13705
      case ENTITY_ID:
13706
        return isSetEntityId();
13707
      }
13708
      throw new IllegalStateException();
13709
    }
13710
 
13711
    @Override
13712
    public boolean equals(Object that) {
13713
      if (that == null)
13714
        return false;
13715
      if (that instanceof getDiscountsForEntity_args)
13716
        return this.equals((getDiscountsForEntity_args)that);
13717
      return false;
13718
    }
13719
 
13720
    public boolean equals(getDiscountsForEntity_args that) {
13721
      if (that == null)
13722
        return false;
13723
 
13724
      boolean this_present_entityId = true;
13725
      boolean that_present_entityId = true;
13726
      if (this_present_entityId || that_present_entityId) {
13727
        if (!(this_present_entityId && that_present_entityId))
13728
          return false;
13729
        if (this.entityId != that.entityId)
13730
          return false;
13731
      }
13732
 
13733
      return true;
13734
    }
13735
 
13736
    @Override
13737
    public int hashCode() {
13738
      return 0;
13739
    }
13740
 
13741
    public int compareTo(getDiscountsForEntity_args other) {
13742
      if (!getClass().equals(other.getClass())) {
13743
        return getClass().getName().compareTo(other.getClass().getName());
13744
      }
13745
 
13746
      int lastComparison = 0;
13747
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
13748
 
13749
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
13750
      if (lastComparison != 0) {
13751
        return lastComparison;
13752
      }
13753
      if (isSetEntityId()) {
13754
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
13755
        if (lastComparison != 0) {
13756
          return lastComparison;
13757
        }
13758
      }
13759
      return 0;
13760
    }
13761
 
13762
    public _Fields fieldForId(int fieldId) {
13763
      return _Fields.findByThriftId(fieldId);
13764
    }
13765
 
13766
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13767
      org.apache.thrift.protocol.TField field;
13768
      iprot.readStructBegin();
13769
      while (true)
13770
      {
13771
        field = iprot.readFieldBegin();
13772
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13773
          break;
13774
        }
13775
        switch (field.id) {
13776
          case 1: // ENTITY_ID
13777
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13778
              this.entityId = iprot.readI64();
13779
              setEntityIdIsSet(true);
13780
            } else { 
13781
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13782
            }
13783
            break;
13784
          default:
13785
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13786
        }
13787
        iprot.readFieldEnd();
13788
      }
13789
      iprot.readStructEnd();
13790
      validate();
13791
    }
13792
 
13793
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13794
      validate();
13795
 
13796
      oprot.writeStructBegin(STRUCT_DESC);
13797
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
13798
      oprot.writeI64(this.entityId);
13799
      oprot.writeFieldEnd();
13800
      oprot.writeFieldStop();
13801
      oprot.writeStructEnd();
13802
    }
13803
 
13804
    @Override
13805
    public String toString() {
13806
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
13807
      boolean first = true;
13808
 
13809
      sb.append("entityId:");
13810
      sb.append(this.entityId);
13811
      first = false;
13812
      sb.append(")");
13813
      return sb.toString();
13814
    }
13815
 
13816
    public void validate() throws org.apache.thrift.TException {
13817
      // check for required fields
13818
    }
13819
 
13820
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13821
      try {
13822
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13823
      } catch (org.apache.thrift.TException te) {
13824
        throw new java.io.IOException(te);
13825
      }
13826
    }
13827
 
13828
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13829
      try {
13830
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
13831
        __isset_bit_vector = new BitSet(1);
13832
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13833
      } catch (org.apache.thrift.TException te) {
13834
        throw new java.io.IOException(te);
13835
      }
13836
    }
13837
 
13838
  }
13839
 
13840
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
13841
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
13842
 
13843
    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);
13844
 
13845
    private Map<String,Double> success; // required
13846
 
13847
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13848
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13849
      SUCCESS((short)0, "success");
13850
 
13851
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13852
 
13853
      static {
13854
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13855
          byName.put(field.getFieldName(), field);
13856
        }
13857
      }
13858
 
13859
      /**
13860
       * Find the _Fields constant that matches fieldId, or null if its not found.
13861
       */
13862
      public static _Fields findByThriftId(int fieldId) {
13863
        switch(fieldId) {
13864
          case 0: // SUCCESS
13865
            return SUCCESS;
13866
          default:
13867
            return null;
13868
        }
13869
      }
13870
 
13871
      /**
13872
       * Find the _Fields constant that matches fieldId, throwing an exception
13873
       * if it is not found.
13874
       */
13875
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13876
        _Fields fields = findByThriftId(fieldId);
13877
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13878
        return fields;
13879
      }
13880
 
13881
      /**
13882
       * Find the _Fields constant that matches name, or null if its not found.
13883
       */
13884
      public static _Fields findByName(String name) {
13885
        return byName.get(name);
13886
      }
13887
 
13888
      private final short _thriftId;
13889
      private final String _fieldName;
13890
 
13891
      _Fields(short thriftId, String fieldName) {
13892
        _thriftId = thriftId;
13893
        _fieldName = fieldName;
13894
      }
13895
 
13896
      public short getThriftFieldId() {
13897
        return _thriftId;
13898
      }
13899
 
13900
      public String getFieldName() {
13901
        return _fieldName;
13902
      }
13903
    }
13904
 
13905
    // isset id assignments
13906
 
13907
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13908
    static {
13909
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13910
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13911
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
13912
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
13913
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
13914
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13915
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
13916
    }
13917
 
13918
    public getDiscountsForEntity_result() {
13919
    }
13920
 
13921
    public getDiscountsForEntity_result(
13922
      Map<String,Double> success)
13923
    {
13924
      this();
13925
      this.success = success;
13926
    }
13927
 
13928
    /**
13929
     * Performs a deep copy on <i>other</i>.
13930
     */
13931
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
13932
      if (other.isSetSuccess()) {
13933
        Map<String,Double> __this__success = new HashMap<String,Double>();
13934
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
13935
 
13936
          String other_element_key = other_element.getKey();
13937
          Double other_element_value = other_element.getValue();
13938
 
13939
          String __this__success_copy_key = other_element_key;
13940
 
13941
          Double __this__success_copy_value = other_element_value;
13942
 
13943
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
13944
        }
13945
        this.success = __this__success;
13946
      }
13947
    }
13948
 
13949
    public getDiscountsForEntity_result deepCopy() {
13950
      return new getDiscountsForEntity_result(this);
13951
    }
13952
 
13953
    @Override
13954
    public void clear() {
13955
      this.success = null;
13956
    }
13957
 
13958
    public int getSuccessSize() {
13959
      return (this.success == null) ? 0 : this.success.size();
13960
    }
13961
 
13962
    public void putToSuccess(String key, double val) {
13963
      if (this.success == null) {
13964
        this.success = new HashMap<String,Double>();
13965
      }
13966
      this.success.put(key, val);
13967
    }
13968
 
13969
    public Map<String,Double> getSuccess() {
13970
      return this.success;
13971
    }
13972
 
13973
    public void setSuccess(Map<String,Double> success) {
13974
      this.success = success;
13975
    }
13976
 
13977
    public void unsetSuccess() {
13978
      this.success = null;
13979
    }
13980
 
13981
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13982
    public boolean isSetSuccess() {
13983
      return this.success != null;
13984
    }
13985
 
13986
    public void setSuccessIsSet(boolean value) {
13987
      if (!value) {
13988
        this.success = null;
13989
      }
13990
    }
13991
 
13992
    public void setFieldValue(_Fields field, Object value) {
13993
      switch (field) {
13994
      case SUCCESS:
13995
        if (value == null) {
13996
          unsetSuccess();
13997
        } else {
13998
          setSuccess((Map<String,Double>)value);
13999
        }
14000
        break;
14001
 
14002
      }
14003
    }
14004
 
14005
    public Object getFieldValue(_Fields field) {
14006
      switch (field) {
14007
      case SUCCESS:
14008
        return getSuccess();
14009
 
14010
      }
14011
      throw new IllegalStateException();
14012
    }
14013
 
14014
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14015
    public boolean isSet(_Fields field) {
14016
      if (field == null) {
14017
        throw new IllegalArgumentException();
14018
      }
14019
 
14020
      switch (field) {
14021
      case SUCCESS:
14022
        return isSetSuccess();
14023
      }
14024
      throw new IllegalStateException();
14025
    }
14026
 
14027
    @Override
14028
    public boolean equals(Object that) {
14029
      if (that == null)
14030
        return false;
14031
      if (that instanceof getDiscountsForEntity_result)
14032
        return this.equals((getDiscountsForEntity_result)that);
14033
      return false;
14034
    }
14035
 
14036
    public boolean equals(getDiscountsForEntity_result that) {
14037
      if (that == null)
14038
        return false;
14039
 
14040
      boolean this_present_success = true && this.isSetSuccess();
14041
      boolean that_present_success = true && that.isSetSuccess();
14042
      if (this_present_success || that_present_success) {
14043
        if (!(this_present_success && that_present_success))
14044
          return false;
14045
        if (!this.success.equals(that.success))
14046
          return false;
14047
      }
14048
 
14049
      return true;
14050
    }
14051
 
14052
    @Override
14053
    public int hashCode() {
14054
      return 0;
14055
    }
14056
 
14057
    public int compareTo(getDiscountsForEntity_result other) {
14058
      if (!getClass().equals(other.getClass())) {
14059
        return getClass().getName().compareTo(other.getClass().getName());
14060
      }
14061
 
14062
      int lastComparison = 0;
14063
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
14064
 
14065
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
14066
      if (lastComparison != 0) {
14067
        return lastComparison;
14068
      }
14069
      if (isSetSuccess()) {
14070
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14071
        if (lastComparison != 0) {
14072
          return lastComparison;
14073
        }
14074
      }
14075
      return 0;
14076
    }
14077
 
14078
    public _Fields fieldForId(int fieldId) {
14079
      return _Fields.findByThriftId(fieldId);
14080
    }
14081
 
14082
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14083
      org.apache.thrift.protocol.TField field;
14084
      iprot.readStructBegin();
14085
      while (true)
14086
      {
14087
        field = iprot.readFieldBegin();
14088
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14089
          break;
14090
        }
14091
        switch (field.id) {
14092
          case 0: // SUCCESS
14093
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
14094
              {
6433 anupam.sin 14095
                org.apache.thrift.protocol.TMap _map33 = iprot.readMapBegin();
14096
                this.success = new HashMap<String,Double>(2*_map33.size);
14097
                for (int _i34 = 0; _i34 < _map33.size; ++_i34)
4494 varun.gupt 14098
                {
6433 anupam.sin 14099
                  String _key35; // required
14100
                  double _val36; // required
14101
                  _key35 = iprot.readString();
14102
                  _val36 = iprot.readDouble();
14103
                  this.success.put(_key35, _val36);
4494 varun.gupt 14104
                }
14105
                iprot.readMapEnd();
14106
              }
14107
            } else { 
14108
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14109
            }
14110
            break;
14111
          default:
14112
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14113
        }
14114
        iprot.readFieldEnd();
14115
      }
14116
      iprot.readStructEnd();
14117
      validate();
14118
    }
14119
 
14120
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14121
      oprot.writeStructBegin(STRUCT_DESC);
14122
 
14123
      if (this.isSetSuccess()) {
14124
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14125
        {
14126
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
6433 anupam.sin 14127
          for (Map.Entry<String, Double> _iter37 : this.success.entrySet())
4494 varun.gupt 14128
          {
6433 anupam.sin 14129
            oprot.writeString(_iter37.getKey());
14130
            oprot.writeDouble(_iter37.getValue());
4494 varun.gupt 14131
          }
14132
          oprot.writeMapEnd();
14133
        }
14134
        oprot.writeFieldEnd();
14135
      }
14136
      oprot.writeFieldStop();
14137
      oprot.writeStructEnd();
14138
    }
14139
 
14140
    @Override
14141
    public String toString() {
14142
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
14143
      boolean first = true;
14144
 
14145
      sb.append("success:");
14146
      if (this.success == null) {
14147
        sb.append("null");
14148
      } else {
14149
        sb.append(this.success);
14150
      }
14151
      first = false;
14152
      sb.append(")");
14153
      return sb.toString();
14154
    }
14155
 
14156
    public void validate() throws org.apache.thrift.TException {
14157
      // check for required fields
14158
    }
14159
 
14160
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14161
      try {
14162
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14163
      } catch (org.apache.thrift.TException te) {
14164
        throw new java.io.IOException(te);
14165
      }
14166
    }
14167
 
14168
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14169
      try {
14170
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14171
      } catch (org.apache.thrift.TException te) {
14172
        throw new java.io.IOException(te);
14173
      }
14174
    }
14175
 
14176
  }
14177
 
5469 rajveer 14178
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
14179
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
14180
 
14181
    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);
14182
 
14183
    private Voucher voucher; // required
14184
 
14185
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14186
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14187
      VOUCHER((short)1, "voucher");
14188
 
14189
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14190
 
14191
      static {
14192
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14193
          byName.put(field.getFieldName(), field);
14194
        }
14195
      }
14196
 
14197
      /**
14198
       * Find the _Fields constant that matches fieldId, or null if its not found.
14199
       */
14200
      public static _Fields findByThriftId(int fieldId) {
14201
        switch(fieldId) {
14202
          case 1: // VOUCHER
14203
            return VOUCHER;
14204
          default:
14205
            return null;
14206
        }
14207
      }
14208
 
14209
      /**
14210
       * Find the _Fields constant that matches fieldId, throwing an exception
14211
       * if it is not found.
14212
       */
14213
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14214
        _Fields fields = findByThriftId(fieldId);
14215
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14216
        return fields;
14217
      }
14218
 
14219
      /**
14220
       * Find the _Fields constant that matches name, or null if its not found.
14221
       */
14222
      public static _Fields findByName(String name) {
14223
        return byName.get(name);
14224
      }
14225
 
14226
      private final short _thriftId;
14227
      private final String _fieldName;
14228
 
14229
      _Fields(short thriftId, String fieldName) {
14230
        _thriftId = thriftId;
14231
        _fieldName = fieldName;
14232
      }
14233
 
14234
      public short getThriftFieldId() {
14235
        return _thriftId;
14236
      }
14237
 
14238
      public String getFieldName() {
14239
        return _fieldName;
14240
      }
14241
    }
14242
 
14243
    // isset id assignments
14244
 
14245
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14246
    static {
14247
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14248
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14249
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
14250
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14251
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
14252
    }
14253
 
14254
    public addVoucher_args() {
14255
    }
14256
 
14257
    public addVoucher_args(
14258
      Voucher voucher)
14259
    {
14260
      this();
14261
      this.voucher = voucher;
14262
    }
14263
 
14264
    /**
14265
     * Performs a deep copy on <i>other</i>.
14266
     */
14267
    public addVoucher_args(addVoucher_args other) {
14268
      if (other.isSetVoucher()) {
14269
        this.voucher = new Voucher(other.voucher);
14270
      }
14271
    }
14272
 
14273
    public addVoucher_args deepCopy() {
14274
      return new addVoucher_args(this);
14275
    }
14276
 
14277
    @Override
14278
    public void clear() {
14279
      this.voucher = null;
14280
    }
14281
 
14282
    public Voucher getVoucher() {
14283
      return this.voucher;
14284
    }
14285
 
14286
    public void setVoucher(Voucher voucher) {
14287
      this.voucher = voucher;
14288
    }
14289
 
14290
    public void unsetVoucher() {
14291
      this.voucher = null;
14292
    }
14293
 
14294
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
14295
    public boolean isSetVoucher() {
14296
      return this.voucher != null;
14297
    }
14298
 
14299
    public void setVoucherIsSet(boolean value) {
14300
      if (!value) {
14301
        this.voucher = null;
14302
      }
14303
    }
14304
 
14305
    public void setFieldValue(_Fields field, Object value) {
14306
      switch (field) {
14307
      case VOUCHER:
14308
        if (value == null) {
14309
          unsetVoucher();
14310
        } else {
14311
          setVoucher((Voucher)value);
14312
        }
14313
        break;
14314
 
14315
      }
14316
    }
14317
 
14318
    public Object getFieldValue(_Fields field) {
14319
      switch (field) {
14320
      case VOUCHER:
14321
        return getVoucher();
14322
 
14323
      }
14324
      throw new IllegalStateException();
14325
    }
14326
 
14327
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14328
    public boolean isSet(_Fields field) {
14329
      if (field == null) {
14330
        throw new IllegalArgumentException();
14331
      }
14332
 
14333
      switch (field) {
14334
      case VOUCHER:
14335
        return isSetVoucher();
14336
      }
14337
      throw new IllegalStateException();
14338
    }
14339
 
14340
    @Override
14341
    public boolean equals(Object that) {
14342
      if (that == null)
14343
        return false;
14344
      if (that instanceof addVoucher_args)
14345
        return this.equals((addVoucher_args)that);
14346
      return false;
14347
    }
14348
 
14349
    public boolean equals(addVoucher_args that) {
14350
      if (that == null)
14351
        return false;
14352
 
14353
      boolean this_present_voucher = true && this.isSetVoucher();
14354
      boolean that_present_voucher = true && that.isSetVoucher();
14355
      if (this_present_voucher || that_present_voucher) {
14356
        if (!(this_present_voucher && that_present_voucher))
14357
          return false;
14358
        if (!this.voucher.equals(that.voucher))
14359
          return false;
14360
      }
14361
 
14362
      return true;
14363
    }
14364
 
14365
    @Override
14366
    public int hashCode() {
14367
      return 0;
14368
    }
14369
 
14370
    public int compareTo(addVoucher_args other) {
14371
      if (!getClass().equals(other.getClass())) {
14372
        return getClass().getName().compareTo(other.getClass().getName());
14373
      }
14374
 
14375
      int lastComparison = 0;
14376
      addVoucher_args typedOther = (addVoucher_args)other;
14377
 
14378
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
14379
      if (lastComparison != 0) {
14380
        return lastComparison;
14381
      }
14382
      if (isSetVoucher()) {
14383
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
14384
        if (lastComparison != 0) {
14385
          return lastComparison;
14386
        }
14387
      }
14388
      return 0;
14389
    }
14390
 
14391
    public _Fields fieldForId(int fieldId) {
14392
      return _Fields.findByThriftId(fieldId);
14393
    }
14394
 
14395
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14396
      org.apache.thrift.protocol.TField field;
14397
      iprot.readStructBegin();
14398
      while (true)
14399
      {
14400
        field = iprot.readFieldBegin();
14401
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14402
          break;
14403
        }
14404
        switch (field.id) {
14405
          case 1: // VOUCHER
14406
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14407
              this.voucher = new Voucher();
14408
              this.voucher.read(iprot);
14409
            } else { 
14410
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14411
            }
14412
            break;
14413
          default:
14414
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14415
        }
14416
        iprot.readFieldEnd();
14417
      }
14418
      iprot.readStructEnd();
14419
      validate();
14420
    }
14421
 
14422
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14423
      validate();
14424
 
14425
      oprot.writeStructBegin(STRUCT_DESC);
14426
      if (this.voucher != null) {
14427
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
14428
        this.voucher.write(oprot);
14429
        oprot.writeFieldEnd();
14430
      }
14431
      oprot.writeFieldStop();
14432
      oprot.writeStructEnd();
14433
    }
14434
 
14435
    @Override
14436
    public String toString() {
14437
      StringBuilder sb = new StringBuilder("addVoucher_args(");
14438
      boolean first = true;
14439
 
14440
      sb.append("voucher:");
14441
      if (this.voucher == null) {
14442
        sb.append("null");
14443
      } else {
14444
        sb.append(this.voucher);
14445
      }
14446
      first = false;
14447
      sb.append(")");
14448
      return sb.toString();
14449
    }
14450
 
14451
    public void validate() throws org.apache.thrift.TException {
14452
      // check for required fields
14453
    }
14454
 
14455
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14456
      try {
14457
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14458
      } catch (org.apache.thrift.TException te) {
14459
        throw new java.io.IOException(te);
14460
      }
14461
    }
14462
 
14463
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14464
      try {
14465
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14466
      } catch (org.apache.thrift.TException te) {
14467
        throw new java.io.IOException(te);
14468
      }
14469
    }
14470
 
14471
  }
14472
 
14473
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
14474
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
14475
 
14476
 
14477
 
14478
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14479
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14480
;
14481
 
14482
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14483
 
14484
      static {
14485
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14486
          byName.put(field.getFieldName(), field);
14487
        }
14488
      }
14489
 
14490
      /**
14491
       * Find the _Fields constant that matches fieldId, or null if its not found.
14492
       */
14493
      public static _Fields findByThriftId(int fieldId) {
14494
        switch(fieldId) {
14495
          default:
14496
            return null;
14497
        }
14498
      }
14499
 
14500
      /**
14501
       * Find the _Fields constant that matches fieldId, throwing an exception
14502
       * if it is not found.
14503
       */
14504
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14505
        _Fields fields = findByThriftId(fieldId);
14506
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14507
        return fields;
14508
      }
14509
 
14510
      /**
14511
       * Find the _Fields constant that matches name, or null if its not found.
14512
       */
14513
      public static _Fields findByName(String name) {
14514
        return byName.get(name);
14515
      }
14516
 
14517
      private final short _thriftId;
14518
      private final String _fieldName;
14519
 
14520
      _Fields(short thriftId, String fieldName) {
14521
        _thriftId = thriftId;
14522
        _fieldName = fieldName;
14523
      }
14524
 
14525
      public short getThriftFieldId() {
14526
        return _thriftId;
14527
      }
14528
 
14529
      public String getFieldName() {
14530
        return _fieldName;
14531
      }
14532
    }
14533
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14534
    static {
14535
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14536
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14537
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
14538
    }
14539
 
14540
    public addVoucher_result() {
14541
    }
14542
 
14543
    /**
14544
     * Performs a deep copy on <i>other</i>.
14545
     */
14546
    public addVoucher_result(addVoucher_result other) {
14547
    }
14548
 
14549
    public addVoucher_result deepCopy() {
14550
      return new addVoucher_result(this);
14551
    }
14552
 
14553
    @Override
14554
    public void clear() {
14555
    }
14556
 
14557
    public void setFieldValue(_Fields field, Object value) {
14558
      switch (field) {
14559
      }
14560
    }
14561
 
14562
    public Object getFieldValue(_Fields field) {
14563
      switch (field) {
14564
      }
14565
      throw new IllegalStateException();
14566
    }
14567
 
14568
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14569
    public boolean isSet(_Fields field) {
14570
      if (field == null) {
14571
        throw new IllegalArgumentException();
14572
      }
14573
 
14574
      switch (field) {
14575
      }
14576
      throw new IllegalStateException();
14577
    }
14578
 
14579
    @Override
14580
    public boolean equals(Object that) {
14581
      if (that == null)
14582
        return false;
14583
      if (that instanceof addVoucher_result)
14584
        return this.equals((addVoucher_result)that);
14585
      return false;
14586
    }
14587
 
14588
    public boolean equals(addVoucher_result that) {
14589
      if (that == null)
14590
        return false;
14591
 
14592
      return true;
14593
    }
14594
 
14595
    @Override
14596
    public int hashCode() {
14597
      return 0;
14598
    }
14599
 
14600
    public int compareTo(addVoucher_result other) {
14601
      if (!getClass().equals(other.getClass())) {
14602
        return getClass().getName().compareTo(other.getClass().getName());
14603
      }
14604
 
14605
      int lastComparison = 0;
14606
      addVoucher_result typedOther = (addVoucher_result)other;
14607
 
14608
      return 0;
14609
    }
14610
 
14611
    public _Fields fieldForId(int fieldId) {
14612
      return _Fields.findByThriftId(fieldId);
14613
    }
14614
 
14615
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14616
      org.apache.thrift.protocol.TField field;
14617
      iprot.readStructBegin();
14618
      while (true)
14619
      {
14620
        field = iprot.readFieldBegin();
14621
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14622
          break;
14623
        }
14624
        switch (field.id) {
14625
          default:
14626
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14627
        }
14628
        iprot.readFieldEnd();
14629
      }
14630
      iprot.readStructEnd();
14631
      validate();
14632
    }
14633
 
14634
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14635
      oprot.writeStructBegin(STRUCT_DESC);
14636
 
14637
      oprot.writeFieldStop();
14638
      oprot.writeStructEnd();
14639
    }
14640
 
14641
    @Override
14642
    public String toString() {
14643
      StringBuilder sb = new StringBuilder("addVoucher_result(");
14644
      boolean first = true;
14645
 
14646
      sb.append(")");
14647
      return sb.toString();
14648
    }
14649
 
14650
    public void validate() throws org.apache.thrift.TException {
14651
      // check for required fields
14652
    }
14653
 
14654
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14655
      try {
14656
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14657
      } catch (org.apache.thrift.TException te) {
14658
        throw new java.io.IOException(te);
14659
      }
14660
    }
14661
 
14662
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14663
      try {
14664
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14665
      } catch (org.apache.thrift.TException te) {
14666
        throw new java.io.IOException(te);
14667
      }
14668
    }
14669
 
14670
  }
14671
 
14672
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
14673
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
14674
 
14675
    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);
14676
    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);
14677
    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);
14678
    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);
14679
 
14680
    private long userId; // required
14681
    private String userEmail; // required
14682
    private VoucherType voucherType; // required
14683
    private long amount; // required
14684
 
14685
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14686
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14687
      USER_ID((short)1, "userId"),
14688
      USER_EMAIL((short)2, "userEmail"),
14689
      /**
14690
       * 
14691
       * @see VoucherType
14692
       */
14693
      VOUCHER_TYPE((short)3, "voucherType"),
14694
      AMOUNT((short)4, "amount");
14695
 
14696
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14697
 
14698
      static {
14699
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14700
          byName.put(field.getFieldName(), field);
14701
        }
14702
      }
14703
 
14704
      /**
14705
       * Find the _Fields constant that matches fieldId, or null if its not found.
14706
       */
14707
      public static _Fields findByThriftId(int fieldId) {
14708
        switch(fieldId) {
14709
          case 1: // USER_ID
14710
            return USER_ID;
14711
          case 2: // USER_EMAIL
14712
            return USER_EMAIL;
14713
          case 3: // VOUCHER_TYPE
14714
            return VOUCHER_TYPE;
14715
          case 4: // AMOUNT
14716
            return AMOUNT;
14717
          default:
14718
            return null;
14719
        }
14720
      }
14721
 
14722
      /**
14723
       * Find the _Fields constant that matches fieldId, throwing an exception
14724
       * if it is not found.
14725
       */
14726
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14727
        _Fields fields = findByThriftId(fieldId);
14728
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14729
        return fields;
14730
      }
14731
 
14732
      /**
14733
       * Find the _Fields constant that matches name, or null if its not found.
14734
       */
14735
      public static _Fields findByName(String name) {
14736
        return byName.get(name);
14737
      }
14738
 
14739
      private final short _thriftId;
14740
      private final String _fieldName;
14741
 
14742
      _Fields(short thriftId, String fieldName) {
14743
        _thriftId = thriftId;
14744
        _fieldName = fieldName;
14745
      }
14746
 
14747
      public short getThriftFieldId() {
14748
        return _thriftId;
14749
      }
14750
 
14751
      public String getFieldName() {
14752
        return _fieldName;
14753
      }
14754
    }
14755
 
14756
    // isset id assignments
14757
    private static final int __USERID_ISSET_ID = 0;
14758
    private static final int __AMOUNT_ISSET_ID = 1;
14759
    private BitSet __isset_bit_vector = new BitSet(2);
14760
 
14761
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14762
    static {
14763
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14764
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14765
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
14766
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14767
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
14768
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14769
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
14770
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14771
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
14772
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14773
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
14774
    }
14775
 
14776
    public assignVoucher_args() {
14777
    }
14778
 
14779
    public assignVoucher_args(
14780
      long userId,
14781
      String userEmail,
14782
      VoucherType voucherType,
14783
      long amount)
14784
    {
14785
      this();
14786
      this.userId = userId;
14787
      setUserIdIsSet(true);
14788
      this.userEmail = userEmail;
14789
      this.voucherType = voucherType;
14790
      this.amount = amount;
14791
      setAmountIsSet(true);
14792
    }
14793
 
14794
    /**
14795
     * Performs a deep copy on <i>other</i>.
14796
     */
14797
    public assignVoucher_args(assignVoucher_args other) {
14798
      __isset_bit_vector.clear();
14799
      __isset_bit_vector.or(other.__isset_bit_vector);
14800
      this.userId = other.userId;
14801
      if (other.isSetUserEmail()) {
14802
        this.userEmail = other.userEmail;
14803
      }
14804
      if (other.isSetVoucherType()) {
14805
        this.voucherType = other.voucherType;
14806
      }
14807
      this.amount = other.amount;
14808
    }
14809
 
14810
    public assignVoucher_args deepCopy() {
14811
      return new assignVoucher_args(this);
14812
    }
14813
 
14814
    @Override
14815
    public void clear() {
14816
      setUserIdIsSet(false);
14817
      this.userId = 0;
14818
      this.userEmail = null;
14819
      this.voucherType = null;
14820
      setAmountIsSet(false);
14821
      this.amount = 0;
14822
    }
14823
 
14824
    public long getUserId() {
14825
      return this.userId;
14826
    }
14827
 
14828
    public void setUserId(long userId) {
14829
      this.userId = userId;
14830
      setUserIdIsSet(true);
14831
    }
14832
 
14833
    public void unsetUserId() {
14834
      __isset_bit_vector.clear(__USERID_ISSET_ID);
14835
    }
14836
 
14837
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
14838
    public boolean isSetUserId() {
14839
      return __isset_bit_vector.get(__USERID_ISSET_ID);
14840
    }
14841
 
14842
    public void setUserIdIsSet(boolean value) {
14843
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
14844
    }
14845
 
14846
    public String getUserEmail() {
14847
      return this.userEmail;
14848
    }
14849
 
14850
    public void setUserEmail(String userEmail) {
14851
      this.userEmail = userEmail;
14852
    }
14853
 
14854
    public void unsetUserEmail() {
14855
      this.userEmail = null;
14856
    }
14857
 
14858
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
14859
    public boolean isSetUserEmail() {
14860
      return this.userEmail != null;
14861
    }
14862
 
14863
    public void setUserEmailIsSet(boolean value) {
14864
      if (!value) {
14865
        this.userEmail = null;
14866
      }
14867
    }
14868
 
14869
    /**
14870
     * 
14871
     * @see VoucherType
14872
     */
14873
    public VoucherType getVoucherType() {
14874
      return this.voucherType;
14875
    }
14876
 
14877
    /**
14878
     * 
14879
     * @see VoucherType
14880
     */
14881
    public void setVoucherType(VoucherType voucherType) {
14882
      this.voucherType = voucherType;
14883
    }
14884
 
14885
    public void unsetVoucherType() {
14886
      this.voucherType = null;
14887
    }
14888
 
14889
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
14890
    public boolean isSetVoucherType() {
14891
      return this.voucherType != null;
14892
    }
14893
 
14894
    public void setVoucherTypeIsSet(boolean value) {
14895
      if (!value) {
14896
        this.voucherType = null;
14897
      }
14898
    }
14899
 
14900
    public long getAmount() {
14901
      return this.amount;
14902
    }
14903
 
14904
    public void setAmount(long amount) {
14905
      this.amount = amount;
14906
      setAmountIsSet(true);
14907
    }
14908
 
14909
    public void unsetAmount() {
14910
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
14911
    }
14912
 
14913
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
14914
    public boolean isSetAmount() {
14915
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
14916
    }
14917
 
14918
    public void setAmountIsSet(boolean value) {
14919
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
14920
    }
14921
 
14922
    public void setFieldValue(_Fields field, Object value) {
14923
      switch (field) {
14924
      case USER_ID:
14925
        if (value == null) {
14926
          unsetUserId();
14927
        } else {
14928
          setUserId((Long)value);
14929
        }
14930
        break;
14931
 
14932
      case USER_EMAIL:
14933
        if (value == null) {
14934
          unsetUserEmail();
14935
        } else {
14936
          setUserEmail((String)value);
14937
        }
14938
        break;
14939
 
14940
      case VOUCHER_TYPE:
14941
        if (value == null) {
14942
          unsetVoucherType();
14943
        } else {
14944
          setVoucherType((VoucherType)value);
14945
        }
14946
        break;
14947
 
14948
      case AMOUNT:
14949
        if (value == null) {
14950
          unsetAmount();
14951
        } else {
14952
          setAmount((Long)value);
14953
        }
14954
        break;
14955
 
14956
      }
14957
    }
14958
 
14959
    public Object getFieldValue(_Fields field) {
14960
      switch (field) {
14961
      case USER_ID:
14962
        return Long.valueOf(getUserId());
14963
 
14964
      case USER_EMAIL:
14965
        return getUserEmail();
14966
 
14967
      case VOUCHER_TYPE:
14968
        return getVoucherType();
14969
 
14970
      case AMOUNT:
14971
        return Long.valueOf(getAmount());
14972
 
14973
      }
14974
      throw new IllegalStateException();
14975
    }
14976
 
14977
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14978
    public boolean isSet(_Fields field) {
14979
      if (field == null) {
14980
        throw new IllegalArgumentException();
14981
      }
14982
 
14983
      switch (field) {
14984
      case USER_ID:
14985
        return isSetUserId();
14986
      case USER_EMAIL:
14987
        return isSetUserEmail();
14988
      case VOUCHER_TYPE:
14989
        return isSetVoucherType();
14990
      case AMOUNT:
14991
        return isSetAmount();
14992
      }
14993
      throw new IllegalStateException();
14994
    }
14995
 
14996
    @Override
14997
    public boolean equals(Object that) {
14998
      if (that == null)
14999
        return false;
15000
      if (that instanceof assignVoucher_args)
15001
        return this.equals((assignVoucher_args)that);
15002
      return false;
15003
    }
15004
 
15005
    public boolean equals(assignVoucher_args that) {
15006
      if (that == null)
15007
        return false;
15008
 
15009
      boolean this_present_userId = true;
15010
      boolean that_present_userId = true;
15011
      if (this_present_userId || that_present_userId) {
15012
        if (!(this_present_userId && that_present_userId))
15013
          return false;
15014
        if (this.userId != that.userId)
15015
          return false;
15016
      }
15017
 
15018
      boolean this_present_userEmail = true && this.isSetUserEmail();
15019
      boolean that_present_userEmail = true && that.isSetUserEmail();
15020
      if (this_present_userEmail || that_present_userEmail) {
15021
        if (!(this_present_userEmail && that_present_userEmail))
15022
          return false;
15023
        if (!this.userEmail.equals(that.userEmail))
15024
          return false;
15025
      }
15026
 
15027
      boolean this_present_voucherType = true && this.isSetVoucherType();
15028
      boolean that_present_voucherType = true && that.isSetVoucherType();
15029
      if (this_present_voucherType || that_present_voucherType) {
15030
        if (!(this_present_voucherType && that_present_voucherType))
15031
          return false;
15032
        if (!this.voucherType.equals(that.voucherType))
15033
          return false;
15034
      }
15035
 
15036
      boolean this_present_amount = true;
15037
      boolean that_present_amount = true;
15038
      if (this_present_amount || that_present_amount) {
15039
        if (!(this_present_amount && that_present_amount))
15040
          return false;
15041
        if (this.amount != that.amount)
15042
          return false;
15043
      }
15044
 
15045
      return true;
15046
    }
15047
 
15048
    @Override
15049
    public int hashCode() {
15050
      return 0;
15051
    }
15052
 
15053
    public int compareTo(assignVoucher_args other) {
15054
      if (!getClass().equals(other.getClass())) {
15055
        return getClass().getName().compareTo(other.getClass().getName());
15056
      }
15057
 
15058
      int lastComparison = 0;
15059
      assignVoucher_args typedOther = (assignVoucher_args)other;
15060
 
15061
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
15062
      if (lastComparison != 0) {
15063
        return lastComparison;
15064
      }
15065
      if (isSetUserId()) {
15066
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
15067
        if (lastComparison != 0) {
15068
          return lastComparison;
15069
        }
15070
      }
15071
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
15072
      if (lastComparison != 0) {
15073
        return lastComparison;
15074
      }
15075
      if (isSetUserEmail()) {
15076
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
15077
        if (lastComparison != 0) {
15078
          return lastComparison;
15079
        }
15080
      }
15081
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
15082
      if (lastComparison != 0) {
15083
        return lastComparison;
15084
      }
15085
      if (isSetVoucherType()) {
15086
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
15087
        if (lastComparison != 0) {
15088
          return lastComparison;
15089
        }
15090
      }
15091
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
15092
      if (lastComparison != 0) {
15093
        return lastComparison;
15094
      }
15095
      if (isSetAmount()) {
15096
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
15097
        if (lastComparison != 0) {
15098
          return lastComparison;
15099
        }
15100
      }
15101
      return 0;
15102
    }
15103
 
15104
    public _Fields fieldForId(int fieldId) {
15105
      return _Fields.findByThriftId(fieldId);
15106
    }
15107
 
15108
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15109
      org.apache.thrift.protocol.TField field;
15110
      iprot.readStructBegin();
15111
      while (true)
15112
      {
15113
        field = iprot.readFieldBegin();
15114
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15115
          break;
15116
        }
15117
        switch (field.id) {
15118
          case 1: // USER_ID
15119
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15120
              this.userId = iprot.readI64();
15121
              setUserIdIsSet(true);
15122
            } else { 
15123
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15124
            }
15125
            break;
15126
          case 2: // USER_EMAIL
15127
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15128
              this.userEmail = iprot.readString();
15129
            } else { 
15130
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15131
            }
15132
            break;
15133
          case 3: // VOUCHER_TYPE
15134
            if (field.type == org.apache.thrift.protocol.TType.I32) {
15135
              this.voucherType = VoucherType.findByValue(iprot.readI32());
15136
            } else { 
15137
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15138
            }
15139
            break;
15140
          case 4: // AMOUNT
15141
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15142
              this.amount = iprot.readI64();
15143
              setAmountIsSet(true);
15144
            } else { 
15145
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15146
            }
15147
            break;
15148
          default:
15149
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15150
        }
15151
        iprot.readFieldEnd();
15152
      }
15153
      iprot.readStructEnd();
15154
      validate();
15155
    }
15156
 
15157
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15158
      validate();
15159
 
15160
      oprot.writeStructBegin(STRUCT_DESC);
15161
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
15162
      oprot.writeI64(this.userId);
15163
      oprot.writeFieldEnd();
15164
      if (this.userEmail != null) {
15165
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
15166
        oprot.writeString(this.userEmail);
15167
        oprot.writeFieldEnd();
15168
      }
15169
      if (this.voucherType != null) {
15170
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
15171
        oprot.writeI32(this.voucherType.getValue());
15172
        oprot.writeFieldEnd();
15173
      }
15174
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
15175
      oprot.writeI64(this.amount);
15176
      oprot.writeFieldEnd();
15177
      oprot.writeFieldStop();
15178
      oprot.writeStructEnd();
15179
    }
15180
 
15181
    @Override
15182
    public String toString() {
15183
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
15184
      boolean first = true;
15185
 
15186
      sb.append("userId:");
15187
      sb.append(this.userId);
15188
      first = false;
15189
      if (!first) sb.append(", ");
15190
      sb.append("userEmail:");
15191
      if (this.userEmail == null) {
15192
        sb.append("null");
15193
      } else {
15194
        sb.append(this.userEmail);
15195
      }
15196
      first = false;
15197
      if (!first) sb.append(", ");
15198
      sb.append("voucherType:");
15199
      if (this.voucherType == null) {
15200
        sb.append("null");
15201
      } else {
15202
        sb.append(this.voucherType);
15203
      }
15204
      first = false;
15205
      if (!first) sb.append(", ");
15206
      sb.append("amount:");
15207
      sb.append(this.amount);
15208
      first = false;
15209
      sb.append(")");
15210
      return sb.toString();
15211
    }
15212
 
15213
    public void validate() throws org.apache.thrift.TException {
15214
      // check for required fields
15215
    }
15216
 
15217
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15218
      try {
15219
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15220
      } catch (org.apache.thrift.TException te) {
15221
        throw new java.io.IOException(te);
15222
      }
15223
    }
15224
 
15225
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15226
      try {
15227
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
15228
        __isset_bit_vector = new BitSet(1);
15229
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15230
      } catch (org.apache.thrift.TException te) {
15231
        throw new java.io.IOException(te);
15232
      }
15233
    }
15234
 
15235
  }
15236
 
15237
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
15238
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
15239
 
15240
    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);
15241
 
15242
    private Voucher success; // required
15243
 
15244
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15245
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15246
      SUCCESS((short)0, "success");
15247
 
15248
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15249
 
15250
      static {
15251
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15252
          byName.put(field.getFieldName(), field);
15253
        }
15254
      }
15255
 
15256
      /**
15257
       * Find the _Fields constant that matches fieldId, or null if its not found.
15258
       */
15259
      public static _Fields findByThriftId(int fieldId) {
15260
        switch(fieldId) {
15261
          case 0: // SUCCESS
15262
            return SUCCESS;
15263
          default:
15264
            return null;
15265
        }
15266
      }
15267
 
15268
      /**
15269
       * Find the _Fields constant that matches fieldId, throwing an exception
15270
       * if it is not found.
15271
       */
15272
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15273
        _Fields fields = findByThriftId(fieldId);
15274
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15275
        return fields;
15276
      }
15277
 
15278
      /**
15279
       * Find the _Fields constant that matches name, or null if its not found.
15280
       */
15281
      public static _Fields findByName(String name) {
15282
        return byName.get(name);
15283
      }
15284
 
15285
      private final short _thriftId;
15286
      private final String _fieldName;
15287
 
15288
      _Fields(short thriftId, String fieldName) {
15289
        _thriftId = thriftId;
15290
        _fieldName = fieldName;
15291
      }
15292
 
15293
      public short getThriftFieldId() {
15294
        return _thriftId;
15295
      }
15296
 
15297
      public String getFieldName() {
15298
        return _fieldName;
15299
      }
15300
    }
15301
 
15302
    // isset id assignments
15303
 
15304
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15305
    static {
15306
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15307
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15308
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
15309
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15310
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
15311
    }
15312
 
15313
    public assignVoucher_result() {
15314
    }
15315
 
15316
    public assignVoucher_result(
15317
      Voucher success)
15318
    {
15319
      this();
15320
      this.success = success;
15321
    }
15322
 
15323
    /**
15324
     * Performs a deep copy on <i>other</i>.
15325
     */
15326
    public assignVoucher_result(assignVoucher_result other) {
15327
      if (other.isSetSuccess()) {
15328
        this.success = new Voucher(other.success);
15329
      }
15330
    }
15331
 
15332
    public assignVoucher_result deepCopy() {
15333
      return new assignVoucher_result(this);
15334
    }
15335
 
15336
    @Override
15337
    public void clear() {
15338
      this.success = null;
15339
    }
15340
 
15341
    public Voucher getSuccess() {
15342
      return this.success;
15343
    }
15344
 
15345
    public void setSuccess(Voucher success) {
15346
      this.success = success;
15347
    }
15348
 
15349
    public void unsetSuccess() {
15350
      this.success = null;
15351
    }
15352
 
15353
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15354
    public boolean isSetSuccess() {
15355
      return this.success != null;
15356
    }
15357
 
15358
    public void setSuccessIsSet(boolean value) {
15359
      if (!value) {
15360
        this.success = null;
15361
      }
15362
    }
15363
 
15364
    public void setFieldValue(_Fields field, Object value) {
15365
      switch (field) {
15366
      case SUCCESS:
15367
        if (value == null) {
15368
          unsetSuccess();
15369
        } else {
15370
          setSuccess((Voucher)value);
15371
        }
15372
        break;
15373
 
15374
      }
15375
    }
15376
 
15377
    public Object getFieldValue(_Fields field) {
15378
      switch (field) {
15379
      case SUCCESS:
15380
        return getSuccess();
15381
 
15382
      }
15383
      throw new IllegalStateException();
15384
    }
15385
 
15386
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15387
    public boolean isSet(_Fields field) {
15388
      if (field == null) {
15389
        throw new IllegalArgumentException();
15390
      }
15391
 
15392
      switch (field) {
15393
      case SUCCESS:
15394
        return isSetSuccess();
15395
      }
15396
      throw new IllegalStateException();
15397
    }
15398
 
15399
    @Override
15400
    public boolean equals(Object that) {
15401
      if (that == null)
15402
        return false;
15403
      if (that instanceof assignVoucher_result)
15404
        return this.equals((assignVoucher_result)that);
15405
      return false;
15406
    }
15407
 
15408
    public boolean equals(assignVoucher_result that) {
15409
      if (that == null)
15410
        return false;
15411
 
15412
      boolean this_present_success = true && this.isSetSuccess();
15413
      boolean that_present_success = true && that.isSetSuccess();
15414
      if (this_present_success || that_present_success) {
15415
        if (!(this_present_success && that_present_success))
15416
          return false;
15417
        if (!this.success.equals(that.success))
15418
          return false;
15419
      }
15420
 
15421
      return true;
15422
    }
15423
 
15424
    @Override
15425
    public int hashCode() {
15426
      return 0;
15427
    }
15428
 
15429
    public int compareTo(assignVoucher_result other) {
15430
      if (!getClass().equals(other.getClass())) {
15431
        return getClass().getName().compareTo(other.getClass().getName());
15432
      }
15433
 
15434
      int lastComparison = 0;
15435
      assignVoucher_result typedOther = (assignVoucher_result)other;
15436
 
15437
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15438
      if (lastComparison != 0) {
15439
        return lastComparison;
15440
      }
15441
      if (isSetSuccess()) {
15442
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15443
        if (lastComparison != 0) {
15444
          return lastComparison;
15445
        }
15446
      }
15447
      return 0;
15448
    }
15449
 
15450
    public _Fields fieldForId(int fieldId) {
15451
      return _Fields.findByThriftId(fieldId);
15452
    }
15453
 
15454
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15455
      org.apache.thrift.protocol.TField field;
15456
      iprot.readStructBegin();
15457
      while (true)
15458
      {
15459
        field = iprot.readFieldBegin();
15460
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15461
          break;
15462
        }
15463
        switch (field.id) {
15464
          case 0: // SUCCESS
15465
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15466
              this.success = new Voucher();
15467
              this.success.read(iprot);
15468
            } else { 
15469
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15470
            }
15471
            break;
15472
          default:
15473
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15474
        }
15475
        iprot.readFieldEnd();
15476
      }
15477
      iprot.readStructEnd();
15478
      validate();
15479
    }
15480
 
15481
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15482
      oprot.writeStructBegin(STRUCT_DESC);
15483
 
15484
      if (this.isSetSuccess()) {
15485
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15486
        this.success.write(oprot);
15487
        oprot.writeFieldEnd();
15488
      }
15489
      oprot.writeFieldStop();
15490
      oprot.writeStructEnd();
15491
    }
15492
 
15493
    @Override
15494
    public String toString() {
15495
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
15496
      boolean first = true;
15497
 
15498
      sb.append("success:");
15499
      if (this.success == null) {
15500
        sb.append("null");
15501
      } else {
15502
        sb.append(this.success);
15503
      }
15504
      first = false;
15505
      sb.append(")");
15506
      return sb.toString();
15507
    }
15508
 
15509
    public void validate() throws org.apache.thrift.TException {
15510
      // check for required fields
15511
    }
15512
 
15513
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15514
      try {
15515
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15516
      } catch (org.apache.thrift.TException te) {
15517
        throw new java.io.IOException(te);
15518
      }
15519
    }
15520
 
15521
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15522
      try {
15523
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15524
      } catch (org.apache.thrift.TException te) {
15525
        throw new java.io.IOException(te);
15526
      }
15527
    }
15528
 
15529
  }
15530
 
15531
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
15532
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
15533
 
15534
    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);
15535
    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);
15536
 
15537
    private String voucherCode; // required
15538
    private long redeemedOn; // required
15539
 
15540
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15541
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15542
      VOUCHER_CODE((short)1, "voucherCode"),
15543
      REDEEMED_ON((short)2, "redeemedOn");
15544
 
15545
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15546
 
15547
      static {
15548
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15549
          byName.put(field.getFieldName(), field);
15550
        }
15551
      }
15552
 
15553
      /**
15554
       * Find the _Fields constant that matches fieldId, or null if its not found.
15555
       */
15556
      public static _Fields findByThriftId(int fieldId) {
15557
        switch(fieldId) {
15558
          case 1: // VOUCHER_CODE
15559
            return VOUCHER_CODE;
15560
          case 2: // REDEEMED_ON
15561
            return REDEEMED_ON;
15562
          default:
15563
            return null;
15564
        }
15565
      }
15566
 
15567
      /**
15568
       * Find the _Fields constant that matches fieldId, throwing an exception
15569
       * if it is not found.
15570
       */
15571
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15572
        _Fields fields = findByThriftId(fieldId);
15573
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15574
        return fields;
15575
      }
15576
 
15577
      /**
15578
       * Find the _Fields constant that matches name, or null if its not found.
15579
       */
15580
      public static _Fields findByName(String name) {
15581
        return byName.get(name);
15582
      }
15583
 
15584
      private final short _thriftId;
15585
      private final String _fieldName;
15586
 
15587
      _Fields(short thriftId, String fieldName) {
15588
        _thriftId = thriftId;
15589
        _fieldName = fieldName;
15590
      }
15591
 
15592
      public short getThriftFieldId() {
15593
        return _thriftId;
15594
      }
15595
 
15596
      public String getFieldName() {
15597
        return _fieldName;
15598
      }
15599
    }
15600
 
15601
    // isset id assignments
15602
    private static final int __REDEEMEDON_ISSET_ID = 0;
15603
    private BitSet __isset_bit_vector = new BitSet(1);
15604
 
15605
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15606
    static {
15607
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15608
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15609
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15610
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15611
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15612
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15613
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
15614
    }
15615
 
15616
    public markVoucherAsRedeemed_args() {
15617
    }
15618
 
15619
    public markVoucherAsRedeemed_args(
15620
      String voucherCode,
15621
      long redeemedOn)
15622
    {
15623
      this();
15624
      this.voucherCode = voucherCode;
15625
      this.redeemedOn = redeemedOn;
15626
      setRedeemedOnIsSet(true);
15627
    }
15628
 
15629
    /**
15630
     * Performs a deep copy on <i>other</i>.
15631
     */
15632
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
15633
      __isset_bit_vector.clear();
15634
      __isset_bit_vector.or(other.__isset_bit_vector);
15635
      if (other.isSetVoucherCode()) {
15636
        this.voucherCode = other.voucherCode;
15637
      }
15638
      this.redeemedOn = other.redeemedOn;
15639
    }
15640
 
15641
    public markVoucherAsRedeemed_args deepCopy() {
15642
      return new markVoucherAsRedeemed_args(this);
15643
    }
15644
 
15645
    @Override
15646
    public void clear() {
15647
      this.voucherCode = null;
15648
      setRedeemedOnIsSet(false);
15649
      this.redeemedOn = 0;
15650
    }
15651
 
15652
    public String getVoucherCode() {
15653
      return this.voucherCode;
15654
    }
15655
 
15656
    public void setVoucherCode(String voucherCode) {
15657
      this.voucherCode = voucherCode;
15658
    }
15659
 
15660
    public void unsetVoucherCode() {
15661
      this.voucherCode = null;
15662
    }
15663
 
15664
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
15665
    public boolean isSetVoucherCode() {
15666
      return this.voucherCode != null;
15667
    }
15668
 
15669
    public void setVoucherCodeIsSet(boolean value) {
15670
      if (!value) {
15671
        this.voucherCode = null;
15672
      }
15673
    }
15674
 
15675
    public long getRedeemedOn() {
15676
      return this.redeemedOn;
15677
    }
15678
 
15679
    public void setRedeemedOn(long redeemedOn) {
15680
      this.redeemedOn = redeemedOn;
15681
      setRedeemedOnIsSet(true);
15682
    }
15683
 
15684
    public void unsetRedeemedOn() {
15685
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
15686
    }
15687
 
15688
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
15689
    public boolean isSetRedeemedOn() {
15690
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
15691
    }
15692
 
15693
    public void setRedeemedOnIsSet(boolean value) {
15694
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
15695
    }
15696
 
15697
    public void setFieldValue(_Fields field, Object value) {
15698
      switch (field) {
15699
      case VOUCHER_CODE:
15700
        if (value == null) {
15701
          unsetVoucherCode();
15702
        } else {
15703
          setVoucherCode((String)value);
15704
        }
15705
        break;
15706
 
15707
      case REDEEMED_ON:
15708
        if (value == null) {
15709
          unsetRedeemedOn();
15710
        } else {
15711
          setRedeemedOn((Long)value);
15712
        }
15713
        break;
15714
 
15715
      }
15716
    }
15717
 
15718
    public Object getFieldValue(_Fields field) {
15719
      switch (field) {
15720
      case VOUCHER_CODE:
15721
        return getVoucherCode();
15722
 
15723
      case REDEEMED_ON:
15724
        return Long.valueOf(getRedeemedOn());
15725
 
15726
      }
15727
      throw new IllegalStateException();
15728
    }
15729
 
15730
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15731
    public boolean isSet(_Fields field) {
15732
      if (field == null) {
15733
        throw new IllegalArgumentException();
15734
      }
15735
 
15736
      switch (field) {
15737
      case VOUCHER_CODE:
15738
        return isSetVoucherCode();
15739
      case REDEEMED_ON:
15740
        return isSetRedeemedOn();
15741
      }
15742
      throw new IllegalStateException();
15743
    }
15744
 
15745
    @Override
15746
    public boolean equals(Object that) {
15747
      if (that == null)
15748
        return false;
15749
      if (that instanceof markVoucherAsRedeemed_args)
15750
        return this.equals((markVoucherAsRedeemed_args)that);
15751
      return false;
15752
    }
15753
 
15754
    public boolean equals(markVoucherAsRedeemed_args that) {
15755
      if (that == null)
15756
        return false;
15757
 
15758
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
15759
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
15760
      if (this_present_voucherCode || that_present_voucherCode) {
15761
        if (!(this_present_voucherCode && that_present_voucherCode))
15762
          return false;
15763
        if (!this.voucherCode.equals(that.voucherCode))
15764
          return false;
15765
      }
15766
 
15767
      boolean this_present_redeemedOn = true;
15768
      boolean that_present_redeemedOn = true;
15769
      if (this_present_redeemedOn || that_present_redeemedOn) {
15770
        if (!(this_present_redeemedOn && that_present_redeemedOn))
15771
          return false;
15772
        if (this.redeemedOn != that.redeemedOn)
15773
          return false;
15774
      }
15775
 
15776
      return true;
15777
    }
15778
 
15779
    @Override
15780
    public int hashCode() {
15781
      return 0;
15782
    }
15783
 
15784
    public int compareTo(markVoucherAsRedeemed_args other) {
15785
      if (!getClass().equals(other.getClass())) {
15786
        return getClass().getName().compareTo(other.getClass().getName());
15787
      }
15788
 
15789
      int lastComparison = 0;
15790
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
15791
 
15792
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
15793
      if (lastComparison != 0) {
15794
        return lastComparison;
15795
      }
15796
      if (isSetVoucherCode()) {
15797
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
15798
        if (lastComparison != 0) {
15799
          return lastComparison;
15800
        }
15801
      }
15802
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
15803
      if (lastComparison != 0) {
15804
        return lastComparison;
15805
      }
15806
      if (isSetRedeemedOn()) {
15807
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
15808
        if (lastComparison != 0) {
15809
          return lastComparison;
15810
        }
15811
      }
15812
      return 0;
15813
    }
15814
 
15815
    public _Fields fieldForId(int fieldId) {
15816
      return _Fields.findByThriftId(fieldId);
15817
    }
15818
 
15819
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15820
      org.apache.thrift.protocol.TField field;
15821
      iprot.readStructBegin();
15822
      while (true)
15823
      {
15824
        field = iprot.readFieldBegin();
15825
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15826
          break;
15827
        }
15828
        switch (field.id) {
15829
          case 1: // VOUCHER_CODE
15830
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15831
              this.voucherCode = iprot.readString();
15832
            } else { 
15833
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15834
            }
15835
            break;
15836
          case 2: // REDEEMED_ON
15837
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15838
              this.redeemedOn = iprot.readI64();
15839
              setRedeemedOnIsSet(true);
15840
            } else { 
15841
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15842
            }
15843
            break;
15844
          default:
15845
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15846
        }
15847
        iprot.readFieldEnd();
15848
      }
15849
      iprot.readStructEnd();
15850
      validate();
15851
    }
15852
 
15853
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15854
      validate();
15855
 
15856
      oprot.writeStructBegin(STRUCT_DESC);
15857
      if (this.voucherCode != null) {
15858
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
15859
        oprot.writeString(this.voucherCode);
15860
        oprot.writeFieldEnd();
15861
      }
15862
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
15863
      oprot.writeI64(this.redeemedOn);
15864
      oprot.writeFieldEnd();
15865
      oprot.writeFieldStop();
15866
      oprot.writeStructEnd();
15867
    }
15868
 
15869
    @Override
15870
    public String toString() {
15871
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
15872
      boolean first = true;
15873
 
15874
      sb.append("voucherCode:");
15875
      if (this.voucherCode == null) {
15876
        sb.append("null");
15877
      } else {
15878
        sb.append(this.voucherCode);
15879
      }
15880
      first = false;
15881
      if (!first) sb.append(", ");
15882
      sb.append("redeemedOn:");
15883
      sb.append(this.redeemedOn);
15884
      first = false;
15885
      sb.append(")");
15886
      return sb.toString();
15887
    }
15888
 
15889
    public void validate() throws org.apache.thrift.TException {
15890
      // check for required fields
15891
    }
15892
 
15893
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15894
      try {
15895
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15896
      } catch (org.apache.thrift.TException te) {
15897
        throw new java.io.IOException(te);
15898
      }
15899
    }
15900
 
15901
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15902
      try {
15903
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
15904
        __isset_bit_vector = new BitSet(1);
15905
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15906
      } catch (org.apache.thrift.TException te) {
15907
        throw new java.io.IOException(te);
15908
      }
15909
    }
15910
 
15911
  }
15912
 
15913
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
15914
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
15915
 
15916
    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);
15917
 
15918
    private boolean success; // required
15919
 
15920
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15921
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15922
      SUCCESS((short)0, "success");
15923
 
15924
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15925
 
15926
      static {
15927
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15928
          byName.put(field.getFieldName(), field);
15929
        }
15930
      }
15931
 
15932
      /**
15933
       * Find the _Fields constant that matches fieldId, or null if its not found.
15934
       */
15935
      public static _Fields findByThriftId(int fieldId) {
15936
        switch(fieldId) {
15937
          case 0: // SUCCESS
15938
            return SUCCESS;
15939
          default:
15940
            return null;
15941
        }
15942
      }
15943
 
15944
      /**
15945
       * Find the _Fields constant that matches fieldId, throwing an exception
15946
       * if it is not found.
15947
       */
15948
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15949
        _Fields fields = findByThriftId(fieldId);
15950
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15951
        return fields;
15952
      }
15953
 
15954
      /**
15955
       * Find the _Fields constant that matches name, or null if its not found.
15956
       */
15957
      public static _Fields findByName(String name) {
15958
        return byName.get(name);
15959
      }
15960
 
15961
      private final short _thriftId;
15962
      private final String _fieldName;
15963
 
15964
      _Fields(short thriftId, String fieldName) {
15965
        _thriftId = thriftId;
15966
        _fieldName = fieldName;
15967
      }
15968
 
15969
      public short getThriftFieldId() {
15970
        return _thriftId;
15971
      }
15972
 
15973
      public String getFieldName() {
15974
        return _fieldName;
15975
      }
15976
    }
15977
 
15978
    // isset id assignments
15979
    private static final int __SUCCESS_ISSET_ID = 0;
15980
    private BitSet __isset_bit_vector = new BitSet(1);
15981
 
15982
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15983
    static {
15984
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15985
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15986
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
15987
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15988
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
15989
    }
15990
 
15991
    public markVoucherAsRedeemed_result() {
15992
    }
15993
 
15994
    public markVoucherAsRedeemed_result(
15995
      boolean success)
15996
    {
15997
      this();
15998
      this.success = success;
15999
      setSuccessIsSet(true);
16000
    }
16001
 
16002
    /**
16003
     * Performs a deep copy on <i>other</i>.
16004
     */
16005
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
16006
      __isset_bit_vector.clear();
16007
      __isset_bit_vector.or(other.__isset_bit_vector);
16008
      this.success = other.success;
16009
    }
16010
 
16011
    public markVoucherAsRedeemed_result deepCopy() {
16012
      return new markVoucherAsRedeemed_result(this);
16013
    }
16014
 
16015
    @Override
16016
    public void clear() {
16017
      setSuccessIsSet(false);
16018
      this.success = false;
16019
    }
16020
 
16021
    public boolean isSuccess() {
16022
      return this.success;
16023
    }
16024
 
16025
    public void setSuccess(boolean success) {
16026
      this.success = success;
16027
      setSuccessIsSet(true);
16028
    }
16029
 
16030
    public void unsetSuccess() {
16031
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
16032
    }
16033
 
16034
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
16035
    public boolean isSetSuccess() {
16036
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
16037
    }
16038
 
16039
    public void setSuccessIsSet(boolean value) {
16040
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
16041
    }
16042
 
16043
    public void setFieldValue(_Fields field, Object value) {
16044
      switch (field) {
16045
      case SUCCESS:
16046
        if (value == null) {
16047
          unsetSuccess();
16048
        } else {
16049
          setSuccess((Boolean)value);
16050
        }
16051
        break;
16052
 
16053
      }
16054
    }
16055
 
16056
    public Object getFieldValue(_Fields field) {
16057
      switch (field) {
16058
      case SUCCESS:
16059
        return Boolean.valueOf(isSuccess());
16060
 
16061
      }
16062
      throw new IllegalStateException();
16063
    }
16064
 
16065
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16066
    public boolean isSet(_Fields field) {
16067
      if (field == null) {
16068
        throw new IllegalArgumentException();
16069
      }
16070
 
16071
      switch (field) {
16072
      case SUCCESS:
16073
        return isSetSuccess();
16074
      }
16075
      throw new IllegalStateException();
16076
    }
16077
 
16078
    @Override
16079
    public boolean equals(Object that) {
16080
      if (that == null)
16081
        return false;
16082
      if (that instanceof markVoucherAsRedeemed_result)
16083
        return this.equals((markVoucherAsRedeemed_result)that);
16084
      return false;
16085
    }
16086
 
16087
    public boolean equals(markVoucherAsRedeemed_result that) {
16088
      if (that == null)
16089
        return false;
16090
 
16091
      boolean this_present_success = true;
16092
      boolean that_present_success = true;
16093
      if (this_present_success || that_present_success) {
16094
        if (!(this_present_success && that_present_success))
16095
          return false;
16096
        if (this.success != that.success)
16097
          return false;
16098
      }
16099
 
16100
      return true;
16101
    }
16102
 
16103
    @Override
16104
    public int hashCode() {
16105
      return 0;
16106
    }
16107
 
16108
    public int compareTo(markVoucherAsRedeemed_result other) {
16109
      if (!getClass().equals(other.getClass())) {
16110
        return getClass().getName().compareTo(other.getClass().getName());
16111
      }
16112
 
16113
      int lastComparison = 0;
16114
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
16115
 
16116
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
16117
      if (lastComparison != 0) {
16118
        return lastComparison;
16119
      }
16120
      if (isSetSuccess()) {
16121
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16122
        if (lastComparison != 0) {
16123
          return lastComparison;
16124
        }
16125
      }
16126
      return 0;
16127
    }
16128
 
16129
    public _Fields fieldForId(int fieldId) {
16130
      return _Fields.findByThriftId(fieldId);
16131
    }
16132
 
16133
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16134
      org.apache.thrift.protocol.TField field;
16135
      iprot.readStructBegin();
16136
      while (true)
16137
      {
16138
        field = iprot.readFieldBegin();
16139
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16140
          break;
16141
        }
16142
        switch (field.id) {
16143
          case 0: // SUCCESS
16144
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
16145
              this.success = iprot.readBool();
16146
              setSuccessIsSet(true);
16147
            } else { 
16148
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16149
            }
16150
            break;
16151
          default:
16152
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16153
        }
16154
        iprot.readFieldEnd();
16155
      }
16156
      iprot.readStructEnd();
16157
      validate();
16158
    }
16159
 
16160
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16161
      oprot.writeStructBegin(STRUCT_DESC);
16162
 
16163
      if (this.isSetSuccess()) {
16164
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16165
        oprot.writeBool(this.success);
16166
        oprot.writeFieldEnd();
16167
      }
16168
      oprot.writeFieldStop();
16169
      oprot.writeStructEnd();
16170
    }
16171
 
16172
    @Override
16173
    public String toString() {
16174
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
16175
      boolean first = true;
16176
 
16177
      sb.append("success:");
16178
      sb.append(this.success);
16179
      first = false;
16180
      sb.append(")");
16181
      return sb.toString();
16182
    }
16183
 
16184
    public void validate() throws org.apache.thrift.TException {
16185
      // check for required fields
16186
    }
16187
 
16188
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16189
      try {
16190
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16191
      } catch (org.apache.thrift.TException te) {
16192
        throw new java.io.IOException(te);
16193
      }
16194
    }
16195
 
16196
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16197
      try {
16198
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16199
      } catch (org.apache.thrift.TException te) {
16200
        throw new java.io.IOException(te);
16201
      }
16202
    }
16203
 
16204
  }
16205
 
1982 varun.gupt 16206
}