Subversion Repositories SmartDukaan

Rev

Rev 6497 | Rev 6679 | 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
 
6497 amit.gupta 52
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException;
53
 
54
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
55
 
3385 varun.gupt 56
    /**
57
     * Returns a list of active coupons
58
     */
3430 rajveer 59
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 60
 
61
    /**
6561 amit.gupta 62
     * Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
6250 amit.gupta 63
     * 
64
     * @param promotionId
65
     * @param endOn
66
     * @param email
67
     * @param amount
6356 amit.gupta 68
     * @param isCod
6250 amit.gupta 69
     * @param usage
6561 amit.gupta 70
     * @param prefix
6250 amit.gupta 71
     */
6561 amit.gupta 72
    public String createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, String prefix) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 73
 
74
    /**
3385 varun.gupt 75
     * Returns the count of successful payments done using a given coupon
76
     * 
77
     * @param couponCode
78
     */
3430 rajveer 79
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 80
 
81
    /**
82
     * Returns the doc string of the rule module
83
     * 
84
     * @param ruleName
85
     */
3430 rajveer 86
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 87
 
4189 varun.gupt 88
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
89
 
4494 varun.gupt 90
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
91
 
5469 rajveer 92
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
93
 
94
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
95
 
96
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
97
 
1982 varun.gupt 98
  }
99
 
3430 rajveer 100
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 101
 
3430 rajveer 102
    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 103
 
6301 amit.gupta 104
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
105
 
106
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
107
 
6356 amit.gupta 108
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
109
 
3430 rajveer 110
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
111
 
112
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
113
 
114
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
115
 
116
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
117
 
6433 anupam.sin 118
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
119
 
3430 rajveer 120
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
121
 
122
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
123
 
6497 amit.gupta 124
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
125
 
126
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
127
 
3430 rajveer 128
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
129
 
6561 amit.gupta 130
    public void createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, String prefix, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 131
 
3430 rajveer 132
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
133
 
134
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
135
 
4189 varun.gupt 136
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
137
 
4494 varun.gupt 138
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
139
 
5469 rajveer 140
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
141
 
142
    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;
143
 
144
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
145
 
3430 rajveer 146
  }
147
 
148
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
149
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
150
      public Factory() {}
151
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
152
        return new Client(prot);
153
      }
154
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
155
        return new Client(iprot, oprot);
156
      }
1982 varun.gupt 157
    }
158
 
3430 rajveer 159
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 160
    {
3430 rajveer 161
      super(prot, prot);
1982 varun.gupt 162
    }
163
 
3430 rajveer 164
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
165
      super(iprot, oprot);
1982 varun.gupt 166
    }
167
 
3430 rajveer 168
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 169
    {
170
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
171
      recv_createPromotion();
172
    }
173
 
3430 rajveer 174
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 175
    {
176
      createPromotion_args args = new createPromotion_args();
3430 rajveer 177
      args.setName(name);
178
      args.setRuleExecutionSrc(ruleExecutionSrc);
179
      args.setStartOn(startOn);
180
      args.setEndOn(endOn);
181
      sendBase("createPromotion", args);
1982 varun.gupt 182
    }
183
 
3430 rajveer 184
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 185
    {
186
      createPromotion_result result = new createPromotion_result();
3430 rajveer 187
      receiveBase(result, "createPromotion");
1982 varun.gupt 188
      if (result.pex != null) {
189
        throw result.pex;
190
      }
191
      return;
192
    }
193
 
6301 amit.gupta 194
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
195
    {
196
      send_getCoupon(couponCode);
197
      return recv_getCoupon();
198
    }
199
 
200
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
201
    {
202
      getCoupon_args args = new getCoupon_args();
203
      args.setCouponCode(couponCode);
204
      sendBase("getCoupon", args);
205
    }
206
 
207
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
208
    {
209
      getCoupon_result result = new getCoupon_result();
210
      receiveBase(result, "getCoupon");
211
      if (result.isSetSuccess()) {
212
        return result.success;
213
      }
214
      if (result.pex != null) {
215
        throw result.pex;
216
      }
217
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
218
    }
219
 
220
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
221
    {
222
      send_isGiftVoucher(couponCode);
223
      return recv_isGiftVoucher();
224
    }
225
 
226
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
227
    {
228
      isGiftVoucher_args args = new isGiftVoucher_args();
229
      args.setCouponCode(couponCode);
230
      sendBase("isGiftVoucher", args);
231
    }
232
 
233
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
234
    {
235
      isGiftVoucher_result result = new isGiftVoucher_result();
236
      receiveBase(result, "isGiftVoucher");
237
      if (result.isSetSuccess()) {
238
        return result.success;
239
      }
240
      if (result.pex != null) {
241
        throw result.pex;
242
      }
243
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
244
    }
245
 
6356 amit.gupta 246
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
247
    {
248
      send_isCodApplicable(couponCode);
249
      return recv_isCodApplicable();
250
    }
251
 
252
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
253
    {
254
      isCodApplicable_args args = new isCodApplicable_args();
255
      args.setCouponCode(couponCode);
256
      sendBase("isCodApplicable", args);
257
    }
258
 
259
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
260
    {
261
      isCodApplicable_result result = new isCodApplicable_result();
262
      receiveBase(result, "isCodApplicable");
263
      if (result.isSetSuccess()) {
264
        return result.success;
265
      }
266
      if (result.pex != null) {
267
        throw result.pex;
268
      }
269
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
270
    }
271
 
3430 rajveer 272
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 273
    {
274
      send_getAllPromotions();
275
      return recv_getAllPromotions();
276
    }
277
 
3430 rajveer 278
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 279
    {
280
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 281
      sendBase("getAllPromotions", args);
1982 varun.gupt 282
    }
283
 
3430 rajveer 284
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 285
    {
286
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 287
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 288
      if (result.isSetSuccess()) {
289
        return result.success;
290
      }
291
      if (result.pex != null) {
292
        throw result.pex;
293
      }
3430 rajveer 294
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 295
    }
296
 
3430 rajveer 297
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 298
    {
299
      send_getPromotionById(promotionId);
300
      return recv_getPromotionById();
301
    }
302
 
3430 rajveer 303
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 304
    {
305
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 306
      args.setPromotionId(promotionId);
307
      sendBase("getPromotionById", args);
1982 varun.gupt 308
    }
309
 
3430 rajveer 310
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 311
    {
312
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 313
      receiveBase(result, "getPromotionById");
1982 varun.gupt 314
      if (result.isSetSuccess()) {
315
        return result.success;
316
      }
317
      if (result.pex != null) {
318
        throw result.pex;
319
      }
3430 rajveer 320
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 321
    }
322
 
3430 rajveer 323
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 324
    {
325
      send_generateCouponsForPromotion(promotionId, couponCode);
326
      recv_generateCouponsForPromotion();
327
    }
328
 
3430 rajveer 329
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 330
    {
331
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 332
      args.setPromotionId(promotionId);
333
      args.setCouponCode(couponCode);
334
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 335
    }
336
 
3430 rajveer 337
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 338
    {
339
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 340
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 341
      if (result.pex != null) {
342
        throw result.pex;
343
      }
344
      return;
345
    }
346
 
3430 rajveer 347
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 348
    {
349
      send_applyCoupon(couponCode, cartId);
350
      return recv_applyCoupon();
351
    }
352
 
3430 rajveer 353
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 354
    {
355
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 356
      args.setCouponCode(couponCode);
357
      args.setCartId(cartId);
358
      sendBase("applyCoupon", args);
1982 varun.gupt 359
    }
360
 
3430 rajveer 361
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 362
    {
363
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 364
      receiveBase(result, "applyCoupon");
1982 varun.gupt 365
      if (result.isSetSuccess()) {
366
        return result.success;
367
      }
368
      if (result.pex != null) {
369
        throw result.pex;
370
      }
3430 rajveer 371
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 372
    }
373
 
6433 anupam.sin 374
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
375
    {
376
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
377
      return recv_applyRechargeCoupon();
378
    }
379
 
380
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
381
    {
382
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
383
      args.setCouponCode(couponCode);
384
      args.setTotalAmount(totalAmount);
385
      args.setUserId(userId);
386
      sendBase("applyRechargeCoupon", args);
387
    }
388
 
389
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
390
    {
391
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
392
      receiveBase(result, "applyRechargeCoupon");
393
      if (result.isSetSuccess()) {
394
        return result.success;
395
      }
396
      if (result.pex != null) {
397
        throw result.pex;
398
      }
399
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
400
    }
401
 
3430 rajveer 402
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 403
    {
404
      send_trackCouponUsage(couponCode, transactionId, userId);
405
      recv_trackCouponUsage();
406
    }
407
 
3430 rajveer 408
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 409
    {
410
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 411
      args.setCouponCode(couponCode);
412
      args.setTransactionId(transactionId);
413
      args.setUserId(userId);
414
      sendBase("trackCouponUsage", args);
1982 varun.gupt 415
    }
416
 
3430 rajveer 417
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 418
    {
419
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 420
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 421
      if (result.pex != null) {
422
        throw result.pex;
423
      }
424
      return;
425
    }
426
 
3430 rajveer 427
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 428
    {
429
      send_getCouponUsageCountByUser(couponCode, userId);
430
      return recv_getCouponUsageCountByUser();
431
    }
432
 
3430 rajveer 433
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 434
    {
435
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 436
      args.setCouponCode(couponCode);
437
      args.setUserId(userId);
438
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 439
    }
440
 
3430 rajveer 441
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 442
    {
443
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 444
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 445
      if (result.isSetSuccess()) {
446
        return result.success;
447
      }
448
      if (result.pex != null) {
449
        throw result.pex;
450
      }
3430 rajveer 451
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 452
    }
453
 
6497 amit.gupta 454
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
455
    {
456
      send_getActiveCodes(promotionId);
457
      return recv_getActiveCodes();
458
    }
459
 
460
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
461
    {
462
      getActiveCodes_args args = new getActiveCodes_args();
463
      args.setPromotionId(promotionId);
464
      sendBase("getActiveCodes", args);
465
    }
466
 
467
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
468
    {
469
      getActiveCodes_result result = new getActiveCodes_result();
470
      receiveBase(result, "getActiveCodes");
471
      if (result.isSetSuccess()) {
472
        return result.success;
473
      }
474
      if (result.pex != null) {
475
        throw result.pex;
476
      }
477
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
478
    }
479
 
480
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
481
    {
482
      send_deleteCoupon(couponCode);
483
      recv_deleteCoupon();
484
    }
485
 
486
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
487
    {
488
      deleteCoupon_args args = new deleteCoupon_args();
489
      args.setCouponCode(couponCode);
490
      sendBase("deleteCoupon", args);
491
    }
492
 
493
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
494
    {
495
      deleteCoupon_result result = new deleteCoupon_result();
496
      receiveBase(result, "deleteCoupon");
497
      if (result.pex != null) {
498
        throw result.pex;
499
      }
500
      return;
501
    }
502
 
3430 rajveer 503
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 504
    {
505
      send_getActiveCoupons();
506
      return recv_getActiveCoupons();
507
    }
508
 
3430 rajveer 509
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 510
    {
511
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 512
      sendBase("getActiveCoupons", args);
3385 varun.gupt 513
    }
514
 
3430 rajveer 515
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 516
    {
517
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 518
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 519
      if (result.isSetSuccess()) {
520
        return result.success;
521
      }
522
      if (result.pex != null) {
523
        throw result.pex;
524
      }
3430 rajveer 525
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 526
    }
527
 
6561 amit.gupta 528
    public String createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 529
    {
6561 amit.gupta 530
      send_createCoupon(promotionId, endOn, email, amount, isCod, usage, prefix);
6250 amit.gupta 531
      return recv_createCoupon();
532
    }
533
 
6561 amit.gupta 534
    public void send_createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 535
    {
536
      createCoupon_args args = new createCoupon_args();
537
      args.setPromotionId(promotionId);
538
      args.setEndOn(endOn);
539
      args.setEmail(email);
540
      args.setAmount(amount);
6356 amit.gupta 541
      args.setIsCod(isCod);
6250 amit.gupta 542
      args.setUsage(usage);
6561 amit.gupta 543
      args.setPrefix(prefix);
6250 amit.gupta 544
      sendBase("createCoupon", args);
545
    }
546
 
547
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
548
    {
549
      createCoupon_result result = new createCoupon_result();
550
      receiveBase(result, "createCoupon");
551
      if (result.isSetSuccess()) {
552
        return result.success;
553
      }
554
      if (result.pex != null) {
555
        throw result.pex;
556
      }
557
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
558
    }
559
 
3430 rajveer 560
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 561
    {
562
      send_getSuccessfulPaymentCountForCoupon(couponCode);
563
      return recv_getSuccessfulPaymentCountForCoupon();
564
    }
565
 
3430 rajveer 566
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 567
    {
568
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 569
      args.setCouponCode(couponCode);
570
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 571
    }
572
 
3430 rajveer 573
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 574
    {
575
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 576
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 577
      if (result.isSetSuccess()) {
578
        return result.success;
579
      }
580
      if (result.pex != null) {
581
        throw result.pex;
582
      }
3430 rajveer 583
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 584
    }
585
 
3430 rajveer 586
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 587
    {
588
      send_getRuleDocString(ruleName);
589
      return recv_getRuleDocString();
590
    }
591
 
3430 rajveer 592
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 593
    {
594
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 595
      args.setRuleName(ruleName);
596
      sendBase("getRuleDocString", args);
3385 varun.gupt 597
    }
598
 
3430 rajveer 599
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 600
    {
601
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 602
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 603
      if (result.isSetSuccess()) {
604
        return result.success;
605
      }
3430 rajveer 606
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 607
    }
608
 
4189 varun.gupt 609
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
610
    {
611
      send_getItemDiscountMap(itemIds);
612
      return recv_getItemDiscountMap();
613
    }
614
 
615
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
616
    {
617
      getItemDiscountMap_args args = new getItemDiscountMap_args();
618
      args.setItemIds(itemIds);
619
      sendBase("getItemDiscountMap", args);
620
    }
621
 
622
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
623
    {
624
      getItemDiscountMap_result result = new getItemDiscountMap_result();
625
      receiveBase(result, "getItemDiscountMap");
626
      if (result.isSetSuccess()) {
627
        return result.success;
628
      }
629
      if (result.pex != null) {
630
        throw result.pex;
631
      }
632
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
633
    }
634
 
4494 varun.gupt 635
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
636
    {
637
      send_getDiscountsForEntity(entityId);
638
      return recv_getDiscountsForEntity();
639
    }
640
 
641
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
642
    {
643
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
644
      args.setEntityId(entityId);
645
      sendBase("getDiscountsForEntity", args);
646
    }
647
 
648
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
649
    {
650
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
651
      receiveBase(result, "getDiscountsForEntity");
652
      if (result.isSetSuccess()) {
653
        return result.success;
654
      }
655
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
656
    }
657
 
5469 rajveer 658
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
659
    {
660
      send_addVoucher(voucher);
661
      recv_addVoucher();
662
    }
663
 
664
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
665
    {
666
      addVoucher_args args = new addVoucher_args();
667
      args.setVoucher(voucher);
668
      sendBase("addVoucher", args);
669
    }
670
 
671
    public void recv_addVoucher() throws org.apache.thrift.TException
672
    {
673
      addVoucher_result result = new addVoucher_result();
674
      receiveBase(result, "addVoucher");
675
      return;
676
    }
677
 
678
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
679
    {
680
      send_assignVoucher(userId, userEmail, voucherType, amount);
681
      return recv_assignVoucher();
682
    }
683
 
684
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
685
    {
686
      assignVoucher_args args = new assignVoucher_args();
687
      args.setUserId(userId);
688
      args.setUserEmail(userEmail);
689
      args.setVoucherType(voucherType);
690
      args.setAmount(amount);
691
      sendBase("assignVoucher", args);
692
    }
693
 
694
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
695
    {
696
      assignVoucher_result result = new assignVoucher_result();
697
      receiveBase(result, "assignVoucher");
698
      if (result.isSetSuccess()) {
699
        return result.success;
700
      }
701
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
702
    }
703
 
704
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
705
    {
706
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
707
      return recv_markVoucherAsRedeemed();
708
    }
709
 
710
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
711
    {
712
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
713
      args.setVoucherCode(voucherCode);
714
      args.setRedeemedOn(redeemedOn);
715
      sendBase("markVoucherAsRedeemed", args);
716
    }
717
 
718
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
719
    {
720
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
721
      receiveBase(result, "markVoucherAsRedeemed");
722
      if (result.isSetSuccess()) {
723
        return result.success;
724
      }
725
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
726
    }
727
 
1982 varun.gupt 728
  }
3430 rajveer 729
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
730
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
731
      private org.apache.thrift.async.TAsyncClientManager clientManager;
732
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
733
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
734
        this.clientManager = clientManager;
735
        this.protocolFactory = protocolFactory;
736
      }
737
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
738
        return new AsyncClient(protocolFactory, clientManager, transport);
739
      }
1982 varun.gupt 740
    }
741
 
3430 rajveer 742
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
743
      super(protocolFactory, clientManager, transport);
744
    }
1982 varun.gupt 745
 
3430 rajveer 746
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
747
      checkReady();
748
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
749
      this.___currentMethod = method_call;
750
      ___manager.call(method_call);
1982 varun.gupt 751
    }
752
 
3430 rajveer 753
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
754
      private String name;
755
      private String ruleExecutionSrc;
756
      private long startOn;
757
      private long endOn;
758
      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 {
759
        super(client, protocolFactory, transport, resultHandler, false);
760
        this.name = name;
761
        this.ruleExecutionSrc = ruleExecutionSrc;
762
        this.startOn = startOn;
763
        this.endOn = endOn;
1982 varun.gupt 764
      }
765
 
3430 rajveer 766
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
767
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 768
        createPromotion_args args = new createPromotion_args();
3430 rajveer 769
        args.setName(name);
770
        args.setRuleExecutionSrc(ruleExecutionSrc);
771
        args.setStartOn(startOn);
772
        args.setEndOn(endOn);
773
        args.write(prot);
774
        prot.writeMessageEnd();
1982 varun.gupt 775
      }
776
 
3430 rajveer 777
      public void getResult() throws PromotionException, org.apache.thrift.TException {
778
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
779
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 780
        }
3430 rajveer 781
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
782
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
783
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 784
      }
3430 rajveer 785
    }
1982 varun.gupt 786
 
6301 amit.gupta 787
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
788
      checkReady();
789
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
790
      this.___currentMethod = method_call;
791
      ___manager.call(method_call);
792
    }
793
 
794
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
795
      private String couponCode;
796
      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 {
797
        super(client, protocolFactory, transport, resultHandler, false);
798
        this.couponCode = couponCode;
799
      }
800
 
801
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
802
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
803
        getCoupon_args args = new getCoupon_args();
804
        args.setCouponCode(couponCode);
805
        args.write(prot);
806
        prot.writeMessageEnd();
807
      }
808
 
809
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
810
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
811
          throw new IllegalStateException("Method call not finished!");
812
        }
813
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
814
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
815
        return (new Client(prot)).recv_getCoupon();
816
      }
817
    }
818
 
819
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
820
      checkReady();
821
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
822
      this.___currentMethod = method_call;
823
      ___manager.call(method_call);
824
    }
825
 
826
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
827
      private String couponCode;
828
      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 {
829
        super(client, protocolFactory, transport, resultHandler, false);
830
        this.couponCode = couponCode;
831
      }
832
 
833
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
834
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
835
        isGiftVoucher_args args = new isGiftVoucher_args();
836
        args.setCouponCode(couponCode);
837
        args.write(prot);
838
        prot.writeMessageEnd();
839
      }
840
 
841
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
842
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
843
          throw new IllegalStateException("Method call not finished!");
844
        }
845
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
846
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
847
        return (new Client(prot)).recv_isGiftVoucher();
848
      }
849
    }
850
 
6356 amit.gupta 851
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
852
      checkReady();
853
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
854
      this.___currentMethod = method_call;
855
      ___manager.call(method_call);
856
    }
857
 
858
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
859
      private String couponCode;
860
      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 {
861
        super(client, protocolFactory, transport, resultHandler, false);
862
        this.couponCode = couponCode;
863
      }
864
 
865
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
866
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
867
        isCodApplicable_args args = new isCodApplicable_args();
868
        args.setCouponCode(couponCode);
869
        args.write(prot);
870
        prot.writeMessageEnd();
871
      }
872
 
873
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
874
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
875
          throw new IllegalStateException("Method call not finished!");
876
        }
877
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
878
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
879
        return (new Client(prot)).recv_isCodApplicable();
880
      }
881
    }
882
 
3430 rajveer 883
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
884
      checkReady();
885
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
886
      this.___currentMethod = method_call;
887
      ___manager.call(method_call);
1982 varun.gupt 888
    }
889
 
3430 rajveer 890
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
891
      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 {
892
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 893
      }
894
 
3430 rajveer 895
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
896
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
897
        getAllPromotions_args args = new getAllPromotions_args();
898
        args.write(prot);
899
        prot.writeMessageEnd();
900
      }
1982 varun.gupt 901
 
3430 rajveer 902
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
903
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
904
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 905
        }
3430 rajveer 906
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
907
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
908
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 909
      }
3430 rajveer 910
    }
1982 varun.gupt 911
 
3430 rajveer 912
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
913
      checkReady();
914
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
915
      this.___currentMethod = method_call;
916
      ___manager.call(method_call);
1982 varun.gupt 917
    }
918
 
3430 rajveer 919
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
920
      private long promotionId;
921
      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 {
922
        super(client, protocolFactory, transport, resultHandler, false);
923
        this.promotionId = promotionId;
1982 varun.gupt 924
      }
925
 
3430 rajveer 926
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
927
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
928
        getPromotionById_args args = new getPromotionById_args();
929
        args.setPromotionId(promotionId);
930
        args.write(prot);
931
        prot.writeMessageEnd();
932
      }
1982 varun.gupt 933
 
3430 rajveer 934
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
935
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
936
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 937
        }
3430 rajveer 938
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
939
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
940
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 941
      }
3430 rajveer 942
    }
1982 varun.gupt 943
 
3430 rajveer 944
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
945
      checkReady();
946
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
947
      this.___currentMethod = method_call;
948
      ___manager.call(method_call);
1982 varun.gupt 949
    }
950
 
3430 rajveer 951
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
952
      private long promotionId;
953
      private String couponCode;
954
      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 {
955
        super(client, protocolFactory, transport, resultHandler, false);
956
        this.promotionId = promotionId;
957
        this.couponCode = couponCode;
1982 varun.gupt 958
      }
959
 
3430 rajveer 960
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
961
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
962
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
963
        args.setPromotionId(promotionId);
964
        args.setCouponCode(couponCode);
965
        args.write(prot);
966
        prot.writeMessageEnd();
3385 varun.gupt 967
      }
968
 
3430 rajveer 969
      public void getResult() throws PromotionException, org.apache.thrift.TException {
970
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
971
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 972
        }
3430 rajveer 973
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
974
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
975
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 976
      }
977
    }
978
 
3430 rajveer 979
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
980
      checkReady();
981
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
982
      this.___currentMethod = method_call;
983
      ___manager.call(method_call);
3385 varun.gupt 984
    }
985
 
3430 rajveer 986
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
987
      private String couponCode;
988
      private long cartId;
989
      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 {
990
        super(client, protocolFactory, transport, resultHandler, false);
991
        this.couponCode = couponCode;
992
        this.cartId = cartId;
1982 varun.gupt 993
      }
994
 
3430 rajveer 995
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
996
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
997
        applyCoupon_args args = new applyCoupon_args();
998
        args.setCouponCode(couponCode);
999
        args.setCartId(cartId);
1000
        args.write(prot);
1001
        prot.writeMessageEnd();
1982 varun.gupt 1002
      }
1003
 
3430 rajveer 1004
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1005
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1006
          throw new IllegalStateException("Method call not finished!");
1007
        }
1008
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1009
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1010
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1011
      }
3430 rajveer 1012
    }
1982 varun.gupt 1013
 
6433 anupam.sin 1014
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1015
      checkReady();
1016
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1017
      this.___currentMethod = method_call;
1018
      ___manager.call(method_call);
1019
    }
1020
 
1021
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1022
      private String couponCode;
1023
      private long totalAmount;
1024
      private long userId;
1025
      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 {
1026
        super(client, protocolFactory, transport, resultHandler, false);
1027
        this.couponCode = couponCode;
1028
        this.totalAmount = totalAmount;
1029
        this.userId = userId;
1030
      }
1031
 
1032
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1033
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1034
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1035
        args.setCouponCode(couponCode);
1036
        args.setTotalAmount(totalAmount);
1037
        args.setUserId(userId);
1038
        args.write(prot);
1039
        prot.writeMessageEnd();
1040
      }
1041
 
1042
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1043
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1044
          throw new IllegalStateException("Method call not finished!");
1045
        }
1046
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1047
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1048
        return (new Client(prot)).recv_applyRechargeCoupon();
1049
      }
1050
    }
1051
 
3430 rajveer 1052
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
1053
      checkReady();
1054
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
1055
      this.___currentMethod = method_call;
1056
      ___manager.call(method_call);
1057
    }
1982 varun.gupt 1058
 
3430 rajveer 1059
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1060
      private String couponCode;
1061
      private long transactionId;
1062
      private long userId;
1063
      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 {
1064
        super(client, protocolFactory, transport, resultHandler, false);
1065
        this.couponCode = couponCode;
1066
        this.transactionId = transactionId;
1067
        this.userId = userId;
1982 varun.gupt 1068
      }
1069
 
3430 rajveer 1070
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1071
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1072
        trackCouponUsage_args args = new trackCouponUsage_args();
1073
        args.setCouponCode(couponCode);
1074
        args.setTransactionId(transactionId);
1075
        args.setUserId(userId);
1076
        args.write(prot);
1077
        prot.writeMessageEnd();
1982 varun.gupt 1078
      }
1079
 
3430 rajveer 1080
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1081
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1082
          throw new IllegalStateException("Method call not finished!");
1083
        }
1084
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1085
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1086
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1087
      }
1088
    }
1089
 
3430 rajveer 1090
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1091
      checkReady();
1092
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1093
      this.___currentMethod = method_call;
1094
      ___manager.call(method_call);
1982 varun.gupt 1095
    }
1096
 
3430 rajveer 1097
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1098
      private String couponCode;
1099
      private long userId;
1100
      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 {
1101
        super(client, protocolFactory, transport, resultHandler, false);
1102
        this.couponCode = couponCode;
1103
        this.userId = userId;
1104
      }
1982 varun.gupt 1105
 
3430 rajveer 1106
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1107
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1108
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1109
        args.setCouponCode(couponCode);
1110
        args.setUserId(userId);
1111
        args.write(prot);
1112
        prot.writeMessageEnd();
1113
      }
1982 varun.gupt 1114
 
3430 rajveer 1115
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1116
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1117
          throw new IllegalStateException("Method call not finished!");
1118
        }
1119
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1120
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1121
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1122
      }
1982 varun.gupt 1123
    }
1124
 
6497 amit.gupta 1125
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1126
      checkReady();
1127
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1128
      this.___currentMethod = method_call;
1129
      ___manager.call(method_call);
1130
    }
1131
 
1132
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1133
      private long promotionId;
1134
      public getActiveCodes_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_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 {
1135
        super(client, protocolFactory, transport, resultHandler, false);
1136
        this.promotionId = promotionId;
1137
      }
1138
 
1139
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1140
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1141
        getActiveCodes_args args = new getActiveCodes_args();
1142
        args.setPromotionId(promotionId);
1143
        args.write(prot);
1144
        prot.writeMessageEnd();
1145
      }
1146
 
1147
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1148
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1149
          throw new IllegalStateException("Method call not finished!");
1150
        }
1151
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1152
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1153
        return (new Client(prot)).recv_getActiveCodes();
1154
      }
1155
    }
1156
 
1157
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1158
      checkReady();
1159
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1160
      this.___currentMethod = method_call;
1161
      ___manager.call(method_call);
1162
    }
1163
 
1164
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1165
      private String couponCode;
1166
      public deleteCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_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 {
1167
        super(client, protocolFactory, transport, resultHandler, false);
1168
        this.couponCode = couponCode;
1169
      }
1170
 
1171
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1172
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1173
        deleteCoupon_args args = new deleteCoupon_args();
1174
        args.setCouponCode(couponCode);
1175
        args.write(prot);
1176
        prot.writeMessageEnd();
1177
      }
1178
 
1179
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1180
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1181
          throw new IllegalStateException("Method call not finished!");
1182
        }
1183
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1184
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1185
        (new Client(prot)).recv_deleteCoupon();
1186
      }
1187
    }
1188
 
3430 rajveer 1189
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1190
      checkReady();
1191
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1192
      this.___currentMethod = method_call;
1193
      ___manager.call(method_call);
1982 varun.gupt 1194
    }
1195
 
3430 rajveer 1196
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1197
      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 {
1198
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1199
      }
1200
 
3430 rajveer 1201
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1202
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1203
        getActiveCoupons_args args = new getActiveCoupons_args();
1204
        args.write(prot);
1205
        prot.writeMessageEnd();
1206
      }
1982 varun.gupt 1207
 
3430 rajveer 1208
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1209
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1210
          throw new IllegalStateException("Method call not finished!");
1211
        }
1212
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1213
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1214
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1215
      }
1216
    }
1217
 
6561 amit.gupta 1218
    public void createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1219
      checkReady();
6561 amit.gupta 1220
      createCoupon_call method_call = new createCoupon_call(promotionId, endOn, email, amount, isCod, usage, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1221
      this.___currentMethod = method_call;
1222
      ___manager.call(method_call);
1223
    }
1224
 
1225
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1226
      private long promotionId;
1227
      private long endOn;
1228
      private String email;
1229
      private long amount;
6356 amit.gupta 1230
      private boolean isCod;
6250 amit.gupta 1231
      private long usage;
6561 amit.gupta 1232
      private String prefix;
1233
      public createCoupon_call(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, String prefix, 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 1234
        super(client, protocolFactory, transport, resultHandler, false);
1235
        this.promotionId = promotionId;
1236
        this.endOn = endOn;
1237
        this.email = email;
1238
        this.amount = amount;
6356 amit.gupta 1239
        this.isCod = isCod;
6250 amit.gupta 1240
        this.usage = usage;
6561 amit.gupta 1241
        this.prefix = prefix;
6250 amit.gupta 1242
      }
1243
 
1244
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1245
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1246
        createCoupon_args args = new createCoupon_args();
1247
        args.setPromotionId(promotionId);
1248
        args.setEndOn(endOn);
1249
        args.setEmail(email);
1250
        args.setAmount(amount);
6356 amit.gupta 1251
        args.setIsCod(isCod);
6250 amit.gupta 1252
        args.setUsage(usage);
6561 amit.gupta 1253
        args.setPrefix(prefix);
6250 amit.gupta 1254
        args.write(prot);
1255
        prot.writeMessageEnd();
1256
      }
1257
 
1258
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1259
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1260
          throw new IllegalStateException("Method call not finished!");
1261
        }
1262
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1263
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1264
        return (new Client(prot)).recv_createCoupon();
1265
      }
1266
    }
1267
 
3430 rajveer 1268
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1269
      checkReady();
1270
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1271
      this.___currentMethod = method_call;
1272
      ___manager.call(method_call);
1982 varun.gupt 1273
    }
1274
 
3430 rajveer 1275
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1276
      private String couponCode;
1277
      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 {
1278
        super(client, protocolFactory, transport, resultHandler, false);
1279
        this.couponCode = couponCode;
1982 varun.gupt 1280
      }
1281
 
3430 rajveer 1282
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1283
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1284
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1285
        args.setCouponCode(couponCode);
1286
        args.write(prot);
1287
        prot.writeMessageEnd();
1288
      }
1982 varun.gupt 1289
 
3430 rajveer 1290
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1291
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1292
          throw new IllegalStateException("Method call not finished!");
1293
        }
1294
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1295
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1296
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1297
      }
1982 varun.gupt 1298
    }
1299
 
3430 rajveer 1300
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1301
      checkReady();
1302
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1303
      this.___currentMethod = method_call;
1304
      ___manager.call(method_call);
1982 varun.gupt 1305
    }
1306
 
3430 rajveer 1307
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1308
      private String ruleName;
1309
      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 {
1310
        super(client, protocolFactory, transport, resultHandler, false);
1311
        this.ruleName = ruleName;
1312
      }
1982 varun.gupt 1313
 
3430 rajveer 1314
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1315
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1316
        getRuleDocString_args args = new getRuleDocString_args();
1317
        args.setRuleName(ruleName);
1318
        args.write(prot);
1319
        prot.writeMessageEnd();
1982 varun.gupt 1320
      }
1321
 
3430 rajveer 1322
      public String getResult() throws org.apache.thrift.TException {
1323
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1324
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1325
        }
3430 rajveer 1326
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1327
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1328
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1329
      }
1330
    }
1331
 
4189 varun.gupt 1332
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1333
      checkReady();
1334
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1335
      this.___currentMethod = method_call;
1336
      ___manager.call(method_call);
1337
    }
1338
 
1339
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1340
      private List<Long> itemIds;
1341
      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 {
1342
        super(client, protocolFactory, transport, resultHandler, false);
1343
        this.itemIds = itemIds;
1344
      }
1345
 
1346
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1347
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1348
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1349
        args.setItemIds(itemIds);
1350
        args.write(prot);
1351
        prot.writeMessageEnd();
1352
      }
1353
 
1354
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1355
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1356
          throw new IllegalStateException("Method call not finished!");
1357
        }
1358
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1359
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1360
        return (new Client(prot)).recv_getItemDiscountMap();
1361
      }
1362
    }
1363
 
4494 varun.gupt 1364
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1365
      checkReady();
1366
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1367
      this.___currentMethod = method_call;
1368
      ___manager.call(method_call);
1369
    }
1370
 
1371
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1372
      private long entityId;
1373
      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 {
1374
        super(client, protocolFactory, transport, resultHandler, false);
1375
        this.entityId = entityId;
1376
      }
1377
 
1378
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1379
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1380
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1381
        args.setEntityId(entityId);
1382
        args.write(prot);
1383
        prot.writeMessageEnd();
1384
      }
1385
 
1386
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1387
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1388
          throw new IllegalStateException("Method call not finished!");
1389
        }
1390
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1391
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1392
        return (new Client(prot)).recv_getDiscountsForEntity();
1393
      }
1394
    }
1395
 
5469 rajveer 1396
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1397
      checkReady();
1398
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1399
      this.___currentMethod = method_call;
1400
      ___manager.call(method_call);
1401
    }
1402
 
1403
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1404
      private Voucher voucher;
1405
      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 {
1406
        super(client, protocolFactory, transport, resultHandler, false);
1407
        this.voucher = voucher;
1408
      }
1409
 
1410
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1411
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1412
        addVoucher_args args = new addVoucher_args();
1413
        args.setVoucher(voucher);
1414
        args.write(prot);
1415
        prot.writeMessageEnd();
1416
      }
1417
 
1418
      public void getResult() throws org.apache.thrift.TException {
1419
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1420
          throw new IllegalStateException("Method call not finished!");
1421
        }
1422
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1423
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1424
        (new Client(prot)).recv_addVoucher();
1425
      }
1426
    }
1427
 
1428
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1429
      checkReady();
1430
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1431
      this.___currentMethod = method_call;
1432
      ___manager.call(method_call);
1433
    }
1434
 
1435
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1436
      private long userId;
1437
      private String userEmail;
1438
      private VoucherType voucherType;
1439
      private long amount;
1440
      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 {
1441
        super(client, protocolFactory, transport, resultHandler, false);
1442
        this.userId = userId;
1443
        this.userEmail = userEmail;
1444
        this.voucherType = voucherType;
1445
        this.amount = amount;
1446
      }
1447
 
1448
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1449
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1450
        assignVoucher_args args = new assignVoucher_args();
1451
        args.setUserId(userId);
1452
        args.setUserEmail(userEmail);
1453
        args.setVoucherType(voucherType);
1454
        args.setAmount(amount);
1455
        args.write(prot);
1456
        prot.writeMessageEnd();
1457
      }
1458
 
1459
      public Voucher getResult() throws org.apache.thrift.TException {
1460
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1461
          throw new IllegalStateException("Method call not finished!");
1462
        }
1463
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1464
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1465
        return (new Client(prot)).recv_assignVoucher();
1466
      }
1467
    }
1468
 
1469
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1470
      checkReady();
1471
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1472
      this.___currentMethod = method_call;
1473
      ___manager.call(method_call);
1474
    }
1475
 
1476
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1477
      private String voucherCode;
1478
      private long redeemedOn;
1479
      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 {
1480
        super(client, protocolFactory, transport, resultHandler, false);
1481
        this.voucherCode = voucherCode;
1482
        this.redeemedOn = redeemedOn;
1483
      }
1484
 
1485
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1486
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1487
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1488
        args.setVoucherCode(voucherCode);
1489
        args.setRedeemedOn(redeemedOn);
1490
        args.write(prot);
1491
        prot.writeMessageEnd();
1492
      }
1493
 
1494
      public boolean getResult() throws org.apache.thrift.TException {
1495
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1496
          throw new IllegalStateException("Method call not finished!");
1497
        }
1498
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1499
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1500
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1501
      }
1502
    }
1503
 
3430 rajveer 1504
  }
1982 varun.gupt 1505
 
3430 rajveer 1506
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1507
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1508
    public Processor(I iface) {
1509
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1510
    }
1511
 
3430 rajveer 1512
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1513
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1514
    }
1515
 
3430 rajveer 1516
    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) {
1517
      processMap.put("createPromotion", new createPromotion());
6301 amit.gupta 1518
      processMap.put("getCoupon", new getCoupon());
1519
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1520
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1521
      processMap.put("getAllPromotions", new getAllPromotions());
1522
      processMap.put("getPromotionById", new getPromotionById());
1523
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1524
      processMap.put("applyCoupon", new applyCoupon());
6433 anupam.sin 1525
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1526
      processMap.put("trackCouponUsage", new trackCouponUsage());
1527
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1528
      processMap.put("getActiveCodes", new getActiveCodes());
1529
      processMap.put("deleteCoupon", new deleteCoupon());
3430 rajveer 1530
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1531
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1532
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1533
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1534
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1535
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1536
      processMap.put("addVoucher", new addVoucher());
1537
      processMap.put("assignVoucher", new assignVoucher());
1538
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1539
      return processMap;
1982 varun.gupt 1540
    }
1541
 
3430 rajveer 1542
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1543
      public createPromotion() {
1544
        super("createPromotion");
1545
      }
1982 varun.gupt 1546
 
3430 rajveer 1547
      protected createPromotion_args getEmptyArgsInstance() {
1548
        return new createPromotion_args();
1549
      }
1982 varun.gupt 1550
 
3430 rajveer 1551
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1552
        createPromotion_result result = new createPromotion_result();
1553
        try {
1554
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1555
        } catch (PromotionException pex) {
1556
          result.pex = pex;
1982 varun.gupt 1557
        }
3430 rajveer 1558
        return result;
1982 varun.gupt 1559
      }
3430 rajveer 1560
    }
1982 varun.gupt 1561
 
6301 amit.gupta 1562
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1563
      public getCoupon() {
1564
        super("getCoupon");
1565
      }
1566
 
1567
      protected getCoupon_args getEmptyArgsInstance() {
1568
        return new getCoupon_args();
1569
      }
1570
 
1571
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1572
        getCoupon_result result = new getCoupon_result();
1573
        try {
1574
          result.success = iface.getCoupon(args.couponCode);
1575
        } catch (PromotionException pex) {
1576
          result.pex = pex;
1577
        }
1578
        return result;
1579
      }
1580
    }
1581
 
1582
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1583
      public isGiftVoucher() {
1584
        super("isGiftVoucher");
1585
      }
1586
 
1587
      protected isGiftVoucher_args getEmptyArgsInstance() {
1588
        return new isGiftVoucher_args();
1589
      }
1590
 
1591
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1592
        isGiftVoucher_result result = new isGiftVoucher_result();
1593
        try {
1594
          result.success = iface.isGiftVoucher(args.couponCode);
1595
          result.setSuccessIsSet(true);
1596
        } catch (PromotionException pex) {
1597
          result.pex = pex;
1598
        }
1599
        return result;
1600
      }
1601
    }
1602
 
6356 amit.gupta 1603
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1604
      public isCodApplicable() {
1605
        super("isCodApplicable");
1606
      }
1607
 
1608
      protected isCodApplicable_args getEmptyArgsInstance() {
1609
        return new isCodApplicable_args();
1610
      }
1611
 
1612
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1613
        isCodApplicable_result result = new isCodApplicable_result();
1614
        try {
1615
          result.success = iface.isCodApplicable(args.couponCode);
1616
          result.setSuccessIsSet(true);
1617
        } catch (PromotionException pex) {
1618
          result.pex = pex;
1619
        }
1620
        return result;
1621
      }
1622
    }
1623
 
3430 rajveer 1624
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1625
      public getAllPromotions() {
1626
        super("getAllPromotions");
1982 varun.gupt 1627
      }
1628
 
3430 rajveer 1629
      protected getAllPromotions_args getEmptyArgsInstance() {
1630
        return new getAllPromotions_args();
1982 varun.gupt 1631
      }
1632
 
3430 rajveer 1633
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1634
        getAllPromotions_result result = new getAllPromotions_result();
1635
        try {
1636
          result.success = iface.getAllPromotions();
1637
        } catch (PromotionException pex) {
1638
          result.pex = pex;
1639
        }
1640
        return result;
1982 varun.gupt 1641
      }
3430 rajveer 1642
    }
1982 varun.gupt 1643
 
3430 rajveer 1644
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1645
      public getPromotionById() {
1646
        super("getPromotionById");
1982 varun.gupt 1647
      }
1648
 
3430 rajveer 1649
      protected getPromotionById_args getEmptyArgsInstance() {
1650
        return new getPromotionById_args();
1982 varun.gupt 1651
      }
1652
 
3430 rajveer 1653
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1654
        getPromotionById_result result = new getPromotionById_result();
1655
        try {
1656
          result.success = iface.getPromotionById(args.promotionId);
1657
        } catch (PromotionException pex) {
1658
          result.pex = pex;
1659
        }
1660
        return result;
1982 varun.gupt 1661
      }
1662
    }
1663
 
3430 rajveer 1664
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1665
      public generateCouponsForPromotion() {
1666
        super("generateCouponsForPromotion");
1667
      }
1982 varun.gupt 1668
 
3430 rajveer 1669
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1670
        return new generateCouponsForPromotion_args();
1671
      }
1982 varun.gupt 1672
 
3430 rajveer 1673
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1674
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1675
        try {
1676
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1677
        } catch (PromotionException pex) {
1678
          result.pex = pex;
1679
        }
1680
        return result;
1681
      }
1982 varun.gupt 1682
    }
1683
 
3430 rajveer 1684
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1685
      public applyCoupon() {
1686
        super("applyCoupon");
1687
      }
1982 varun.gupt 1688
 
3430 rajveer 1689
      protected applyCoupon_args getEmptyArgsInstance() {
1690
        return new applyCoupon_args();
1691
      }
1982 varun.gupt 1692
 
3430 rajveer 1693
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1694
        applyCoupon_result result = new applyCoupon_result();
1695
        try {
1696
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1697
        } catch (PromotionException pex) {
1698
          result.pex = pex;
1699
        }
1700
        return result;
1982 varun.gupt 1701
      }
1702
    }
1703
 
6433 anupam.sin 1704
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1705
      public applyRechargeCoupon() {
1706
        super("applyRechargeCoupon");
1707
      }
1708
 
1709
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1710
        return new applyRechargeCoupon_args();
1711
      }
1712
 
1713
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1714
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1715
        try {
1716
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1717
        } catch (PromotionException pex) {
1718
          result.pex = pex;
1719
        }
1720
        return result;
1721
      }
1722
    }
1723
 
3430 rajveer 1724
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1725
      public trackCouponUsage() {
1726
        super("trackCouponUsage");
1727
      }
1982 varun.gupt 1728
 
3430 rajveer 1729
      protected trackCouponUsage_args getEmptyArgsInstance() {
1730
        return new trackCouponUsage_args();
1982 varun.gupt 1731
      }
1732
 
3430 rajveer 1733
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1734
        trackCouponUsage_result result = new trackCouponUsage_result();
1735
        try {
1736
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1737
        } catch (PromotionException pex) {
1738
          result.pex = pex;
1739
        }
1740
        return result;
1741
      }
1982 varun.gupt 1742
    }
1743
 
3430 rajveer 1744
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1745
      public getCouponUsageCountByUser() {
1746
        super("getCouponUsageCountByUser");
1982 varun.gupt 1747
      }
1748
 
3430 rajveer 1749
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1750
        return new getCouponUsageCountByUser_args();
1751
      }
1982 varun.gupt 1752
 
3430 rajveer 1753
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1754
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1755
        try {
1756
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1757
          result.setSuccessIsSet(true);
1758
        } catch (PromotionException pex) {
1759
          result.pex = pex;
1760
        }
1761
        return result;
1762
      }
1982 varun.gupt 1763
    }
1764
 
6497 amit.gupta 1765
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1766
      public getActiveCodes() {
1767
        super("getActiveCodes");
1768
      }
1769
 
1770
      protected getActiveCodes_args getEmptyArgsInstance() {
1771
        return new getActiveCodes_args();
1772
      }
1773
 
1774
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
1775
        getActiveCodes_result result = new getActiveCodes_result();
1776
        try {
1777
          result.success = iface.getActiveCodes(args.promotionId);
1778
        } catch (PromotionException pex) {
1779
          result.pex = pex;
1780
        }
1781
        return result;
1782
      }
1783
    }
1784
 
1785
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
1786
      public deleteCoupon() {
1787
        super("deleteCoupon");
1788
      }
1789
 
1790
      protected deleteCoupon_args getEmptyArgsInstance() {
1791
        return new deleteCoupon_args();
1792
      }
1793
 
1794
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
1795
        deleteCoupon_result result = new deleteCoupon_result();
1796
        try {
1797
          iface.deleteCoupon(args.couponCode);
1798
        } catch (PromotionException pex) {
1799
          result.pex = pex;
1800
        }
1801
        return result;
1802
      }
1803
    }
1804
 
3430 rajveer 1805
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1806
      public getActiveCoupons() {
1807
        super("getActiveCoupons");
1808
      }
1982 varun.gupt 1809
 
3430 rajveer 1810
      protected getActiveCoupons_args getEmptyArgsInstance() {
1811
        return new getActiveCoupons_args();
1812
      }
1982 varun.gupt 1813
 
3430 rajveer 1814
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1815
        getActiveCoupons_result result = new getActiveCoupons_result();
1816
        try {
1817
          result.success = iface.getActiveCoupons();
1818
        } catch (PromotionException pex) {
1819
          result.pex = pex;
1820
        }
1821
        return result;
1822
      }
1982 varun.gupt 1823
    }
1824
 
6250 amit.gupta 1825
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
1826
      public createCoupon() {
1827
        super("createCoupon");
1828
      }
1829
 
1830
      protected createCoupon_args getEmptyArgsInstance() {
1831
        return new createCoupon_args();
1832
      }
1833
 
1834
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
1835
        createCoupon_result result = new createCoupon_result();
1836
        try {
6561 amit.gupta 1837
          result.success = iface.createCoupon(args.promotionId, args.endOn, args.email, args.amount, args.isCod, args.usage, args.prefix);
6250 amit.gupta 1838
        } catch (PromotionException pex) {
1839
          result.pex = pex;
1840
        }
1841
        return result;
1842
      }
1843
    }
1844
 
3430 rajveer 1845
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1846
      public getSuccessfulPaymentCountForCoupon() {
1847
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1848
      }
1849
 
3430 rajveer 1850
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1851
        return new getSuccessfulPaymentCountForCoupon_args();
1852
      }
1982 varun.gupt 1853
 
3430 rajveer 1854
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1855
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1856
        try {
1857
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1858
          result.setSuccessIsSet(true);
1859
        } catch (PromotionException pex) {
1860
          result.pex = pex;
1982 varun.gupt 1861
        }
3430 rajveer 1862
        return result;
1982 varun.gupt 1863
      }
1864
    }
1865
 
3430 rajveer 1866
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1867
      public getRuleDocString() {
1868
        super("getRuleDocString");
1869
      }
1982 varun.gupt 1870
 
3430 rajveer 1871
      protected getRuleDocString_args getEmptyArgsInstance() {
1872
        return new getRuleDocString_args();
1873
      }
1982 varun.gupt 1874
 
3430 rajveer 1875
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1876
        getRuleDocString_result result = new getRuleDocString_result();
1877
        result.success = iface.getRuleDocString(args.ruleName);
1878
        return result;
1879
      }
1982 varun.gupt 1880
    }
1881
 
4189 varun.gupt 1882
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1883
      public getItemDiscountMap() {
1884
        super("getItemDiscountMap");
1885
      }
1886
 
1887
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1888
        return new getItemDiscountMap_args();
1889
      }
1890
 
1891
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1892
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1893
        try {
1894
          result.success = iface.getItemDiscountMap(args.itemIds);
1895
        } catch (PromotionException pex) {
1896
          result.pex = pex;
1897
        }
1898
        return result;
1899
      }
1900
    }
1901
 
4494 varun.gupt 1902
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1903
      public getDiscountsForEntity() {
1904
        super("getDiscountsForEntity");
1905
      }
1906
 
1907
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1908
        return new getDiscountsForEntity_args();
1909
      }
1910
 
1911
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1912
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1913
        result.success = iface.getDiscountsForEntity(args.entityId);
1914
        return result;
1915
      }
1916
    }
1917
 
5469 rajveer 1918
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
1919
      public addVoucher() {
1920
        super("addVoucher");
1921
      }
1922
 
1923
      protected addVoucher_args getEmptyArgsInstance() {
1924
        return new addVoucher_args();
1925
      }
1926
 
1927
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
1928
        addVoucher_result result = new addVoucher_result();
1929
        iface.addVoucher(args.voucher);
1930
        return result;
1931
      }
1932
    }
1933
 
1934
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
1935
      public assignVoucher() {
1936
        super("assignVoucher");
1937
      }
1938
 
1939
      protected assignVoucher_args getEmptyArgsInstance() {
1940
        return new assignVoucher_args();
1941
      }
1942
 
1943
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
1944
        assignVoucher_result result = new assignVoucher_result();
1945
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
1946
        return result;
1947
      }
1948
    }
1949
 
1950
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
1951
      public markVoucherAsRedeemed() {
1952
        super("markVoucherAsRedeemed");
1953
      }
1954
 
1955
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
1956
        return new markVoucherAsRedeemed_args();
1957
      }
1958
 
1959
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
1960
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
1961
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
1962
        result.setSuccessIsSet(true);
1963
        return result;
1964
      }
1965
    }
1966
 
1982 varun.gupt 1967
  }
1968
 
3430 rajveer 1969
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1970
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1971
 
3430 rajveer 1972
    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);
1973
    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);
1974
    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);
1975
    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 1976
 
3430 rajveer 1977
    private String name; // required
1978
    private String ruleExecutionSrc; // required
1979
    private long startOn; // required
1980
    private long endOn; // required
1982 varun.gupt 1981
 
1982
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1983
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1984
      NAME((short)1, "name"),
1985
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1986
      START_ON((short)3, "startOn"),
1987
      END_ON((short)4, "endOn");
1988
 
1989
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1990
 
1991
      static {
1992
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1993
          byName.put(field.getFieldName(), field);
1994
        }
1995
      }
1996
 
1997
      /**
1998
       * Find the _Fields constant that matches fieldId, or null if its not found.
1999
       */
2000
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2001
        switch(fieldId) {
2002
          case 1: // NAME
2003
            return NAME;
2004
          case 2: // RULE_EXECUTION_SRC
2005
            return RULE_EXECUTION_SRC;
2006
          case 3: // START_ON
2007
            return START_ON;
2008
          case 4: // END_ON
2009
            return END_ON;
2010
          default:
2011
            return null;
2012
        }
1982 varun.gupt 2013
      }
2014
 
2015
      /**
2016
       * Find the _Fields constant that matches fieldId, throwing an exception
2017
       * if it is not found.
2018
       */
2019
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2020
        _Fields fields = findByThriftId(fieldId);
2021
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2022
        return fields;
2023
      }
2024
 
2025
      /**
2026
       * Find the _Fields constant that matches name, or null if its not found.
2027
       */
2028
      public static _Fields findByName(String name) {
2029
        return byName.get(name);
2030
      }
2031
 
2032
      private final short _thriftId;
2033
      private final String _fieldName;
2034
 
2035
      _Fields(short thriftId, String fieldName) {
2036
        _thriftId = thriftId;
2037
        _fieldName = fieldName;
2038
      }
2039
 
2040
      public short getThriftFieldId() {
2041
        return _thriftId;
2042
      }
2043
 
2044
      public String getFieldName() {
2045
        return _fieldName;
2046
      }
2047
    }
2048
 
2049
    // isset id assignments
2050
    private static final int __STARTON_ISSET_ID = 0;
2051
    private static final int __ENDON_ISSET_ID = 1;
2052
    private BitSet __isset_bit_vector = new BitSet(2);
2053
 
3430 rajveer 2054
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2055
    static {
3430 rajveer 2056
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2057
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2058
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2059
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2060
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2061
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2062
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2063
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2064
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2065
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2066
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2067
    }
2068
 
2069
    public createPromotion_args() {
2070
    }
2071
 
2072
    public createPromotion_args(
2073
      String name,
2074
      String ruleExecutionSrc,
2075
      long startOn,
2076
      long endOn)
2077
    {
2078
      this();
2079
      this.name = name;
2080
      this.ruleExecutionSrc = ruleExecutionSrc;
2081
      this.startOn = startOn;
2082
      setStartOnIsSet(true);
2083
      this.endOn = endOn;
2084
      setEndOnIsSet(true);
2085
    }
2086
 
2087
    /**
2088
     * Performs a deep copy on <i>other</i>.
2089
     */
2090
    public createPromotion_args(createPromotion_args other) {
2091
      __isset_bit_vector.clear();
2092
      __isset_bit_vector.or(other.__isset_bit_vector);
2093
      if (other.isSetName()) {
2094
        this.name = other.name;
2095
      }
2096
      if (other.isSetRuleExecutionSrc()) {
2097
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2098
      }
2099
      this.startOn = other.startOn;
2100
      this.endOn = other.endOn;
2101
    }
2102
 
2103
    public createPromotion_args deepCopy() {
2104
      return new createPromotion_args(this);
2105
    }
2106
 
3430 rajveer 2107
    @Override
2108
    public void clear() {
2109
      this.name = null;
2110
      this.ruleExecutionSrc = null;
2111
      setStartOnIsSet(false);
2112
      this.startOn = 0;
2113
      setEndOnIsSet(false);
2114
      this.endOn = 0;
1982 varun.gupt 2115
    }
2116
 
2117
    public String getName() {
2118
      return this.name;
2119
    }
2120
 
3430 rajveer 2121
    public void setName(String name) {
1982 varun.gupt 2122
      this.name = name;
2123
    }
2124
 
2125
    public void unsetName() {
2126
      this.name = null;
2127
    }
2128
 
3430 rajveer 2129
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2130
    public boolean isSetName() {
2131
      return this.name != null;
2132
    }
2133
 
2134
    public void setNameIsSet(boolean value) {
2135
      if (!value) {
2136
        this.name = null;
2137
      }
2138
    }
2139
 
2140
    public String getRuleExecutionSrc() {
2141
      return this.ruleExecutionSrc;
2142
    }
2143
 
3430 rajveer 2144
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2145
      this.ruleExecutionSrc = ruleExecutionSrc;
2146
    }
2147
 
2148
    public void unsetRuleExecutionSrc() {
2149
      this.ruleExecutionSrc = null;
2150
    }
2151
 
3430 rajveer 2152
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2153
    public boolean isSetRuleExecutionSrc() {
2154
      return this.ruleExecutionSrc != null;
2155
    }
2156
 
2157
    public void setRuleExecutionSrcIsSet(boolean value) {
2158
      if (!value) {
2159
        this.ruleExecutionSrc = null;
2160
      }
2161
    }
2162
 
2163
    public long getStartOn() {
2164
      return this.startOn;
2165
    }
2166
 
3430 rajveer 2167
    public void setStartOn(long startOn) {
1982 varun.gupt 2168
      this.startOn = startOn;
2169
      setStartOnIsSet(true);
2170
    }
2171
 
2172
    public void unsetStartOn() {
2173
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2174
    }
2175
 
3430 rajveer 2176
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2177
    public boolean isSetStartOn() {
2178
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2179
    }
2180
 
2181
    public void setStartOnIsSet(boolean value) {
2182
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2183
    }
2184
 
2185
    public long getEndOn() {
2186
      return this.endOn;
2187
    }
2188
 
3430 rajveer 2189
    public void setEndOn(long endOn) {
1982 varun.gupt 2190
      this.endOn = endOn;
2191
      setEndOnIsSet(true);
2192
    }
2193
 
2194
    public void unsetEndOn() {
2195
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2196
    }
2197
 
3430 rajveer 2198
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2199
    public boolean isSetEndOn() {
2200
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2201
    }
2202
 
2203
    public void setEndOnIsSet(boolean value) {
2204
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2205
    }
2206
 
2207
    public void setFieldValue(_Fields field, Object value) {
2208
      switch (field) {
2209
      case NAME:
2210
        if (value == null) {
2211
          unsetName();
2212
        } else {
2213
          setName((String)value);
2214
        }
2215
        break;
2216
 
2217
      case RULE_EXECUTION_SRC:
2218
        if (value == null) {
2219
          unsetRuleExecutionSrc();
2220
        } else {
2221
          setRuleExecutionSrc((String)value);
2222
        }
2223
        break;
2224
 
2225
      case START_ON:
2226
        if (value == null) {
2227
          unsetStartOn();
2228
        } else {
2229
          setStartOn((Long)value);
2230
        }
2231
        break;
2232
 
2233
      case END_ON:
2234
        if (value == null) {
2235
          unsetEndOn();
2236
        } else {
2237
          setEndOn((Long)value);
2238
        }
2239
        break;
2240
 
2241
      }
2242
    }
2243
 
2244
    public Object getFieldValue(_Fields field) {
2245
      switch (field) {
2246
      case NAME:
2247
        return getName();
2248
 
2249
      case RULE_EXECUTION_SRC:
2250
        return getRuleExecutionSrc();
2251
 
2252
      case START_ON:
3430 rajveer 2253
        return Long.valueOf(getStartOn());
1982 varun.gupt 2254
 
2255
      case END_ON:
3430 rajveer 2256
        return Long.valueOf(getEndOn());
1982 varun.gupt 2257
 
2258
      }
2259
      throw new IllegalStateException();
2260
    }
2261
 
3430 rajveer 2262
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2263
    public boolean isSet(_Fields field) {
2264
      if (field == null) {
2265
        throw new IllegalArgumentException();
2266
      }
1982 varun.gupt 2267
 
2268
      switch (field) {
2269
      case NAME:
2270
        return isSetName();
2271
      case RULE_EXECUTION_SRC:
2272
        return isSetRuleExecutionSrc();
2273
      case START_ON:
2274
        return isSetStartOn();
2275
      case END_ON:
2276
        return isSetEndOn();
2277
      }
2278
      throw new IllegalStateException();
2279
    }
2280
 
2281
    @Override
2282
    public boolean equals(Object that) {
2283
      if (that == null)
2284
        return false;
2285
      if (that instanceof createPromotion_args)
2286
        return this.equals((createPromotion_args)that);
2287
      return false;
2288
    }
2289
 
2290
    public boolean equals(createPromotion_args that) {
2291
      if (that == null)
2292
        return false;
2293
 
2294
      boolean this_present_name = true && this.isSetName();
2295
      boolean that_present_name = true && that.isSetName();
2296
      if (this_present_name || that_present_name) {
2297
        if (!(this_present_name && that_present_name))
2298
          return false;
2299
        if (!this.name.equals(that.name))
2300
          return false;
2301
      }
2302
 
2303
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2304
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2305
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2306
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2307
          return false;
2308
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2309
          return false;
2310
      }
2311
 
2312
      boolean this_present_startOn = true;
2313
      boolean that_present_startOn = true;
2314
      if (this_present_startOn || that_present_startOn) {
2315
        if (!(this_present_startOn && that_present_startOn))
2316
          return false;
2317
        if (this.startOn != that.startOn)
2318
          return false;
2319
      }
2320
 
2321
      boolean this_present_endOn = true;
2322
      boolean that_present_endOn = true;
2323
      if (this_present_endOn || that_present_endOn) {
2324
        if (!(this_present_endOn && that_present_endOn))
2325
          return false;
2326
        if (this.endOn != that.endOn)
2327
          return false;
2328
      }
2329
 
2330
      return true;
2331
    }
2332
 
2333
    @Override
2334
    public int hashCode() {
2335
      return 0;
2336
    }
2337
 
2338
    public int compareTo(createPromotion_args other) {
2339
      if (!getClass().equals(other.getClass())) {
2340
        return getClass().getName().compareTo(other.getClass().getName());
2341
      }
2342
 
2343
      int lastComparison = 0;
2344
      createPromotion_args typedOther = (createPromotion_args)other;
2345
 
3430 rajveer 2346
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2347
      if (lastComparison != 0) {
2348
        return lastComparison;
2349
      }
3430 rajveer 2350
      if (isSetName()) {
2351
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2352
        if (lastComparison != 0) {
2353
          return lastComparison;
2354
        }
1982 varun.gupt 2355
      }
3430 rajveer 2356
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2357
      if (lastComparison != 0) {
2358
        return lastComparison;
2359
      }
3430 rajveer 2360
      if (isSetRuleExecutionSrc()) {
2361
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2362
        if (lastComparison != 0) {
2363
          return lastComparison;
2364
        }
1982 varun.gupt 2365
      }
3430 rajveer 2366
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2367
      if (lastComparison != 0) {
2368
        return lastComparison;
2369
      }
3430 rajveer 2370
      if (isSetStartOn()) {
2371
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2372
        if (lastComparison != 0) {
2373
          return lastComparison;
2374
        }
1982 varun.gupt 2375
      }
3430 rajveer 2376
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2377
      if (lastComparison != 0) {
2378
        return lastComparison;
2379
      }
3430 rajveer 2380
      if (isSetEndOn()) {
2381
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2382
        if (lastComparison != 0) {
2383
          return lastComparison;
2384
        }
1982 varun.gupt 2385
      }
2386
      return 0;
2387
    }
2388
 
3430 rajveer 2389
    public _Fields fieldForId(int fieldId) {
2390
      return _Fields.findByThriftId(fieldId);
2391
    }
2392
 
2393
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2394
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2395
      iprot.readStructBegin();
2396
      while (true)
2397
      {
2398
        field = iprot.readFieldBegin();
3430 rajveer 2399
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2400
          break;
2401
        }
3430 rajveer 2402
        switch (field.id) {
2403
          case 1: // NAME
2404
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2405
              this.name = iprot.readString();
2406
            } else { 
2407
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2408
            }
2409
            break;
2410
          case 2: // RULE_EXECUTION_SRC
2411
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2412
              this.ruleExecutionSrc = iprot.readString();
2413
            } else { 
2414
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2415
            }
2416
            break;
2417
          case 3: // START_ON
2418
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2419
              this.startOn = iprot.readI64();
2420
              setStartOnIsSet(true);
2421
            } else { 
2422
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2423
            }
2424
            break;
2425
          case 4: // END_ON
2426
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2427
              this.endOn = iprot.readI64();
2428
              setEndOnIsSet(true);
2429
            } else { 
2430
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2431
            }
2432
            break;
2433
          default:
2434
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2435
        }
3430 rajveer 2436
        iprot.readFieldEnd();
1982 varun.gupt 2437
      }
2438
      iprot.readStructEnd();
2439
      validate();
2440
    }
2441
 
3430 rajveer 2442
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2443
      validate();
2444
 
2445
      oprot.writeStructBegin(STRUCT_DESC);
2446
      if (this.name != null) {
2447
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2448
        oprot.writeString(this.name);
2449
        oprot.writeFieldEnd();
2450
      }
2451
      if (this.ruleExecutionSrc != null) {
2452
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2453
        oprot.writeString(this.ruleExecutionSrc);
2454
        oprot.writeFieldEnd();
2455
      }
2456
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2457
      oprot.writeI64(this.startOn);
2458
      oprot.writeFieldEnd();
2459
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2460
      oprot.writeI64(this.endOn);
2461
      oprot.writeFieldEnd();
2462
      oprot.writeFieldStop();
2463
      oprot.writeStructEnd();
2464
    }
2465
 
2466
    @Override
2467
    public String toString() {
2468
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2469
      boolean first = true;
2470
 
2471
      sb.append("name:");
2472
      if (this.name == null) {
2473
        sb.append("null");
2474
      } else {
2475
        sb.append(this.name);
2476
      }
2477
      first = false;
2478
      if (!first) sb.append(", ");
2479
      sb.append("ruleExecutionSrc:");
2480
      if (this.ruleExecutionSrc == null) {
2481
        sb.append("null");
2482
      } else {
2483
        sb.append(this.ruleExecutionSrc);
2484
      }
2485
      first = false;
2486
      if (!first) sb.append(", ");
2487
      sb.append("startOn:");
2488
      sb.append(this.startOn);
2489
      first = false;
2490
      if (!first) sb.append(", ");
2491
      sb.append("endOn:");
2492
      sb.append(this.endOn);
2493
      first = false;
2494
      sb.append(")");
2495
      return sb.toString();
2496
    }
2497
 
3430 rajveer 2498
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2499
      // check for required fields
2500
    }
2501
 
3430 rajveer 2502
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2503
      try {
2504
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2505
      } catch (org.apache.thrift.TException te) {
2506
        throw new java.io.IOException(te);
2507
      }
2508
    }
2509
 
2510
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2511
      try {
2512
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2513
        __isset_bit_vector = new BitSet(1);
2514
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2515
      } catch (org.apache.thrift.TException te) {
2516
        throw new java.io.IOException(te);
2517
      }
2518
    }
2519
 
1982 varun.gupt 2520
  }
2521
 
3430 rajveer 2522
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2523
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2524
 
3430 rajveer 2525
    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 2526
 
3430 rajveer 2527
    private PromotionException pex; // required
1982 varun.gupt 2528
 
2529
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2530
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2531
      PEX((short)1, "pex");
2532
 
2533
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2534
 
2535
      static {
2536
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2537
          byName.put(field.getFieldName(), field);
2538
        }
2539
      }
2540
 
2541
      /**
2542
       * Find the _Fields constant that matches fieldId, or null if its not found.
2543
       */
2544
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2545
        switch(fieldId) {
2546
          case 1: // PEX
2547
            return PEX;
2548
          default:
2549
            return null;
2550
        }
1982 varun.gupt 2551
      }
2552
 
2553
      /**
2554
       * Find the _Fields constant that matches fieldId, throwing an exception
2555
       * if it is not found.
2556
       */
2557
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2558
        _Fields fields = findByThriftId(fieldId);
2559
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2560
        return fields;
2561
      }
2562
 
2563
      /**
2564
       * Find the _Fields constant that matches name, or null if its not found.
2565
       */
2566
      public static _Fields findByName(String name) {
2567
        return byName.get(name);
2568
      }
2569
 
2570
      private final short _thriftId;
2571
      private final String _fieldName;
2572
 
2573
      _Fields(short thriftId, String fieldName) {
2574
        _thriftId = thriftId;
2575
        _fieldName = fieldName;
2576
      }
2577
 
2578
      public short getThriftFieldId() {
2579
        return _thriftId;
2580
      }
2581
 
2582
      public String getFieldName() {
2583
        return _fieldName;
2584
      }
2585
    }
2586
 
2587
    // isset id assignments
2588
 
3430 rajveer 2589
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2590
    static {
3430 rajveer 2591
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2592
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2593
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2594
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2595
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2596
    }
2597
 
2598
    public createPromotion_result() {
2599
    }
2600
 
2601
    public createPromotion_result(
2602
      PromotionException pex)
2603
    {
2604
      this();
2605
      this.pex = pex;
2606
    }
2607
 
2608
    /**
2609
     * Performs a deep copy on <i>other</i>.
2610
     */
2611
    public createPromotion_result(createPromotion_result other) {
2612
      if (other.isSetPex()) {
2613
        this.pex = new PromotionException(other.pex);
2614
      }
2615
    }
2616
 
2617
    public createPromotion_result deepCopy() {
2618
      return new createPromotion_result(this);
2619
    }
2620
 
3430 rajveer 2621
    @Override
2622
    public void clear() {
2623
      this.pex = null;
1982 varun.gupt 2624
    }
2625
 
2626
    public PromotionException getPex() {
2627
      return this.pex;
2628
    }
2629
 
3430 rajveer 2630
    public void setPex(PromotionException pex) {
1982 varun.gupt 2631
      this.pex = pex;
2632
    }
2633
 
2634
    public void unsetPex() {
2635
      this.pex = null;
2636
    }
2637
 
3430 rajveer 2638
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2639
    public boolean isSetPex() {
2640
      return this.pex != null;
2641
    }
2642
 
2643
    public void setPexIsSet(boolean value) {
2644
      if (!value) {
2645
        this.pex = null;
2646
      }
2647
    }
2648
 
2649
    public void setFieldValue(_Fields field, Object value) {
2650
      switch (field) {
2651
      case PEX:
2652
        if (value == null) {
2653
          unsetPex();
2654
        } else {
2655
          setPex((PromotionException)value);
2656
        }
2657
        break;
2658
 
2659
      }
2660
    }
2661
 
2662
    public Object getFieldValue(_Fields field) {
2663
      switch (field) {
2664
      case PEX:
2665
        return getPex();
2666
 
2667
      }
2668
      throw new IllegalStateException();
2669
    }
2670
 
3430 rajveer 2671
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2672
    public boolean isSet(_Fields field) {
2673
      if (field == null) {
2674
        throw new IllegalArgumentException();
2675
      }
1982 varun.gupt 2676
 
2677
      switch (field) {
2678
      case PEX:
2679
        return isSetPex();
2680
      }
2681
      throw new IllegalStateException();
2682
    }
2683
 
2684
    @Override
2685
    public boolean equals(Object that) {
2686
      if (that == null)
2687
        return false;
2688
      if (that instanceof createPromotion_result)
2689
        return this.equals((createPromotion_result)that);
2690
      return false;
2691
    }
2692
 
2693
    public boolean equals(createPromotion_result that) {
2694
      if (that == null)
2695
        return false;
2696
 
2697
      boolean this_present_pex = true && this.isSetPex();
2698
      boolean that_present_pex = true && that.isSetPex();
2699
      if (this_present_pex || that_present_pex) {
2700
        if (!(this_present_pex && that_present_pex))
2701
          return false;
2702
        if (!this.pex.equals(that.pex))
2703
          return false;
2704
      }
2705
 
2706
      return true;
2707
    }
2708
 
2709
    @Override
2710
    public int hashCode() {
2711
      return 0;
2712
    }
2713
 
2714
    public int compareTo(createPromotion_result other) {
2715
      if (!getClass().equals(other.getClass())) {
2716
        return getClass().getName().compareTo(other.getClass().getName());
2717
      }
2718
 
2719
      int lastComparison = 0;
2720
      createPromotion_result typedOther = (createPromotion_result)other;
2721
 
3430 rajveer 2722
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2723
      if (lastComparison != 0) {
2724
        return lastComparison;
2725
      }
3430 rajveer 2726
      if (isSetPex()) {
2727
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2728
        if (lastComparison != 0) {
2729
          return lastComparison;
2730
        }
1982 varun.gupt 2731
      }
2732
      return 0;
2733
    }
2734
 
3430 rajveer 2735
    public _Fields fieldForId(int fieldId) {
2736
      return _Fields.findByThriftId(fieldId);
2737
    }
2738
 
2739
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2740
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2741
      iprot.readStructBegin();
2742
      while (true)
2743
      {
2744
        field = iprot.readFieldBegin();
3430 rajveer 2745
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2746
          break;
2747
        }
3430 rajveer 2748
        switch (field.id) {
2749
          case 1: // PEX
2750
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2751
              this.pex = new PromotionException();
2752
              this.pex.read(iprot);
2753
            } else { 
2754
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2755
            }
2756
            break;
2757
          default:
2758
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2759
        }
3430 rajveer 2760
        iprot.readFieldEnd();
1982 varun.gupt 2761
      }
2762
      iprot.readStructEnd();
2763
      validate();
2764
    }
2765
 
3430 rajveer 2766
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2767
      oprot.writeStructBegin(STRUCT_DESC);
2768
 
2769
      if (this.isSetPex()) {
2770
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2771
        this.pex.write(oprot);
2772
        oprot.writeFieldEnd();
2773
      }
2774
      oprot.writeFieldStop();
2775
      oprot.writeStructEnd();
2776
    }
2777
 
2778
    @Override
2779
    public String toString() {
2780
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2781
      boolean first = true;
2782
 
2783
      sb.append("pex:");
2784
      if (this.pex == null) {
2785
        sb.append("null");
2786
      } else {
2787
        sb.append(this.pex);
2788
      }
2789
      first = false;
2790
      sb.append(")");
2791
      return sb.toString();
2792
    }
2793
 
3430 rajveer 2794
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2795
      // check for required fields
2796
    }
2797
 
3430 rajveer 2798
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2799
      try {
2800
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2801
      } catch (org.apache.thrift.TException te) {
2802
        throw new java.io.IOException(te);
2803
      }
2804
    }
2805
 
2806
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2807
      try {
2808
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2809
      } catch (org.apache.thrift.TException te) {
2810
        throw new java.io.IOException(te);
2811
      }
2812
    }
2813
 
1982 varun.gupt 2814
  }
2815
 
6301 amit.gupta 2816
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
2817
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
2818
 
2819
    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);
2820
 
2821
    private String couponCode; // required
2822
 
2823
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2824
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2825
      COUPON_CODE((short)1, "couponCode");
2826
 
2827
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2828
 
2829
      static {
2830
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2831
          byName.put(field.getFieldName(), field);
2832
        }
2833
      }
2834
 
2835
      /**
2836
       * Find the _Fields constant that matches fieldId, or null if its not found.
2837
       */
2838
      public static _Fields findByThriftId(int fieldId) {
2839
        switch(fieldId) {
2840
          case 1: // COUPON_CODE
2841
            return COUPON_CODE;
2842
          default:
2843
            return null;
2844
        }
2845
      }
2846
 
2847
      /**
2848
       * Find the _Fields constant that matches fieldId, throwing an exception
2849
       * if it is not found.
2850
       */
2851
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2852
        _Fields fields = findByThriftId(fieldId);
2853
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2854
        return fields;
2855
      }
2856
 
2857
      /**
2858
       * Find the _Fields constant that matches name, or null if its not found.
2859
       */
2860
      public static _Fields findByName(String name) {
2861
        return byName.get(name);
2862
      }
2863
 
2864
      private final short _thriftId;
2865
      private final String _fieldName;
2866
 
2867
      _Fields(short thriftId, String fieldName) {
2868
        _thriftId = thriftId;
2869
        _fieldName = fieldName;
2870
      }
2871
 
2872
      public short getThriftFieldId() {
2873
        return _thriftId;
2874
      }
2875
 
2876
      public String getFieldName() {
2877
        return _fieldName;
2878
      }
2879
    }
2880
 
2881
    // isset id assignments
2882
 
2883
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2884
    static {
2885
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2886
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2887
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2888
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2889
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
2890
    }
2891
 
2892
    public getCoupon_args() {
2893
    }
2894
 
2895
    public getCoupon_args(
2896
      String couponCode)
2897
    {
2898
      this();
2899
      this.couponCode = couponCode;
2900
    }
2901
 
2902
    /**
2903
     * Performs a deep copy on <i>other</i>.
2904
     */
2905
    public getCoupon_args(getCoupon_args other) {
2906
      if (other.isSetCouponCode()) {
2907
        this.couponCode = other.couponCode;
2908
      }
2909
    }
2910
 
2911
    public getCoupon_args deepCopy() {
2912
      return new getCoupon_args(this);
2913
    }
2914
 
2915
    @Override
2916
    public void clear() {
2917
      this.couponCode = null;
2918
    }
2919
 
2920
    public String getCouponCode() {
2921
      return this.couponCode;
2922
    }
2923
 
2924
    public void setCouponCode(String couponCode) {
2925
      this.couponCode = couponCode;
2926
    }
2927
 
2928
    public void unsetCouponCode() {
2929
      this.couponCode = null;
2930
    }
2931
 
2932
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
2933
    public boolean isSetCouponCode() {
2934
      return this.couponCode != null;
2935
    }
2936
 
2937
    public void setCouponCodeIsSet(boolean value) {
2938
      if (!value) {
2939
        this.couponCode = null;
2940
      }
2941
    }
2942
 
2943
    public void setFieldValue(_Fields field, Object value) {
2944
      switch (field) {
2945
      case COUPON_CODE:
2946
        if (value == null) {
2947
          unsetCouponCode();
2948
        } else {
2949
          setCouponCode((String)value);
2950
        }
2951
        break;
2952
 
2953
      }
2954
    }
2955
 
2956
    public Object getFieldValue(_Fields field) {
2957
      switch (field) {
2958
      case COUPON_CODE:
2959
        return getCouponCode();
2960
 
2961
      }
2962
      throw new IllegalStateException();
2963
    }
2964
 
2965
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2966
    public boolean isSet(_Fields field) {
2967
      if (field == null) {
2968
        throw new IllegalArgumentException();
2969
      }
2970
 
2971
      switch (field) {
2972
      case COUPON_CODE:
2973
        return isSetCouponCode();
2974
      }
2975
      throw new IllegalStateException();
2976
    }
2977
 
2978
    @Override
2979
    public boolean equals(Object that) {
2980
      if (that == null)
2981
        return false;
2982
      if (that instanceof getCoupon_args)
2983
        return this.equals((getCoupon_args)that);
2984
      return false;
2985
    }
2986
 
2987
    public boolean equals(getCoupon_args that) {
2988
      if (that == null)
2989
        return false;
2990
 
2991
      boolean this_present_couponCode = true && this.isSetCouponCode();
2992
      boolean that_present_couponCode = true && that.isSetCouponCode();
2993
      if (this_present_couponCode || that_present_couponCode) {
2994
        if (!(this_present_couponCode && that_present_couponCode))
2995
          return false;
2996
        if (!this.couponCode.equals(that.couponCode))
2997
          return false;
2998
      }
2999
 
3000
      return true;
3001
    }
3002
 
3003
    @Override
3004
    public int hashCode() {
3005
      return 0;
3006
    }
3007
 
3008
    public int compareTo(getCoupon_args other) {
3009
      if (!getClass().equals(other.getClass())) {
3010
        return getClass().getName().compareTo(other.getClass().getName());
3011
      }
3012
 
3013
      int lastComparison = 0;
3014
      getCoupon_args typedOther = (getCoupon_args)other;
3015
 
3016
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3017
      if (lastComparison != 0) {
3018
        return lastComparison;
3019
      }
3020
      if (isSetCouponCode()) {
3021
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3022
        if (lastComparison != 0) {
3023
          return lastComparison;
3024
        }
3025
      }
3026
      return 0;
3027
    }
3028
 
3029
    public _Fields fieldForId(int fieldId) {
3030
      return _Fields.findByThriftId(fieldId);
3031
    }
3032
 
3033
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3034
      org.apache.thrift.protocol.TField field;
3035
      iprot.readStructBegin();
3036
      while (true)
3037
      {
3038
        field = iprot.readFieldBegin();
3039
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3040
          break;
3041
        }
3042
        switch (field.id) {
3043
          case 1: // COUPON_CODE
3044
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3045
              this.couponCode = iprot.readString();
3046
            } else { 
3047
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3048
            }
3049
            break;
3050
          default:
3051
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3052
        }
3053
        iprot.readFieldEnd();
3054
      }
3055
      iprot.readStructEnd();
3056
      validate();
3057
    }
3058
 
3059
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3060
      validate();
3061
 
3062
      oprot.writeStructBegin(STRUCT_DESC);
3063
      if (this.couponCode != null) {
3064
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3065
        oprot.writeString(this.couponCode);
3066
        oprot.writeFieldEnd();
3067
      }
3068
      oprot.writeFieldStop();
3069
      oprot.writeStructEnd();
3070
    }
3071
 
3072
    @Override
3073
    public String toString() {
3074
      StringBuilder sb = new StringBuilder("getCoupon_args(");
3075
      boolean first = true;
3076
 
3077
      sb.append("couponCode:");
3078
      if (this.couponCode == null) {
3079
        sb.append("null");
3080
      } else {
3081
        sb.append(this.couponCode);
3082
      }
3083
      first = false;
3084
      sb.append(")");
3085
      return sb.toString();
3086
    }
3087
 
3088
    public void validate() throws org.apache.thrift.TException {
3089
      // check for required fields
3090
    }
3091
 
3092
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3093
      try {
3094
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3095
      } catch (org.apache.thrift.TException te) {
3096
        throw new java.io.IOException(te);
3097
      }
3098
    }
3099
 
3100
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3101
      try {
3102
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3103
      } catch (org.apache.thrift.TException te) {
3104
        throw new java.io.IOException(te);
3105
      }
3106
    }
3107
 
3108
  }
3109
 
3110
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
3111
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
3112
 
3113
    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);
3114
    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);
3115
 
3116
    private Coupon success; // required
3117
    private PromotionException pex; // required
3118
 
3119
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3120
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3121
      SUCCESS((short)0, "success"),
3122
      PEX((short)1, "pex");
3123
 
3124
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3125
 
3126
      static {
3127
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3128
          byName.put(field.getFieldName(), field);
3129
        }
3130
      }
3131
 
3132
      /**
3133
       * Find the _Fields constant that matches fieldId, or null if its not found.
3134
       */
3135
      public static _Fields findByThriftId(int fieldId) {
3136
        switch(fieldId) {
3137
          case 0: // SUCCESS
3138
            return SUCCESS;
3139
          case 1: // PEX
3140
            return PEX;
3141
          default:
3142
            return null;
3143
        }
3144
      }
3145
 
3146
      /**
3147
       * Find the _Fields constant that matches fieldId, throwing an exception
3148
       * if it is not found.
3149
       */
3150
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3151
        _Fields fields = findByThriftId(fieldId);
3152
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3153
        return fields;
3154
      }
3155
 
3156
      /**
3157
       * Find the _Fields constant that matches name, or null if its not found.
3158
       */
3159
      public static _Fields findByName(String name) {
3160
        return byName.get(name);
3161
      }
3162
 
3163
      private final short _thriftId;
3164
      private final String _fieldName;
3165
 
3166
      _Fields(short thriftId, String fieldName) {
3167
        _thriftId = thriftId;
3168
        _fieldName = fieldName;
3169
      }
3170
 
3171
      public short getThriftFieldId() {
3172
        return _thriftId;
3173
      }
3174
 
3175
      public String getFieldName() {
3176
        return _fieldName;
3177
      }
3178
    }
3179
 
3180
    // isset id assignments
3181
 
3182
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3183
    static {
3184
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3185
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3186
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
3187
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3188
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3189
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3190
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
3191
    }
3192
 
3193
    public getCoupon_result() {
3194
    }
3195
 
3196
    public getCoupon_result(
3197
      Coupon success,
3198
      PromotionException pex)
3199
    {
3200
      this();
3201
      this.success = success;
3202
      this.pex = pex;
3203
    }
3204
 
3205
    /**
3206
     * Performs a deep copy on <i>other</i>.
3207
     */
3208
    public getCoupon_result(getCoupon_result other) {
3209
      if (other.isSetSuccess()) {
3210
        this.success = new Coupon(other.success);
3211
      }
3212
      if (other.isSetPex()) {
3213
        this.pex = new PromotionException(other.pex);
3214
      }
3215
    }
3216
 
3217
    public getCoupon_result deepCopy() {
3218
      return new getCoupon_result(this);
3219
    }
3220
 
3221
    @Override
3222
    public void clear() {
3223
      this.success = null;
3224
      this.pex = null;
3225
    }
3226
 
3227
    public Coupon getSuccess() {
3228
      return this.success;
3229
    }
3230
 
3231
    public void setSuccess(Coupon success) {
3232
      this.success = success;
3233
    }
3234
 
3235
    public void unsetSuccess() {
3236
      this.success = null;
3237
    }
3238
 
3239
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3240
    public boolean isSetSuccess() {
3241
      return this.success != null;
3242
    }
3243
 
3244
    public void setSuccessIsSet(boolean value) {
3245
      if (!value) {
3246
        this.success = null;
3247
      }
3248
    }
3249
 
3250
    public PromotionException getPex() {
3251
      return this.pex;
3252
    }
3253
 
3254
    public void setPex(PromotionException pex) {
3255
      this.pex = pex;
3256
    }
3257
 
3258
    public void unsetPex() {
3259
      this.pex = null;
3260
    }
3261
 
3262
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3263
    public boolean isSetPex() {
3264
      return this.pex != null;
3265
    }
3266
 
3267
    public void setPexIsSet(boolean value) {
3268
      if (!value) {
3269
        this.pex = null;
3270
      }
3271
    }
3272
 
3273
    public void setFieldValue(_Fields field, Object value) {
3274
      switch (field) {
3275
      case SUCCESS:
3276
        if (value == null) {
3277
          unsetSuccess();
3278
        } else {
3279
          setSuccess((Coupon)value);
3280
        }
3281
        break;
3282
 
3283
      case PEX:
3284
        if (value == null) {
3285
          unsetPex();
3286
        } else {
3287
          setPex((PromotionException)value);
3288
        }
3289
        break;
3290
 
3291
      }
3292
    }
3293
 
3294
    public Object getFieldValue(_Fields field) {
3295
      switch (field) {
3296
      case SUCCESS:
3297
        return getSuccess();
3298
 
3299
      case PEX:
3300
        return getPex();
3301
 
3302
      }
3303
      throw new IllegalStateException();
3304
    }
3305
 
3306
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3307
    public boolean isSet(_Fields field) {
3308
      if (field == null) {
3309
        throw new IllegalArgumentException();
3310
      }
3311
 
3312
      switch (field) {
3313
      case SUCCESS:
3314
        return isSetSuccess();
3315
      case PEX:
3316
        return isSetPex();
3317
      }
3318
      throw new IllegalStateException();
3319
    }
3320
 
3321
    @Override
3322
    public boolean equals(Object that) {
3323
      if (that == null)
3324
        return false;
3325
      if (that instanceof getCoupon_result)
3326
        return this.equals((getCoupon_result)that);
3327
      return false;
3328
    }
3329
 
3330
    public boolean equals(getCoupon_result that) {
3331
      if (that == null)
3332
        return false;
3333
 
3334
      boolean this_present_success = true && this.isSetSuccess();
3335
      boolean that_present_success = true && that.isSetSuccess();
3336
      if (this_present_success || that_present_success) {
3337
        if (!(this_present_success && that_present_success))
3338
          return false;
3339
        if (!this.success.equals(that.success))
3340
          return false;
3341
      }
3342
 
3343
      boolean this_present_pex = true && this.isSetPex();
3344
      boolean that_present_pex = true && that.isSetPex();
3345
      if (this_present_pex || that_present_pex) {
3346
        if (!(this_present_pex && that_present_pex))
3347
          return false;
3348
        if (!this.pex.equals(that.pex))
3349
          return false;
3350
      }
3351
 
3352
      return true;
3353
    }
3354
 
3355
    @Override
3356
    public int hashCode() {
3357
      return 0;
3358
    }
3359
 
3360
    public int compareTo(getCoupon_result other) {
3361
      if (!getClass().equals(other.getClass())) {
3362
        return getClass().getName().compareTo(other.getClass().getName());
3363
      }
3364
 
3365
      int lastComparison = 0;
3366
      getCoupon_result typedOther = (getCoupon_result)other;
3367
 
3368
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3369
      if (lastComparison != 0) {
3370
        return lastComparison;
3371
      }
3372
      if (isSetSuccess()) {
3373
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3374
        if (lastComparison != 0) {
3375
          return lastComparison;
3376
        }
3377
      }
3378
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3379
      if (lastComparison != 0) {
3380
        return lastComparison;
3381
      }
3382
      if (isSetPex()) {
3383
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3384
        if (lastComparison != 0) {
3385
          return lastComparison;
3386
        }
3387
      }
3388
      return 0;
3389
    }
3390
 
3391
    public _Fields fieldForId(int fieldId) {
3392
      return _Fields.findByThriftId(fieldId);
3393
    }
3394
 
3395
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3396
      org.apache.thrift.protocol.TField field;
3397
      iprot.readStructBegin();
3398
      while (true)
3399
      {
3400
        field = iprot.readFieldBegin();
3401
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3402
          break;
3403
        }
3404
        switch (field.id) {
3405
          case 0: // SUCCESS
3406
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3407
              this.success = new Coupon();
3408
              this.success.read(iprot);
3409
            } else { 
3410
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3411
            }
3412
            break;
3413
          case 1: // PEX
3414
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3415
              this.pex = new PromotionException();
3416
              this.pex.read(iprot);
3417
            } else { 
3418
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3419
            }
3420
            break;
3421
          default:
3422
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3423
        }
3424
        iprot.readFieldEnd();
3425
      }
3426
      iprot.readStructEnd();
3427
      validate();
3428
    }
3429
 
3430
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3431
      oprot.writeStructBegin(STRUCT_DESC);
3432
 
3433
      if (this.isSetSuccess()) {
3434
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3435
        this.success.write(oprot);
3436
        oprot.writeFieldEnd();
3437
      } else if (this.isSetPex()) {
3438
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3439
        this.pex.write(oprot);
3440
        oprot.writeFieldEnd();
3441
      }
3442
      oprot.writeFieldStop();
3443
      oprot.writeStructEnd();
3444
    }
3445
 
3446
    @Override
3447
    public String toString() {
3448
      StringBuilder sb = new StringBuilder("getCoupon_result(");
3449
      boolean first = true;
3450
 
3451
      sb.append("success:");
3452
      if (this.success == null) {
3453
        sb.append("null");
3454
      } else {
3455
        sb.append(this.success);
3456
      }
3457
      first = false;
3458
      if (!first) sb.append(", ");
3459
      sb.append("pex:");
3460
      if (this.pex == null) {
3461
        sb.append("null");
3462
      } else {
3463
        sb.append(this.pex);
3464
      }
3465
      first = false;
3466
      sb.append(")");
3467
      return sb.toString();
3468
    }
3469
 
3470
    public void validate() throws org.apache.thrift.TException {
3471
      // check for required fields
3472
    }
3473
 
3474
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3475
      try {
3476
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3477
      } catch (org.apache.thrift.TException te) {
3478
        throw new java.io.IOException(te);
3479
      }
3480
    }
3481
 
3482
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3483
      try {
3484
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3485
      } catch (org.apache.thrift.TException te) {
3486
        throw new java.io.IOException(te);
3487
      }
3488
    }
3489
 
3490
  }
3491
 
3492
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
3493
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
3494
 
3495
    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);
3496
 
3497
    private String couponCode; // required
3498
 
3499
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3500
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3501
      COUPON_CODE((short)1, "couponCode");
3502
 
3503
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3504
 
3505
      static {
3506
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3507
          byName.put(field.getFieldName(), field);
3508
        }
3509
      }
3510
 
3511
      /**
3512
       * Find the _Fields constant that matches fieldId, or null if its not found.
3513
       */
3514
      public static _Fields findByThriftId(int fieldId) {
3515
        switch(fieldId) {
3516
          case 1: // COUPON_CODE
3517
            return COUPON_CODE;
3518
          default:
3519
            return null;
3520
        }
3521
      }
3522
 
3523
      /**
3524
       * Find the _Fields constant that matches fieldId, throwing an exception
3525
       * if it is not found.
3526
       */
3527
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3528
        _Fields fields = findByThriftId(fieldId);
3529
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3530
        return fields;
3531
      }
3532
 
3533
      /**
3534
       * Find the _Fields constant that matches name, or null if its not found.
3535
       */
3536
      public static _Fields findByName(String name) {
3537
        return byName.get(name);
3538
      }
3539
 
3540
      private final short _thriftId;
3541
      private final String _fieldName;
3542
 
3543
      _Fields(short thriftId, String fieldName) {
3544
        _thriftId = thriftId;
3545
        _fieldName = fieldName;
3546
      }
3547
 
3548
      public short getThriftFieldId() {
3549
        return _thriftId;
3550
      }
3551
 
3552
      public String getFieldName() {
3553
        return _fieldName;
3554
      }
3555
    }
3556
 
3557
    // isset id assignments
3558
 
3559
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3560
    static {
3561
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3562
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3563
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3564
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3565
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
3566
    }
3567
 
3568
    public isGiftVoucher_args() {
3569
    }
3570
 
3571
    public isGiftVoucher_args(
3572
      String couponCode)
3573
    {
3574
      this();
3575
      this.couponCode = couponCode;
3576
    }
3577
 
3578
    /**
3579
     * Performs a deep copy on <i>other</i>.
3580
     */
3581
    public isGiftVoucher_args(isGiftVoucher_args other) {
3582
      if (other.isSetCouponCode()) {
3583
        this.couponCode = other.couponCode;
3584
      }
3585
    }
3586
 
3587
    public isGiftVoucher_args deepCopy() {
3588
      return new isGiftVoucher_args(this);
3589
    }
3590
 
3591
    @Override
3592
    public void clear() {
3593
      this.couponCode = null;
3594
    }
3595
 
3596
    public String getCouponCode() {
3597
      return this.couponCode;
3598
    }
3599
 
3600
    public void setCouponCode(String couponCode) {
3601
      this.couponCode = couponCode;
3602
    }
3603
 
3604
    public void unsetCouponCode() {
3605
      this.couponCode = null;
3606
    }
3607
 
3608
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3609
    public boolean isSetCouponCode() {
3610
      return this.couponCode != null;
3611
    }
3612
 
3613
    public void setCouponCodeIsSet(boolean value) {
3614
      if (!value) {
3615
        this.couponCode = null;
3616
      }
3617
    }
3618
 
3619
    public void setFieldValue(_Fields field, Object value) {
3620
      switch (field) {
3621
      case COUPON_CODE:
3622
        if (value == null) {
3623
          unsetCouponCode();
3624
        } else {
3625
          setCouponCode((String)value);
3626
        }
3627
        break;
3628
 
3629
      }
3630
    }
3631
 
3632
    public Object getFieldValue(_Fields field) {
3633
      switch (field) {
3634
      case COUPON_CODE:
3635
        return getCouponCode();
3636
 
3637
      }
3638
      throw new IllegalStateException();
3639
    }
3640
 
3641
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3642
    public boolean isSet(_Fields field) {
3643
      if (field == null) {
3644
        throw new IllegalArgumentException();
3645
      }
3646
 
3647
      switch (field) {
3648
      case COUPON_CODE:
3649
        return isSetCouponCode();
3650
      }
3651
      throw new IllegalStateException();
3652
    }
3653
 
3654
    @Override
3655
    public boolean equals(Object that) {
3656
      if (that == null)
3657
        return false;
3658
      if (that instanceof isGiftVoucher_args)
3659
        return this.equals((isGiftVoucher_args)that);
3660
      return false;
3661
    }
3662
 
3663
    public boolean equals(isGiftVoucher_args that) {
3664
      if (that == null)
3665
        return false;
3666
 
3667
      boolean this_present_couponCode = true && this.isSetCouponCode();
3668
      boolean that_present_couponCode = true && that.isSetCouponCode();
3669
      if (this_present_couponCode || that_present_couponCode) {
3670
        if (!(this_present_couponCode && that_present_couponCode))
3671
          return false;
3672
        if (!this.couponCode.equals(that.couponCode))
3673
          return false;
3674
      }
3675
 
3676
      return true;
3677
    }
3678
 
3679
    @Override
3680
    public int hashCode() {
3681
      return 0;
3682
    }
3683
 
3684
    public int compareTo(isGiftVoucher_args other) {
3685
      if (!getClass().equals(other.getClass())) {
3686
        return getClass().getName().compareTo(other.getClass().getName());
3687
      }
3688
 
3689
      int lastComparison = 0;
3690
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
3691
 
3692
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3693
      if (lastComparison != 0) {
3694
        return lastComparison;
3695
      }
3696
      if (isSetCouponCode()) {
3697
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3698
        if (lastComparison != 0) {
3699
          return lastComparison;
3700
        }
3701
      }
3702
      return 0;
3703
    }
3704
 
3705
    public _Fields fieldForId(int fieldId) {
3706
      return _Fields.findByThriftId(fieldId);
3707
    }
3708
 
3709
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3710
      org.apache.thrift.protocol.TField field;
3711
      iprot.readStructBegin();
3712
      while (true)
3713
      {
3714
        field = iprot.readFieldBegin();
3715
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3716
          break;
3717
        }
3718
        switch (field.id) {
3719
          case 1: // COUPON_CODE
3720
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3721
              this.couponCode = iprot.readString();
3722
            } else { 
3723
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3724
            }
3725
            break;
3726
          default:
3727
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3728
        }
3729
        iprot.readFieldEnd();
3730
      }
3731
      iprot.readStructEnd();
3732
      validate();
3733
    }
3734
 
3735
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3736
      validate();
3737
 
3738
      oprot.writeStructBegin(STRUCT_DESC);
3739
      if (this.couponCode != null) {
3740
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3741
        oprot.writeString(this.couponCode);
3742
        oprot.writeFieldEnd();
3743
      }
3744
      oprot.writeFieldStop();
3745
      oprot.writeStructEnd();
3746
    }
3747
 
3748
    @Override
3749
    public String toString() {
3750
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
3751
      boolean first = true;
3752
 
3753
      sb.append("couponCode:");
3754
      if (this.couponCode == null) {
3755
        sb.append("null");
3756
      } else {
3757
        sb.append(this.couponCode);
3758
      }
3759
      first = false;
3760
      sb.append(")");
3761
      return sb.toString();
3762
    }
3763
 
3764
    public void validate() throws org.apache.thrift.TException {
3765
      // check for required fields
3766
    }
3767
 
3768
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3769
      try {
3770
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3771
      } catch (org.apache.thrift.TException te) {
3772
        throw new java.io.IOException(te);
3773
      }
3774
    }
3775
 
3776
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3777
      try {
3778
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3779
      } catch (org.apache.thrift.TException te) {
3780
        throw new java.io.IOException(te);
3781
      }
3782
    }
3783
 
3784
  }
3785
 
3786
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
3787
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
3788
 
3789
    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);
3790
    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);
3791
 
3792
    private boolean success; // required
3793
    private PromotionException pex; // required
3794
 
3795
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3796
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3797
      SUCCESS((short)0, "success"),
3798
      PEX((short)1, "pex");
3799
 
3800
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3801
 
3802
      static {
3803
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3804
          byName.put(field.getFieldName(), field);
3805
        }
3806
      }
3807
 
3808
      /**
3809
       * Find the _Fields constant that matches fieldId, or null if its not found.
3810
       */
3811
      public static _Fields findByThriftId(int fieldId) {
3812
        switch(fieldId) {
3813
          case 0: // SUCCESS
3814
            return SUCCESS;
3815
          case 1: // PEX
3816
            return PEX;
3817
          default:
3818
            return null;
3819
        }
3820
      }
3821
 
3822
      /**
3823
       * Find the _Fields constant that matches fieldId, throwing an exception
3824
       * if it is not found.
3825
       */
3826
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3827
        _Fields fields = findByThriftId(fieldId);
3828
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3829
        return fields;
3830
      }
3831
 
3832
      /**
3833
       * Find the _Fields constant that matches name, or null if its not found.
3834
       */
3835
      public static _Fields findByName(String name) {
3836
        return byName.get(name);
3837
      }
3838
 
3839
      private final short _thriftId;
3840
      private final String _fieldName;
3841
 
3842
      _Fields(short thriftId, String fieldName) {
3843
        _thriftId = thriftId;
3844
        _fieldName = fieldName;
3845
      }
3846
 
3847
      public short getThriftFieldId() {
3848
        return _thriftId;
3849
      }
3850
 
3851
      public String getFieldName() {
3852
        return _fieldName;
3853
      }
3854
    }
3855
 
3856
    // isset id assignments
3857
    private static final int __SUCCESS_ISSET_ID = 0;
3858
    private BitSet __isset_bit_vector = new BitSet(1);
3859
 
3860
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3861
    static {
3862
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3863
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3864
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
3865
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3866
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3867
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3868
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
3869
    }
3870
 
3871
    public isGiftVoucher_result() {
3872
    }
3873
 
3874
    public isGiftVoucher_result(
3875
      boolean success,
3876
      PromotionException pex)
3877
    {
3878
      this();
3879
      this.success = success;
3880
      setSuccessIsSet(true);
3881
      this.pex = pex;
3882
    }
3883
 
3884
    /**
3885
     * Performs a deep copy on <i>other</i>.
3886
     */
3887
    public isGiftVoucher_result(isGiftVoucher_result other) {
3888
      __isset_bit_vector.clear();
3889
      __isset_bit_vector.or(other.__isset_bit_vector);
3890
      this.success = other.success;
3891
      if (other.isSetPex()) {
3892
        this.pex = new PromotionException(other.pex);
3893
      }
3894
    }
3895
 
3896
    public isGiftVoucher_result deepCopy() {
3897
      return new isGiftVoucher_result(this);
3898
    }
3899
 
3900
    @Override
3901
    public void clear() {
3902
      setSuccessIsSet(false);
3903
      this.success = false;
3904
      this.pex = null;
3905
    }
3906
 
3907
    public boolean isSuccess() {
3908
      return this.success;
3909
    }
3910
 
3911
    public void setSuccess(boolean success) {
3912
      this.success = success;
3913
      setSuccessIsSet(true);
3914
    }
3915
 
3916
    public void unsetSuccess() {
3917
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3918
    }
3919
 
3920
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3921
    public boolean isSetSuccess() {
3922
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3923
    }
3924
 
3925
    public void setSuccessIsSet(boolean value) {
3926
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3927
    }
3928
 
3929
    public PromotionException getPex() {
3930
      return this.pex;
3931
    }
3932
 
3933
    public void setPex(PromotionException pex) {
3934
      this.pex = pex;
3935
    }
3936
 
3937
    public void unsetPex() {
3938
      this.pex = null;
3939
    }
3940
 
3941
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3942
    public boolean isSetPex() {
3943
      return this.pex != null;
3944
    }
3945
 
3946
    public void setPexIsSet(boolean value) {
3947
      if (!value) {
3948
        this.pex = null;
3949
      }
3950
    }
3951
 
3952
    public void setFieldValue(_Fields field, Object value) {
3953
      switch (field) {
3954
      case SUCCESS:
3955
        if (value == null) {
3956
          unsetSuccess();
3957
        } else {
3958
          setSuccess((Boolean)value);
3959
        }
3960
        break;
3961
 
3962
      case PEX:
3963
        if (value == null) {
3964
          unsetPex();
3965
        } else {
3966
          setPex((PromotionException)value);
3967
        }
3968
        break;
3969
 
3970
      }
3971
    }
3972
 
3973
    public Object getFieldValue(_Fields field) {
3974
      switch (field) {
3975
      case SUCCESS:
3976
        return Boolean.valueOf(isSuccess());
3977
 
3978
      case PEX:
3979
        return getPex();
3980
 
3981
      }
3982
      throw new IllegalStateException();
3983
    }
3984
 
3985
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3986
    public boolean isSet(_Fields field) {
3987
      if (field == null) {
3988
        throw new IllegalArgumentException();
3989
      }
3990
 
3991
      switch (field) {
3992
      case SUCCESS:
3993
        return isSetSuccess();
3994
      case PEX:
3995
        return isSetPex();
3996
      }
3997
      throw new IllegalStateException();
3998
    }
3999
 
4000
    @Override
4001
    public boolean equals(Object that) {
4002
      if (that == null)
4003
        return false;
4004
      if (that instanceof isGiftVoucher_result)
4005
        return this.equals((isGiftVoucher_result)that);
4006
      return false;
4007
    }
4008
 
4009
    public boolean equals(isGiftVoucher_result that) {
4010
      if (that == null)
4011
        return false;
4012
 
4013
      boolean this_present_success = true;
4014
      boolean that_present_success = true;
4015
      if (this_present_success || that_present_success) {
4016
        if (!(this_present_success && that_present_success))
4017
          return false;
4018
        if (this.success != that.success)
4019
          return false;
4020
      }
4021
 
4022
      boolean this_present_pex = true && this.isSetPex();
4023
      boolean that_present_pex = true && that.isSetPex();
4024
      if (this_present_pex || that_present_pex) {
4025
        if (!(this_present_pex && that_present_pex))
4026
          return false;
4027
        if (!this.pex.equals(that.pex))
4028
          return false;
4029
      }
4030
 
4031
      return true;
4032
    }
4033
 
4034
    @Override
4035
    public int hashCode() {
4036
      return 0;
4037
    }
4038
 
4039
    public int compareTo(isGiftVoucher_result other) {
4040
      if (!getClass().equals(other.getClass())) {
4041
        return getClass().getName().compareTo(other.getClass().getName());
4042
      }
4043
 
4044
      int lastComparison = 0;
4045
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4046
 
4047
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4048
      if (lastComparison != 0) {
4049
        return lastComparison;
4050
      }
4051
      if (isSetSuccess()) {
4052
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4053
        if (lastComparison != 0) {
4054
          return lastComparison;
4055
        }
4056
      }
4057
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4058
      if (lastComparison != 0) {
4059
        return lastComparison;
4060
      }
4061
      if (isSetPex()) {
4062
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4063
        if (lastComparison != 0) {
4064
          return lastComparison;
4065
        }
4066
      }
4067
      return 0;
4068
    }
4069
 
4070
    public _Fields fieldForId(int fieldId) {
4071
      return _Fields.findByThriftId(fieldId);
4072
    }
4073
 
4074
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4075
      org.apache.thrift.protocol.TField field;
4076
      iprot.readStructBegin();
4077
      while (true)
4078
      {
4079
        field = iprot.readFieldBegin();
4080
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4081
          break;
4082
        }
4083
        switch (field.id) {
4084
          case 0: // SUCCESS
4085
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4086
              this.success = iprot.readBool();
4087
              setSuccessIsSet(true);
4088
            } else { 
4089
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4090
            }
4091
            break;
4092
          case 1: // PEX
4093
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4094
              this.pex = new PromotionException();
4095
              this.pex.read(iprot);
4096
            } else { 
4097
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4098
            }
4099
            break;
4100
          default:
4101
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4102
        }
4103
        iprot.readFieldEnd();
4104
      }
4105
      iprot.readStructEnd();
4106
      validate();
4107
    }
4108
 
4109
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4110
      oprot.writeStructBegin(STRUCT_DESC);
4111
 
4112
      if (this.isSetSuccess()) {
4113
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4114
        oprot.writeBool(this.success);
4115
        oprot.writeFieldEnd();
4116
      } else if (this.isSetPex()) {
4117
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4118
        this.pex.write(oprot);
4119
        oprot.writeFieldEnd();
4120
      }
4121
      oprot.writeFieldStop();
4122
      oprot.writeStructEnd();
4123
    }
4124
 
4125
    @Override
4126
    public String toString() {
4127
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
4128
      boolean first = true;
4129
 
4130
      sb.append("success:");
4131
      sb.append(this.success);
4132
      first = false;
4133
      if (!first) sb.append(", ");
4134
      sb.append("pex:");
4135
      if (this.pex == null) {
4136
        sb.append("null");
4137
      } else {
4138
        sb.append(this.pex);
4139
      }
4140
      first = false;
4141
      sb.append(")");
4142
      return sb.toString();
4143
    }
4144
 
4145
    public void validate() throws org.apache.thrift.TException {
4146
      // check for required fields
4147
    }
4148
 
4149
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4150
      try {
4151
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4152
      } catch (org.apache.thrift.TException te) {
4153
        throw new java.io.IOException(te);
4154
      }
4155
    }
4156
 
4157
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4158
      try {
4159
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4160
      } catch (org.apache.thrift.TException te) {
4161
        throw new java.io.IOException(te);
4162
      }
4163
    }
4164
 
4165
  }
4166
 
6356 amit.gupta 4167
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
4168
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
4169
 
4170
    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);
4171
 
4172
    private String couponCode; // required
4173
 
4174
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4175
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4176
      COUPON_CODE((short)1, "couponCode");
4177
 
4178
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4179
 
4180
      static {
4181
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4182
          byName.put(field.getFieldName(), field);
4183
        }
4184
      }
4185
 
4186
      /**
4187
       * Find the _Fields constant that matches fieldId, or null if its not found.
4188
       */
4189
      public static _Fields findByThriftId(int fieldId) {
4190
        switch(fieldId) {
4191
          case 1: // COUPON_CODE
4192
            return COUPON_CODE;
4193
          default:
4194
            return null;
4195
        }
4196
      }
4197
 
4198
      /**
4199
       * Find the _Fields constant that matches fieldId, throwing an exception
4200
       * if it is not found.
4201
       */
4202
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4203
        _Fields fields = findByThriftId(fieldId);
4204
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4205
        return fields;
4206
      }
4207
 
4208
      /**
4209
       * Find the _Fields constant that matches name, or null if its not found.
4210
       */
4211
      public static _Fields findByName(String name) {
4212
        return byName.get(name);
4213
      }
4214
 
4215
      private final short _thriftId;
4216
      private final String _fieldName;
4217
 
4218
      _Fields(short thriftId, String fieldName) {
4219
        _thriftId = thriftId;
4220
        _fieldName = fieldName;
4221
      }
4222
 
4223
      public short getThriftFieldId() {
4224
        return _thriftId;
4225
      }
4226
 
4227
      public String getFieldName() {
4228
        return _fieldName;
4229
      }
4230
    }
4231
 
4232
    // isset id assignments
4233
 
4234
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4235
    static {
4236
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4237
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4238
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4239
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4240
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
4241
    }
4242
 
4243
    public isCodApplicable_args() {
4244
    }
4245
 
4246
    public isCodApplicable_args(
4247
      String couponCode)
4248
    {
4249
      this();
4250
      this.couponCode = couponCode;
4251
    }
4252
 
4253
    /**
4254
     * Performs a deep copy on <i>other</i>.
4255
     */
4256
    public isCodApplicable_args(isCodApplicable_args other) {
4257
      if (other.isSetCouponCode()) {
4258
        this.couponCode = other.couponCode;
4259
      }
4260
    }
4261
 
4262
    public isCodApplicable_args deepCopy() {
4263
      return new isCodApplicable_args(this);
4264
    }
4265
 
4266
    @Override
4267
    public void clear() {
4268
      this.couponCode = null;
4269
    }
4270
 
4271
    public String getCouponCode() {
4272
      return this.couponCode;
4273
    }
4274
 
4275
    public void setCouponCode(String couponCode) {
4276
      this.couponCode = couponCode;
4277
    }
4278
 
4279
    public void unsetCouponCode() {
4280
      this.couponCode = null;
4281
    }
4282
 
4283
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4284
    public boolean isSetCouponCode() {
4285
      return this.couponCode != null;
4286
    }
4287
 
4288
    public void setCouponCodeIsSet(boolean value) {
4289
      if (!value) {
4290
        this.couponCode = null;
4291
      }
4292
    }
4293
 
4294
    public void setFieldValue(_Fields field, Object value) {
4295
      switch (field) {
4296
      case COUPON_CODE:
4297
        if (value == null) {
4298
          unsetCouponCode();
4299
        } else {
4300
          setCouponCode((String)value);
4301
        }
4302
        break;
4303
 
4304
      }
4305
    }
4306
 
4307
    public Object getFieldValue(_Fields field) {
4308
      switch (field) {
4309
      case COUPON_CODE:
4310
        return getCouponCode();
4311
 
4312
      }
4313
      throw new IllegalStateException();
4314
    }
4315
 
4316
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4317
    public boolean isSet(_Fields field) {
4318
      if (field == null) {
4319
        throw new IllegalArgumentException();
4320
      }
4321
 
4322
      switch (field) {
4323
      case COUPON_CODE:
4324
        return isSetCouponCode();
4325
      }
4326
      throw new IllegalStateException();
4327
    }
4328
 
4329
    @Override
4330
    public boolean equals(Object that) {
4331
      if (that == null)
4332
        return false;
4333
      if (that instanceof isCodApplicable_args)
4334
        return this.equals((isCodApplicable_args)that);
4335
      return false;
4336
    }
4337
 
4338
    public boolean equals(isCodApplicable_args that) {
4339
      if (that == null)
4340
        return false;
4341
 
4342
      boolean this_present_couponCode = true && this.isSetCouponCode();
4343
      boolean that_present_couponCode = true && that.isSetCouponCode();
4344
      if (this_present_couponCode || that_present_couponCode) {
4345
        if (!(this_present_couponCode && that_present_couponCode))
4346
          return false;
4347
        if (!this.couponCode.equals(that.couponCode))
4348
          return false;
4349
      }
4350
 
4351
      return true;
4352
    }
4353
 
4354
    @Override
4355
    public int hashCode() {
4356
      return 0;
4357
    }
4358
 
4359
    public int compareTo(isCodApplicable_args other) {
4360
      if (!getClass().equals(other.getClass())) {
4361
        return getClass().getName().compareTo(other.getClass().getName());
4362
      }
4363
 
4364
      int lastComparison = 0;
4365
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
4366
 
4367
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4368
      if (lastComparison != 0) {
4369
        return lastComparison;
4370
      }
4371
      if (isSetCouponCode()) {
4372
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4373
        if (lastComparison != 0) {
4374
          return lastComparison;
4375
        }
4376
      }
4377
      return 0;
4378
    }
4379
 
4380
    public _Fields fieldForId(int fieldId) {
4381
      return _Fields.findByThriftId(fieldId);
4382
    }
4383
 
4384
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4385
      org.apache.thrift.protocol.TField field;
4386
      iprot.readStructBegin();
4387
      while (true)
4388
      {
4389
        field = iprot.readFieldBegin();
4390
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4391
          break;
4392
        }
4393
        switch (field.id) {
4394
          case 1: // COUPON_CODE
4395
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4396
              this.couponCode = iprot.readString();
4397
            } else { 
4398
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4399
            }
4400
            break;
4401
          default:
4402
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4403
        }
4404
        iprot.readFieldEnd();
4405
      }
4406
      iprot.readStructEnd();
4407
      validate();
4408
    }
4409
 
4410
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4411
      validate();
4412
 
4413
      oprot.writeStructBegin(STRUCT_DESC);
4414
      if (this.couponCode != null) {
4415
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4416
        oprot.writeString(this.couponCode);
4417
        oprot.writeFieldEnd();
4418
      }
4419
      oprot.writeFieldStop();
4420
      oprot.writeStructEnd();
4421
    }
4422
 
4423
    @Override
4424
    public String toString() {
4425
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
4426
      boolean first = true;
4427
 
4428
      sb.append("couponCode:");
4429
      if (this.couponCode == null) {
4430
        sb.append("null");
4431
      } else {
4432
        sb.append(this.couponCode);
4433
      }
4434
      first = false;
4435
      sb.append(")");
4436
      return sb.toString();
4437
    }
4438
 
4439
    public void validate() throws org.apache.thrift.TException {
4440
      // check for required fields
4441
    }
4442
 
4443
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4444
      try {
4445
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4446
      } catch (org.apache.thrift.TException te) {
4447
        throw new java.io.IOException(te);
4448
      }
4449
    }
4450
 
4451
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4452
      try {
4453
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4454
      } catch (org.apache.thrift.TException te) {
4455
        throw new java.io.IOException(te);
4456
      }
4457
    }
4458
 
4459
  }
4460
 
4461
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
4462
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
4463
 
4464
    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);
4465
    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);
4466
 
4467
    private boolean success; // required
4468
    private PromotionException pex; // required
4469
 
4470
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4471
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4472
      SUCCESS((short)0, "success"),
4473
      PEX((short)1, "pex");
4474
 
4475
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4476
 
4477
      static {
4478
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4479
          byName.put(field.getFieldName(), field);
4480
        }
4481
      }
4482
 
4483
      /**
4484
       * Find the _Fields constant that matches fieldId, or null if its not found.
4485
       */
4486
      public static _Fields findByThriftId(int fieldId) {
4487
        switch(fieldId) {
4488
          case 0: // SUCCESS
4489
            return SUCCESS;
4490
          case 1: // PEX
4491
            return PEX;
4492
          default:
4493
            return null;
4494
        }
4495
      }
4496
 
4497
      /**
4498
       * Find the _Fields constant that matches fieldId, throwing an exception
4499
       * if it is not found.
4500
       */
4501
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4502
        _Fields fields = findByThriftId(fieldId);
4503
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4504
        return fields;
4505
      }
4506
 
4507
      /**
4508
       * Find the _Fields constant that matches name, or null if its not found.
4509
       */
4510
      public static _Fields findByName(String name) {
4511
        return byName.get(name);
4512
      }
4513
 
4514
      private final short _thriftId;
4515
      private final String _fieldName;
4516
 
4517
      _Fields(short thriftId, String fieldName) {
4518
        _thriftId = thriftId;
4519
        _fieldName = fieldName;
4520
      }
4521
 
4522
      public short getThriftFieldId() {
4523
        return _thriftId;
4524
      }
4525
 
4526
      public String getFieldName() {
4527
        return _fieldName;
4528
      }
4529
    }
4530
 
4531
    // isset id assignments
4532
    private static final int __SUCCESS_ISSET_ID = 0;
4533
    private BitSet __isset_bit_vector = new BitSet(1);
4534
 
4535
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4536
    static {
4537
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4538
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4539
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4540
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4541
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4542
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4543
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
4544
    }
4545
 
4546
    public isCodApplicable_result() {
4547
    }
4548
 
4549
    public isCodApplicable_result(
4550
      boolean success,
4551
      PromotionException pex)
4552
    {
4553
      this();
4554
      this.success = success;
4555
      setSuccessIsSet(true);
4556
      this.pex = pex;
4557
    }
4558
 
4559
    /**
4560
     * Performs a deep copy on <i>other</i>.
4561
     */
4562
    public isCodApplicable_result(isCodApplicable_result other) {
4563
      __isset_bit_vector.clear();
4564
      __isset_bit_vector.or(other.__isset_bit_vector);
4565
      this.success = other.success;
4566
      if (other.isSetPex()) {
4567
        this.pex = new PromotionException(other.pex);
4568
      }
4569
    }
4570
 
4571
    public isCodApplicable_result deepCopy() {
4572
      return new isCodApplicable_result(this);
4573
    }
4574
 
4575
    @Override
4576
    public void clear() {
4577
      setSuccessIsSet(false);
4578
      this.success = false;
4579
      this.pex = null;
4580
    }
4581
 
4582
    public boolean isSuccess() {
4583
      return this.success;
4584
    }
4585
 
4586
    public void setSuccess(boolean success) {
4587
      this.success = success;
4588
      setSuccessIsSet(true);
4589
    }
4590
 
4591
    public void unsetSuccess() {
4592
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4593
    }
4594
 
4595
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4596
    public boolean isSetSuccess() {
4597
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4598
    }
4599
 
4600
    public void setSuccessIsSet(boolean value) {
4601
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4602
    }
4603
 
4604
    public PromotionException getPex() {
4605
      return this.pex;
4606
    }
4607
 
4608
    public void setPex(PromotionException pex) {
4609
      this.pex = pex;
4610
    }
4611
 
4612
    public void unsetPex() {
4613
      this.pex = null;
4614
    }
4615
 
4616
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4617
    public boolean isSetPex() {
4618
      return this.pex != null;
4619
    }
4620
 
4621
    public void setPexIsSet(boolean value) {
4622
      if (!value) {
4623
        this.pex = null;
4624
      }
4625
    }
4626
 
4627
    public void setFieldValue(_Fields field, Object value) {
4628
      switch (field) {
4629
      case SUCCESS:
4630
        if (value == null) {
4631
          unsetSuccess();
4632
        } else {
4633
          setSuccess((Boolean)value);
4634
        }
4635
        break;
4636
 
4637
      case PEX:
4638
        if (value == null) {
4639
          unsetPex();
4640
        } else {
4641
          setPex((PromotionException)value);
4642
        }
4643
        break;
4644
 
4645
      }
4646
    }
4647
 
4648
    public Object getFieldValue(_Fields field) {
4649
      switch (field) {
4650
      case SUCCESS:
4651
        return Boolean.valueOf(isSuccess());
4652
 
4653
      case PEX:
4654
        return getPex();
4655
 
4656
      }
4657
      throw new IllegalStateException();
4658
    }
4659
 
4660
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4661
    public boolean isSet(_Fields field) {
4662
      if (field == null) {
4663
        throw new IllegalArgumentException();
4664
      }
4665
 
4666
      switch (field) {
4667
      case SUCCESS:
4668
        return isSetSuccess();
4669
      case PEX:
4670
        return isSetPex();
4671
      }
4672
      throw new IllegalStateException();
4673
    }
4674
 
4675
    @Override
4676
    public boolean equals(Object that) {
4677
      if (that == null)
4678
        return false;
4679
      if (that instanceof isCodApplicable_result)
4680
        return this.equals((isCodApplicable_result)that);
4681
      return false;
4682
    }
4683
 
4684
    public boolean equals(isCodApplicable_result that) {
4685
      if (that == null)
4686
        return false;
4687
 
4688
      boolean this_present_success = true;
4689
      boolean that_present_success = true;
4690
      if (this_present_success || that_present_success) {
4691
        if (!(this_present_success && that_present_success))
4692
          return false;
4693
        if (this.success != that.success)
4694
          return false;
4695
      }
4696
 
4697
      boolean this_present_pex = true && this.isSetPex();
4698
      boolean that_present_pex = true && that.isSetPex();
4699
      if (this_present_pex || that_present_pex) {
4700
        if (!(this_present_pex && that_present_pex))
4701
          return false;
4702
        if (!this.pex.equals(that.pex))
4703
          return false;
4704
      }
4705
 
4706
      return true;
4707
    }
4708
 
4709
    @Override
4710
    public int hashCode() {
4711
      return 0;
4712
    }
4713
 
4714
    public int compareTo(isCodApplicable_result other) {
4715
      if (!getClass().equals(other.getClass())) {
4716
        return getClass().getName().compareTo(other.getClass().getName());
4717
      }
4718
 
4719
      int lastComparison = 0;
4720
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
4721
 
4722
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4723
      if (lastComparison != 0) {
4724
        return lastComparison;
4725
      }
4726
      if (isSetSuccess()) {
4727
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4728
        if (lastComparison != 0) {
4729
          return lastComparison;
4730
        }
4731
      }
4732
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4733
      if (lastComparison != 0) {
4734
        return lastComparison;
4735
      }
4736
      if (isSetPex()) {
4737
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4738
        if (lastComparison != 0) {
4739
          return lastComparison;
4740
        }
4741
      }
4742
      return 0;
4743
    }
4744
 
4745
    public _Fields fieldForId(int fieldId) {
4746
      return _Fields.findByThriftId(fieldId);
4747
    }
4748
 
4749
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4750
      org.apache.thrift.protocol.TField field;
4751
      iprot.readStructBegin();
4752
      while (true)
4753
      {
4754
        field = iprot.readFieldBegin();
4755
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4756
          break;
4757
        }
4758
        switch (field.id) {
4759
          case 0: // SUCCESS
4760
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4761
              this.success = iprot.readBool();
4762
              setSuccessIsSet(true);
4763
            } else { 
4764
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4765
            }
4766
            break;
4767
          case 1: // PEX
4768
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4769
              this.pex = new PromotionException();
4770
              this.pex.read(iprot);
4771
            } else { 
4772
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4773
            }
4774
            break;
4775
          default:
4776
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4777
        }
4778
        iprot.readFieldEnd();
4779
      }
4780
      iprot.readStructEnd();
4781
      validate();
4782
    }
4783
 
4784
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4785
      oprot.writeStructBegin(STRUCT_DESC);
4786
 
4787
      if (this.isSetSuccess()) {
4788
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4789
        oprot.writeBool(this.success);
4790
        oprot.writeFieldEnd();
4791
      } else if (this.isSetPex()) {
4792
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4793
        this.pex.write(oprot);
4794
        oprot.writeFieldEnd();
4795
      }
4796
      oprot.writeFieldStop();
4797
      oprot.writeStructEnd();
4798
    }
4799
 
4800
    @Override
4801
    public String toString() {
4802
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
4803
      boolean first = true;
4804
 
4805
      sb.append("success:");
4806
      sb.append(this.success);
4807
      first = false;
4808
      if (!first) sb.append(", ");
4809
      sb.append("pex:");
4810
      if (this.pex == null) {
4811
        sb.append("null");
4812
      } else {
4813
        sb.append(this.pex);
4814
      }
4815
      first = false;
4816
      sb.append(")");
4817
      return sb.toString();
4818
    }
4819
 
4820
    public void validate() throws org.apache.thrift.TException {
4821
      // check for required fields
4822
    }
4823
 
4824
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4825
      try {
4826
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4827
      } catch (org.apache.thrift.TException te) {
4828
        throw new java.io.IOException(te);
4829
      }
4830
    }
4831
 
4832
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4833
      try {
4834
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4835
      } catch (org.apache.thrift.TException te) {
4836
        throw new java.io.IOException(te);
4837
      }
4838
    }
4839
 
4840
  }
4841
 
3430 rajveer 4842
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
4843
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 4844
 
4845
 
4846
 
4847
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4848
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4849
;
4850
 
4851
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4852
 
4853
      static {
4854
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4855
          byName.put(field.getFieldName(), field);
4856
        }
4857
      }
4858
 
4859
      /**
4860
       * Find the _Fields constant that matches fieldId, or null if its not found.
4861
       */
4862
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4863
        switch(fieldId) {
4864
          default:
4865
            return null;
4866
        }
1982 varun.gupt 4867
      }
4868
 
4869
      /**
4870
       * Find the _Fields constant that matches fieldId, throwing an exception
4871
       * if it is not found.
4872
       */
4873
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4874
        _Fields fields = findByThriftId(fieldId);
4875
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4876
        return fields;
4877
      }
4878
 
4879
      /**
4880
       * Find the _Fields constant that matches name, or null if its not found.
4881
       */
4882
      public static _Fields findByName(String name) {
4883
        return byName.get(name);
4884
      }
4885
 
4886
      private final short _thriftId;
4887
      private final String _fieldName;
4888
 
4889
      _Fields(short thriftId, String fieldName) {
4890
        _thriftId = thriftId;
4891
        _fieldName = fieldName;
4892
      }
4893
 
4894
      public short getThriftFieldId() {
4895
        return _thriftId;
4896
      }
4897
 
4898
      public String getFieldName() {
4899
        return _fieldName;
4900
      }
4901
    }
3430 rajveer 4902
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4903
    static {
3430 rajveer 4904
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4905
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4906
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 4907
    }
4908
 
4909
    public getAllPromotions_args() {
4910
    }
4911
 
4912
    /**
4913
     * Performs a deep copy on <i>other</i>.
4914
     */
4915
    public getAllPromotions_args(getAllPromotions_args other) {
4916
    }
4917
 
4918
    public getAllPromotions_args deepCopy() {
4919
      return new getAllPromotions_args(this);
4920
    }
4921
 
3430 rajveer 4922
    @Override
4923
    public void clear() {
1982 varun.gupt 4924
    }
4925
 
4926
    public void setFieldValue(_Fields field, Object value) {
4927
      switch (field) {
4928
      }
4929
    }
4930
 
4931
    public Object getFieldValue(_Fields field) {
4932
      switch (field) {
4933
      }
4934
      throw new IllegalStateException();
4935
    }
4936
 
3430 rajveer 4937
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4938
    public boolean isSet(_Fields field) {
4939
      if (field == null) {
4940
        throw new IllegalArgumentException();
4941
      }
1982 varun.gupt 4942
 
4943
      switch (field) {
4944
      }
4945
      throw new IllegalStateException();
4946
    }
4947
 
4948
    @Override
4949
    public boolean equals(Object that) {
4950
      if (that == null)
4951
        return false;
4952
      if (that instanceof getAllPromotions_args)
4953
        return this.equals((getAllPromotions_args)that);
4954
      return false;
4955
    }
4956
 
4957
    public boolean equals(getAllPromotions_args that) {
4958
      if (that == null)
4959
        return false;
4960
 
4961
      return true;
4962
    }
4963
 
4964
    @Override
4965
    public int hashCode() {
4966
      return 0;
4967
    }
4968
 
4969
    public int compareTo(getAllPromotions_args other) {
4970
      if (!getClass().equals(other.getClass())) {
4971
        return getClass().getName().compareTo(other.getClass().getName());
4972
      }
4973
 
4974
      int lastComparison = 0;
4975
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
4976
 
4977
      return 0;
4978
    }
4979
 
3430 rajveer 4980
    public _Fields fieldForId(int fieldId) {
4981
      return _Fields.findByThriftId(fieldId);
4982
    }
4983
 
4984
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4985
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4986
      iprot.readStructBegin();
4987
      while (true)
4988
      {
4989
        field = iprot.readFieldBegin();
3430 rajveer 4990
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4991
          break;
4992
        }
3430 rajveer 4993
        switch (field.id) {
4994
          default:
4995
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4996
        }
3430 rajveer 4997
        iprot.readFieldEnd();
1982 varun.gupt 4998
      }
4999
      iprot.readStructEnd();
5000
      validate();
5001
    }
5002
 
3430 rajveer 5003
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5004
      validate();
5005
 
5006
      oprot.writeStructBegin(STRUCT_DESC);
5007
      oprot.writeFieldStop();
5008
      oprot.writeStructEnd();
5009
    }
5010
 
5011
    @Override
5012
    public String toString() {
5013
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5014
      boolean first = true;
5015
 
5016
      sb.append(")");
5017
      return sb.toString();
5018
    }
5019
 
3430 rajveer 5020
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5021
      // check for required fields
5022
    }
5023
 
3430 rajveer 5024
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5025
      try {
5026
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5027
      } catch (org.apache.thrift.TException te) {
5028
        throw new java.io.IOException(te);
5029
      }
5030
    }
5031
 
5032
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5033
      try {
5034
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5035
      } catch (org.apache.thrift.TException te) {
5036
        throw new java.io.IOException(te);
5037
      }
5038
    }
5039
 
1982 varun.gupt 5040
  }
5041
 
3430 rajveer 5042
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5043
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5044
 
3430 rajveer 5045
    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);
5046
    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 5047
 
3430 rajveer 5048
    private List<Promotion> success; // required
5049
    private PromotionException pex; // required
1982 varun.gupt 5050
 
5051
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5052
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5053
      SUCCESS((short)0, "success"),
5054
      PEX((short)1, "pex");
5055
 
5056
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5057
 
5058
      static {
5059
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5060
          byName.put(field.getFieldName(), field);
5061
        }
5062
      }
5063
 
5064
      /**
5065
       * Find the _Fields constant that matches fieldId, or null if its not found.
5066
       */
5067
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5068
        switch(fieldId) {
5069
          case 0: // SUCCESS
5070
            return SUCCESS;
5071
          case 1: // PEX
5072
            return PEX;
5073
          default:
5074
            return null;
5075
        }
1982 varun.gupt 5076
      }
5077
 
5078
      /**
5079
       * Find the _Fields constant that matches fieldId, throwing an exception
5080
       * if it is not found.
5081
       */
5082
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5083
        _Fields fields = findByThriftId(fieldId);
5084
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5085
        return fields;
5086
      }
5087
 
5088
      /**
5089
       * Find the _Fields constant that matches name, or null if its not found.
5090
       */
5091
      public static _Fields findByName(String name) {
5092
        return byName.get(name);
5093
      }
5094
 
5095
      private final short _thriftId;
5096
      private final String _fieldName;
5097
 
5098
      _Fields(short thriftId, String fieldName) {
5099
        _thriftId = thriftId;
5100
        _fieldName = fieldName;
5101
      }
5102
 
5103
      public short getThriftFieldId() {
5104
        return _thriftId;
5105
      }
5106
 
5107
      public String getFieldName() {
5108
        return _fieldName;
5109
      }
5110
    }
5111
 
5112
    // isset id assignments
5113
 
3430 rajveer 5114
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5115
    static {
3430 rajveer 5116
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5117
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5118
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
5119
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
5120
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5121
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5122
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5123
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 5124
    }
5125
 
5126
    public getAllPromotions_result() {
5127
    }
5128
 
5129
    public getAllPromotions_result(
5130
      List<Promotion> success,
5131
      PromotionException pex)
5132
    {
5133
      this();
5134
      this.success = success;
5135
      this.pex = pex;
5136
    }
5137
 
5138
    /**
5139
     * Performs a deep copy on <i>other</i>.
5140
     */
5141
    public getAllPromotions_result(getAllPromotions_result other) {
5142
      if (other.isSetSuccess()) {
5143
        List<Promotion> __this__success = new ArrayList<Promotion>();
5144
        for (Promotion other_element : other.success) {
5145
          __this__success.add(new Promotion(other_element));
5146
        }
5147
        this.success = __this__success;
5148
      }
5149
      if (other.isSetPex()) {
5150
        this.pex = new PromotionException(other.pex);
5151
      }
5152
    }
5153
 
5154
    public getAllPromotions_result deepCopy() {
5155
      return new getAllPromotions_result(this);
5156
    }
5157
 
3430 rajveer 5158
    @Override
5159
    public void clear() {
5160
      this.success = null;
5161
      this.pex = null;
1982 varun.gupt 5162
    }
5163
 
5164
    public int getSuccessSize() {
5165
      return (this.success == null) ? 0 : this.success.size();
5166
    }
5167
 
5168
    public java.util.Iterator<Promotion> getSuccessIterator() {
5169
      return (this.success == null) ? null : this.success.iterator();
5170
    }
5171
 
5172
    public void addToSuccess(Promotion elem) {
5173
      if (this.success == null) {
5174
        this.success = new ArrayList<Promotion>();
5175
      }
5176
      this.success.add(elem);
5177
    }
5178
 
5179
    public List<Promotion> getSuccess() {
5180
      return this.success;
5181
    }
5182
 
3430 rajveer 5183
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 5184
      this.success = success;
5185
    }
5186
 
5187
    public void unsetSuccess() {
5188
      this.success = null;
5189
    }
5190
 
3430 rajveer 5191
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5192
    public boolean isSetSuccess() {
5193
      return this.success != null;
5194
    }
5195
 
5196
    public void setSuccessIsSet(boolean value) {
5197
      if (!value) {
5198
        this.success = null;
5199
      }
5200
    }
5201
 
5202
    public PromotionException getPex() {
5203
      return this.pex;
5204
    }
5205
 
3430 rajveer 5206
    public void setPex(PromotionException pex) {
1982 varun.gupt 5207
      this.pex = pex;
5208
    }
5209
 
5210
    public void unsetPex() {
5211
      this.pex = null;
5212
    }
5213
 
3430 rajveer 5214
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5215
    public boolean isSetPex() {
5216
      return this.pex != null;
5217
    }
5218
 
5219
    public void setPexIsSet(boolean value) {
5220
      if (!value) {
5221
        this.pex = null;
5222
      }
5223
    }
5224
 
5225
    public void setFieldValue(_Fields field, Object value) {
5226
      switch (field) {
5227
      case SUCCESS:
5228
        if (value == null) {
5229
          unsetSuccess();
5230
        } else {
5231
          setSuccess((List<Promotion>)value);
5232
        }
5233
        break;
5234
 
5235
      case PEX:
5236
        if (value == null) {
5237
          unsetPex();
5238
        } else {
5239
          setPex((PromotionException)value);
5240
        }
5241
        break;
5242
 
5243
      }
5244
    }
5245
 
5246
    public Object getFieldValue(_Fields field) {
5247
      switch (field) {
5248
      case SUCCESS:
5249
        return getSuccess();
5250
 
5251
      case PEX:
5252
        return getPex();
5253
 
5254
      }
5255
      throw new IllegalStateException();
5256
    }
5257
 
3430 rajveer 5258
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5259
    public boolean isSet(_Fields field) {
5260
      if (field == null) {
5261
        throw new IllegalArgumentException();
5262
      }
1982 varun.gupt 5263
 
5264
      switch (field) {
5265
      case SUCCESS:
5266
        return isSetSuccess();
5267
      case PEX:
5268
        return isSetPex();
5269
      }
5270
      throw new IllegalStateException();
5271
    }
5272
 
5273
    @Override
5274
    public boolean equals(Object that) {
5275
      if (that == null)
5276
        return false;
5277
      if (that instanceof getAllPromotions_result)
5278
        return this.equals((getAllPromotions_result)that);
5279
      return false;
5280
    }
5281
 
5282
    public boolean equals(getAllPromotions_result that) {
5283
      if (that == null)
5284
        return false;
5285
 
5286
      boolean this_present_success = true && this.isSetSuccess();
5287
      boolean that_present_success = true && that.isSetSuccess();
5288
      if (this_present_success || that_present_success) {
5289
        if (!(this_present_success && that_present_success))
5290
          return false;
5291
        if (!this.success.equals(that.success))
5292
          return false;
5293
      }
5294
 
5295
      boolean this_present_pex = true && this.isSetPex();
5296
      boolean that_present_pex = true && that.isSetPex();
5297
      if (this_present_pex || that_present_pex) {
5298
        if (!(this_present_pex && that_present_pex))
5299
          return false;
5300
        if (!this.pex.equals(that.pex))
5301
          return false;
5302
      }
5303
 
5304
      return true;
5305
    }
5306
 
5307
    @Override
5308
    public int hashCode() {
5309
      return 0;
5310
    }
5311
 
5312
    public int compareTo(getAllPromotions_result other) {
5313
      if (!getClass().equals(other.getClass())) {
5314
        return getClass().getName().compareTo(other.getClass().getName());
5315
      }
5316
 
5317
      int lastComparison = 0;
5318
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
5319
 
3430 rajveer 5320
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5321
      if (lastComparison != 0) {
5322
        return lastComparison;
5323
      }
3430 rajveer 5324
      if (isSetSuccess()) {
5325
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5326
        if (lastComparison != 0) {
5327
          return lastComparison;
5328
        }
1982 varun.gupt 5329
      }
3430 rajveer 5330
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5331
      if (lastComparison != 0) {
5332
        return lastComparison;
5333
      }
3430 rajveer 5334
      if (isSetPex()) {
5335
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5336
        if (lastComparison != 0) {
5337
          return lastComparison;
5338
        }
1982 varun.gupt 5339
      }
5340
      return 0;
5341
    }
5342
 
3430 rajveer 5343
    public _Fields fieldForId(int fieldId) {
5344
      return _Fields.findByThriftId(fieldId);
5345
    }
5346
 
5347
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5348
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5349
      iprot.readStructBegin();
5350
      while (true)
5351
      {
5352
        field = iprot.readFieldBegin();
3430 rajveer 5353
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5354
          break;
5355
        }
3430 rajveer 5356
        switch (field.id) {
5357
          case 0: // SUCCESS
5358
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
5359
              {
5327 rajveer 5360
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
5361
                this.success = new ArrayList<Promotion>(_list12.size);
5362
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 5363
                {
5327 rajveer 5364
                  Promotion _elem14; // required
5365
                  _elem14 = new Promotion();
5366
                  _elem14.read(iprot);
5367
                  this.success.add(_elem14);
1982 varun.gupt 5368
                }
3430 rajveer 5369
                iprot.readListEnd();
1982 varun.gupt 5370
              }
3430 rajveer 5371
            } else { 
5372
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5373
            }
5374
            break;
5375
          case 1: // PEX
5376
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5377
              this.pex = new PromotionException();
5378
              this.pex.read(iprot);
5379
            } else { 
5380
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5381
            }
5382
            break;
5383
          default:
5384
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5385
        }
3430 rajveer 5386
        iprot.readFieldEnd();
1982 varun.gupt 5387
      }
5388
      iprot.readStructEnd();
5389
      validate();
5390
    }
5391
 
3430 rajveer 5392
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5393
      oprot.writeStructBegin(STRUCT_DESC);
5394
 
5395
      if (this.isSetSuccess()) {
5396
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5397
        {
3430 rajveer 5398
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 5399
          for (Promotion _iter15 : this.success)
1982 varun.gupt 5400
          {
5327 rajveer 5401
            _iter15.write(oprot);
1982 varun.gupt 5402
          }
5403
          oprot.writeListEnd();
5404
        }
5405
        oprot.writeFieldEnd();
5406
      } else if (this.isSetPex()) {
5407
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5408
        this.pex.write(oprot);
5409
        oprot.writeFieldEnd();
5410
      }
5411
      oprot.writeFieldStop();
5412
      oprot.writeStructEnd();
5413
    }
5414
 
5415
    @Override
5416
    public String toString() {
5417
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
5418
      boolean first = true;
5419
 
5420
      sb.append("success:");
5421
      if (this.success == null) {
5422
        sb.append("null");
5423
      } else {
5424
        sb.append(this.success);
5425
      }
5426
      first = false;
5427
      if (!first) sb.append(", ");
5428
      sb.append("pex:");
5429
      if (this.pex == null) {
5430
        sb.append("null");
5431
      } else {
5432
        sb.append(this.pex);
5433
      }
5434
      first = false;
5435
      sb.append(")");
5436
      return sb.toString();
5437
    }
5438
 
3430 rajveer 5439
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5440
      // check for required fields
5441
    }
5442
 
3430 rajveer 5443
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5444
      try {
5445
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5446
      } catch (org.apache.thrift.TException te) {
5447
        throw new java.io.IOException(te);
5448
      }
5449
    }
5450
 
5451
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5452
      try {
5453
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5454
      } catch (org.apache.thrift.TException te) {
5455
        throw new java.io.IOException(te);
5456
      }
5457
    }
5458
 
1982 varun.gupt 5459
  }
5460
 
3430 rajveer 5461
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
5462
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 5463
 
3430 rajveer 5464
    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 5465
 
3430 rajveer 5466
    private long promotionId; // required
1982 varun.gupt 5467
 
5468
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5469
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5470
      PROMOTION_ID((short)1, "promotionId");
5471
 
5472
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5473
 
5474
      static {
5475
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5476
          byName.put(field.getFieldName(), field);
5477
        }
5478
      }
5479
 
5480
      /**
5481
       * Find the _Fields constant that matches fieldId, or null if its not found.
5482
       */
5483
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5484
        switch(fieldId) {
5485
          case 1: // PROMOTION_ID
5486
            return PROMOTION_ID;
5487
          default:
5488
            return null;
5489
        }
1982 varun.gupt 5490
      }
5491
 
5492
      /**
5493
       * Find the _Fields constant that matches fieldId, throwing an exception
5494
       * if it is not found.
5495
       */
5496
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5497
        _Fields fields = findByThriftId(fieldId);
5498
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5499
        return fields;
5500
      }
5501
 
5502
      /**
5503
       * Find the _Fields constant that matches name, or null if its not found.
5504
       */
5505
      public static _Fields findByName(String name) {
5506
        return byName.get(name);
5507
      }
5508
 
5509
      private final short _thriftId;
5510
      private final String _fieldName;
5511
 
5512
      _Fields(short thriftId, String fieldName) {
5513
        _thriftId = thriftId;
5514
        _fieldName = fieldName;
5515
      }
5516
 
5517
      public short getThriftFieldId() {
5518
        return _thriftId;
5519
      }
5520
 
5521
      public String getFieldName() {
5522
        return _fieldName;
5523
      }
5524
    }
5525
 
5526
    // isset id assignments
5527
    private static final int __PROMOTIONID_ISSET_ID = 0;
5528
    private BitSet __isset_bit_vector = new BitSet(1);
5529
 
3430 rajveer 5530
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5531
    static {
3430 rajveer 5532
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5533
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5534
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5535
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5536
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 5537
    }
5538
 
5539
    public getPromotionById_args() {
5540
    }
5541
 
5542
    public getPromotionById_args(
5543
      long promotionId)
5544
    {
5545
      this();
5546
      this.promotionId = promotionId;
5547
      setPromotionIdIsSet(true);
5548
    }
5549
 
5550
    /**
5551
     * Performs a deep copy on <i>other</i>.
5552
     */
5553
    public getPromotionById_args(getPromotionById_args other) {
5554
      __isset_bit_vector.clear();
5555
      __isset_bit_vector.or(other.__isset_bit_vector);
5556
      this.promotionId = other.promotionId;
5557
    }
5558
 
5559
    public getPromotionById_args deepCopy() {
5560
      return new getPromotionById_args(this);
5561
    }
5562
 
3430 rajveer 5563
    @Override
5564
    public void clear() {
5565
      setPromotionIdIsSet(false);
5566
      this.promotionId = 0;
1982 varun.gupt 5567
    }
5568
 
5569
    public long getPromotionId() {
5570
      return this.promotionId;
5571
    }
5572
 
3430 rajveer 5573
    public void setPromotionId(long promotionId) {
1982 varun.gupt 5574
      this.promotionId = promotionId;
5575
      setPromotionIdIsSet(true);
5576
    }
5577
 
5578
    public void unsetPromotionId() {
5579
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
5580
    }
5581
 
3430 rajveer 5582
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5583
    public boolean isSetPromotionId() {
5584
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
5585
    }
5586
 
5587
    public void setPromotionIdIsSet(boolean value) {
5588
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
5589
    }
5590
 
5591
    public void setFieldValue(_Fields field, Object value) {
5592
      switch (field) {
5593
      case PROMOTION_ID:
5594
        if (value == null) {
5595
          unsetPromotionId();
5596
        } else {
5597
          setPromotionId((Long)value);
5598
        }
5599
        break;
5600
 
5601
      }
5602
    }
5603
 
5604
    public Object getFieldValue(_Fields field) {
5605
      switch (field) {
5606
      case PROMOTION_ID:
3430 rajveer 5607
        return Long.valueOf(getPromotionId());
1982 varun.gupt 5608
 
5609
      }
5610
      throw new IllegalStateException();
5611
    }
5612
 
3430 rajveer 5613
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5614
    public boolean isSet(_Fields field) {
5615
      if (field == null) {
5616
        throw new IllegalArgumentException();
5617
      }
1982 varun.gupt 5618
 
5619
      switch (field) {
5620
      case PROMOTION_ID:
5621
        return isSetPromotionId();
5622
      }
5623
      throw new IllegalStateException();
5624
    }
5625
 
5626
    @Override
5627
    public boolean equals(Object that) {
5628
      if (that == null)
5629
        return false;
5630
      if (that instanceof getPromotionById_args)
5631
        return this.equals((getPromotionById_args)that);
5632
      return false;
5633
    }
5634
 
5635
    public boolean equals(getPromotionById_args that) {
5636
      if (that == null)
5637
        return false;
5638
 
5639
      boolean this_present_promotionId = true;
5640
      boolean that_present_promotionId = true;
5641
      if (this_present_promotionId || that_present_promotionId) {
5642
        if (!(this_present_promotionId && that_present_promotionId))
5643
          return false;
5644
        if (this.promotionId != that.promotionId)
5645
          return false;
5646
      }
5647
 
5648
      return true;
5649
    }
5650
 
5651
    @Override
5652
    public int hashCode() {
5653
      return 0;
5654
    }
5655
 
5656
    public int compareTo(getPromotionById_args other) {
5657
      if (!getClass().equals(other.getClass())) {
5658
        return getClass().getName().compareTo(other.getClass().getName());
5659
      }
5660
 
5661
      int lastComparison = 0;
5662
      getPromotionById_args typedOther = (getPromotionById_args)other;
5663
 
3430 rajveer 5664
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 5665
      if (lastComparison != 0) {
5666
        return lastComparison;
5667
      }
3430 rajveer 5668
      if (isSetPromotionId()) {
5669
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
5670
        if (lastComparison != 0) {
5671
          return lastComparison;
5672
        }
1982 varun.gupt 5673
      }
5674
      return 0;
5675
    }
5676
 
3430 rajveer 5677
    public _Fields fieldForId(int fieldId) {
5678
      return _Fields.findByThriftId(fieldId);
5679
    }
5680
 
5681
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5682
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5683
      iprot.readStructBegin();
5684
      while (true)
5685
      {
5686
        field = iprot.readFieldBegin();
3430 rajveer 5687
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5688
          break;
5689
        }
3430 rajveer 5690
        switch (field.id) {
5691
          case 1: // PROMOTION_ID
5692
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5693
              this.promotionId = iprot.readI64();
5694
              setPromotionIdIsSet(true);
5695
            } else { 
5696
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5697
            }
5698
            break;
5699
          default:
5700
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5701
        }
3430 rajveer 5702
        iprot.readFieldEnd();
1982 varun.gupt 5703
      }
5704
      iprot.readStructEnd();
5705
      validate();
5706
    }
5707
 
3430 rajveer 5708
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5709
      validate();
5710
 
5711
      oprot.writeStructBegin(STRUCT_DESC);
5712
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
5713
      oprot.writeI64(this.promotionId);
5714
      oprot.writeFieldEnd();
5715
      oprot.writeFieldStop();
5716
      oprot.writeStructEnd();
5717
    }
5718
 
5719
    @Override
5720
    public String toString() {
5721
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
5722
      boolean first = true;
5723
 
5724
      sb.append("promotionId:");
5725
      sb.append(this.promotionId);
5726
      first = false;
5727
      sb.append(")");
5728
      return sb.toString();
5729
    }
5730
 
3430 rajveer 5731
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5732
      // check for required fields
5733
    }
5734
 
3430 rajveer 5735
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5736
      try {
5737
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5738
      } catch (org.apache.thrift.TException te) {
5739
        throw new java.io.IOException(te);
5740
      }
5741
    }
5742
 
5743
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5744
      try {
5745
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5746
        __isset_bit_vector = new BitSet(1);
5747
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5748
      } catch (org.apache.thrift.TException te) {
5749
        throw new java.io.IOException(te);
5750
      }
5751
    }
5752
 
1982 varun.gupt 5753
  }
5754
 
3430 rajveer 5755
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
5756
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 5757
 
3430 rajveer 5758
    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);
5759
    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 5760
 
3430 rajveer 5761
    private Promotion success; // required
5762
    private PromotionException pex; // required
1982 varun.gupt 5763
 
5764
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5765
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5766
      SUCCESS((short)0, "success"),
5767
      PEX((short)1, "pex");
5768
 
5769
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5770
 
5771
      static {
5772
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5773
          byName.put(field.getFieldName(), field);
5774
        }
5775
      }
5776
 
5777
      /**
5778
       * Find the _Fields constant that matches fieldId, or null if its not found.
5779
       */
5780
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5781
        switch(fieldId) {
5782
          case 0: // SUCCESS
5783
            return SUCCESS;
5784
          case 1: // PEX
5785
            return PEX;
5786
          default:
5787
            return null;
5788
        }
1982 varun.gupt 5789
      }
5790
 
5791
      /**
5792
       * Find the _Fields constant that matches fieldId, throwing an exception
5793
       * if it is not found.
5794
       */
5795
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5796
        _Fields fields = findByThriftId(fieldId);
5797
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5798
        return fields;
5799
      }
5800
 
5801
      /**
5802
       * Find the _Fields constant that matches name, or null if its not found.
5803
       */
5804
      public static _Fields findByName(String name) {
5805
        return byName.get(name);
5806
      }
5807
 
5808
      private final short _thriftId;
5809
      private final String _fieldName;
5810
 
5811
      _Fields(short thriftId, String fieldName) {
5812
        _thriftId = thriftId;
5813
        _fieldName = fieldName;
5814
      }
5815
 
5816
      public short getThriftFieldId() {
5817
        return _thriftId;
5818
      }
5819
 
5820
      public String getFieldName() {
5821
        return _fieldName;
5822
      }
5823
    }
5824
 
5825
    // isset id assignments
5826
 
3430 rajveer 5827
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5828
    static {
3430 rajveer 5829
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5830
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5831
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
5832
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5833
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5834
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5835
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 5836
    }
5837
 
5838
    public getPromotionById_result() {
5839
    }
5840
 
5841
    public getPromotionById_result(
5842
      Promotion success,
5843
      PromotionException pex)
5844
    {
5845
      this();
5846
      this.success = success;
5847
      this.pex = pex;
5848
    }
5849
 
5850
    /**
5851
     * Performs a deep copy on <i>other</i>.
5852
     */
5853
    public getPromotionById_result(getPromotionById_result other) {
5854
      if (other.isSetSuccess()) {
5855
        this.success = new Promotion(other.success);
5856
      }
5857
      if (other.isSetPex()) {
5858
        this.pex = new PromotionException(other.pex);
5859
      }
5860
    }
5861
 
5862
    public getPromotionById_result deepCopy() {
5863
      return new getPromotionById_result(this);
5864
    }
5865
 
3430 rajveer 5866
    @Override
5867
    public void clear() {
5868
      this.success = null;
5869
      this.pex = null;
1982 varun.gupt 5870
    }
5871
 
5872
    public Promotion getSuccess() {
5873
      return this.success;
5874
    }
5875
 
3430 rajveer 5876
    public void setSuccess(Promotion success) {
1982 varun.gupt 5877
      this.success = success;
5878
    }
5879
 
5880
    public void unsetSuccess() {
5881
      this.success = null;
5882
    }
5883
 
3430 rajveer 5884
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5885
    public boolean isSetSuccess() {
5886
      return this.success != null;
5887
    }
5888
 
5889
    public void setSuccessIsSet(boolean value) {
5890
      if (!value) {
5891
        this.success = null;
5892
      }
5893
    }
5894
 
5895
    public PromotionException getPex() {
5896
      return this.pex;
5897
    }
5898
 
3430 rajveer 5899
    public void setPex(PromotionException pex) {
1982 varun.gupt 5900
      this.pex = pex;
5901
    }
5902
 
5903
    public void unsetPex() {
5904
      this.pex = null;
5905
    }
5906
 
3430 rajveer 5907
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5908
    public boolean isSetPex() {
5909
      return this.pex != null;
5910
    }
5911
 
5912
    public void setPexIsSet(boolean value) {
5913
      if (!value) {
5914
        this.pex = null;
5915
      }
5916
    }
5917
 
5918
    public void setFieldValue(_Fields field, Object value) {
5919
      switch (field) {
5920
      case SUCCESS:
5921
        if (value == null) {
5922
          unsetSuccess();
5923
        } else {
5924
          setSuccess((Promotion)value);
5925
        }
5926
        break;
5927
 
5928
      case PEX:
5929
        if (value == null) {
5930
          unsetPex();
5931
        } else {
5932
          setPex((PromotionException)value);
5933
        }
5934
        break;
5935
 
5936
      }
5937
    }
5938
 
5939
    public Object getFieldValue(_Fields field) {
5940
      switch (field) {
5941
      case SUCCESS:
5942
        return getSuccess();
5943
 
5944
      case PEX:
5945
        return getPex();
5946
 
5947
      }
5948
      throw new IllegalStateException();
5949
    }
5950
 
3430 rajveer 5951
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5952
    public boolean isSet(_Fields field) {
5953
      if (field == null) {
5954
        throw new IllegalArgumentException();
5955
      }
1982 varun.gupt 5956
 
5957
      switch (field) {
5958
      case SUCCESS:
5959
        return isSetSuccess();
5960
      case PEX:
5961
        return isSetPex();
5962
      }
5963
      throw new IllegalStateException();
5964
    }
5965
 
5966
    @Override
5967
    public boolean equals(Object that) {
5968
      if (that == null)
5969
        return false;
5970
      if (that instanceof getPromotionById_result)
5971
        return this.equals((getPromotionById_result)that);
5972
      return false;
5973
    }
5974
 
5975
    public boolean equals(getPromotionById_result that) {
5976
      if (that == null)
5977
        return false;
5978
 
5979
      boolean this_present_success = true && this.isSetSuccess();
5980
      boolean that_present_success = true && that.isSetSuccess();
5981
      if (this_present_success || that_present_success) {
5982
        if (!(this_present_success && that_present_success))
5983
          return false;
5984
        if (!this.success.equals(that.success))
5985
          return false;
5986
      }
5987
 
5988
      boolean this_present_pex = true && this.isSetPex();
5989
      boolean that_present_pex = true && that.isSetPex();
5990
      if (this_present_pex || that_present_pex) {
5991
        if (!(this_present_pex && that_present_pex))
5992
          return false;
5993
        if (!this.pex.equals(that.pex))
5994
          return false;
5995
      }
5996
 
5997
      return true;
5998
    }
5999
 
6000
    @Override
6001
    public int hashCode() {
6002
      return 0;
6003
    }
6004
 
6005
    public int compareTo(getPromotionById_result other) {
6006
      if (!getClass().equals(other.getClass())) {
6007
        return getClass().getName().compareTo(other.getClass().getName());
6008
      }
6009
 
6010
      int lastComparison = 0;
6011
      getPromotionById_result typedOther = (getPromotionById_result)other;
6012
 
3430 rajveer 6013
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6014
      if (lastComparison != 0) {
6015
        return lastComparison;
6016
      }
3430 rajveer 6017
      if (isSetSuccess()) {
6018
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6019
        if (lastComparison != 0) {
6020
          return lastComparison;
6021
        }
1982 varun.gupt 6022
      }
3430 rajveer 6023
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6024
      if (lastComparison != 0) {
6025
        return lastComparison;
6026
      }
3430 rajveer 6027
      if (isSetPex()) {
6028
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6029
        if (lastComparison != 0) {
6030
          return lastComparison;
6031
        }
1982 varun.gupt 6032
      }
6033
      return 0;
6034
    }
6035
 
3430 rajveer 6036
    public _Fields fieldForId(int fieldId) {
6037
      return _Fields.findByThriftId(fieldId);
6038
    }
6039
 
6040
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6041
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6042
      iprot.readStructBegin();
6043
      while (true)
6044
      {
6045
        field = iprot.readFieldBegin();
3430 rajveer 6046
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6047
          break;
6048
        }
3430 rajveer 6049
        switch (field.id) {
6050
          case 0: // SUCCESS
6051
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6052
              this.success = new Promotion();
6053
              this.success.read(iprot);
6054
            } else { 
6055
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6056
            }
6057
            break;
6058
          case 1: // PEX
6059
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6060
              this.pex = new PromotionException();
6061
              this.pex.read(iprot);
6062
            } else { 
6063
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6064
            }
6065
            break;
6066
          default:
6067
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6068
        }
3430 rajveer 6069
        iprot.readFieldEnd();
1982 varun.gupt 6070
      }
6071
      iprot.readStructEnd();
6072
      validate();
6073
    }
6074
 
3430 rajveer 6075
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6076
      oprot.writeStructBegin(STRUCT_DESC);
6077
 
6078
      if (this.isSetSuccess()) {
6079
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6080
        this.success.write(oprot);
6081
        oprot.writeFieldEnd();
6082
      } else if (this.isSetPex()) {
6083
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6084
        this.pex.write(oprot);
6085
        oprot.writeFieldEnd();
6086
      }
6087
      oprot.writeFieldStop();
6088
      oprot.writeStructEnd();
6089
    }
6090
 
6091
    @Override
6092
    public String toString() {
6093
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
6094
      boolean first = true;
6095
 
6096
      sb.append("success:");
6097
      if (this.success == null) {
6098
        sb.append("null");
6099
      } else {
6100
        sb.append(this.success);
6101
      }
6102
      first = false;
6103
      if (!first) sb.append(", ");
6104
      sb.append("pex:");
6105
      if (this.pex == null) {
6106
        sb.append("null");
6107
      } else {
6108
        sb.append(this.pex);
6109
      }
6110
      first = false;
6111
      sb.append(")");
6112
      return sb.toString();
6113
    }
6114
 
3430 rajveer 6115
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6116
      // check for required fields
6117
    }
6118
 
3430 rajveer 6119
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6120
      try {
6121
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6122
      } catch (org.apache.thrift.TException te) {
6123
        throw new java.io.IOException(te);
6124
      }
6125
    }
6126
 
6127
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6128
      try {
6129
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6130
      } catch (org.apache.thrift.TException te) {
6131
        throw new java.io.IOException(te);
6132
      }
6133
    }
6134
 
1982 varun.gupt 6135
  }
6136
 
3430 rajveer 6137
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
6138
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 6139
 
3430 rajveer 6140
    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);
6141
    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 6142
 
3430 rajveer 6143
    private long promotionId; // required
6144
    private String couponCode; // required
1982 varun.gupt 6145
 
6146
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6147
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6148
      PROMOTION_ID((short)1, "promotionId"),
6149
      COUPON_CODE((short)2, "couponCode");
6150
 
6151
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6152
 
6153
      static {
6154
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6155
          byName.put(field.getFieldName(), field);
6156
        }
6157
      }
6158
 
6159
      /**
6160
       * Find the _Fields constant that matches fieldId, or null if its not found.
6161
       */
6162
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6163
        switch(fieldId) {
6164
          case 1: // PROMOTION_ID
6165
            return PROMOTION_ID;
6166
          case 2: // COUPON_CODE
6167
            return COUPON_CODE;
6168
          default:
6169
            return null;
6170
        }
1982 varun.gupt 6171
      }
6172
 
6173
      /**
6174
       * Find the _Fields constant that matches fieldId, throwing an exception
6175
       * if it is not found.
6176
       */
6177
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6178
        _Fields fields = findByThriftId(fieldId);
6179
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6180
        return fields;
6181
      }
6182
 
6183
      /**
6184
       * Find the _Fields constant that matches name, or null if its not found.
6185
       */
6186
      public static _Fields findByName(String name) {
6187
        return byName.get(name);
6188
      }
6189
 
6190
      private final short _thriftId;
6191
      private final String _fieldName;
6192
 
6193
      _Fields(short thriftId, String fieldName) {
6194
        _thriftId = thriftId;
6195
        _fieldName = fieldName;
6196
      }
6197
 
6198
      public short getThriftFieldId() {
6199
        return _thriftId;
6200
      }
6201
 
6202
      public String getFieldName() {
6203
        return _fieldName;
6204
      }
6205
    }
6206
 
6207
    // isset id assignments
6208
    private static final int __PROMOTIONID_ISSET_ID = 0;
6209
    private BitSet __isset_bit_vector = new BitSet(1);
6210
 
3430 rajveer 6211
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6212
    static {
3430 rajveer 6213
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6214
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6215
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6216
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6217
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6218
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6219
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 6220
    }
6221
 
6222
    public generateCouponsForPromotion_args() {
6223
    }
6224
 
6225
    public generateCouponsForPromotion_args(
6226
      long promotionId,
6227
      String couponCode)
6228
    {
6229
      this();
6230
      this.promotionId = promotionId;
6231
      setPromotionIdIsSet(true);
6232
      this.couponCode = couponCode;
6233
    }
6234
 
6235
    /**
6236
     * Performs a deep copy on <i>other</i>.
6237
     */
6238
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
6239
      __isset_bit_vector.clear();
6240
      __isset_bit_vector.or(other.__isset_bit_vector);
6241
      this.promotionId = other.promotionId;
6242
      if (other.isSetCouponCode()) {
6243
        this.couponCode = other.couponCode;
6244
      }
6245
    }
6246
 
6247
    public generateCouponsForPromotion_args deepCopy() {
6248
      return new generateCouponsForPromotion_args(this);
6249
    }
6250
 
3430 rajveer 6251
    @Override
6252
    public void clear() {
6253
      setPromotionIdIsSet(false);
6254
      this.promotionId = 0;
6255
      this.couponCode = null;
1982 varun.gupt 6256
    }
6257
 
6258
    public long getPromotionId() {
6259
      return this.promotionId;
6260
    }
6261
 
3430 rajveer 6262
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6263
      this.promotionId = promotionId;
6264
      setPromotionIdIsSet(true);
6265
    }
6266
 
6267
    public void unsetPromotionId() {
6268
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6269
    }
6270
 
3430 rajveer 6271
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6272
    public boolean isSetPromotionId() {
6273
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6274
    }
6275
 
6276
    public void setPromotionIdIsSet(boolean value) {
6277
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6278
    }
6279
 
6280
    public String getCouponCode() {
6281
      return this.couponCode;
6282
    }
6283
 
3430 rajveer 6284
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6285
      this.couponCode = couponCode;
6286
    }
6287
 
6288
    public void unsetCouponCode() {
6289
      this.couponCode = null;
6290
    }
6291
 
3430 rajveer 6292
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6293
    public boolean isSetCouponCode() {
6294
      return this.couponCode != null;
6295
    }
6296
 
6297
    public void setCouponCodeIsSet(boolean value) {
6298
      if (!value) {
6299
        this.couponCode = null;
6300
      }
6301
    }
6302
 
6303
    public void setFieldValue(_Fields field, Object value) {
6304
      switch (field) {
6305
      case PROMOTION_ID:
6306
        if (value == null) {
6307
          unsetPromotionId();
6308
        } else {
6309
          setPromotionId((Long)value);
6310
        }
6311
        break;
6312
 
6313
      case COUPON_CODE:
6314
        if (value == null) {
6315
          unsetCouponCode();
6316
        } else {
6317
          setCouponCode((String)value);
6318
        }
6319
        break;
6320
 
6321
      }
6322
    }
6323
 
6324
    public Object getFieldValue(_Fields field) {
6325
      switch (field) {
6326
      case PROMOTION_ID:
3430 rajveer 6327
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6328
 
6329
      case COUPON_CODE:
6330
        return getCouponCode();
6331
 
6332
      }
6333
      throw new IllegalStateException();
6334
    }
6335
 
3430 rajveer 6336
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6337
    public boolean isSet(_Fields field) {
6338
      if (field == null) {
6339
        throw new IllegalArgumentException();
6340
      }
1982 varun.gupt 6341
 
6342
      switch (field) {
6343
      case PROMOTION_ID:
6344
        return isSetPromotionId();
6345
      case COUPON_CODE:
6346
        return isSetCouponCode();
6347
      }
6348
      throw new IllegalStateException();
6349
    }
6350
 
6351
    @Override
6352
    public boolean equals(Object that) {
6353
      if (that == null)
6354
        return false;
6355
      if (that instanceof generateCouponsForPromotion_args)
6356
        return this.equals((generateCouponsForPromotion_args)that);
6357
      return false;
6358
    }
6359
 
6360
    public boolean equals(generateCouponsForPromotion_args that) {
6361
      if (that == null)
6362
        return false;
6363
 
6364
      boolean this_present_promotionId = true;
6365
      boolean that_present_promotionId = true;
6366
      if (this_present_promotionId || that_present_promotionId) {
6367
        if (!(this_present_promotionId && that_present_promotionId))
6368
          return false;
6369
        if (this.promotionId != that.promotionId)
6370
          return false;
6371
      }
6372
 
6373
      boolean this_present_couponCode = true && this.isSetCouponCode();
6374
      boolean that_present_couponCode = true && that.isSetCouponCode();
6375
      if (this_present_couponCode || that_present_couponCode) {
6376
        if (!(this_present_couponCode && that_present_couponCode))
6377
          return false;
6378
        if (!this.couponCode.equals(that.couponCode))
6379
          return false;
6380
      }
6381
 
6382
      return true;
6383
    }
6384
 
6385
    @Override
6386
    public int hashCode() {
6387
      return 0;
6388
    }
6389
 
6390
    public int compareTo(generateCouponsForPromotion_args other) {
6391
      if (!getClass().equals(other.getClass())) {
6392
        return getClass().getName().compareTo(other.getClass().getName());
6393
      }
6394
 
6395
      int lastComparison = 0;
6396
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
6397
 
3430 rajveer 6398
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6399
      if (lastComparison != 0) {
6400
        return lastComparison;
6401
      }
3430 rajveer 6402
      if (isSetPromotionId()) {
6403
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6404
        if (lastComparison != 0) {
6405
          return lastComparison;
6406
        }
1982 varun.gupt 6407
      }
3430 rajveer 6408
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6409
      if (lastComparison != 0) {
6410
        return lastComparison;
6411
      }
3430 rajveer 6412
      if (isSetCouponCode()) {
6413
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6414
        if (lastComparison != 0) {
6415
          return lastComparison;
6416
        }
1982 varun.gupt 6417
      }
6418
      return 0;
6419
    }
6420
 
3430 rajveer 6421
    public _Fields fieldForId(int fieldId) {
6422
      return _Fields.findByThriftId(fieldId);
6423
    }
6424
 
6425
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6426
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6427
      iprot.readStructBegin();
6428
      while (true)
6429
      {
6430
        field = iprot.readFieldBegin();
3430 rajveer 6431
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6432
          break;
6433
        }
3430 rajveer 6434
        switch (field.id) {
6435
          case 1: // PROMOTION_ID
6436
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6437
              this.promotionId = iprot.readI64();
6438
              setPromotionIdIsSet(true);
6439
            } else { 
6440
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6441
            }
6442
            break;
6443
          case 2: // COUPON_CODE
6444
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6445
              this.couponCode = iprot.readString();
6446
            } else { 
6447
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6448
            }
6449
            break;
6450
          default:
6451
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6452
        }
3430 rajveer 6453
        iprot.readFieldEnd();
1982 varun.gupt 6454
      }
6455
      iprot.readStructEnd();
6456
      validate();
6457
    }
6458
 
3430 rajveer 6459
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6460
      validate();
6461
 
6462
      oprot.writeStructBegin(STRUCT_DESC);
6463
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6464
      oprot.writeI64(this.promotionId);
6465
      oprot.writeFieldEnd();
6466
      if (this.couponCode != null) {
6467
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6468
        oprot.writeString(this.couponCode);
6469
        oprot.writeFieldEnd();
6470
      }
6471
      oprot.writeFieldStop();
6472
      oprot.writeStructEnd();
6473
    }
6474
 
6475
    @Override
6476
    public String toString() {
6477
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
6478
      boolean first = true;
6479
 
6480
      sb.append("promotionId:");
6481
      sb.append(this.promotionId);
6482
      first = false;
6483
      if (!first) sb.append(", ");
6484
      sb.append("couponCode:");
6485
      if (this.couponCode == null) {
6486
        sb.append("null");
6487
      } else {
6488
        sb.append(this.couponCode);
6489
      }
6490
      first = false;
6491
      sb.append(")");
6492
      return sb.toString();
6493
    }
6494
 
3430 rajveer 6495
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6496
      // check for required fields
6497
    }
6498
 
3430 rajveer 6499
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6500
      try {
6501
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6502
      } catch (org.apache.thrift.TException te) {
6503
        throw new java.io.IOException(te);
6504
      }
6505
    }
6506
 
6507
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6508
      try {
6509
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6510
        __isset_bit_vector = new BitSet(1);
6511
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6512
      } catch (org.apache.thrift.TException te) {
6513
        throw new java.io.IOException(te);
6514
      }
6515
    }
6516
 
1982 varun.gupt 6517
  }
6518
 
3430 rajveer 6519
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
6520
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 6521
 
3430 rajveer 6522
    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 6523
 
3430 rajveer 6524
    private PromotionException pex; // required
1982 varun.gupt 6525
 
6526
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6527
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6528
      PEX((short)1, "pex");
6529
 
6530
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6531
 
6532
      static {
6533
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6534
          byName.put(field.getFieldName(), field);
6535
        }
6536
      }
6537
 
6538
      /**
6539
       * Find the _Fields constant that matches fieldId, or null if its not found.
6540
       */
6541
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6542
        switch(fieldId) {
6543
          case 1: // PEX
6544
            return PEX;
6545
          default:
6546
            return null;
6547
        }
1982 varun.gupt 6548
      }
6549
 
6550
      /**
6551
       * Find the _Fields constant that matches fieldId, throwing an exception
6552
       * if it is not found.
6553
       */
6554
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6555
        _Fields fields = findByThriftId(fieldId);
6556
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6557
        return fields;
6558
      }
6559
 
6560
      /**
6561
       * Find the _Fields constant that matches name, or null if its not found.
6562
       */
6563
      public static _Fields findByName(String name) {
6564
        return byName.get(name);
6565
      }
6566
 
6567
      private final short _thriftId;
6568
      private final String _fieldName;
6569
 
6570
      _Fields(short thriftId, String fieldName) {
6571
        _thriftId = thriftId;
6572
        _fieldName = fieldName;
6573
      }
6574
 
6575
      public short getThriftFieldId() {
6576
        return _thriftId;
6577
      }
6578
 
6579
      public String getFieldName() {
6580
        return _fieldName;
6581
      }
6582
    }
6583
 
6584
    // isset id assignments
6585
 
3430 rajveer 6586
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6587
    static {
3430 rajveer 6588
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6589
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6590
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6591
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6592
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 6593
    }
6594
 
6595
    public generateCouponsForPromotion_result() {
6596
    }
6597
 
6598
    public generateCouponsForPromotion_result(
6599
      PromotionException pex)
6600
    {
6601
      this();
6602
      this.pex = pex;
6603
    }
6604
 
6605
    /**
6606
     * Performs a deep copy on <i>other</i>.
6607
     */
6608
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
6609
      if (other.isSetPex()) {
6610
        this.pex = new PromotionException(other.pex);
6611
      }
6612
    }
6613
 
6614
    public generateCouponsForPromotion_result deepCopy() {
6615
      return new generateCouponsForPromotion_result(this);
6616
    }
6617
 
3430 rajveer 6618
    @Override
6619
    public void clear() {
6620
      this.pex = null;
1982 varun.gupt 6621
    }
6622
 
6623
    public PromotionException getPex() {
6624
      return this.pex;
6625
    }
6626
 
3430 rajveer 6627
    public void setPex(PromotionException pex) {
1982 varun.gupt 6628
      this.pex = pex;
6629
    }
6630
 
6631
    public void unsetPex() {
6632
      this.pex = null;
6633
    }
6634
 
3430 rajveer 6635
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6636
    public boolean isSetPex() {
6637
      return this.pex != null;
6638
    }
6639
 
6640
    public void setPexIsSet(boolean value) {
6641
      if (!value) {
6642
        this.pex = null;
6643
      }
6644
    }
6645
 
6646
    public void setFieldValue(_Fields field, Object value) {
6647
      switch (field) {
6648
      case PEX:
6649
        if (value == null) {
6650
          unsetPex();
6651
        } else {
6652
          setPex((PromotionException)value);
6653
        }
6654
        break;
6655
 
6656
      }
6657
    }
6658
 
6659
    public Object getFieldValue(_Fields field) {
6660
      switch (field) {
6661
      case PEX:
6662
        return getPex();
6663
 
6664
      }
6665
      throw new IllegalStateException();
6666
    }
6667
 
3430 rajveer 6668
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6669
    public boolean isSet(_Fields field) {
6670
      if (field == null) {
6671
        throw new IllegalArgumentException();
6672
      }
1982 varun.gupt 6673
 
6674
      switch (field) {
6675
      case PEX:
6676
        return isSetPex();
6677
      }
6678
      throw new IllegalStateException();
6679
    }
6680
 
6681
    @Override
6682
    public boolean equals(Object that) {
6683
      if (that == null)
6684
        return false;
6685
      if (that instanceof generateCouponsForPromotion_result)
6686
        return this.equals((generateCouponsForPromotion_result)that);
6687
      return false;
6688
    }
6689
 
6690
    public boolean equals(generateCouponsForPromotion_result that) {
6691
      if (that == null)
6692
        return false;
6693
 
6694
      boolean this_present_pex = true && this.isSetPex();
6695
      boolean that_present_pex = true && that.isSetPex();
6696
      if (this_present_pex || that_present_pex) {
6697
        if (!(this_present_pex && that_present_pex))
6698
          return false;
6699
        if (!this.pex.equals(that.pex))
6700
          return false;
6701
      }
6702
 
6703
      return true;
6704
    }
6705
 
6706
    @Override
6707
    public int hashCode() {
6708
      return 0;
6709
    }
6710
 
6711
    public int compareTo(generateCouponsForPromotion_result other) {
6712
      if (!getClass().equals(other.getClass())) {
6713
        return getClass().getName().compareTo(other.getClass().getName());
6714
      }
6715
 
6716
      int lastComparison = 0;
6717
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
6718
 
3430 rajveer 6719
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6720
      if (lastComparison != 0) {
6721
        return lastComparison;
6722
      }
3430 rajveer 6723
      if (isSetPex()) {
6724
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6725
        if (lastComparison != 0) {
6726
          return lastComparison;
6727
        }
1982 varun.gupt 6728
      }
6729
      return 0;
6730
    }
6731
 
3430 rajveer 6732
    public _Fields fieldForId(int fieldId) {
6733
      return _Fields.findByThriftId(fieldId);
6734
    }
6735
 
6736
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6737
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6738
      iprot.readStructBegin();
6739
      while (true)
6740
      {
6741
        field = iprot.readFieldBegin();
3430 rajveer 6742
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6743
          break;
6744
        }
3430 rajveer 6745
        switch (field.id) {
6746
          case 1: // PEX
6747
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6748
              this.pex = new PromotionException();
6749
              this.pex.read(iprot);
6750
            } else { 
6751
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6752
            }
6753
            break;
6754
          default:
6755
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6756
        }
3430 rajveer 6757
        iprot.readFieldEnd();
1982 varun.gupt 6758
      }
6759
      iprot.readStructEnd();
6760
      validate();
6761
    }
6762
 
3430 rajveer 6763
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6764
      oprot.writeStructBegin(STRUCT_DESC);
6765
 
6766
      if (this.isSetPex()) {
6767
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6768
        this.pex.write(oprot);
6769
        oprot.writeFieldEnd();
6770
      }
6771
      oprot.writeFieldStop();
6772
      oprot.writeStructEnd();
6773
    }
6774
 
6775
    @Override
6776
    public String toString() {
6777
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
6778
      boolean first = true;
6779
 
6780
      sb.append("pex:");
6781
      if (this.pex == null) {
6782
        sb.append("null");
6783
      } else {
6784
        sb.append(this.pex);
6785
      }
6786
      first = false;
6787
      sb.append(")");
6788
      return sb.toString();
6789
    }
6790
 
3430 rajveer 6791
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6792
      // check for required fields
6793
    }
6794
 
3430 rajveer 6795
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6796
      try {
6797
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6798
      } catch (org.apache.thrift.TException te) {
6799
        throw new java.io.IOException(te);
6800
      }
6801
    }
6802
 
6803
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6804
      try {
6805
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6806
      } catch (org.apache.thrift.TException te) {
6807
        throw new java.io.IOException(te);
6808
      }
6809
    }
6810
 
1982 varun.gupt 6811
  }
6812
 
3430 rajveer 6813
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
6814
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 6815
 
3430 rajveer 6816
    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);
6817
    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 6818
 
3430 rajveer 6819
    private String couponCode; // required
6820
    private long cartId; // required
1982 varun.gupt 6821
 
6822
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6823
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6824
      COUPON_CODE((short)1, "couponCode"),
6825
      CART_ID((short)2, "cartId");
6826
 
6827
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6828
 
6829
      static {
6830
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6831
          byName.put(field.getFieldName(), field);
6832
        }
6833
      }
6834
 
6835
      /**
6836
       * Find the _Fields constant that matches fieldId, or null if its not found.
6837
       */
6838
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6839
        switch(fieldId) {
6840
          case 1: // COUPON_CODE
6841
            return COUPON_CODE;
6842
          case 2: // CART_ID
6843
            return CART_ID;
6844
          default:
6845
            return null;
6846
        }
1982 varun.gupt 6847
      }
6848
 
6849
      /**
6850
       * Find the _Fields constant that matches fieldId, throwing an exception
6851
       * if it is not found.
6852
       */
6853
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6854
        _Fields fields = findByThriftId(fieldId);
6855
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6856
        return fields;
6857
      }
6858
 
6859
      /**
6860
       * Find the _Fields constant that matches name, or null if its not found.
6861
       */
6862
      public static _Fields findByName(String name) {
6863
        return byName.get(name);
6864
      }
6865
 
6866
      private final short _thriftId;
6867
      private final String _fieldName;
6868
 
6869
      _Fields(short thriftId, String fieldName) {
6870
        _thriftId = thriftId;
6871
        _fieldName = fieldName;
6872
      }
6873
 
6874
      public short getThriftFieldId() {
6875
        return _thriftId;
6876
      }
6877
 
6878
      public String getFieldName() {
6879
        return _fieldName;
6880
      }
6881
    }
6882
 
6883
    // isset id assignments
6884
    private static final int __CARTID_ISSET_ID = 0;
6885
    private BitSet __isset_bit_vector = new BitSet(1);
6886
 
3430 rajveer 6887
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6888
    static {
3430 rajveer 6889
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6890
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6891
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6892
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6893
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6894
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6895
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 6896
    }
6897
 
6898
    public applyCoupon_args() {
6899
    }
6900
 
6901
    public applyCoupon_args(
6902
      String couponCode,
6903
      long cartId)
6904
    {
6905
      this();
6906
      this.couponCode = couponCode;
6907
      this.cartId = cartId;
6908
      setCartIdIsSet(true);
6909
    }
6910
 
6911
    /**
6912
     * Performs a deep copy on <i>other</i>.
6913
     */
6914
    public applyCoupon_args(applyCoupon_args other) {
6915
      __isset_bit_vector.clear();
6916
      __isset_bit_vector.or(other.__isset_bit_vector);
6917
      if (other.isSetCouponCode()) {
6918
        this.couponCode = other.couponCode;
6919
      }
6920
      this.cartId = other.cartId;
6921
    }
6922
 
6923
    public applyCoupon_args deepCopy() {
6924
      return new applyCoupon_args(this);
6925
    }
6926
 
3430 rajveer 6927
    @Override
6928
    public void clear() {
6929
      this.couponCode = null;
6930
      setCartIdIsSet(false);
6931
      this.cartId = 0;
1982 varun.gupt 6932
    }
6933
 
6934
    public String getCouponCode() {
6935
      return this.couponCode;
6936
    }
6937
 
3430 rajveer 6938
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6939
      this.couponCode = couponCode;
6940
    }
6941
 
6942
    public void unsetCouponCode() {
6943
      this.couponCode = null;
6944
    }
6945
 
3430 rajveer 6946
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6947
    public boolean isSetCouponCode() {
6948
      return this.couponCode != null;
6949
    }
6950
 
6951
    public void setCouponCodeIsSet(boolean value) {
6952
      if (!value) {
6953
        this.couponCode = null;
6954
      }
6955
    }
6956
 
6957
    public long getCartId() {
6958
      return this.cartId;
6959
    }
6960
 
3430 rajveer 6961
    public void setCartId(long cartId) {
1982 varun.gupt 6962
      this.cartId = cartId;
6963
      setCartIdIsSet(true);
6964
    }
6965
 
6966
    public void unsetCartId() {
6967
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
6968
    }
6969
 
3430 rajveer 6970
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6971
    public boolean isSetCartId() {
6972
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
6973
    }
6974
 
6975
    public void setCartIdIsSet(boolean value) {
6976
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
6977
    }
6978
 
6979
    public void setFieldValue(_Fields field, Object value) {
6980
      switch (field) {
6981
      case COUPON_CODE:
6982
        if (value == null) {
6983
          unsetCouponCode();
6984
        } else {
6985
          setCouponCode((String)value);
6986
        }
6987
        break;
6988
 
6989
      case CART_ID:
6990
        if (value == null) {
6991
          unsetCartId();
6992
        } else {
6993
          setCartId((Long)value);
6994
        }
6995
        break;
6996
 
6997
      }
6998
    }
6999
 
7000
    public Object getFieldValue(_Fields field) {
7001
      switch (field) {
7002
      case COUPON_CODE:
7003
        return getCouponCode();
7004
 
7005
      case CART_ID:
3430 rajveer 7006
        return Long.valueOf(getCartId());
1982 varun.gupt 7007
 
7008
      }
7009
      throw new IllegalStateException();
7010
    }
7011
 
3430 rajveer 7012
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7013
    public boolean isSet(_Fields field) {
7014
      if (field == null) {
7015
        throw new IllegalArgumentException();
7016
      }
1982 varun.gupt 7017
 
7018
      switch (field) {
7019
      case COUPON_CODE:
7020
        return isSetCouponCode();
7021
      case CART_ID:
7022
        return isSetCartId();
7023
      }
7024
      throw new IllegalStateException();
7025
    }
7026
 
7027
    @Override
7028
    public boolean equals(Object that) {
7029
      if (that == null)
7030
        return false;
7031
      if (that instanceof applyCoupon_args)
7032
        return this.equals((applyCoupon_args)that);
7033
      return false;
7034
    }
7035
 
7036
    public boolean equals(applyCoupon_args that) {
7037
      if (that == null)
7038
        return false;
7039
 
7040
      boolean this_present_couponCode = true && this.isSetCouponCode();
7041
      boolean that_present_couponCode = true && that.isSetCouponCode();
7042
      if (this_present_couponCode || that_present_couponCode) {
7043
        if (!(this_present_couponCode && that_present_couponCode))
7044
          return false;
7045
        if (!this.couponCode.equals(that.couponCode))
7046
          return false;
7047
      }
7048
 
7049
      boolean this_present_cartId = true;
7050
      boolean that_present_cartId = true;
7051
      if (this_present_cartId || that_present_cartId) {
7052
        if (!(this_present_cartId && that_present_cartId))
7053
          return false;
7054
        if (this.cartId != that.cartId)
7055
          return false;
7056
      }
7057
 
7058
      return true;
7059
    }
7060
 
7061
    @Override
7062
    public int hashCode() {
7063
      return 0;
7064
    }
7065
 
7066
    public int compareTo(applyCoupon_args other) {
7067
      if (!getClass().equals(other.getClass())) {
7068
        return getClass().getName().compareTo(other.getClass().getName());
7069
      }
7070
 
7071
      int lastComparison = 0;
7072
      applyCoupon_args typedOther = (applyCoupon_args)other;
7073
 
3430 rajveer 7074
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7075
      if (lastComparison != 0) {
7076
        return lastComparison;
7077
      }
3430 rajveer 7078
      if (isSetCouponCode()) {
7079
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7080
        if (lastComparison != 0) {
7081
          return lastComparison;
7082
        }
1982 varun.gupt 7083
      }
3430 rajveer 7084
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 7085
      if (lastComparison != 0) {
7086
        return lastComparison;
7087
      }
3430 rajveer 7088
      if (isSetCartId()) {
7089
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
7090
        if (lastComparison != 0) {
7091
          return lastComparison;
7092
        }
1982 varun.gupt 7093
      }
7094
      return 0;
7095
    }
7096
 
3430 rajveer 7097
    public _Fields fieldForId(int fieldId) {
7098
      return _Fields.findByThriftId(fieldId);
7099
    }
7100
 
7101
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7102
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7103
      iprot.readStructBegin();
7104
      while (true)
7105
      {
7106
        field = iprot.readFieldBegin();
3430 rajveer 7107
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7108
          break;
7109
        }
3430 rajveer 7110
        switch (field.id) {
7111
          case 1: // COUPON_CODE
7112
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7113
              this.couponCode = iprot.readString();
7114
            } else { 
7115
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7116
            }
7117
            break;
7118
          case 2: // CART_ID
7119
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7120
              this.cartId = iprot.readI64();
7121
              setCartIdIsSet(true);
7122
            } else { 
7123
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7124
            }
7125
            break;
7126
          default:
7127
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7128
        }
3430 rajveer 7129
        iprot.readFieldEnd();
1982 varun.gupt 7130
      }
7131
      iprot.readStructEnd();
7132
      validate();
7133
    }
7134
 
3430 rajveer 7135
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7136
      validate();
7137
 
7138
      oprot.writeStructBegin(STRUCT_DESC);
7139
      if (this.couponCode != null) {
7140
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7141
        oprot.writeString(this.couponCode);
7142
        oprot.writeFieldEnd();
7143
      }
7144
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
7145
      oprot.writeI64(this.cartId);
7146
      oprot.writeFieldEnd();
7147
      oprot.writeFieldStop();
7148
      oprot.writeStructEnd();
7149
    }
7150
 
7151
    @Override
7152
    public String toString() {
7153
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
7154
      boolean first = true;
7155
 
7156
      sb.append("couponCode:");
7157
      if (this.couponCode == null) {
7158
        sb.append("null");
7159
      } else {
7160
        sb.append(this.couponCode);
7161
      }
7162
      first = false;
7163
      if (!first) sb.append(", ");
7164
      sb.append("cartId:");
7165
      sb.append(this.cartId);
7166
      first = false;
7167
      sb.append(")");
7168
      return sb.toString();
7169
    }
7170
 
3430 rajveer 7171
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7172
      // check for required fields
7173
    }
7174
 
3430 rajveer 7175
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7176
      try {
7177
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7178
      } catch (org.apache.thrift.TException te) {
7179
        throw new java.io.IOException(te);
7180
      }
7181
    }
7182
 
7183
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7184
      try {
7185
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7186
        __isset_bit_vector = new BitSet(1);
7187
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7188
      } catch (org.apache.thrift.TException te) {
7189
        throw new java.io.IOException(te);
7190
      }
7191
    }
7192
 
1982 varun.gupt 7193
  }
7194
 
3430 rajveer 7195
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7196
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 7197
 
3430 rajveer 7198
    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);
7199
    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 7200
 
3430 rajveer 7201
    private Cart success; // required
7202
    private PromotionException pex; // required
1982 varun.gupt 7203
 
7204
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7205
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7206
      SUCCESS((short)0, "success"),
7207
      PEX((short)1, "pex");
7208
 
7209
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7210
 
7211
      static {
7212
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7213
          byName.put(field.getFieldName(), field);
7214
        }
7215
      }
7216
 
7217
      /**
7218
       * Find the _Fields constant that matches fieldId, or null if its not found.
7219
       */
7220
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7221
        switch(fieldId) {
7222
          case 0: // SUCCESS
7223
            return SUCCESS;
7224
          case 1: // PEX
7225
            return PEX;
7226
          default:
7227
            return null;
7228
        }
1982 varun.gupt 7229
      }
7230
 
7231
      /**
7232
       * Find the _Fields constant that matches fieldId, throwing an exception
7233
       * if it is not found.
7234
       */
7235
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7236
        _Fields fields = findByThriftId(fieldId);
7237
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7238
        return fields;
7239
      }
7240
 
7241
      /**
7242
       * Find the _Fields constant that matches name, or null if its not found.
7243
       */
7244
      public static _Fields findByName(String name) {
7245
        return byName.get(name);
7246
      }
7247
 
7248
      private final short _thriftId;
7249
      private final String _fieldName;
7250
 
7251
      _Fields(short thriftId, String fieldName) {
7252
        _thriftId = thriftId;
7253
        _fieldName = fieldName;
7254
      }
7255
 
7256
      public short getThriftFieldId() {
7257
        return _thriftId;
7258
      }
7259
 
7260
      public String getFieldName() {
7261
        return _fieldName;
7262
      }
7263
    }
7264
 
7265
    // isset id assignments
7266
 
3430 rajveer 7267
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7268
    static {
3430 rajveer 7269
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7270
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7271
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
7272
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7273
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7274
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7275
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 7276
    }
7277
 
7278
    public applyCoupon_result() {
7279
    }
7280
 
7281
    public applyCoupon_result(
7282
      Cart success,
7283
      PromotionException pex)
7284
    {
7285
      this();
7286
      this.success = success;
7287
      this.pex = pex;
7288
    }
7289
 
7290
    /**
7291
     * Performs a deep copy on <i>other</i>.
7292
     */
7293
    public applyCoupon_result(applyCoupon_result other) {
7294
      if (other.isSetSuccess()) {
7295
        this.success = new Cart(other.success);
7296
      }
7297
      if (other.isSetPex()) {
7298
        this.pex = new PromotionException(other.pex);
7299
      }
7300
    }
7301
 
7302
    public applyCoupon_result deepCopy() {
7303
      return new applyCoupon_result(this);
7304
    }
7305
 
3430 rajveer 7306
    @Override
7307
    public void clear() {
7308
      this.success = null;
7309
      this.pex = null;
1982 varun.gupt 7310
    }
7311
 
7312
    public Cart getSuccess() {
7313
      return this.success;
7314
    }
7315
 
3430 rajveer 7316
    public void setSuccess(Cart success) {
1982 varun.gupt 7317
      this.success = success;
7318
    }
7319
 
7320
    public void unsetSuccess() {
7321
      this.success = null;
7322
    }
7323
 
3430 rajveer 7324
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7325
    public boolean isSetSuccess() {
7326
      return this.success != null;
7327
    }
7328
 
7329
    public void setSuccessIsSet(boolean value) {
7330
      if (!value) {
7331
        this.success = null;
7332
      }
7333
    }
7334
 
7335
    public PromotionException getPex() {
7336
      return this.pex;
7337
    }
7338
 
3430 rajveer 7339
    public void setPex(PromotionException pex) {
1982 varun.gupt 7340
      this.pex = pex;
7341
    }
7342
 
7343
    public void unsetPex() {
7344
      this.pex = null;
7345
    }
7346
 
3430 rajveer 7347
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7348
    public boolean isSetPex() {
7349
      return this.pex != null;
7350
    }
7351
 
7352
    public void setPexIsSet(boolean value) {
7353
      if (!value) {
7354
        this.pex = null;
7355
      }
7356
    }
7357
 
7358
    public void setFieldValue(_Fields field, Object value) {
7359
      switch (field) {
7360
      case SUCCESS:
7361
        if (value == null) {
7362
          unsetSuccess();
7363
        } else {
7364
          setSuccess((Cart)value);
7365
        }
7366
        break;
7367
 
7368
      case PEX:
7369
        if (value == null) {
7370
          unsetPex();
7371
        } else {
7372
          setPex((PromotionException)value);
7373
        }
7374
        break;
7375
 
7376
      }
7377
    }
7378
 
7379
    public Object getFieldValue(_Fields field) {
7380
      switch (field) {
7381
      case SUCCESS:
7382
        return getSuccess();
7383
 
7384
      case PEX:
7385
        return getPex();
7386
 
7387
      }
7388
      throw new IllegalStateException();
7389
    }
7390
 
3430 rajveer 7391
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7392
    public boolean isSet(_Fields field) {
7393
      if (field == null) {
7394
        throw new IllegalArgumentException();
7395
      }
1982 varun.gupt 7396
 
7397
      switch (field) {
7398
      case SUCCESS:
7399
        return isSetSuccess();
7400
      case PEX:
7401
        return isSetPex();
7402
      }
7403
      throw new IllegalStateException();
7404
    }
7405
 
7406
    @Override
7407
    public boolean equals(Object that) {
7408
      if (that == null)
7409
        return false;
7410
      if (that instanceof applyCoupon_result)
7411
        return this.equals((applyCoupon_result)that);
7412
      return false;
7413
    }
7414
 
7415
    public boolean equals(applyCoupon_result that) {
7416
      if (that == null)
7417
        return false;
7418
 
7419
      boolean this_present_success = true && this.isSetSuccess();
7420
      boolean that_present_success = true && that.isSetSuccess();
7421
      if (this_present_success || that_present_success) {
7422
        if (!(this_present_success && that_present_success))
7423
          return false;
7424
        if (!this.success.equals(that.success))
7425
          return false;
7426
      }
7427
 
7428
      boolean this_present_pex = true && this.isSetPex();
7429
      boolean that_present_pex = true && that.isSetPex();
7430
      if (this_present_pex || that_present_pex) {
7431
        if (!(this_present_pex && that_present_pex))
7432
          return false;
7433
        if (!this.pex.equals(that.pex))
7434
          return false;
7435
      }
7436
 
7437
      return true;
7438
    }
7439
 
7440
    @Override
7441
    public int hashCode() {
7442
      return 0;
7443
    }
7444
 
7445
    public int compareTo(applyCoupon_result other) {
7446
      if (!getClass().equals(other.getClass())) {
7447
        return getClass().getName().compareTo(other.getClass().getName());
7448
      }
7449
 
7450
      int lastComparison = 0;
7451
      applyCoupon_result typedOther = (applyCoupon_result)other;
7452
 
3430 rajveer 7453
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 7454
      if (lastComparison != 0) {
7455
        return lastComparison;
7456
      }
3430 rajveer 7457
      if (isSetSuccess()) {
7458
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7459
        if (lastComparison != 0) {
7460
          return lastComparison;
7461
        }
1982 varun.gupt 7462
      }
3430 rajveer 7463
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7464
      if (lastComparison != 0) {
7465
        return lastComparison;
7466
      }
3430 rajveer 7467
      if (isSetPex()) {
7468
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7469
        if (lastComparison != 0) {
7470
          return lastComparison;
7471
        }
1982 varun.gupt 7472
      }
7473
      return 0;
7474
    }
7475
 
3430 rajveer 7476
    public _Fields fieldForId(int fieldId) {
7477
      return _Fields.findByThriftId(fieldId);
7478
    }
7479
 
7480
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7481
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7482
      iprot.readStructBegin();
7483
      while (true)
7484
      {
7485
        field = iprot.readFieldBegin();
3430 rajveer 7486
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7487
          break;
7488
        }
3430 rajveer 7489
        switch (field.id) {
7490
          case 0: // SUCCESS
7491
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7492
              this.success = new Cart();
7493
              this.success.read(iprot);
7494
            } else { 
7495
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7496
            }
7497
            break;
7498
          case 1: // PEX
7499
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7500
              this.pex = new PromotionException();
7501
              this.pex.read(iprot);
7502
            } else { 
7503
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7504
            }
7505
            break;
7506
          default:
7507
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7508
        }
3430 rajveer 7509
        iprot.readFieldEnd();
1982 varun.gupt 7510
      }
7511
      iprot.readStructEnd();
7512
      validate();
7513
    }
7514
 
3430 rajveer 7515
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7516
      oprot.writeStructBegin(STRUCT_DESC);
7517
 
7518
      if (this.isSetSuccess()) {
7519
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7520
        this.success.write(oprot);
7521
        oprot.writeFieldEnd();
7522
      } else if (this.isSetPex()) {
7523
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7524
        this.pex.write(oprot);
7525
        oprot.writeFieldEnd();
7526
      }
7527
      oprot.writeFieldStop();
7528
      oprot.writeStructEnd();
7529
    }
7530
 
7531
    @Override
7532
    public String toString() {
7533
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
7534
      boolean first = true;
7535
 
7536
      sb.append("success:");
7537
      if (this.success == null) {
7538
        sb.append("null");
7539
      } else {
7540
        sb.append(this.success);
7541
      }
7542
      first = false;
7543
      if (!first) sb.append(", ");
7544
      sb.append("pex:");
7545
      if (this.pex == null) {
7546
        sb.append("null");
7547
      } else {
7548
        sb.append(this.pex);
7549
      }
7550
      first = false;
7551
      sb.append(")");
7552
      return sb.toString();
7553
    }
7554
 
3430 rajveer 7555
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7556
      // check for required fields
7557
    }
7558
 
3430 rajveer 7559
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7560
      try {
7561
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7562
      } catch (org.apache.thrift.TException te) {
7563
        throw new java.io.IOException(te);
7564
      }
7565
    }
7566
 
7567
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7568
      try {
7569
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7570
      } catch (org.apache.thrift.TException te) {
7571
        throw new java.io.IOException(te);
7572
      }
7573
    }
7574
 
1982 varun.gupt 7575
  }
7576
 
6433 anupam.sin 7577
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7578
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
7579
 
7580
    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);
7581
    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);
7582
    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);
7583
 
7584
    private String couponCode; // required
7585
    private long totalAmount; // required
7586
    private long userId; // required
7587
 
7588
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7589
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7590
      COUPON_CODE((short)1, "couponCode"),
7591
      TOTAL_AMOUNT((short)2, "totalAmount"),
7592
      USER_ID((short)3, "userId");
7593
 
7594
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7595
 
7596
      static {
7597
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7598
          byName.put(field.getFieldName(), field);
7599
        }
7600
      }
7601
 
7602
      /**
7603
       * Find the _Fields constant that matches fieldId, or null if its not found.
7604
       */
7605
      public static _Fields findByThriftId(int fieldId) {
7606
        switch(fieldId) {
7607
          case 1: // COUPON_CODE
7608
            return COUPON_CODE;
7609
          case 2: // TOTAL_AMOUNT
7610
            return TOTAL_AMOUNT;
7611
          case 3: // USER_ID
7612
            return USER_ID;
7613
          default:
7614
            return null;
7615
        }
7616
      }
7617
 
7618
      /**
7619
       * Find the _Fields constant that matches fieldId, throwing an exception
7620
       * if it is not found.
7621
       */
7622
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7623
        _Fields fields = findByThriftId(fieldId);
7624
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7625
        return fields;
7626
      }
7627
 
7628
      /**
7629
       * Find the _Fields constant that matches name, or null if its not found.
7630
       */
7631
      public static _Fields findByName(String name) {
7632
        return byName.get(name);
7633
      }
7634
 
7635
      private final short _thriftId;
7636
      private final String _fieldName;
7637
 
7638
      _Fields(short thriftId, String fieldName) {
7639
        _thriftId = thriftId;
7640
        _fieldName = fieldName;
7641
      }
7642
 
7643
      public short getThriftFieldId() {
7644
        return _thriftId;
7645
      }
7646
 
7647
      public String getFieldName() {
7648
        return _fieldName;
7649
      }
7650
    }
7651
 
7652
    // isset id assignments
7653
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
7654
    private static final int __USERID_ISSET_ID = 1;
7655
    private BitSet __isset_bit_vector = new BitSet(2);
7656
 
7657
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7658
    static {
7659
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7660
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7661
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7662
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7663
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7664
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7665
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7666
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7667
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
7668
    }
7669
 
7670
    public applyRechargeCoupon_args() {
7671
    }
7672
 
7673
    public applyRechargeCoupon_args(
7674
      String couponCode,
7675
      long totalAmount,
7676
      long userId)
7677
    {
7678
      this();
7679
      this.couponCode = couponCode;
7680
      this.totalAmount = totalAmount;
7681
      setTotalAmountIsSet(true);
7682
      this.userId = userId;
7683
      setUserIdIsSet(true);
7684
    }
7685
 
7686
    /**
7687
     * Performs a deep copy on <i>other</i>.
7688
     */
7689
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
7690
      __isset_bit_vector.clear();
7691
      __isset_bit_vector.or(other.__isset_bit_vector);
7692
      if (other.isSetCouponCode()) {
7693
        this.couponCode = other.couponCode;
7694
      }
7695
      this.totalAmount = other.totalAmount;
7696
      this.userId = other.userId;
7697
    }
7698
 
7699
    public applyRechargeCoupon_args deepCopy() {
7700
      return new applyRechargeCoupon_args(this);
7701
    }
7702
 
7703
    @Override
7704
    public void clear() {
7705
      this.couponCode = null;
7706
      setTotalAmountIsSet(false);
7707
      this.totalAmount = 0;
7708
      setUserIdIsSet(false);
7709
      this.userId = 0;
7710
    }
7711
 
7712
    public String getCouponCode() {
7713
      return this.couponCode;
7714
    }
7715
 
7716
    public void setCouponCode(String couponCode) {
7717
      this.couponCode = couponCode;
7718
    }
7719
 
7720
    public void unsetCouponCode() {
7721
      this.couponCode = null;
7722
    }
7723
 
7724
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
7725
    public boolean isSetCouponCode() {
7726
      return this.couponCode != null;
7727
    }
7728
 
7729
    public void setCouponCodeIsSet(boolean value) {
7730
      if (!value) {
7731
        this.couponCode = null;
7732
      }
7733
    }
7734
 
7735
    public long getTotalAmount() {
7736
      return this.totalAmount;
7737
    }
7738
 
7739
    public void setTotalAmount(long totalAmount) {
7740
      this.totalAmount = totalAmount;
7741
      setTotalAmountIsSet(true);
7742
    }
7743
 
7744
    public void unsetTotalAmount() {
7745
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
7746
    }
7747
 
7748
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
7749
    public boolean isSetTotalAmount() {
7750
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
7751
    }
7752
 
7753
    public void setTotalAmountIsSet(boolean value) {
7754
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
7755
    }
7756
 
7757
    public long getUserId() {
7758
      return this.userId;
7759
    }
7760
 
7761
    public void setUserId(long userId) {
7762
      this.userId = userId;
7763
      setUserIdIsSet(true);
7764
    }
7765
 
7766
    public void unsetUserId() {
7767
      __isset_bit_vector.clear(__USERID_ISSET_ID);
7768
    }
7769
 
7770
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
7771
    public boolean isSetUserId() {
7772
      return __isset_bit_vector.get(__USERID_ISSET_ID);
7773
    }
7774
 
7775
    public void setUserIdIsSet(boolean value) {
7776
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
7777
    }
7778
 
7779
    public void setFieldValue(_Fields field, Object value) {
7780
      switch (field) {
7781
      case COUPON_CODE:
7782
        if (value == null) {
7783
          unsetCouponCode();
7784
        } else {
7785
          setCouponCode((String)value);
7786
        }
7787
        break;
7788
 
7789
      case TOTAL_AMOUNT:
7790
        if (value == null) {
7791
          unsetTotalAmount();
7792
        } else {
7793
          setTotalAmount((Long)value);
7794
        }
7795
        break;
7796
 
7797
      case USER_ID:
7798
        if (value == null) {
7799
          unsetUserId();
7800
        } else {
7801
          setUserId((Long)value);
7802
        }
7803
        break;
7804
 
7805
      }
7806
    }
7807
 
7808
    public Object getFieldValue(_Fields field) {
7809
      switch (field) {
7810
      case COUPON_CODE:
7811
        return getCouponCode();
7812
 
7813
      case TOTAL_AMOUNT:
7814
        return Long.valueOf(getTotalAmount());
7815
 
7816
      case USER_ID:
7817
        return Long.valueOf(getUserId());
7818
 
7819
      }
7820
      throw new IllegalStateException();
7821
    }
7822
 
7823
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7824
    public boolean isSet(_Fields field) {
7825
      if (field == null) {
7826
        throw new IllegalArgumentException();
7827
      }
7828
 
7829
      switch (field) {
7830
      case COUPON_CODE:
7831
        return isSetCouponCode();
7832
      case TOTAL_AMOUNT:
7833
        return isSetTotalAmount();
7834
      case USER_ID:
7835
        return isSetUserId();
7836
      }
7837
      throw new IllegalStateException();
7838
    }
7839
 
7840
    @Override
7841
    public boolean equals(Object that) {
7842
      if (that == null)
7843
        return false;
7844
      if (that instanceof applyRechargeCoupon_args)
7845
        return this.equals((applyRechargeCoupon_args)that);
7846
      return false;
7847
    }
7848
 
7849
    public boolean equals(applyRechargeCoupon_args that) {
7850
      if (that == null)
7851
        return false;
7852
 
7853
      boolean this_present_couponCode = true && this.isSetCouponCode();
7854
      boolean that_present_couponCode = true && that.isSetCouponCode();
7855
      if (this_present_couponCode || that_present_couponCode) {
7856
        if (!(this_present_couponCode && that_present_couponCode))
7857
          return false;
7858
        if (!this.couponCode.equals(that.couponCode))
7859
          return false;
7860
      }
7861
 
7862
      boolean this_present_totalAmount = true;
7863
      boolean that_present_totalAmount = true;
7864
      if (this_present_totalAmount || that_present_totalAmount) {
7865
        if (!(this_present_totalAmount && that_present_totalAmount))
7866
          return false;
7867
        if (this.totalAmount != that.totalAmount)
7868
          return false;
7869
      }
7870
 
7871
      boolean this_present_userId = true;
7872
      boolean that_present_userId = true;
7873
      if (this_present_userId || that_present_userId) {
7874
        if (!(this_present_userId && that_present_userId))
7875
          return false;
7876
        if (this.userId != that.userId)
7877
          return false;
7878
      }
7879
 
7880
      return true;
7881
    }
7882
 
7883
    @Override
7884
    public int hashCode() {
7885
      return 0;
7886
    }
7887
 
7888
    public int compareTo(applyRechargeCoupon_args other) {
7889
      if (!getClass().equals(other.getClass())) {
7890
        return getClass().getName().compareTo(other.getClass().getName());
7891
      }
7892
 
7893
      int lastComparison = 0;
7894
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
7895
 
7896
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
7897
      if (lastComparison != 0) {
7898
        return lastComparison;
7899
      }
7900
      if (isSetCouponCode()) {
7901
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7902
        if (lastComparison != 0) {
7903
          return lastComparison;
7904
        }
7905
      }
7906
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
7907
      if (lastComparison != 0) {
7908
        return lastComparison;
7909
      }
7910
      if (isSetTotalAmount()) {
7911
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
7912
        if (lastComparison != 0) {
7913
          return lastComparison;
7914
        }
7915
      }
7916
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
7917
      if (lastComparison != 0) {
7918
        return lastComparison;
7919
      }
7920
      if (isSetUserId()) {
7921
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
7922
        if (lastComparison != 0) {
7923
          return lastComparison;
7924
        }
7925
      }
7926
      return 0;
7927
    }
7928
 
7929
    public _Fields fieldForId(int fieldId) {
7930
      return _Fields.findByThriftId(fieldId);
7931
    }
7932
 
7933
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7934
      org.apache.thrift.protocol.TField field;
7935
      iprot.readStructBegin();
7936
      while (true)
7937
      {
7938
        field = iprot.readFieldBegin();
7939
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7940
          break;
7941
        }
7942
        switch (field.id) {
7943
          case 1: // COUPON_CODE
7944
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7945
              this.couponCode = iprot.readString();
7946
            } else { 
7947
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7948
            }
7949
            break;
7950
          case 2: // TOTAL_AMOUNT
7951
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7952
              this.totalAmount = iprot.readI64();
7953
              setTotalAmountIsSet(true);
7954
            } else { 
7955
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7956
            }
7957
            break;
7958
          case 3: // USER_ID
7959
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7960
              this.userId = iprot.readI64();
7961
              setUserIdIsSet(true);
7962
            } else { 
7963
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7964
            }
7965
            break;
7966
          default:
7967
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7968
        }
7969
        iprot.readFieldEnd();
7970
      }
7971
      iprot.readStructEnd();
7972
      validate();
7973
    }
7974
 
7975
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7976
      validate();
7977
 
7978
      oprot.writeStructBegin(STRUCT_DESC);
7979
      if (this.couponCode != null) {
7980
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7981
        oprot.writeString(this.couponCode);
7982
        oprot.writeFieldEnd();
7983
      }
7984
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
7985
      oprot.writeI64(this.totalAmount);
7986
      oprot.writeFieldEnd();
7987
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
7988
      oprot.writeI64(this.userId);
7989
      oprot.writeFieldEnd();
7990
      oprot.writeFieldStop();
7991
      oprot.writeStructEnd();
7992
    }
7993
 
7994
    @Override
7995
    public String toString() {
7996
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
7997
      boolean first = true;
7998
 
7999
      sb.append("couponCode:");
8000
      if (this.couponCode == null) {
8001
        sb.append("null");
8002
      } else {
8003
        sb.append(this.couponCode);
8004
      }
8005
      first = false;
8006
      if (!first) sb.append(", ");
8007
      sb.append("totalAmount:");
8008
      sb.append(this.totalAmount);
8009
      first = false;
8010
      if (!first) sb.append(", ");
8011
      sb.append("userId:");
8012
      sb.append(this.userId);
8013
      first = false;
8014
      sb.append(")");
8015
      return sb.toString();
8016
    }
8017
 
8018
    public void validate() throws org.apache.thrift.TException {
8019
      // check for required fields
8020
    }
8021
 
8022
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8023
      try {
8024
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8025
      } catch (org.apache.thrift.TException te) {
8026
        throw new java.io.IOException(te);
8027
      }
8028
    }
8029
 
8030
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8031
      try {
8032
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8033
        __isset_bit_vector = new BitSet(1);
8034
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8035
      } catch (org.apache.thrift.TException te) {
8036
        throw new java.io.IOException(te);
8037
      }
8038
    }
8039
 
8040
  }
8041
 
8042
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8043
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
8044
 
8045
    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);
8046
    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);
8047
 
8048
    private Map<Long,String> success; // required
8049
    private PromotionException pex; // required
8050
 
8051
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8052
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8053
      SUCCESS((short)0, "success"),
8054
      PEX((short)1, "pex");
8055
 
8056
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8057
 
8058
      static {
8059
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8060
          byName.put(field.getFieldName(), field);
8061
        }
8062
      }
8063
 
8064
      /**
8065
       * Find the _Fields constant that matches fieldId, or null if its not found.
8066
       */
8067
      public static _Fields findByThriftId(int fieldId) {
8068
        switch(fieldId) {
8069
          case 0: // SUCCESS
8070
            return SUCCESS;
8071
          case 1: // PEX
8072
            return PEX;
8073
          default:
8074
            return null;
8075
        }
8076
      }
8077
 
8078
      /**
8079
       * Find the _Fields constant that matches fieldId, throwing an exception
8080
       * if it is not found.
8081
       */
8082
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8083
        _Fields fields = findByThriftId(fieldId);
8084
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8085
        return fields;
8086
      }
8087
 
8088
      /**
8089
       * Find the _Fields constant that matches name, or null if its not found.
8090
       */
8091
      public static _Fields findByName(String name) {
8092
        return byName.get(name);
8093
      }
8094
 
8095
      private final short _thriftId;
8096
      private final String _fieldName;
8097
 
8098
      _Fields(short thriftId, String fieldName) {
8099
        _thriftId = thriftId;
8100
        _fieldName = fieldName;
8101
      }
8102
 
8103
      public short getThriftFieldId() {
8104
        return _thriftId;
8105
      }
8106
 
8107
      public String getFieldName() {
8108
        return _fieldName;
8109
      }
8110
    }
8111
 
8112
    // isset id assignments
8113
 
8114
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8115
    static {
8116
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8117
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8118
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8119
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8120
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
8121
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8122
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8123
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8124
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
8125
    }
8126
 
8127
    public applyRechargeCoupon_result() {
8128
    }
8129
 
8130
    public applyRechargeCoupon_result(
8131
      Map<Long,String> success,
8132
      PromotionException pex)
8133
    {
8134
      this();
8135
      this.success = success;
8136
      this.pex = pex;
8137
    }
8138
 
8139
    /**
8140
     * Performs a deep copy on <i>other</i>.
8141
     */
8142
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
8143
      if (other.isSetSuccess()) {
8144
        Map<Long,String> __this__success = new HashMap<Long,String>();
8145
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
8146
 
8147
          Long other_element_key = other_element.getKey();
8148
          String other_element_value = other_element.getValue();
8149
 
8150
          Long __this__success_copy_key = other_element_key;
8151
 
8152
          String __this__success_copy_value = other_element_value;
8153
 
8154
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8155
        }
8156
        this.success = __this__success;
8157
      }
8158
      if (other.isSetPex()) {
8159
        this.pex = new PromotionException(other.pex);
8160
      }
8161
    }
8162
 
8163
    public applyRechargeCoupon_result deepCopy() {
8164
      return new applyRechargeCoupon_result(this);
8165
    }
8166
 
8167
    @Override
8168
    public void clear() {
8169
      this.success = null;
8170
      this.pex = null;
8171
    }
8172
 
8173
    public int getSuccessSize() {
8174
      return (this.success == null) ? 0 : this.success.size();
8175
    }
8176
 
8177
    public void putToSuccess(long key, String val) {
8178
      if (this.success == null) {
8179
        this.success = new HashMap<Long,String>();
8180
      }
8181
      this.success.put(key, val);
8182
    }
8183
 
8184
    public Map<Long,String> getSuccess() {
8185
      return this.success;
8186
    }
8187
 
8188
    public void setSuccess(Map<Long,String> success) {
8189
      this.success = success;
8190
    }
8191
 
8192
    public void unsetSuccess() {
8193
      this.success = null;
8194
    }
8195
 
8196
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8197
    public boolean isSetSuccess() {
8198
      return this.success != null;
8199
    }
8200
 
8201
    public void setSuccessIsSet(boolean value) {
8202
      if (!value) {
8203
        this.success = null;
8204
      }
8205
    }
8206
 
8207
    public PromotionException getPex() {
8208
      return this.pex;
8209
    }
8210
 
8211
    public void setPex(PromotionException pex) {
8212
      this.pex = pex;
8213
    }
8214
 
8215
    public void unsetPex() {
8216
      this.pex = null;
8217
    }
8218
 
8219
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8220
    public boolean isSetPex() {
8221
      return this.pex != null;
8222
    }
8223
 
8224
    public void setPexIsSet(boolean value) {
8225
      if (!value) {
8226
        this.pex = null;
8227
      }
8228
    }
8229
 
8230
    public void setFieldValue(_Fields field, Object value) {
8231
      switch (field) {
8232
      case SUCCESS:
8233
        if (value == null) {
8234
          unsetSuccess();
8235
        } else {
8236
          setSuccess((Map<Long,String>)value);
8237
        }
8238
        break;
8239
 
8240
      case PEX:
8241
        if (value == null) {
8242
          unsetPex();
8243
        } else {
8244
          setPex((PromotionException)value);
8245
        }
8246
        break;
8247
 
8248
      }
8249
    }
8250
 
8251
    public Object getFieldValue(_Fields field) {
8252
      switch (field) {
8253
      case SUCCESS:
8254
        return getSuccess();
8255
 
8256
      case PEX:
8257
        return getPex();
8258
 
8259
      }
8260
      throw new IllegalStateException();
8261
    }
8262
 
8263
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8264
    public boolean isSet(_Fields field) {
8265
      if (field == null) {
8266
        throw new IllegalArgumentException();
8267
      }
8268
 
8269
      switch (field) {
8270
      case SUCCESS:
8271
        return isSetSuccess();
8272
      case PEX:
8273
        return isSetPex();
8274
      }
8275
      throw new IllegalStateException();
8276
    }
8277
 
8278
    @Override
8279
    public boolean equals(Object that) {
8280
      if (that == null)
8281
        return false;
8282
      if (that instanceof applyRechargeCoupon_result)
8283
        return this.equals((applyRechargeCoupon_result)that);
8284
      return false;
8285
    }
8286
 
8287
    public boolean equals(applyRechargeCoupon_result that) {
8288
      if (that == null)
8289
        return false;
8290
 
8291
      boolean this_present_success = true && this.isSetSuccess();
8292
      boolean that_present_success = true && that.isSetSuccess();
8293
      if (this_present_success || that_present_success) {
8294
        if (!(this_present_success && that_present_success))
8295
          return false;
8296
        if (!this.success.equals(that.success))
8297
          return false;
8298
      }
8299
 
8300
      boolean this_present_pex = true && this.isSetPex();
8301
      boolean that_present_pex = true && that.isSetPex();
8302
      if (this_present_pex || that_present_pex) {
8303
        if (!(this_present_pex && that_present_pex))
8304
          return false;
8305
        if (!this.pex.equals(that.pex))
8306
          return false;
8307
      }
8308
 
8309
      return true;
8310
    }
8311
 
8312
    @Override
8313
    public int hashCode() {
8314
      return 0;
8315
    }
8316
 
8317
    public int compareTo(applyRechargeCoupon_result other) {
8318
      if (!getClass().equals(other.getClass())) {
8319
        return getClass().getName().compareTo(other.getClass().getName());
8320
      }
8321
 
8322
      int lastComparison = 0;
8323
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
8324
 
8325
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8326
      if (lastComparison != 0) {
8327
        return lastComparison;
8328
      }
8329
      if (isSetSuccess()) {
8330
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8331
        if (lastComparison != 0) {
8332
          return lastComparison;
8333
        }
8334
      }
8335
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
8336
      if (lastComparison != 0) {
8337
        return lastComparison;
8338
      }
8339
      if (isSetPex()) {
8340
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8341
        if (lastComparison != 0) {
8342
          return lastComparison;
8343
        }
8344
      }
8345
      return 0;
8346
    }
8347
 
8348
    public _Fields fieldForId(int fieldId) {
8349
      return _Fields.findByThriftId(fieldId);
8350
    }
8351
 
8352
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8353
      org.apache.thrift.protocol.TField field;
8354
      iprot.readStructBegin();
8355
      while (true)
8356
      {
8357
        field = iprot.readFieldBegin();
8358
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8359
          break;
8360
        }
8361
        switch (field.id) {
8362
          case 0: // SUCCESS
8363
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
8364
              {
8365
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
8366
                this.success = new HashMap<Long,String>(2*_map16.size);
8367
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
8368
                {
8369
                  long _key18; // required
8370
                  String _val19; // required
8371
                  _key18 = iprot.readI64();
8372
                  _val19 = iprot.readString();
8373
                  this.success.put(_key18, _val19);
8374
                }
8375
                iprot.readMapEnd();
8376
              }
8377
            } else { 
8378
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8379
            }
8380
            break;
8381
          case 1: // PEX
8382
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8383
              this.pex = new PromotionException();
8384
              this.pex.read(iprot);
8385
            } else { 
8386
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8387
            }
8388
            break;
8389
          default:
8390
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8391
        }
8392
        iprot.readFieldEnd();
8393
      }
8394
      iprot.readStructEnd();
8395
      validate();
8396
    }
8397
 
8398
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8399
      oprot.writeStructBegin(STRUCT_DESC);
8400
 
8401
      if (this.isSetSuccess()) {
8402
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8403
        {
8404
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
8405
          for (Map.Entry<Long, String> _iter20 : this.success.entrySet())
8406
          {
8407
            oprot.writeI64(_iter20.getKey());
8408
            oprot.writeString(_iter20.getValue());
8409
          }
8410
          oprot.writeMapEnd();
8411
        }
8412
        oprot.writeFieldEnd();
8413
      } else if (this.isSetPex()) {
8414
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8415
        this.pex.write(oprot);
8416
        oprot.writeFieldEnd();
8417
      }
8418
      oprot.writeFieldStop();
8419
      oprot.writeStructEnd();
8420
    }
8421
 
8422
    @Override
8423
    public String toString() {
8424
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
8425
      boolean first = true;
8426
 
8427
      sb.append("success:");
8428
      if (this.success == null) {
8429
        sb.append("null");
8430
      } else {
8431
        sb.append(this.success);
8432
      }
8433
      first = false;
8434
      if (!first) sb.append(", ");
8435
      sb.append("pex:");
8436
      if (this.pex == null) {
8437
        sb.append("null");
8438
      } else {
8439
        sb.append(this.pex);
8440
      }
8441
      first = false;
8442
      sb.append(")");
8443
      return sb.toString();
8444
    }
8445
 
8446
    public void validate() throws org.apache.thrift.TException {
8447
      // check for required fields
8448
    }
8449
 
8450
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8451
      try {
8452
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8453
      } catch (org.apache.thrift.TException te) {
8454
        throw new java.io.IOException(te);
8455
      }
8456
    }
8457
 
8458
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8459
      try {
8460
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8461
      } catch (org.apache.thrift.TException te) {
8462
        throw new java.io.IOException(te);
8463
      }
8464
    }
8465
 
8466
  }
8467
 
3430 rajveer 8468
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
8469
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 8470
 
3430 rajveer 8471
    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);
8472
    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);
8473
    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 8474
 
3430 rajveer 8475
    private String couponCode; // required
8476
    private long transactionId; // required
8477
    private long userId; // required
1982 varun.gupt 8478
 
8479
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8480
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8481
      COUPON_CODE((short)1, "couponCode"),
8482
      TRANSACTION_ID((short)2, "transactionId"),
8483
      USER_ID((short)3, "userId");
8484
 
8485
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8486
 
8487
      static {
8488
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8489
          byName.put(field.getFieldName(), field);
8490
        }
8491
      }
8492
 
8493
      /**
8494
       * Find the _Fields constant that matches fieldId, or null if its not found.
8495
       */
8496
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8497
        switch(fieldId) {
8498
          case 1: // COUPON_CODE
8499
            return COUPON_CODE;
8500
          case 2: // TRANSACTION_ID
8501
            return TRANSACTION_ID;
8502
          case 3: // USER_ID
8503
            return USER_ID;
8504
          default:
8505
            return null;
8506
        }
1982 varun.gupt 8507
      }
8508
 
8509
      /**
8510
       * Find the _Fields constant that matches fieldId, throwing an exception
8511
       * if it is not found.
8512
       */
8513
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8514
        _Fields fields = findByThriftId(fieldId);
8515
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8516
        return fields;
8517
      }
8518
 
8519
      /**
8520
       * Find the _Fields constant that matches name, or null if its not found.
8521
       */
8522
      public static _Fields findByName(String name) {
8523
        return byName.get(name);
8524
      }
8525
 
8526
      private final short _thriftId;
8527
      private final String _fieldName;
8528
 
8529
      _Fields(short thriftId, String fieldName) {
8530
        _thriftId = thriftId;
8531
        _fieldName = fieldName;
8532
      }
8533
 
8534
      public short getThriftFieldId() {
8535
        return _thriftId;
8536
      }
8537
 
8538
      public String getFieldName() {
8539
        return _fieldName;
8540
      }
8541
    }
8542
 
8543
    // isset id assignments
8544
    private static final int __TRANSACTIONID_ISSET_ID = 0;
8545
    private static final int __USERID_ISSET_ID = 1;
8546
    private BitSet __isset_bit_vector = new BitSet(2);
8547
 
3430 rajveer 8548
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8549
    static {
3430 rajveer 8550
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8551
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8552
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8553
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8554
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8555
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8556
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8557
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8558
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 8559
    }
8560
 
8561
    public trackCouponUsage_args() {
8562
    }
8563
 
8564
    public trackCouponUsage_args(
8565
      String couponCode,
8566
      long transactionId,
8567
      long userId)
8568
    {
8569
      this();
8570
      this.couponCode = couponCode;
8571
      this.transactionId = transactionId;
8572
      setTransactionIdIsSet(true);
8573
      this.userId = userId;
8574
      setUserIdIsSet(true);
8575
    }
8576
 
8577
    /**
8578
     * Performs a deep copy on <i>other</i>.
8579
     */
8580
    public trackCouponUsage_args(trackCouponUsage_args other) {
8581
      __isset_bit_vector.clear();
8582
      __isset_bit_vector.or(other.__isset_bit_vector);
8583
      if (other.isSetCouponCode()) {
8584
        this.couponCode = other.couponCode;
8585
      }
8586
      this.transactionId = other.transactionId;
8587
      this.userId = other.userId;
8588
    }
8589
 
8590
    public trackCouponUsage_args deepCopy() {
8591
      return new trackCouponUsage_args(this);
8592
    }
8593
 
3430 rajveer 8594
    @Override
8595
    public void clear() {
8596
      this.couponCode = null;
8597
      setTransactionIdIsSet(false);
8598
      this.transactionId = 0;
8599
      setUserIdIsSet(false);
8600
      this.userId = 0;
1982 varun.gupt 8601
    }
8602
 
8603
    public String getCouponCode() {
8604
      return this.couponCode;
8605
    }
8606
 
3430 rajveer 8607
    public void setCouponCode(String couponCode) {
1982 varun.gupt 8608
      this.couponCode = couponCode;
8609
    }
8610
 
8611
    public void unsetCouponCode() {
8612
      this.couponCode = null;
8613
    }
8614
 
3430 rajveer 8615
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8616
    public boolean isSetCouponCode() {
8617
      return this.couponCode != null;
8618
    }
8619
 
8620
    public void setCouponCodeIsSet(boolean value) {
8621
      if (!value) {
8622
        this.couponCode = null;
8623
      }
8624
    }
8625
 
8626
    public long getTransactionId() {
8627
      return this.transactionId;
8628
    }
8629
 
3430 rajveer 8630
    public void setTransactionId(long transactionId) {
1982 varun.gupt 8631
      this.transactionId = transactionId;
8632
      setTransactionIdIsSet(true);
8633
    }
8634
 
8635
    public void unsetTransactionId() {
8636
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
8637
    }
8638
 
3430 rajveer 8639
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8640
    public boolean isSetTransactionId() {
8641
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
8642
    }
8643
 
8644
    public void setTransactionIdIsSet(boolean value) {
8645
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
8646
    }
8647
 
8648
    public long getUserId() {
8649
      return this.userId;
8650
    }
8651
 
3430 rajveer 8652
    public void setUserId(long userId) {
1982 varun.gupt 8653
      this.userId = userId;
8654
      setUserIdIsSet(true);
8655
    }
8656
 
8657
    public void unsetUserId() {
8658
      __isset_bit_vector.clear(__USERID_ISSET_ID);
8659
    }
8660
 
3430 rajveer 8661
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8662
    public boolean isSetUserId() {
8663
      return __isset_bit_vector.get(__USERID_ISSET_ID);
8664
    }
8665
 
8666
    public void setUserIdIsSet(boolean value) {
8667
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
8668
    }
8669
 
8670
    public void setFieldValue(_Fields field, Object value) {
8671
      switch (field) {
8672
      case COUPON_CODE:
8673
        if (value == null) {
8674
          unsetCouponCode();
8675
        } else {
8676
          setCouponCode((String)value);
8677
        }
8678
        break;
8679
 
8680
      case TRANSACTION_ID:
8681
        if (value == null) {
8682
          unsetTransactionId();
8683
        } else {
8684
          setTransactionId((Long)value);
8685
        }
8686
        break;
8687
 
8688
      case USER_ID:
8689
        if (value == null) {
8690
          unsetUserId();
8691
        } else {
8692
          setUserId((Long)value);
8693
        }
8694
        break;
8695
 
8696
      }
8697
    }
8698
 
8699
    public Object getFieldValue(_Fields field) {
8700
      switch (field) {
8701
      case COUPON_CODE:
8702
        return getCouponCode();
8703
 
8704
      case TRANSACTION_ID:
3430 rajveer 8705
        return Long.valueOf(getTransactionId());
1982 varun.gupt 8706
 
8707
      case USER_ID:
3430 rajveer 8708
        return Long.valueOf(getUserId());
1982 varun.gupt 8709
 
8710
      }
8711
      throw new IllegalStateException();
8712
    }
8713
 
3430 rajveer 8714
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8715
    public boolean isSet(_Fields field) {
8716
      if (field == null) {
8717
        throw new IllegalArgumentException();
8718
      }
1982 varun.gupt 8719
 
8720
      switch (field) {
8721
      case COUPON_CODE:
8722
        return isSetCouponCode();
8723
      case TRANSACTION_ID:
8724
        return isSetTransactionId();
8725
      case USER_ID:
8726
        return isSetUserId();
8727
      }
8728
      throw new IllegalStateException();
8729
    }
8730
 
8731
    @Override
8732
    public boolean equals(Object that) {
8733
      if (that == null)
8734
        return false;
8735
      if (that instanceof trackCouponUsage_args)
8736
        return this.equals((trackCouponUsage_args)that);
8737
      return false;
8738
    }
8739
 
8740
    public boolean equals(trackCouponUsage_args that) {
8741
      if (that == null)
8742
        return false;
8743
 
8744
      boolean this_present_couponCode = true && this.isSetCouponCode();
8745
      boolean that_present_couponCode = true && that.isSetCouponCode();
8746
      if (this_present_couponCode || that_present_couponCode) {
8747
        if (!(this_present_couponCode && that_present_couponCode))
8748
          return false;
8749
        if (!this.couponCode.equals(that.couponCode))
8750
          return false;
8751
      }
8752
 
8753
      boolean this_present_transactionId = true;
8754
      boolean that_present_transactionId = true;
8755
      if (this_present_transactionId || that_present_transactionId) {
8756
        if (!(this_present_transactionId && that_present_transactionId))
8757
          return false;
8758
        if (this.transactionId != that.transactionId)
8759
          return false;
8760
      }
8761
 
8762
      boolean this_present_userId = true;
8763
      boolean that_present_userId = true;
8764
      if (this_present_userId || that_present_userId) {
8765
        if (!(this_present_userId && that_present_userId))
8766
          return false;
8767
        if (this.userId != that.userId)
8768
          return false;
8769
      }
8770
 
8771
      return true;
8772
    }
8773
 
8774
    @Override
8775
    public int hashCode() {
8776
      return 0;
8777
    }
8778
 
8779
    public int compareTo(trackCouponUsage_args other) {
8780
      if (!getClass().equals(other.getClass())) {
8781
        return getClass().getName().compareTo(other.getClass().getName());
8782
      }
8783
 
8784
      int lastComparison = 0;
8785
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
8786
 
3430 rajveer 8787
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 8788
      if (lastComparison != 0) {
8789
        return lastComparison;
8790
      }
3430 rajveer 8791
      if (isSetCouponCode()) {
8792
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8793
        if (lastComparison != 0) {
8794
          return lastComparison;
8795
        }
1982 varun.gupt 8796
      }
3430 rajveer 8797
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 8798
      if (lastComparison != 0) {
8799
        return lastComparison;
8800
      }
3430 rajveer 8801
      if (isSetTransactionId()) {
8802
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
8803
        if (lastComparison != 0) {
8804
          return lastComparison;
8805
        }
1982 varun.gupt 8806
      }
3430 rajveer 8807
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 8808
      if (lastComparison != 0) {
8809
        return lastComparison;
8810
      }
3430 rajveer 8811
      if (isSetUserId()) {
8812
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
8813
        if (lastComparison != 0) {
8814
          return lastComparison;
8815
        }
1982 varun.gupt 8816
      }
8817
      return 0;
8818
    }
8819
 
3430 rajveer 8820
    public _Fields fieldForId(int fieldId) {
8821
      return _Fields.findByThriftId(fieldId);
8822
    }
8823
 
8824
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8825
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8826
      iprot.readStructBegin();
8827
      while (true)
8828
      {
8829
        field = iprot.readFieldBegin();
3430 rajveer 8830
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8831
          break;
8832
        }
3430 rajveer 8833
        switch (field.id) {
8834
          case 1: // COUPON_CODE
8835
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8836
              this.couponCode = iprot.readString();
8837
            } else { 
8838
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8839
            }
8840
            break;
8841
          case 2: // TRANSACTION_ID
8842
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8843
              this.transactionId = iprot.readI64();
8844
              setTransactionIdIsSet(true);
8845
            } else { 
8846
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8847
            }
8848
            break;
8849
          case 3: // USER_ID
8850
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8851
              this.userId = iprot.readI64();
8852
              setUserIdIsSet(true);
8853
            } else { 
8854
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8855
            }
8856
            break;
8857
          default:
8858
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8859
        }
3430 rajveer 8860
        iprot.readFieldEnd();
1982 varun.gupt 8861
      }
8862
      iprot.readStructEnd();
8863
      validate();
8864
    }
8865
 
3430 rajveer 8866
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8867
      validate();
8868
 
8869
      oprot.writeStructBegin(STRUCT_DESC);
8870
      if (this.couponCode != null) {
8871
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8872
        oprot.writeString(this.couponCode);
8873
        oprot.writeFieldEnd();
8874
      }
8875
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
8876
      oprot.writeI64(this.transactionId);
8877
      oprot.writeFieldEnd();
8878
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
8879
      oprot.writeI64(this.userId);
8880
      oprot.writeFieldEnd();
8881
      oprot.writeFieldStop();
8882
      oprot.writeStructEnd();
8883
    }
8884
 
8885
    @Override
8886
    public String toString() {
8887
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
8888
      boolean first = true;
8889
 
8890
      sb.append("couponCode:");
8891
      if (this.couponCode == null) {
8892
        sb.append("null");
8893
      } else {
8894
        sb.append(this.couponCode);
8895
      }
8896
      first = false;
8897
      if (!first) sb.append(", ");
8898
      sb.append("transactionId:");
8899
      sb.append(this.transactionId);
8900
      first = false;
8901
      if (!first) sb.append(", ");
8902
      sb.append("userId:");
8903
      sb.append(this.userId);
8904
      first = false;
8905
      sb.append(")");
8906
      return sb.toString();
8907
    }
8908
 
3430 rajveer 8909
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8910
      // check for required fields
8911
    }
8912
 
3430 rajveer 8913
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8914
      try {
8915
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8916
      } catch (org.apache.thrift.TException te) {
8917
        throw new java.io.IOException(te);
8918
      }
8919
    }
8920
 
8921
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8922
      try {
8923
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8924
        __isset_bit_vector = new BitSet(1);
8925
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8926
      } catch (org.apache.thrift.TException te) {
8927
        throw new java.io.IOException(te);
8928
      }
8929
    }
8930
 
1982 varun.gupt 8931
  }
8932
 
3430 rajveer 8933
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
8934
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 8935
 
3430 rajveer 8936
    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 8937
 
3430 rajveer 8938
    private PromotionException pex; // required
1982 varun.gupt 8939
 
8940
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8941
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8942
      PEX((short)1, "pex");
8943
 
8944
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8945
 
8946
      static {
8947
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8948
          byName.put(field.getFieldName(), field);
8949
        }
8950
      }
8951
 
8952
      /**
8953
       * Find the _Fields constant that matches fieldId, or null if its not found.
8954
       */
8955
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8956
        switch(fieldId) {
8957
          case 1: // PEX
8958
            return PEX;
8959
          default:
8960
            return null;
8961
        }
1982 varun.gupt 8962
      }
8963
 
8964
      /**
8965
       * Find the _Fields constant that matches fieldId, throwing an exception
8966
       * if it is not found.
8967
       */
8968
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8969
        _Fields fields = findByThriftId(fieldId);
8970
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8971
        return fields;
8972
      }
8973
 
8974
      /**
8975
       * Find the _Fields constant that matches name, or null if its not found.
8976
       */
8977
      public static _Fields findByName(String name) {
8978
        return byName.get(name);
8979
      }
8980
 
8981
      private final short _thriftId;
8982
      private final String _fieldName;
8983
 
8984
      _Fields(short thriftId, String fieldName) {
8985
        _thriftId = thriftId;
8986
        _fieldName = fieldName;
8987
      }
8988
 
8989
      public short getThriftFieldId() {
8990
        return _thriftId;
8991
      }
8992
 
8993
      public String getFieldName() {
8994
        return _fieldName;
8995
      }
8996
    }
8997
 
8998
    // isset id assignments
8999
 
3430 rajveer 9000
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9001
    static {
3430 rajveer 9002
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9003
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9004
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9005
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9006
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 9007
    }
9008
 
9009
    public trackCouponUsage_result() {
9010
    }
9011
 
9012
    public trackCouponUsage_result(
9013
      PromotionException pex)
9014
    {
9015
      this();
9016
      this.pex = pex;
9017
    }
9018
 
9019
    /**
9020
     * Performs a deep copy on <i>other</i>.
9021
     */
9022
    public trackCouponUsage_result(trackCouponUsage_result other) {
9023
      if (other.isSetPex()) {
9024
        this.pex = new PromotionException(other.pex);
9025
      }
9026
    }
9027
 
9028
    public trackCouponUsage_result deepCopy() {
9029
      return new trackCouponUsage_result(this);
9030
    }
9031
 
3430 rajveer 9032
    @Override
9033
    public void clear() {
9034
      this.pex = null;
1982 varun.gupt 9035
    }
9036
 
9037
    public PromotionException getPex() {
9038
      return this.pex;
9039
    }
9040
 
3430 rajveer 9041
    public void setPex(PromotionException pex) {
1982 varun.gupt 9042
      this.pex = pex;
9043
    }
9044
 
9045
    public void unsetPex() {
9046
      this.pex = null;
9047
    }
9048
 
3430 rajveer 9049
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9050
    public boolean isSetPex() {
9051
      return this.pex != null;
9052
    }
9053
 
9054
    public void setPexIsSet(boolean value) {
9055
      if (!value) {
9056
        this.pex = null;
9057
      }
9058
    }
9059
 
9060
    public void setFieldValue(_Fields field, Object value) {
9061
      switch (field) {
9062
      case PEX:
9063
        if (value == null) {
9064
          unsetPex();
9065
        } else {
9066
          setPex((PromotionException)value);
9067
        }
9068
        break;
9069
 
9070
      }
9071
    }
9072
 
9073
    public Object getFieldValue(_Fields field) {
9074
      switch (field) {
9075
      case PEX:
9076
        return getPex();
9077
 
9078
      }
9079
      throw new IllegalStateException();
9080
    }
9081
 
3430 rajveer 9082
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9083
    public boolean isSet(_Fields field) {
9084
      if (field == null) {
9085
        throw new IllegalArgumentException();
9086
      }
1982 varun.gupt 9087
 
9088
      switch (field) {
9089
      case PEX:
9090
        return isSetPex();
9091
      }
9092
      throw new IllegalStateException();
9093
    }
9094
 
9095
    @Override
9096
    public boolean equals(Object that) {
9097
      if (that == null)
9098
        return false;
9099
      if (that instanceof trackCouponUsage_result)
9100
        return this.equals((trackCouponUsage_result)that);
9101
      return false;
9102
    }
9103
 
9104
    public boolean equals(trackCouponUsage_result that) {
9105
      if (that == null)
9106
        return false;
9107
 
9108
      boolean this_present_pex = true && this.isSetPex();
9109
      boolean that_present_pex = true && that.isSetPex();
9110
      if (this_present_pex || that_present_pex) {
9111
        if (!(this_present_pex && that_present_pex))
9112
          return false;
9113
        if (!this.pex.equals(that.pex))
9114
          return false;
9115
      }
9116
 
9117
      return true;
9118
    }
9119
 
9120
    @Override
9121
    public int hashCode() {
9122
      return 0;
9123
    }
9124
 
9125
    public int compareTo(trackCouponUsage_result other) {
9126
      if (!getClass().equals(other.getClass())) {
9127
        return getClass().getName().compareTo(other.getClass().getName());
9128
      }
9129
 
9130
      int lastComparison = 0;
9131
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
9132
 
3430 rajveer 9133
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 9134
      if (lastComparison != 0) {
9135
        return lastComparison;
9136
      }
3430 rajveer 9137
      if (isSetPex()) {
9138
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9139
        if (lastComparison != 0) {
9140
          return lastComparison;
9141
        }
1982 varun.gupt 9142
      }
9143
      return 0;
9144
    }
9145
 
3430 rajveer 9146
    public _Fields fieldForId(int fieldId) {
9147
      return _Fields.findByThriftId(fieldId);
9148
    }
9149
 
9150
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9151
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9152
      iprot.readStructBegin();
9153
      while (true)
9154
      {
9155
        field = iprot.readFieldBegin();
3430 rajveer 9156
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9157
          break;
9158
        }
3430 rajveer 9159
        switch (field.id) {
9160
          case 1: // PEX
9161
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9162
              this.pex = new PromotionException();
9163
              this.pex.read(iprot);
9164
            } else { 
9165
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9166
            }
9167
            break;
9168
          default:
9169
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9170
        }
3430 rajveer 9171
        iprot.readFieldEnd();
1982 varun.gupt 9172
      }
9173
      iprot.readStructEnd();
9174
      validate();
9175
    }
9176
 
3430 rajveer 9177
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9178
      oprot.writeStructBegin(STRUCT_DESC);
9179
 
9180
      if (this.isSetPex()) {
9181
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9182
        this.pex.write(oprot);
9183
        oprot.writeFieldEnd();
9184
      }
9185
      oprot.writeFieldStop();
9186
      oprot.writeStructEnd();
9187
    }
9188
 
9189
    @Override
9190
    public String toString() {
9191
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
9192
      boolean first = true;
9193
 
9194
      sb.append("pex:");
9195
      if (this.pex == null) {
9196
        sb.append("null");
9197
      } else {
9198
        sb.append(this.pex);
9199
      }
9200
      first = false;
9201
      sb.append(")");
9202
      return sb.toString();
9203
    }
9204
 
3430 rajveer 9205
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9206
      // check for required fields
9207
    }
9208
 
3430 rajveer 9209
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9210
      try {
9211
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9212
      } catch (org.apache.thrift.TException te) {
9213
        throw new java.io.IOException(te);
9214
      }
9215
    }
9216
 
9217
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9218
      try {
9219
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9220
      } catch (org.apache.thrift.TException te) {
9221
        throw new java.io.IOException(te);
9222
      }
9223
    }
9224
 
1982 varun.gupt 9225
  }
9226
 
3430 rajveer 9227
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
9228
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 9229
 
3430 rajveer 9230
    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);
9231
    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 9232
 
3430 rajveer 9233
    private String couponCode; // required
9234
    private long userId; // required
1982 varun.gupt 9235
 
9236
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9237
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9238
      COUPON_CODE((short)1, "couponCode"),
9239
      USER_ID((short)2, "userId");
9240
 
9241
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9242
 
9243
      static {
9244
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9245
          byName.put(field.getFieldName(), field);
9246
        }
9247
      }
9248
 
9249
      /**
9250
       * Find the _Fields constant that matches fieldId, or null if its not found.
9251
       */
9252
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9253
        switch(fieldId) {
9254
          case 1: // COUPON_CODE
9255
            return COUPON_CODE;
9256
          case 2: // USER_ID
9257
            return USER_ID;
9258
          default:
9259
            return null;
9260
        }
1982 varun.gupt 9261
      }
9262
 
9263
      /**
9264
       * Find the _Fields constant that matches fieldId, throwing an exception
9265
       * if it is not found.
9266
       */
9267
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9268
        _Fields fields = findByThriftId(fieldId);
9269
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9270
        return fields;
9271
      }
9272
 
9273
      /**
9274
       * Find the _Fields constant that matches name, or null if its not found.
9275
       */
9276
      public static _Fields findByName(String name) {
9277
        return byName.get(name);
9278
      }
9279
 
9280
      private final short _thriftId;
9281
      private final String _fieldName;
9282
 
9283
      _Fields(short thriftId, String fieldName) {
9284
        _thriftId = thriftId;
9285
        _fieldName = fieldName;
9286
      }
9287
 
9288
      public short getThriftFieldId() {
9289
        return _thriftId;
9290
      }
9291
 
9292
      public String getFieldName() {
9293
        return _fieldName;
9294
      }
9295
    }
9296
 
9297
    // isset id assignments
9298
    private static final int __USERID_ISSET_ID = 0;
9299
    private BitSet __isset_bit_vector = new BitSet(1);
9300
 
3430 rajveer 9301
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9302
    static {
3430 rajveer 9303
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9304
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9305
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9306
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9307
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9308
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9309
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 9310
    }
9311
 
9312
    public getCouponUsageCountByUser_args() {
9313
    }
9314
 
9315
    public getCouponUsageCountByUser_args(
9316
      String couponCode,
9317
      long userId)
9318
    {
9319
      this();
9320
      this.couponCode = couponCode;
9321
      this.userId = userId;
9322
      setUserIdIsSet(true);
9323
    }
9324
 
9325
    /**
9326
     * Performs a deep copy on <i>other</i>.
9327
     */
9328
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
9329
      __isset_bit_vector.clear();
9330
      __isset_bit_vector.or(other.__isset_bit_vector);
9331
      if (other.isSetCouponCode()) {
9332
        this.couponCode = other.couponCode;
9333
      }
9334
      this.userId = other.userId;
9335
    }
9336
 
9337
    public getCouponUsageCountByUser_args deepCopy() {
9338
      return new getCouponUsageCountByUser_args(this);
9339
    }
9340
 
3430 rajveer 9341
    @Override
9342
    public void clear() {
9343
      this.couponCode = null;
9344
      setUserIdIsSet(false);
9345
      this.userId = 0;
1982 varun.gupt 9346
    }
9347
 
9348
    public String getCouponCode() {
9349
      return this.couponCode;
9350
    }
9351
 
3430 rajveer 9352
    public void setCouponCode(String couponCode) {
1982 varun.gupt 9353
      this.couponCode = couponCode;
9354
    }
9355
 
9356
    public void unsetCouponCode() {
9357
      this.couponCode = null;
9358
    }
9359
 
3430 rajveer 9360
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9361
    public boolean isSetCouponCode() {
9362
      return this.couponCode != null;
9363
    }
9364
 
9365
    public void setCouponCodeIsSet(boolean value) {
9366
      if (!value) {
9367
        this.couponCode = null;
9368
      }
9369
    }
9370
 
9371
    public long getUserId() {
9372
      return this.userId;
9373
    }
9374
 
3430 rajveer 9375
    public void setUserId(long userId) {
1982 varun.gupt 9376
      this.userId = userId;
9377
      setUserIdIsSet(true);
9378
    }
9379
 
9380
    public void unsetUserId() {
9381
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9382
    }
9383
 
3430 rajveer 9384
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9385
    public boolean isSetUserId() {
9386
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9387
    }
9388
 
9389
    public void setUserIdIsSet(boolean value) {
9390
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9391
    }
9392
 
9393
    public void setFieldValue(_Fields field, Object value) {
9394
      switch (field) {
9395
      case COUPON_CODE:
9396
        if (value == null) {
9397
          unsetCouponCode();
9398
        } else {
9399
          setCouponCode((String)value);
9400
        }
9401
        break;
9402
 
9403
      case USER_ID:
9404
        if (value == null) {
9405
          unsetUserId();
9406
        } else {
9407
          setUserId((Long)value);
9408
        }
9409
        break;
9410
 
9411
      }
9412
    }
9413
 
9414
    public Object getFieldValue(_Fields field) {
9415
      switch (field) {
9416
      case COUPON_CODE:
9417
        return getCouponCode();
9418
 
9419
      case USER_ID:
3430 rajveer 9420
        return Long.valueOf(getUserId());
1982 varun.gupt 9421
 
9422
      }
9423
      throw new IllegalStateException();
9424
    }
9425
 
3430 rajveer 9426
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9427
    public boolean isSet(_Fields field) {
9428
      if (field == null) {
9429
        throw new IllegalArgumentException();
9430
      }
1982 varun.gupt 9431
 
9432
      switch (field) {
9433
      case COUPON_CODE:
9434
        return isSetCouponCode();
9435
      case USER_ID:
9436
        return isSetUserId();
9437
      }
9438
      throw new IllegalStateException();
9439
    }
9440
 
9441
    @Override
9442
    public boolean equals(Object that) {
9443
      if (that == null)
9444
        return false;
9445
      if (that instanceof getCouponUsageCountByUser_args)
9446
        return this.equals((getCouponUsageCountByUser_args)that);
9447
      return false;
9448
    }
9449
 
9450
    public boolean equals(getCouponUsageCountByUser_args that) {
9451
      if (that == null)
9452
        return false;
9453
 
9454
      boolean this_present_couponCode = true && this.isSetCouponCode();
9455
      boolean that_present_couponCode = true && that.isSetCouponCode();
9456
      if (this_present_couponCode || that_present_couponCode) {
9457
        if (!(this_present_couponCode && that_present_couponCode))
9458
          return false;
9459
        if (!this.couponCode.equals(that.couponCode))
9460
          return false;
9461
      }
9462
 
9463
      boolean this_present_userId = true;
9464
      boolean that_present_userId = true;
9465
      if (this_present_userId || that_present_userId) {
9466
        if (!(this_present_userId && that_present_userId))
9467
          return false;
9468
        if (this.userId != that.userId)
9469
          return false;
9470
      }
9471
 
9472
      return true;
9473
    }
9474
 
9475
    @Override
9476
    public int hashCode() {
9477
      return 0;
9478
    }
9479
 
9480
    public int compareTo(getCouponUsageCountByUser_args other) {
9481
      if (!getClass().equals(other.getClass())) {
9482
        return getClass().getName().compareTo(other.getClass().getName());
9483
      }
9484
 
9485
      int lastComparison = 0;
9486
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
9487
 
3430 rajveer 9488
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 9489
      if (lastComparison != 0) {
9490
        return lastComparison;
9491
      }
3430 rajveer 9492
      if (isSetCouponCode()) {
9493
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9494
        if (lastComparison != 0) {
9495
          return lastComparison;
9496
        }
1982 varun.gupt 9497
      }
3430 rajveer 9498
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 9499
      if (lastComparison != 0) {
9500
        return lastComparison;
9501
      }
3430 rajveer 9502
      if (isSetUserId()) {
9503
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9504
        if (lastComparison != 0) {
9505
          return lastComparison;
9506
        }
1982 varun.gupt 9507
      }
9508
      return 0;
9509
    }
9510
 
3430 rajveer 9511
    public _Fields fieldForId(int fieldId) {
9512
      return _Fields.findByThriftId(fieldId);
9513
    }
9514
 
9515
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9516
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9517
      iprot.readStructBegin();
9518
      while (true)
9519
      {
9520
        field = iprot.readFieldBegin();
3430 rajveer 9521
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9522
          break;
9523
        }
3430 rajveer 9524
        switch (field.id) {
9525
          case 1: // COUPON_CODE
9526
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9527
              this.couponCode = iprot.readString();
9528
            } else { 
9529
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9530
            }
9531
            break;
9532
          case 2: // USER_ID
9533
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9534
              this.userId = iprot.readI64();
9535
              setUserIdIsSet(true);
9536
            } else { 
9537
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9538
            }
9539
            break;
9540
          default:
9541
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9542
        }
3430 rajveer 9543
        iprot.readFieldEnd();
1982 varun.gupt 9544
      }
9545
      iprot.readStructEnd();
9546
      validate();
9547
    }
9548
 
3430 rajveer 9549
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9550
      validate();
9551
 
9552
      oprot.writeStructBegin(STRUCT_DESC);
9553
      if (this.couponCode != null) {
9554
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9555
        oprot.writeString(this.couponCode);
9556
        oprot.writeFieldEnd();
9557
      }
9558
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9559
      oprot.writeI64(this.userId);
9560
      oprot.writeFieldEnd();
9561
      oprot.writeFieldStop();
9562
      oprot.writeStructEnd();
9563
    }
9564
 
9565
    @Override
9566
    public String toString() {
9567
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
9568
      boolean first = true;
9569
 
9570
      sb.append("couponCode:");
9571
      if (this.couponCode == null) {
9572
        sb.append("null");
9573
      } else {
9574
        sb.append(this.couponCode);
9575
      }
9576
      first = false;
9577
      if (!first) sb.append(", ");
9578
      sb.append("userId:");
9579
      sb.append(this.userId);
9580
      first = false;
9581
      sb.append(")");
9582
      return sb.toString();
9583
    }
9584
 
3430 rajveer 9585
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9586
      // check for required fields
9587
    }
9588
 
3430 rajveer 9589
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9590
      try {
9591
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9592
      } catch (org.apache.thrift.TException te) {
9593
        throw new java.io.IOException(te);
9594
      }
9595
    }
9596
 
9597
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9598
      try {
9599
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9600
        __isset_bit_vector = new BitSet(1);
9601
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9602
      } catch (org.apache.thrift.TException te) {
9603
        throw new java.io.IOException(te);
9604
      }
9605
    }
9606
 
1982 varun.gupt 9607
  }
9608
 
3430 rajveer 9609
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
9610
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 9611
 
3430 rajveer 9612
    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);
9613
    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 9614
 
3430 rajveer 9615
    private long success; // required
9616
    private PromotionException pex; // required
1982 varun.gupt 9617
 
9618
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9619
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9620
      SUCCESS((short)0, "success"),
9621
      PEX((short)1, "pex");
9622
 
9623
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9624
 
9625
      static {
9626
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9627
          byName.put(field.getFieldName(), field);
9628
        }
9629
      }
9630
 
9631
      /**
9632
       * Find the _Fields constant that matches fieldId, or null if its not found.
9633
       */
9634
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9635
        switch(fieldId) {
9636
          case 0: // SUCCESS
9637
            return SUCCESS;
9638
          case 1: // PEX
9639
            return PEX;
9640
          default:
9641
            return null;
9642
        }
1982 varun.gupt 9643
      }
9644
 
9645
      /**
9646
       * Find the _Fields constant that matches fieldId, throwing an exception
9647
       * if it is not found.
9648
       */
9649
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9650
        _Fields fields = findByThriftId(fieldId);
9651
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9652
        return fields;
9653
      }
9654
 
9655
      /**
9656
       * Find the _Fields constant that matches name, or null if its not found.
9657
       */
9658
      public static _Fields findByName(String name) {
9659
        return byName.get(name);
9660
      }
9661
 
9662
      private final short _thriftId;
9663
      private final String _fieldName;
9664
 
9665
      _Fields(short thriftId, String fieldName) {
9666
        _thriftId = thriftId;
9667
        _fieldName = fieldName;
9668
      }
9669
 
9670
      public short getThriftFieldId() {
9671
        return _thriftId;
9672
      }
9673
 
9674
      public String getFieldName() {
9675
        return _fieldName;
9676
      }
9677
    }
9678
 
9679
    // isset id assignments
9680
    private static final int __SUCCESS_ISSET_ID = 0;
9681
    private BitSet __isset_bit_vector = new BitSet(1);
9682
 
3430 rajveer 9683
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9684
    static {
3430 rajveer 9685
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9686
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9687
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9688
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9689
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9690
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9691
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 9692
    }
9693
 
9694
    public getCouponUsageCountByUser_result() {
9695
    }
9696
 
9697
    public getCouponUsageCountByUser_result(
9698
      long success,
9699
      PromotionException pex)
9700
    {
9701
      this();
9702
      this.success = success;
9703
      setSuccessIsSet(true);
9704
      this.pex = pex;
9705
    }
9706
 
9707
    /**
9708
     * Performs a deep copy on <i>other</i>.
9709
     */
9710
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
9711
      __isset_bit_vector.clear();
9712
      __isset_bit_vector.or(other.__isset_bit_vector);
9713
      this.success = other.success;
9714
      if (other.isSetPex()) {
9715
        this.pex = new PromotionException(other.pex);
9716
      }
9717
    }
9718
 
9719
    public getCouponUsageCountByUser_result deepCopy() {
9720
      return new getCouponUsageCountByUser_result(this);
9721
    }
9722
 
3430 rajveer 9723
    @Override
9724
    public void clear() {
9725
      setSuccessIsSet(false);
9726
      this.success = 0;
9727
      this.pex = null;
1982 varun.gupt 9728
    }
9729
 
9730
    public long getSuccess() {
9731
      return this.success;
9732
    }
9733
 
3430 rajveer 9734
    public void setSuccess(long success) {
1982 varun.gupt 9735
      this.success = success;
9736
      setSuccessIsSet(true);
9737
    }
9738
 
9739
    public void unsetSuccess() {
9740
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
9741
    }
9742
 
3430 rajveer 9743
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9744
    public boolean isSetSuccess() {
9745
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
9746
    }
9747
 
9748
    public void setSuccessIsSet(boolean value) {
9749
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
9750
    }
9751
 
9752
    public PromotionException getPex() {
9753
      return this.pex;
9754
    }
9755
 
3430 rajveer 9756
    public void setPex(PromotionException pex) {
1982 varun.gupt 9757
      this.pex = pex;
9758
    }
9759
 
9760
    public void unsetPex() {
9761
      this.pex = null;
9762
    }
9763
 
3430 rajveer 9764
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9765
    public boolean isSetPex() {
9766
      return this.pex != null;
9767
    }
9768
 
9769
    public void setPexIsSet(boolean value) {
9770
      if (!value) {
9771
        this.pex = null;
9772
      }
9773
    }
9774
 
9775
    public void setFieldValue(_Fields field, Object value) {
9776
      switch (field) {
9777
      case SUCCESS:
9778
        if (value == null) {
9779
          unsetSuccess();
9780
        } else {
9781
          setSuccess((Long)value);
9782
        }
9783
        break;
9784
 
9785
      case PEX:
9786
        if (value == null) {
9787
          unsetPex();
9788
        } else {
9789
          setPex((PromotionException)value);
9790
        }
9791
        break;
9792
 
9793
      }
9794
    }
9795
 
9796
    public Object getFieldValue(_Fields field) {
9797
      switch (field) {
9798
      case SUCCESS:
3430 rajveer 9799
        return Long.valueOf(getSuccess());
1982 varun.gupt 9800
 
9801
      case PEX:
9802
        return getPex();
9803
 
9804
      }
9805
      throw new IllegalStateException();
9806
    }
9807
 
3430 rajveer 9808
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9809
    public boolean isSet(_Fields field) {
9810
      if (field == null) {
9811
        throw new IllegalArgumentException();
9812
      }
1982 varun.gupt 9813
 
9814
      switch (field) {
9815
      case SUCCESS:
9816
        return isSetSuccess();
9817
      case PEX:
9818
        return isSetPex();
9819
      }
9820
      throw new IllegalStateException();
9821
    }
9822
 
9823
    @Override
9824
    public boolean equals(Object that) {
9825
      if (that == null)
9826
        return false;
9827
      if (that instanceof getCouponUsageCountByUser_result)
9828
        return this.equals((getCouponUsageCountByUser_result)that);
9829
      return false;
9830
    }
9831
 
9832
    public boolean equals(getCouponUsageCountByUser_result that) {
9833
      if (that == null)
9834
        return false;
9835
 
9836
      boolean this_present_success = true;
9837
      boolean that_present_success = true;
9838
      if (this_present_success || that_present_success) {
9839
        if (!(this_present_success && that_present_success))
9840
          return false;
9841
        if (this.success != that.success)
9842
          return false;
9843
      }
9844
 
9845
      boolean this_present_pex = true && this.isSetPex();
9846
      boolean that_present_pex = true && that.isSetPex();
9847
      if (this_present_pex || that_present_pex) {
9848
        if (!(this_present_pex && that_present_pex))
9849
          return false;
9850
        if (!this.pex.equals(that.pex))
9851
          return false;
9852
      }
9853
 
9854
      return true;
9855
    }
9856
 
9857
    @Override
9858
    public int hashCode() {
9859
      return 0;
9860
    }
9861
 
9862
    public int compareTo(getCouponUsageCountByUser_result other) {
9863
      if (!getClass().equals(other.getClass())) {
9864
        return getClass().getName().compareTo(other.getClass().getName());
9865
      }
9866
 
9867
      int lastComparison = 0;
9868
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
9869
 
3430 rajveer 9870
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 9871
      if (lastComparison != 0) {
9872
        return lastComparison;
9873
      }
3430 rajveer 9874
      if (isSetSuccess()) {
9875
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9876
        if (lastComparison != 0) {
9877
          return lastComparison;
9878
        }
1982 varun.gupt 9879
      }
3430 rajveer 9880
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 9881
      if (lastComparison != 0) {
9882
        return lastComparison;
9883
      }
3430 rajveer 9884
      if (isSetPex()) {
9885
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9886
        if (lastComparison != 0) {
9887
          return lastComparison;
9888
        }
1982 varun.gupt 9889
      }
9890
      return 0;
9891
    }
9892
 
3430 rajveer 9893
    public _Fields fieldForId(int fieldId) {
9894
      return _Fields.findByThriftId(fieldId);
9895
    }
9896
 
9897
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9898
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9899
      iprot.readStructBegin();
9900
      while (true)
9901
      {
9902
        field = iprot.readFieldBegin();
3430 rajveer 9903
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9904
          break;
9905
        }
3430 rajveer 9906
        switch (field.id) {
9907
          case 0: // SUCCESS
9908
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9909
              this.success = iprot.readI64();
9910
              setSuccessIsSet(true);
9911
            } else { 
9912
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9913
            }
9914
            break;
9915
          case 1: // PEX
9916
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9917
              this.pex = new PromotionException();
9918
              this.pex.read(iprot);
9919
            } else { 
9920
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9921
            }
9922
            break;
9923
          default:
9924
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9925
        }
3430 rajveer 9926
        iprot.readFieldEnd();
1982 varun.gupt 9927
      }
9928
      iprot.readStructEnd();
9929
      validate();
9930
    }
9931
 
3430 rajveer 9932
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9933
      oprot.writeStructBegin(STRUCT_DESC);
9934
 
9935
      if (this.isSetSuccess()) {
9936
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9937
        oprot.writeI64(this.success);
9938
        oprot.writeFieldEnd();
9939
      } else if (this.isSetPex()) {
9940
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9941
        this.pex.write(oprot);
9942
        oprot.writeFieldEnd();
9943
      }
9944
      oprot.writeFieldStop();
9945
      oprot.writeStructEnd();
9946
    }
9947
 
9948
    @Override
9949
    public String toString() {
9950
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
9951
      boolean first = true;
9952
 
9953
      sb.append("success:");
9954
      sb.append(this.success);
9955
      first = false;
9956
      if (!first) sb.append(", ");
9957
      sb.append("pex:");
9958
      if (this.pex == null) {
9959
        sb.append("null");
9960
      } else {
9961
        sb.append(this.pex);
9962
      }
9963
      first = false;
9964
      sb.append(")");
9965
      return sb.toString();
9966
    }
9967
 
3430 rajveer 9968
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9969
      // check for required fields
9970
    }
9971
 
3430 rajveer 9972
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9973
      try {
9974
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9975
      } catch (org.apache.thrift.TException te) {
9976
        throw new java.io.IOException(te);
9977
      }
9978
    }
9979
 
9980
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9981
      try {
9982
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9983
      } catch (org.apache.thrift.TException te) {
9984
        throw new java.io.IOException(te);
9985
      }
9986
    }
9987
 
1982 varun.gupt 9988
  }
9989
 
6497 amit.gupta 9990
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
9991
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
9992
 
9993
    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);
9994
 
9995
    private long promotionId; // required
9996
 
9997
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9998
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9999
      PROMOTION_ID((short)1, "promotionId");
10000
 
10001
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10002
 
10003
      static {
10004
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10005
          byName.put(field.getFieldName(), field);
10006
        }
10007
      }
10008
 
10009
      /**
10010
       * Find the _Fields constant that matches fieldId, or null if its not found.
10011
       */
10012
      public static _Fields findByThriftId(int fieldId) {
10013
        switch(fieldId) {
10014
          case 1: // PROMOTION_ID
10015
            return PROMOTION_ID;
10016
          default:
10017
            return null;
10018
        }
10019
      }
10020
 
10021
      /**
10022
       * Find the _Fields constant that matches fieldId, throwing an exception
10023
       * if it is not found.
10024
       */
10025
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10026
        _Fields fields = findByThriftId(fieldId);
10027
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10028
        return fields;
10029
      }
10030
 
10031
      /**
10032
       * Find the _Fields constant that matches name, or null if its not found.
10033
       */
10034
      public static _Fields findByName(String name) {
10035
        return byName.get(name);
10036
      }
10037
 
10038
      private final short _thriftId;
10039
      private final String _fieldName;
10040
 
10041
      _Fields(short thriftId, String fieldName) {
10042
        _thriftId = thriftId;
10043
        _fieldName = fieldName;
10044
      }
10045
 
10046
      public short getThriftFieldId() {
10047
        return _thriftId;
10048
      }
10049
 
10050
      public String getFieldName() {
10051
        return _fieldName;
10052
      }
10053
    }
10054
 
10055
    // isset id assignments
10056
    private static final int __PROMOTIONID_ISSET_ID = 0;
10057
    private BitSet __isset_bit_vector = new BitSet(1);
10058
 
10059
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10060
    static {
10061
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10062
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10063
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10064
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10065
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
10066
    }
10067
 
10068
    public getActiveCodes_args() {
10069
    }
10070
 
10071
    public getActiveCodes_args(
10072
      long promotionId)
10073
    {
10074
      this();
10075
      this.promotionId = promotionId;
10076
      setPromotionIdIsSet(true);
10077
    }
10078
 
10079
    /**
10080
     * Performs a deep copy on <i>other</i>.
10081
     */
10082
    public getActiveCodes_args(getActiveCodes_args other) {
10083
      __isset_bit_vector.clear();
10084
      __isset_bit_vector.or(other.__isset_bit_vector);
10085
      this.promotionId = other.promotionId;
10086
    }
10087
 
10088
    public getActiveCodes_args deepCopy() {
10089
      return new getActiveCodes_args(this);
10090
    }
10091
 
10092
    @Override
10093
    public void clear() {
10094
      setPromotionIdIsSet(false);
10095
      this.promotionId = 0;
10096
    }
10097
 
10098
    public long getPromotionId() {
10099
      return this.promotionId;
10100
    }
10101
 
10102
    public void setPromotionId(long promotionId) {
10103
      this.promotionId = promotionId;
10104
      setPromotionIdIsSet(true);
10105
    }
10106
 
10107
    public void unsetPromotionId() {
10108
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
10109
    }
10110
 
10111
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
10112
    public boolean isSetPromotionId() {
10113
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
10114
    }
10115
 
10116
    public void setPromotionIdIsSet(boolean value) {
10117
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
10118
    }
10119
 
10120
    public void setFieldValue(_Fields field, Object value) {
10121
      switch (field) {
10122
      case PROMOTION_ID:
10123
        if (value == null) {
10124
          unsetPromotionId();
10125
        } else {
10126
          setPromotionId((Long)value);
10127
        }
10128
        break;
10129
 
10130
      }
10131
    }
10132
 
10133
    public Object getFieldValue(_Fields field) {
10134
      switch (field) {
10135
      case PROMOTION_ID:
10136
        return Long.valueOf(getPromotionId());
10137
 
10138
      }
10139
      throw new IllegalStateException();
10140
    }
10141
 
10142
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10143
    public boolean isSet(_Fields field) {
10144
      if (field == null) {
10145
        throw new IllegalArgumentException();
10146
      }
10147
 
10148
      switch (field) {
10149
      case PROMOTION_ID:
10150
        return isSetPromotionId();
10151
      }
10152
      throw new IllegalStateException();
10153
    }
10154
 
10155
    @Override
10156
    public boolean equals(Object that) {
10157
      if (that == null)
10158
        return false;
10159
      if (that instanceof getActiveCodes_args)
10160
        return this.equals((getActiveCodes_args)that);
10161
      return false;
10162
    }
10163
 
10164
    public boolean equals(getActiveCodes_args that) {
10165
      if (that == null)
10166
        return false;
10167
 
10168
      boolean this_present_promotionId = true;
10169
      boolean that_present_promotionId = true;
10170
      if (this_present_promotionId || that_present_promotionId) {
10171
        if (!(this_present_promotionId && that_present_promotionId))
10172
          return false;
10173
        if (this.promotionId != that.promotionId)
10174
          return false;
10175
      }
10176
 
10177
      return true;
10178
    }
10179
 
10180
    @Override
10181
    public int hashCode() {
10182
      return 0;
10183
    }
10184
 
10185
    public int compareTo(getActiveCodes_args other) {
10186
      if (!getClass().equals(other.getClass())) {
10187
        return getClass().getName().compareTo(other.getClass().getName());
10188
      }
10189
 
10190
      int lastComparison = 0;
10191
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
10192
 
10193
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
10194
      if (lastComparison != 0) {
10195
        return lastComparison;
10196
      }
10197
      if (isSetPromotionId()) {
10198
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
10199
        if (lastComparison != 0) {
10200
          return lastComparison;
10201
        }
10202
      }
10203
      return 0;
10204
    }
10205
 
10206
    public _Fields fieldForId(int fieldId) {
10207
      return _Fields.findByThriftId(fieldId);
10208
    }
10209
 
10210
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10211
      org.apache.thrift.protocol.TField field;
10212
      iprot.readStructBegin();
10213
      while (true)
10214
      {
10215
        field = iprot.readFieldBegin();
10216
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10217
          break;
10218
        }
10219
        switch (field.id) {
10220
          case 1: // PROMOTION_ID
10221
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10222
              this.promotionId = iprot.readI64();
10223
              setPromotionIdIsSet(true);
10224
            } else { 
10225
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10226
            }
10227
            break;
10228
          default:
10229
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10230
        }
10231
        iprot.readFieldEnd();
10232
      }
10233
      iprot.readStructEnd();
10234
      validate();
10235
    }
10236
 
10237
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10238
      validate();
10239
 
10240
      oprot.writeStructBegin(STRUCT_DESC);
10241
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
10242
      oprot.writeI64(this.promotionId);
10243
      oprot.writeFieldEnd();
10244
      oprot.writeFieldStop();
10245
      oprot.writeStructEnd();
10246
    }
10247
 
10248
    @Override
10249
    public String toString() {
10250
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
10251
      boolean first = true;
10252
 
10253
      sb.append("promotionId:");
10254
      sb.append(this.promotionId);
10255
      first = false;
10256
      sb.append(")");
10257
      return sb.toString();
10258
    }
10259
 
10260
    public void validate() throws org.apache.thrift.TException {
10261
      // check for required fields
10262
    }
10263
 
10264
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10265
      try {
10266
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10267
      } catch (org.apache.thrift.TException te) {
10268
        throw new java.io.IOException(te);
10269
      }
10270
    }
10271
 
10272
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10273
      try {
10274
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10275
        __isset_bit_vector = new BitSet(1);
10276
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10277
      } catch (org.apache.thrift.TException te) {
10278
        throw new java.io.IOException(te);
10279
      }
10280
    }
10281
 
10282
  }
10283
 
10284
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
10285
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
10286
 
10287
    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);
10288
    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);
10289
 
10290
    private List<Coupon> success; // required
10291
    private PromotionException pex; // required
10292
 
10293
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10294
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10295
      SUCCESS((short)0, "success"),
10296
      PEX((short)1, "pex");
10297
 
10298
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10299
 
10300
      static {
10301
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10302
          byName.put(field.getFieldName(), field);
10303
        }
10304
      }
10305
 
10306
      /**
10307
       * Find the _Fields constant that matches fieldId, or null if its not found.
10308
       */
10309
      public static _Fields findByThriftId(int fieldId) {
10310
        switch(fieldId) {
10311
          case 0: // SUCCESS
10312
            return SUCCESS;
10313
          case 1: // PEX
10314
            return PEX;
10315
          default:
10316
            return null;
10317
        }
10318
      }
10319
 
10320
      /**
10321
       * Find the _Fields constant that matches fieldId, throwing an exception
10322
       * if it is not found.
10323
       */
10324
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10325
        _Fields fields = findByThriftId(fieldId);
10326
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10327
        return fields;
10328
      }
10329
 
10330
      /**
10331
       * Find the _Fields constant that matches name, or null if its not found.
10332
       */
10333
      public static _Fields findByName(String name) {
10334
        return byName.get(name);
10335
      }
10336
 
10337
      private final short _thriftId;
10338
      private final String _fieldName;
10339
 
10340
      _Fields(short thriftId, String fieldName) {
10341
        _thriftId = thriftId;
10342
        _fieldName = fieldName;
10343
      }
10344
 
10345
      public short getThriftFieldId() {
10346
        return _thriftId;
10347
      }
10348
 
10349
      public String getFieldName() {
10350
        return _fieldName;
10351
      }
10352
    }
10353
 
10354
    // isset id assignments
10355
 
10356
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10357
    static {
10358
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10359
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10360
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
10361
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
10362
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10363
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10364
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10365
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
10366
    }
10367
 
10368
    public getActiveCodes_result() {
10369
    }
10370
 
10371
    public getActiveCodes_result(
10372
      List<Coupon> success,
10373
      PromotionException pex)
10374
    {
10375
      this();
10376
      this.success = success;
10377
      this.pex = pex;
10378
    }
10379
 
10380
    /**
10381
     * Performs a deep copy on <i>other</i>.
10382
     */
10383
    public getActiveCodes_result(getActiveCodes_result other) {
10384
      if (other.isSetSuccess()) {
10385
        List<Coupon> __this__success = new ArrayList<Coupon>();
10386
        for (Coupon other_element : other.success) {
10387
          __this__success.add(new Coupon(other_element));
10388
        }
10389
        this.success = __this__success;
10390
      }
10391
      if (other.isSetPex()) {
10392
        this.pex = new PromotionException(other.pex);
10393
      }
10394
    }
10395
 
10396
    public getActiveCodes_result deepCopy() {
10397
      return new getActiveCodes_result(this);
10398
    }
10399
 
10400
    @Override
10401
    public void clear() {
10402
      this.success = null;
10403
      this.pex = null;
10404
    }
10405
 
10406
    public int getSuccessSize() {
10407
      return (this.success == null) ? 0 : this.success.size();
10408
    }
10409
 
10410
    public java.util.Iterator<Coupon> getSuccessIterator() {
10411
      return (this.success == null) ? null : this.success.iterator();
10412
    }
10413
 
10414
    public void addToSuccess(Coupon elem) {
10415
      if (this.success == null) {
10416
        this.success = new ArrayList<Coupon>();
10417
      }
10418
      this.success.add(elem);
10419
    }
10420
 
10421
    public List<Coupon> getSuccess() {
10422
      return this.success;
10423
    }
10424
 
10425
    public void setSuccess(List<Coupon> success) {
10426
      this.success = success;
10427
    }
10428
 
10429
    public void unsetSuccess() {
10430
      this.success = null;
10431
    }
10432
 
10433
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
10434
    public boolean isSetSuccess() {
10435
      return this.success != null;
10436
    }
10437
 
10438
    public void setSuccessIsSet(boolean value) {
10439
      if (!value) {
10440
        this.success = null;
10441
      }
10442
    }
10443
 
10444
    public PromotionException getPex() {
10445
      return this.pex;
10446
    }
10447
 
10448
    public void setPex(PromotionException pex) {
10449
      this.pex = pex;
10450
    }
10451
 
10452
    public void unsetPex() {
10453
      this.pex = null;
10454
    }
10455
 
10456
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
10457
    public boolean isSetPex() {
10458
      return this.pex != null;
10459
    }
10460
 
10461
    public void setPexIsSet(boolean value) {
10462
      if (!value) {
10463
        this.pex = null;
10464
      }
10465
    }
10466
 
10467
    public void setFieldValue(_Fields field, Object value) {
10468
      switch (field) {
10469
      case SUCCESS:
10470
        if (value == null) {
10471
          unsetSuccess();
10472
        } else {
10473
          setSuccess((List<Coupon>)value);
10474
        }
10475
        break;
10476
 
10477
      case PEX:
10478
        if (value == null) {
10479
          unsetPex();
10480
        } else {
10481
          setPex((PromotionException)value);
10482
        }
10483
        break;
10484
 
10485
      }
10486
    }
10487
 
10488
    public Object getFieldValue(_Fields field) {
10489
      switch (field) {
10490
      case SUCCESS:
10491
        return getSuccess();
10492
 
10493
      case PEX:
10494
        return getPex();
10495
 
10496
      }
10497
      throw new IllegalStateException();
10498
    }
10499
 
10500
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10501
    public boolean isSet(_Fields field) {
10502
      if (field == null) {
10503
        throw new IllegalArgumentException();
10504
      }
10505
 
10506
      switch (field) {
10507
      case SUCCESS:
10508
        return isSetSuccess();
10509
      case PEX:
10510
        return isSetPex();
10511
      }
10512
      throw new IllegalStateException();
10513
    }
10514
 
10515
    @Override
10516
    public boolean equals(Object that) {
10517
      if (that == null)
10518
        return false;
10519
      if (that instanceof getActiveCodes_result)
10520
        return this.equals((getActiveCodes_result)that);
10521
      return false;
10522
    }
10523
 
10524
    public boolean equals(getActiveCodes_result that) {
10525
      if (that == null)
10526
        return false;
10527
 
10528
      boolean this_present_success = true && this.isSetSuccess();
10529
      boolean that_present_success = true && that.isSetSuccess();
10530
      if (this_present_success || that_present_success) {
10531
        if (!(this_present_success && that_present_success))
10532
          return false;
10533
        if (!this.success.equals(that.success))
10534
          return false;
10535
      }
10536
 
10537
      boolean this_present_pex = true && this.isSetPex();
10538
      boolean that_present_pex = true && that.isSetPex();
10539
      if (this_present_pex || that_present_pex) {
10540
        if (!(this_present_pex && that_present_pex))
10541
          return false;
10542
        if (!this.pex.equals(that.pex))
10543
          return false;
10544
      }
10545
 
10546
      return true;
10547
    }
10548
 
10549
    @Override
10550
    public int hashCode() {
10551
      return 0;
10552
    }
10553
 
10554
    public int compareTo(getActiveCodes_result other) {
10555
      if (!getClass().equals(other.getClass())) {
10556
        return getClass().getName().compareTo(other.getClass().getName());
10557
      }
10558
 
10559
      int lastComparison = 0;
10560
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
10561
 
10562
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
10563
      if (lastComparison != 0) {
10564
        return lastComparison;
10565
      }
10566
      if (isSetSuccess()) {
10567
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10568
        if (lastComparison != 0) {
10569
          return lastComparison;
10570
        }
10571
      }
10572
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
10573
      if (lastComparison != 0) {
10574
        return lastComparison;
10575
      }
10576
      if (isSetPex()) {
10577
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10578
        if (lastComparison != 0) {
10579
          return lastComparison;
10580
        }
10581
      }
10582
      return 0;
10583
    }
10584
 
10585
    public _Fields fieldForId(int fieldId) {
10586
      return _Fields.findByThriftId(fieldId);
10587
    }
10588
 
10589
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10590
      org.apache.thrift.protocol.TField field;
10591
      iprot.readStructBegin();
10592
      while (true)
10593
      {
10594
        field = iprot.readFieldBegin();
10595
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10596
          break;
10597
        }
10598
        switch (field.id) {
10599
          case 0: // SUCCESS
10600
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
10601
              {
10602
                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
10603
                this.success = new ArrayList<Coupon>(_list21.size);
10604
                for (int _i22 = 0; _i22 < _list21.size; ++_i22)
10605
                {
10606
                  Coupon _elem23; // required
10607
                  _elem23 = new Coupon();
10608
                  _elem23.read(iprot);
10609
                  this.success.add(_elem23);
10610
                }
10611
                iprot.readListEnd();
10612
              }
10613
            } else { 
10614
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10615
            }
10616
            break;
10617
          case 1: // PEX
10618
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10619
              this.pex = new PromotionException();
10620
              this.pex.read(iprot);
10621
            } else { 
10622
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10623
            }
10624
            break;
10625
          default:
10626
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10627
        }
10628
        iprot.readFieldEnd();
10629
      }
10630
      iprot.readStructEnd();
10631
      validate();
10632
    }
10633
 
10634
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10635
      oprot.writeStructBegin(STRUCT_DESC);
10636
 
10637
      if (this.isSetSuccess()) {
10638
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10639
        {
10640
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
10641
          for (Coupon _iter24 : this.success)
10642
          {
10643
            _iter24.write(oprot);
10644
          }
10645
          oprot.writeListEnd();
10646
        }
10647
        oprot.writeFieldEnd();
10648
      } else if (this.isSetPex()) {
10649
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10650
        this.pex.write(oprot);
10651
        oprot.writeFieldEnd();
10652
      }
10653
      oprot.writeFieldStop();
10654
      oprot.writeStructEnd();
10655
    }
10656
 
10657
    @Override
10658
    public String toString() {
10659
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
10660
      boolean first = true;
10661
 
10662
      sb.append("success:");
10663
      if (this.success == null) {
10664
        sb.append("null");
10665
      } else {
10666
        sb.append(this.success);
10667
      }
10668
      first = false;
10669
      if (!first) sb.append(", ");
10670
      sb.append("pex:");
10671
      if (this.pex == null) {
10672
        sb.append("null");
10673
      } else {
10674
        sb.append(this.pex);
10675
      }
10676
      first = false;
10677
      sb.append(")");
10678
      return sb.toString();
10679
    }
10680
 
10681
    public void validate() throws org.apache.thrift.TException {
10682
      // check for required fields
10683
    }
10684
 
10685
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10686
      try {
10687
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10688
      } catch (org.apache.thrift.TException te) {
10689
        throw new java.io.IOException(te);
10690
      }
10691
    }
10692
 
10693
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10694
      try {
10695
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10696
      } catch (org.apache.thrift.TException te) {
10697
        throw new java.io.IOException(te);
10698
      }
10699
    }
10700
 
10701
  }
10702
 
10703
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
10704
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
10705
 
10706
    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);
10707
 
10708
    private String couponCode; // required
10709
 
10710
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10711
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10712
      COUPON_CODE((short)1, "couponCode");
10713
 
10714
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10715
 
10716
      static {
10717
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10718
          byName.put(field.getFieldName(), field);
10719
        }
10720
      }
10721
 
10722
      /**
10723
       * Find the _Fields constant that matches fieldId, or null if its not found.
10724
       */
10725
      public static _Fields findByThriftId(int fieldId) {
10726
        switch(fieldId) {
10727
          case 1: // COUPON_CODE
10728
            return COUPON_CODE;
10729
          default:
10730
            return null;
10731
        }
10732
      }
10733
 
10734
      /**
10735
       * Find the _Fields constant that matches fieldId, throwing an exception
10736
       * if it is not found.
10737
       */
10738
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10739
        _Fields fields = findByThriftId(fieldId);
10740
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10741
        return fields;
10742
      }
10743
 
10744
      /**
10745
       * Find the _Fields constant that matches name, or null if its not found.
10746
       */
10747
      public static _Fields findByName(String name) {
10748
        return byName.get(name);
10749
      }
10750
 
10751
      private final short _thriftId;
10752
      private final String _fieldName;
10753
 
10754
      _Fields(short thriftId, String fieldName) {
10755
        _thriftId = thriftId;
10756
        _fieldName = fieldName;
10757
      }
10758
 
10759
      public short getThriftFieldId() {
10760
        return _thriftId;
10761
      }
10762
 
10763
      public String getFieldName() {
10764
        return _fieldName;
10765
      }
10766
    }
10767
 
10768
    // isset id assignments
10769
 
10770
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10771
    static {
10772
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10773
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10774
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10775
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10776
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
10777
    }
10778
 
10779
    public deleteCoupon_args() {
10780
    }
10781
 
10782
    public deleteCoupon_args(
10783
      String couponCode)
10784
    {
10785
      this();
10786
      this.couponCode = couponCode;
10787
    }
10788
 
10789
    /**
10790
     * Performs a deep copy on <i>other</i>.
10791
     */
10792
    public deleteCoupon_args(deleteCoupon_args other) {
10793
      if (other.isSetCouponCode()) {
10794
        this.couponCode = other.couponCode;
10795
      }
10796
    }
10797
 
10798
    public deleteCoupon_args deepCopy() {
10799
      return new deleteCoupon_args(this);
10800
    }
10801
 
10802
    @Override
10803
    public void clear() {
10804
      this.couponCode = null;
10805
    }
10806
 
10807
    public String getCouponCode() {
10808
      return this.couponCode;
10809
    }
10810
 
10811
    public void setCouponCode(String couponCode) {
10812
      this.couponCode = couponCode;
10813
    }
10814
 
10815
    public void unsetCouponCode() {
10816
      this.couponCode = null;
10817
    }
10818
 
10819
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
10820
    public boolean isSetCouponCode() {
10821
      return this.couponCode != null;
10822
    }
10823
 
10824
    public void setCouponCodeIsSet(boolean value) {
10825
      if (!value) {
10826
        this.couponCode = null;
10827
      }
10828
    }
10829
 
10830
    public void setFieldValue(_Fields field, Object value) {
10831
      switch (field) {
10832
      case COUPON_CODE:
10833
        if (value == null) {
10834
          unsetCouponCode();
10835
        } else {
10836
          setCouponCode((String)value);
10837
        }
10838
        break;
10839
 
10840
      }
10841
    }
10842
 
10843
    public Object getFieldValue(_Fields field) {
10844
      switch (field) {
10845
      case COUPON_CODE:
10846
        return getCouponCode();
10847
 
10848
      }
10849
      throw new IllegalStateException();
10850
    }
10851
 
10852
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10853
    public boolean isSet(_Fields field) {
10854
      if (field == null) {
10855
        throw new IllegalArgumentException();
10856
      }
10857
 
10858
      switch (field) {
10859
      case COUPON_CODE:
10860
        return isSetCouponCode();
10861
      }
10862
      throw new IllegalStateException();
10863
    }
10864
 
10865
    @Override
10866
    public boolean equals(Object that) {
10867
      if (that == null)
10868
        return false;
10869
      if (that instanceof deleteCoupon_args)
10870
        return this.equals((deleteCoupon_args)that);
10871
      return false;
10872
    }
10873
 
10874
    public boolean equals(deleteCoupon_args that) {
10875
      if (that == null)
10876
        return false;
10877
 
10878
      boolean this_present_couponCode = true && this.isSetCouponCode();
10879
      boolean that_present_couponCode = true && that.isSetCouponCode();
10880
      if (this_present_couponCode || that_present_couponCode) {
10881
        if (!(this_present_couponCode && that_present_couponCode))
10882
          return false;
10883
        if (!this.couponCode.equals(that.couponCode))
10884
          return false;
10885
      }
10886
 
10887
      return true;
10888
    }
10889
 
10890
    @Override
10891
    public int hashCode() {
10892
      return 0;
10893
    }
10894
 
10895
    public int compareTo(deleteCoupon_args other) {
10896
      if (!getClass().equals(other.getClass())) {
10897
        return getClass().getName().compareTo(other.getClass().getName());
10898
      }
10899
 
10900
      int lastComparison = 0;
10901
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
10902
 
10903
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
10904
      if (lastComparison != 0) {
10905
        return lastComparison;
10906
      }
10907
      if (isSetCouponCode()) {
10908
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10909
        if (lastComparison != 0) {
10910
          return lastComparison;
10911
        }
10912
      }
10913
      return 0;
10914
    }
10915
 
10916
    public _Fields fieldForId(int fieldId) {
10917
      return _Fields.findByThriftId(fieldId);
10918
    }
10919
 
10920
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10921
      org.apache.thrift.protocol.TField field;
10922
      iprot.readStructBegin();
10923
      while (true)
10924
      {
10925
        field = iprot.readFieldBegin();
10926
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10927
          break;
10928
        }
10929
        switch (field.id) {
10930
          case 1: // COUPON_CODE
10931
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10932
              this.couponCode = iprot.readString();
10933
            } else { 
10934
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10935
            }
10936
            break;
10937
          default:
10938
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10939
        }
10940
        iprot.readFieldEnd();
10941
      }
10942
      iprot.readStructEnd();
10943
      validate();
10944
    }
10945
 
10946
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10947
      validate();
10948
 
10949
      oprot.writeStructBegin(STRUCT_DESC);
10950
      if (this.couponCode != null) {
10951
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10952
        oprot.writeString(this.couponCode);
10953
        oprot.writeFieldEnd();
10954
      }
10955
      oprot.writeFieldStop();
10956
      oprot.writeStructEnd();
10957
    }
10958
 
10959
    @Override
10960
    public String toString() {
10961
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
10962
      boolean first = true;
10963
 
10964
      sb.append("couponCode:");
10965
      if (this.couponCode == null) {
10966
        sb.append("null");
10967
      } else {
10968
        sb.append(this.couponCode);
10969
      }
10970
      first = false;
10971
      sb.append(")");
10972
      return sb.toString();
10973
    }
10974
 
10975
    public void validate() throws org.apache.thrift.TException {
10976
      // check for required fields
10977
    }
10978
 
10979
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10980
      try {
10981
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10982
      } catch (org.apache.thrift.TException te) {
10983
        throw new java.io.IOException(te);
10984
      }
10985
    }
10986
 
10987
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10988
      try {
10989
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10990
      } catch (org.apache.thrift.TException te) {
10991
        throw new java.io.IOException(te);
10992
      }
10993
    }
10994
 
10995
  }
10996
 
10997
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
10998
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
10999
 
11000
    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);
11001
 
11002
    private PromotionException pex; // required
11003
 
11004
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11005
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11006
      PEX((short)1, "pex");
11007
 
11008
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11009
 
11010
      static {
11011
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11012
          byName.put(field.getFieldName(), field);
11013
        }
11014
      }
11015
 
11016
      /**
11017
       * Find the _Fields constant that matches fieldId, or null if its not found.
11018
       */
11019
      public static _Fields findByThriftId(int fieldId) {
11020
        switch(fieldId) {
11021
          case 1: // PEX
11022
            return PEX;
11023
          default:
11024
            return null;
11025
        }
11026
      }
11027
 
11028
      /**
11029
       * Find the _Fields constant that matches fieldId, throwing an exception
11030
       * if it is not found.
11031
       */
11032
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11033
        _Fields fields = findByThriftId(fieldId);
11034
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11035
        return fields;
11036
      }
11037
 
11038
      /**
11039
       * Find the _Fields constant that matches name, or null if its not found.
11040
       */
11041
      public static _Fields findByName(String name) {
11042
        return byName.get(name);
11043
      }
11044
 
11045
      private final short _thriftId;
11046
      private final String _fieldName;
11047
 
11048
      _Fields(short thriftId, String fieldName) {
11049
        _thriftId = thriftId;
11050
        _fieldName = fieldName;
11051
      }
11052
 
11053
      public short getThriftFieldId() {
11054
        return _thriftId;
11055
      }
11056
 
11057
      public String getFieldName() {
11058
        return _fieldName;
11059
      }
11060
    }
11061
 
11062
    // isset id assignments
11063
 
11064
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11065
    static {
11066
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11067
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11068
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11069
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11070
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
11071
    }
11072
 
11073
    public deleteCoupon_result() {
11074
    }
11075
 
11076
    public deleteCoupon_result(
11077
      PromotionException pex)
11078
    {
11079
      this();
11080
      this.pex = pex;
11081
    }
11082
 
11083
    /**
11084
     * Performs a deep copy on <i>other</i>.
11085
     */
11086
    public deleteCoupon_result(deleteCoupon_result other) {
11087
      if (other.isSetPex()) {
11088
        this.pex = new PromotionException(other.pex);
11089
      }
11090
    }
11091
 
11092
    public deleteCoupon_result deepCopy() {
11093
      return new deleteCoupon_result(this);
11094
    }
11095
 
11096
    @Override
11097
    public void clear() {
11098
      this.pex = null;
11099
    }
11100
 
11101
    public PromotionException getPex() {
11102
      return this.pex;
11103
    }
11104
 
11105
    public void setPex(PromotionException pex) {
11106
      this.pex = pex;
11107
    }
11108
 
11109
    public void unsetPex() {
11110
      this.pex = null;
11111
    }
11112
 
11113
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
11114
    public boolean isSetPex() {
11115
      return this.pex != null;
11116
    }
11117
 
11118
    public void setPexIsSet(boolean value) {
11119
      if (!value) {
11120
        this.pex = null;
11121
      }
11122
    }
11123
 
11124
    public void setFieldValue(_Fields field, Object value) {
11125
      switch (field) {
11126
      case PEX:
11127
        if (value == null) {
11128
          unsetPex();
11129
        } else {
11130
          setPex((PromotionException)value);
11131
        }
11132
        break;
11133
 
11134
      }
11135
    }
11136
 
11137
    public Object getFieldValue(_Fields field) {
11138
      switch (field) {
11139
      case PEX:
11140
        return getPex();
11141
 
11142
      }
11143
      throw new IllegalStateException();
11144
    }
11145
 
11146
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11147
    public boolean isSet(_Fields field) {
11148
      if (field == null) {
11149
        throw new IllegalArgumentException();
11150
      }
11151
 
11152
      switch (field) {
11153
      case PEX:
11154
        return isSetPex();
11155
      }
11156
      throw new IllegalStateException();
11157
    }
11158
 
11159
    @Override
11160
    public boolean equals(Object that) {
11161
      if (that == null)
11162
        return false;
11163
      if (that instanceof deleteCoupon_result)
11164
        return this.equals((deleteCoupon_result)that);
11165
      return false;
11166
    }
11167
 
11168
    public boolean equals(deleteCoupon_result that) {
11169
      if (that == null)
11170
        return false;
11171
 
11172
      boolean this_present_pex = true && this.isSetPex();
11173
      boolean that_present_pex = true && that.isSetPex();
11174
      if (this_present_pex || that_present_pex) {
11175
        if (!(this_present_pex && that_present_pex))
11176
          return false;
11177
        if (!this.pex.equals(that.pex))
11178
          return false;
11179
      }
11180
 
11181
      return true;
11182
    }
11183
 
11184
    @Override
11185
    public int hashCode() {
11186
      return 0;
11187
    }
11188
 
11189
    public int compareTo(deleteCoupon_result other) {
11190
      if (!getClass().equals(other.getClass())) {
11191
        return getClass().getName().compareTo(other.getClass().getName());
11192
      }
11193
 
11194
      int lastComparison = 0;
11195
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
11196
 
11197
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
11198
      if (lastComparison != 0) {
11199
        return lastComparison;
11200
      }
11201
      if (isSetPex()) {
11202
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11203
        if (lastComparison != 0) {
11204
          return lastComparison;
11205
        }
11206
      }
11207
      return 0;
11208
    }
11209
 
11210
    public _Fields fieldForId(int fieldId) {
11211
      return _Fields.findByThriftId(fieldId);
11212
    }
11213
 
11214
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11215
      org.apache.thrift.protocol.TField field;
11216
      iprot.readStructBegin();
11217
      while (true)
11218
      {
11219
        field = iprot.readFieldBegin();
11220
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11221
          break;
11222
        }
11223
        switch (field.id) {
11224
          case 1: // PEX
11225
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11226
              this.pex = new PromotionException();
11227
              this.pex.read(iprot);
11228
            } else { 
11229
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11230
            }
11231
            break;
11232
          default:
11233
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11234
        }
11235
        iprot.readFieldEnd();
11236
      }
11237
      iprot.readStructEnd();
11238
      validate();
11239
    }
11240
 
11241
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11242
      oprot.writeStructBegin(STRUCT_DESC);
11243
 
11244
      if (this.isSetPex()) {
11245
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11246
        this.pex.write(oprot);
11247
        oprot.writeFieldEnd();
11248
      }
11249
      oprot.writeFieldStop();
11250
      oprot.writeStructEnd();
11251
    }
11252
 
11253
    @Override
11254
    public String toString() {
11255
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
11256
      boolean first = true;
11257
 
11258
      sb.append("pex:");
11259
      if (this.pex == null) {
11260
        sb.append("null");
11261
      } else {
11262
        sb.append(this.pex);
11263
      }
11264
      first = false;
11265
      sb.append(")");
11266
      return sb.toString();
11267
    }
11268
 
11269
    public void validate() throws org.apache.thrift.TException {
11270
      // check for required fields
11271
    }
11272
 
11273
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11274
      try {
11275
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11276
      } catch (org.apache.thrift.TException te) {
11277
        throw new java.io.IOException(te);
11278
      }
11279
    }
11280
 
11281
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11282
      try {
11283
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11284
      } catch (org.apache.thrift.TException te) {
11285
        throw new java.io.IOException(te);
11286
      }
11287
    }
11288
 
11289
  }
11290
 
3430 rajveer 11291
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
11292
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 11293
 
11294
 
11295
 
11296
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11297
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11298
;
11299
 
11300
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11301
 
11302
      static {
11303
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11304
          byName.put(field.getFieldName(), field);
11305
        }
11306
      }
11307
 
11308
      /**
11309
       * Find the _Fields constant that matches fieldId, or null if its not found.
11310
       */
11311
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11312
        switch(fieldId) {
11313
          default:
11314
            return null;
11315
        }
3385 varun.gupt 11316
      }
11317
 
11318
      /**
11319
       * Find the _Fields constant that matches fieldId, throwing an exception
11320
       * if it is not found.
11321
       */
11322
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11323
        _Fields fields = findByThriftId(fieldId);
11324
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11325
        return fields;
11326
      }
11327
 
11328
      /**
11329
       * Find the _Fields constant that matches name, or null if its not found.
11330
       */
11331
      public static _Fields findByName(String name) {
11332
        return byName.get(name);
11333
      }
11334
 
11335
      private final short _thriftId;
11336
      private final String _fieldName;
11337
 
11338
      _Fields(short thriftId, String fieldName) {
11339
        _thriftId = thriftId;
11340
        _fieldName = fieldName;
11341
      }
11342
 
11343
      public short getThriftFieldId() {
11344
        return _thriftId;
11345
      }
11346
 
11347
      public String getFieldName() {
11348
        return _fieldName;
11349
      }
11350
    }
3430 rajveer 11351
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11352
    static {
3430 rajveer 11353
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11354
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11355
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 11356
    }
11357
 
11358
    public getActiveCoupons_args() {
11359
    }
11360
 
11361
    /**
11362
     * Performs a deep copy on <i>other</i>.
11363
     */
11364
    public getActiveCoupons_args(getActiveCoupons_args other) {
11365
    }
11366
 
11367
    public getActiveCoupons_args deepCopy() {
11368
      return new getActiveCoupons_args(this);
11369
    }
11370
 
3430 rajveer 11371
    @Override
11372
    public void clear() {
3385 varun.gupt 11373
    }
11374
 
11375
    public void setFieldValue(_Fields field, Object value) {
11376
      switch (field) {
11377
      }
11378
    }
11379
 
11380
    public Object getFieldValue(_Fields field) {
11381
      switch (field) {
11382
      }
11383
      throw new IllegalStateException();
11384
    }
11385
 
3430 rajveer 11386
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11387
    public boolean isSet(_Fields field) {
11388
      if (field == null) {
11389
        throw new IllegalArgumentException();
11390
      }
3385 varun.gupt 11391
 
11392
      switch (field) {
11393
      }
11394
      throw new IllegalStateException();
11395
    }
11396
 
11397
    @Override
11398
    public boolean equals(Object that) {
11399
      if (that == null)
11400
        return false;
11401
      if (that instanceof getActiveCoupons_args)
11402
        return this.equals((getActiveCoupons_args)that);
11403
      return false;
11404
    }
11405
 
11406
    public boolean equals(getActiveCoupons_args that) {
11407
      if (that == null)
11408
        return false;
11409
 
11410
      return true;
11411
    }
11412
 
11413
    @Override
11414
    public int hashCode() {
11415
      return 0;
11416
    }
11417
 
11418
    public int compareTo(getActiveCoupons_args other) {
11419
      if (!getClass().equals(other.getClass())) {
11420
        return getClass().getName().compareTo(other.getClass().getName());
11421
      }
11422
 
11423
      int lastComparison = 0;
11424
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
11425
 
11426
      return 0;
11427
    }
11428
 
3430 rajveer 11429
    public _Fields fieldForId(int fieldId) {
11430
      return _Fields.findByThriftId(fieldId);
11431
    }
11432
 
11433
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11434
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11435
      iprot.readStructBegin();
11436
      while (true)
11437
      {
11438
        field = iprot.readFieldBegin();
3430 rajveer 11439
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11440
          break;
11441
        }
3430 rajveer 11442
        switch (field.id) {
11443
          default:
11444
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11445
        }
3430 rajveer 11446
        iprot.readFieldEnd();
3385 varun.gupt 11447
      }
11448
      iprot.readStructEnd();
11449
      validate();
11450
    }
11451
 
3430 rajveer 11452
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11453
      validate();
11454
 
11455
      oprot.writeStructBegin(STRUCT_DESC);
11456
      oprot.writeFieldStop();
11457
      oprot.writeStructEnd();
11458
    }
11459
 
11460
    @Override
11461
    public String toString() {
11462
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
11463
      boolean first = true;
11464
 
11465
      sb.append(")");
11466
      return sb.toString();
11467
    }
11468
 
3430 rajveer 11469
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11470
      // check for required fields
11471
    }
11472
 
3430 rajveer 11473
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11474
      try {
11475
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11476
      } catch (org.apache.thrift.TException te) {
11477
        throw new java.io.IOException(te);
11478
      }
11479
    }
11480
 
11481
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11482
      try {
11483
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11484
      } catch (org.apache.thrift.TException te) {
11485
        throw new java.io.IOException(te);
11486
      }
11487
    }
11488
 
3385 varun.gupt 11489
  }
11490
 
3430 rajveer 11491
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
11492
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 11493
 
3430 rajveer 11494
    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);
11495
    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 11496
 
3430 rajveer 11497
    private List<Coupon> success; // required
11498
    private PromotionException pex; // required
3385 varun.gupt 11499
 
11500
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11501
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11502
      SUCCESS((short)0, "success"),
11503
      PEX((short)1, "pex");
11504
 
11505
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11506
 
11507
      static {
11508
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11509
          byName.put(field.getFieldName(), field);
11510
        }
11511
      }
11512
 
11513
      /**
11514
       * Find the _Fields constant that matches fieldId, or null if its not found.
11515
       */
11516
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11517
        switch(fieldId) {
11518
          case 0: // SUCCESS
11519
            return SUCCESS;
11520
          case 1: // PEX
11521
            return PEX;
11522
          default:
11523
            return null;
11524
        }
3385 varun.gupt 11525
      }
11526
 
11527
      /**
11528
       * Find the _Fields constant that matches fieldId, throwing an exception
11529
       * if it is not found.
11530
       */
11531
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11532
        _Fields fields = findByThriftId(fieldId);
11533
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11534
        return fields;
11535
      }
11536
 
11537
      /**
11538
       * Find the _Fields constant that matches name, or null if its not found.
11539
       */
11540
      public static _Fields findByName(String name) {
11541
        return byName.get(name);
11542
      }
11543
 
11544
      private final short _thriftId;
11545
      private final String _fieldName;
11546
 
11547
      _Fields(short thriftId, String fieldName) {
11548
        _thriftId = thriftId;
11549
        _fieldName = fieldName;
11550
      }
11551
 
11552
      public short getThriftFieldId() {
11553
        return _thriftId;
11554
      }
11555
 
11556
      public String getFieldName() {
11557
        return _fieldName;
11558
      }
11559
    }
11560
 
11561
    // isset id assignments
11562
 
3430 rajveer 11563
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11564
    static {
3430 rajveer 11565
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11566
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11567
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11568
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
11569
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11570
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11571
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11572
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 11573
    }
11574
 
11575
    public getActiveCoupons_result() {
11576
    }
11577
 
11578
    public getActiveCoupons_result(
11579
      List<Coupon> success,
11580
      PromotionException pex)
11581
    {
11582
      this();
11583
      this.success = success;
11584
      this.pex = pex;
11585
    }
11586
 
11587
    /**
11588
     * Performs a deep copy on <i>other</i>.
11589
     */
11590
    public getActiveCoupons_result(getActiveCoupons_result other) {
11591
      if (other.isSetSuccess()) {
11592
        List<Coupon> __this__success = new ArrayList<Coupon>();
11593
        for (Coupon other_element : other.success) {
11594
          __this__success.add(new Coupon(other_element));
11595
        }
11596
        this.success = __this__success;
11597
      }
11598
      if (other.isSetPex()) {
11599
        this.pex = new PromotionException(other.pex);
11600
      }
11601
    }
11602
 
11603
    public getActiveCoupons_result deepCopy() {
11604
      return new getActiveCoupons_result(this);
11605
    }
11606
 
3430 rajveer 11607
    @Override
11608
    public void clear() {
11609
      this.success = null;
11610
      this.pex = null;
3385 varun.gupt 11611
    }
11612
 
11613
    public int getSuccessSize() {
11614
      return (this.success == null) ? 0 : this.success.size();
11615
    }
11616
 
11617
    public java.util.Iterator<Coupon> getSuccessIterator() {
11618
      return (this.success == null) ? null : this.success.iterator();
11619
    }
11620
 
11621
    public void addToSuccess(Coupon elem) {
11622
      if (this.success == null) {
11623
        this.success = new ArrayList<Coupon>();
11624
      }
11625
      this.success.add(elem);
11626
    }
11627
 
11628
    public List<Coupon> getSuccess() {
11629
      return this.success;
11630
    }
11631
 
3430 rajveer 11632
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 11633
      this.success = success;
11634
    }
11635
 
11636
    public void unsetSuccess() {
11637
      this.success = null;
11638
    }
11639
 
3430 rajveer 11640
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11641
    public boolean isSetSuccess() {
11642
      return this.success != null;
11643
    }
11644
 
11645
    public void setSuccessIsSet(boolean value) {
11646
      if (!value) {
11647
        this.success = null;
11648
      }
11649
    }
11650
 
11651
    public PromotionException getPex() {
11652
      return this.pex;
11653
    }
11654
 
3430 rajveer 11655
    public void setPex(PromotionException pex) {
3385 varun.gupt 11656
      this.pex = pex;
11657
    }
11658
 
11659
    public void unsetPex() {
11660
      this.pex = null;
11661
    }
11662
 
3430 rajveer 11663
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11664
    public boolean isSetPex() {
11665
      return this.pex != null;
11666
    }
11667
 
11668
    public void setPexIsSet(boolean value) {
11669
      if (!value) {
11670
        this.pex = null;
11671
      }
11672
    }
11673
 
11674
    public void setFieldValue(_Fields field, Object value) {
11675
      switch (field) {
11676
      case SUCCESS:
11677
        if (value == null) {
11678
          unsetSuccess();
11679
        } else {
11680
          setSuccess((List<Coupon>)value);
11681
        }
11682
        break;
11683
 
11684
      case PEX:
11685
        if (value == null) {
11686
          unsetPex();
11687
        } else {
11688
          setPex((PromotionException)value);
11689
        }
11690
        break;
11691
 
11692
      }
11693
    }
11694
 
11695
    public Object getFieldValue(_Fields field) {
11696
      switch (field) {
11697
      case SUCCESS:
11698
        return getSuccess();
11699
 
11700
      case PEX:
11701
        return getPex();
11702
 
11703
      }
11704
      throw new IllegalStateException();
11705
    }
11706
 
3430 rajveer 11707
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11708
    public boolean isSet(_Fields field) {
11709
      if (field == null) {
11710
        throw new IllegalArgumentException();
11711
      }
3385 varun.gupt 11712
 
11713
      switch (field) {
11714
      case SUCCESS:
11715
        return isSetSuccess();
11716
      case PEX:
11717
        return isSetPex();
11718
      }
11719
      throw new IllegalStateException();
11720
    }
11721
 
11722
    @Override
11723
    public boolean equals(Object that) {
11724
      if (that == null)
11725
        return false;
11726
      if (that instanceof getActiveCoupons_result)
11727
        return this.equals((getActiveCoupons_result)that);
11728
      return false;
11729
    }
11730
 
11731
    public boolean equals(getActiveCoupons_result that) {
11732
      if (that == null)
11733
        return false;
11734
 
11735
      boolean this_present_success = true && this.isSetSuccess();
11736
      boolean that_present_success = true && that.isSetSuccess();
11737
      if (this_present_success || that_present_success) {
11738
        if (!(this_present_success && that_present_success))
11739
          return false;
11740
        if (!this.success.equals(that.success))
11741
          return false;
11742
      }
11743
 
11744
      boolean this_present_pex = true && this.isSetPex();
11745
      boolean that_present_pex = true && that.isSetPex();
11746
      if (this_present_pex || that_present_pex) {
11747
        if (!(this_present_pex && that_present_pex))
11748
          return false;
11749
        if (!this.pex.equals(that.pex))
11750
          return false;
11751
      }
11752
 
11753
      return true;
11754
    }
11755
 
11756
    @Override
11757
    public int hashCode() {
11758
      return 0;
11759
    }
11760
 
11761
    public int compareTo(getActiveCoupons_result other) {
11762
      if (!getClass().equals(other.getClass())) {
11763
        return getClass().getName().compareTo(other.getClass().getName());
11764
      }
11765
 
11766
      int lastComparison = 0;
11767
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
11768
 
3430 rajveer 11769
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 11770
      if (lastComparison != 0) {
11771
        return lastComparison;
11772
      }
3430 rajveer 11773
      if (isSetSuccess()) {
11774
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11775
        if (lastComparison != 0) {
11776
          return lastComparison;
11777
        }
3385 varun.gupt 11778
      }
3430 rajveer 11779
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 11780
      if (lastComparison != 0) {
11781
        return lastComparison;
11782
      }
3430 rajveer 11783
      if (isSetPex()) {
11784
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11785
        if (lastComparison != 0) {
11786
          return lastComparison;
11787
        }
3385 varun.gupt 11788
      }
11789
      return 0;
11790
    }
11791
 
3430 rajveer 11792
    public _Fields fieldForId(int fieldId) {
11793
      return _Fields.findByThriftId(fieldId);
11794
    }
11795
 
11796
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11797
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11798
      iprot.readStructBegin();
11799
      while (true)
11800
      {
11801
        field = iprot.readFieldBegin();
3430 rajveer 11802
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11803
          break;
11804
        }
3430 rajveer 11805
        switch (field.id) {
11806
          case 0: // SUCCESS
11807
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
11808
              {
6497 amit.gupta 11809
                org.apache.thrift.protocol.TList _list25 = iprot.readListBegin();
11810
                this.success = new ArrayList<Coupon>(_list25.size);
11811
                for (int _i26 = 0; _i26 < _list25.size; ++_i26)
3385 varun.gupt 11812
                {
6497 amit.gupta 11813
                  Coupon _elem27; // required
11814
                  _elem27 = new Coupon();
11815
                  _elem27.read(iprot);
11816
                  this.success.add(_elem27);
3385 varun.gupt 11817
                }
3430 rajveer 11818
                iprot.readListEnd();
3385 varun.gupt 11819
              }
3430 rajveer 11820
            } else { 
11821
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11822
            }
11823
            break;
11824
          case 1: // PEX
11825
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11826
              this.pex = new PromotionException();
11827
              this.pex.read(iprot);
11828
            } else { 
11829
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11830
            }
11831
            break;
11832
          default:
11833
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11834
        }
3430 rajveer 11835
        iprot.readFieldEnd();
3385 varun.gupt 11836
      }
11837
      iprot.readStructEnd();
11838
      validate();
11839
    }
11840
 
3430 rajveer 11841
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11842
      oprot.writeStructBegin(STRUCT_DESC);
11843
 
11844
      if (this.isSetSuccess()) {
11845
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11846
        {
3430 rajveer 11847
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6497 amit.gupta 11848
          for (Coupon _iter28 : this.success)
3385 varun.gupt 11849
          {
6497 amit.gupta 11850
            _iter28.write(oprot);
3385 varun.gupt 11851
          }
11852
          oprot.writeListEnd();
11853
        }
11854
        oprot.writeFieldEnd();
11855
      } else if (this.isSetPex()) {
11856
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11857
        this.pex.write(oprot);
11858
        oprot.writeFieldEnd();
11859
      }
11860
      oprot.writeFieldStop();
11861
      oprot.writeStructEnd();
11862
    }
11863
 
11864
    @Override
11865
    public String toString() {
11866
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
11867
      boolean first = true;
11868
 
11869
      sb.append("success:");
11870
      if (this.success == null) {
11871
        sb.append("null");
11872
      } else {
11873
        sb.append(this.success);
11874
      }
11875
      first = false;
11876
      if (!first) sb.append(", ");
11877
      sb.append("pex:");
11878
      if (this.pex == null) {
11879
        sb.append("null");
11880
      } else {
11881
        sb.append(this.pex);
11882
      }
11883
      first = false;
11884
      sb.append(")");
11885
      return sb.toString();
11886
    }
11887
 
3430 rajveer 11888
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11889
      // check for required fields
11890
    }
11891
 
3430 rajveer 11892
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11893
      try {
11894
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11895
      } catch (org.apache.thrift.TException te) {
11896
        throw new java.io.IOException(te);
11897
      }
11898
    }
11899
 
11900
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11901
      try {
11902
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11903
      } catch (org.apache.thrift.TException te) {
11904
        throw new java.io.IOException(te);
11905
      }
11906
    }
11907
 
3385 varun.gupt 11908
  }
11909
 
6250 amit.gupta 11910
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
11911
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
11912
 
11913
    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);
11914
    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);
11915
    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);
11916
    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 11917
    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);
11918
    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);
6561 amit.gupta 11919
    private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)7);
6250 amit.gupta 11920
 
11921
    private long promotionId; // required
11922
    private long endOn; // required
11923
    private String email; // required
11924
    private long amount; // required
6356 amit.gupta 11925
    private boolean isCod; // required
6250 amit.gupta 11926
    private long usage; // required
6561 amit.gupta 11927
    private String prefix; // required
6250 amit.gupta 11928
 
11929
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11930
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11931
      PROMOTION_ID((short)1, "promotionId"),
11932
      END_ON((short)2, "endOn"),
11933
      EMAIL((short)3, "email"),
11934
      AMOUNT((short)4, "amount"),
6356 amit.gupta 11935
      IS_COD((short)5, "isCod"),
6561 amit.gupta 11936
      USAGE((short)6, "usage"),
11937
      PREFIX((short)7, "prefix");
6250 amit.gupta 11938
 
11939
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11940
 
11941
      static {
11942
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11943
          byName.put(field.getFieldName(), field);
11944
        }
11945
      }
11946
 
11947
      /**
11948
       * Find the _Fields constant that matches fieldId, or null if its not found.
11949
       */
11950
      public static _Fields findByThriftId(int fieldId) {
11951
        switch(fieldId) {
11952
          case 1: // PROMOTION_ID
11953
            return PROMOTION_ID;
11954
          case 2: // END_ON
11955
            return END_ON;
11956
          case 3: // EMAIL
11957
            return EMAIL;
11958
          case 4: // AMOUNT
11959
            return AMOUNT;
6356 amit.gupta 11960
          case 5: // IS_COD
11961
            return IS_COD;
11962
          case 6: // USAGE
6250 amit.gupta 11963
            return USAGE;
6561 amit.gupta 11964
          case 7: // PREFIX
11965
            return PREFIX;
6250 amit.gupta 11966
          default:
11967
            return null;
11968
        }
11969
      }
11970
 
11971
      /**
11972
       * Find the _Fields constant that matches fieldId, throwing an exception
11973
       * if it is not found.
11974
       */
11975
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11976
        _Fields fields = findByThriftId(fieldId);
11977
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11978
        return fields;
11979
      }
11980
 
11981
      /**
11982
       * Find the _Fields constant that matches name, or null if its not found.
11983
       */
11984
      public static _Fields findByName(String name) {
11985
        return byName.get(name);
11986
      }
11987
 
11988
      private final short _thriftId;
11989
      private final String _fieldName;
11990
 
11991
      _Fields(short thriftId, String fieldName) {
11992
        _thriftId = thriftId;
11993
        _fieldName = fieldName;
11994
      }
11995
 
11996
      public short getThriftFieldId() {
11997
        return _thriftId;
11998
      }
11999
 
12000
      public String getFieldName() {
12001
        return _fieldName;
12002
      }
12003
    }
12004
 
12005
    // isset id assignments
12006
    private static final int __PROMOTIONID_ISSET_ID = 0;
12007
    private static final int __ENDON_ISSET_ID = 1;
12008
    private static final int __AMOUNT_ISSET_ID = 2;
6356 amit.gupta 12009
    private static final int __ISCOD_ISSET_ID = 3;
12010
    private static final int __USAGE_ISSET_ID = 4;
12011
    private BitSet __isset_bit_vector = new BitSet(5);
6250 amit.gupta 12012
 
12013
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12014
    static {
12015
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12016
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12017
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12018
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12019
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12020
      tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12021
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12022
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12023
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6356 amit.gupta 12024
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12025
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6250 amit.gupta 12026
      tmpMap.put(_Fields.USAGE, new org.apache.thrift.meta_data.FieldMetaData("usage", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12027
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6561 amit.gupta 12028
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12029
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 12030
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12031
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
12032
    }
12033
 
12034
    public createCoupon_args() {
12035
    }
12036
 
12037
    public createCoupon_args(
12038
      long promotionId,
12039
      long endOn,
12040
      String email,
12041
      long amount,
6356 amit.gupta 12042
      boolean isCod,
6561 amit.gupta 12043
      long usage,
12044
      String prefix)
6250 amit.gupta 12045
    {
12046
      this();
12047
      this.promotionId = promotionId;
12048
      setPromotionIdIsSet(true);
12049
      this.endOn = endOn;
12050
      setEndOnIsSet(true);
12051
      this.email = email;
12052
      this.amount = amount;
12053
      setAmountIsSet(true);
6356 amit.gupta 12054
      this.isCod = isCod;
12055
      setIsCodIsSet(true);
6250 amit.gupta 12056
      this.usage = usage;
12057
      setUsageIsSet(true);
6561 amit.gupta 12058
      this.prefix = prefix;
6250 amit.gupta 12059
    }
12060
 
12061
    /**
12062
     * Performs a deep copy on <i>other</i>.
12063
     */
12064
    public createCoupon_args(createCoupon_args other) {
12065
      __isset_bit_vector.clear();
12066
      __isset_bit_vector.or(other.__isset_bit_vector);
12067
      this.promotionId = other.promotionId;
12068
      this.endOn = other.endOn;
12069
      if (other.isSetEmail()) {
12070
        this.email = other.email;
12071
      }
12072
      this.amount = other.amount;
6356 amit.gupta 12073
      this.isCod = other.isCod;
6250 amit.gupta 12074
      this.usage = other.usage;
6561 amit.gupta 12075
      if (other.isSetPrefix()) {
12076
        this.prefix = other.prefix;
12077
      }
6250 amit.gupta 12078
    }
12079
 
12080
    public createCoupon_args deepCopy() {
12081
      return new createCoupon_args(this);
12082
    }
12083
 
12084
    @Override
12085
    public void clear() {
12086
      setPromotionIdIsSet(false);
12087
      this.promotionId = 0;
12088
      setEndOnIsSet(false);
12089
      this.endOn = 0;
12090
      this.email = null;
12091
      setAmountIsSet(false);
12092
      this.amount = 0;
6356 amit.gupta 12093
      setIsCodIsSet(false);
12094
      this.isCod = false;
6250 amit.gupta 12095
      setUsageIsSet(false);
12096
      this.usage = 0;
6561 amit.gupta 12097
      this.prefix = null;
6250 amit.gupta 12098
    }
12099
 
12100
    public long getPromotionId() {
12101
      return this.promotionId;
12102
    }
12103
 
12104
    public void setPromotionId(long promotionId) {
12105
      this.promotionId = promotionId;
12106
      setPromotionIdIsSet(true);
12107
    }
12108
 
12109
    public void unsetPromotionId() {
12110
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
12111
    }
12112
 
12113
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
12114
    public boolean isSetPromotionId() {
12115
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
12116
    }
12117
 
12118
    public void setPromotionIdIsSet(boolean value) {
12119
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
12120
    }
12121
 
12122
    public long getEndOn() {
12123
      return this.endOn;
12124
    }
12125
 
12126
    public void setEndOn(long endOn) {
12127
      this.endOn = endOn;
12128
      setEndOnIsSet(true);
12129
    }
12130
 
12131
    public void unsetEndOn() {
12132
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
12133
    }
12134
 
12135
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
12136
    public boolean isSetEndOn() {
12137
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
12138
    }
12139
 
12140
    public void setEndOnIsSet(boolean value) {
12141
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
12142
    }
12143
 
12144
    public String getEmail() {
12145
      return this.email;
12146
    }
12147
 
12148
    public void setEmail(String email) {
12149
      this.email = email;
12150
    }
12151
 
12152
    public void unsetEmail() {
12153
      this.email = null;
12154
    }
12155
 
12156
    /** Returns true if field email is set (has been assigned a value) and false otherwise */
12157
    public boolean isSetEmail() {
12158
      return this.email != null;
12159
    }
12160
 
12161
    public void setEmailIsSet(boolean value) {
12162
      if (!value) {
12163
        this.email = null;
12164
      }
12165
    }
12166
 
12167
    public long getAmount() {
12168
      return this.amount;
12169
    }
12170
 
12171
    public void setAmount(long amount) {
12172
      this.amount = amount;
12173
      setAmountIsSet(true);
12174
    }
12175
 
12176
    public void unsetAmount() {
12177
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
12178
    }
12179
 
12180
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
12181
    public boolean isSetAmount() {
12182
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
12183
    }
12184
 
12185
    public void setAmountIsSet(boolean value) {
12186
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
12187
    }
12188
 
6356 amit.gupta 12189
    public boolean isIsCod() {
12190
      return this.isCod;
12191
    }
12192
 
12193
    public void setIsCod(boolean isCod) {
12194
      this.isCod = isCod;
12195
      setIsCodIsSet(true);
12196
    }
12197
 
12198
    public void unsetIsCod() {
12199
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
12200
    }
12201
 
12202
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
12203
    public boolean isSetIsCod() {
12204
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
12205
    }
12206
 
12207
    public void setIsCodIsSet(boolean value) {
12208
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
12209
    }
12210
 
6250 amit.gupta 12211
    public long getUsage() {
12212
      return this.usage;
12213
    }
12214
 
12215
    public void setUsage(long usage) {
12216
      this.usage = usage;
12217
      setUsageIsSet(true);
12218
    }
12219
 
12220
    public void unsetUsage() {
12221
      __isset_bit_vector.clear(__USAGE_ISSET_ID);
12222
    }
12223
 
12224
    /** Returns true if field usage is set (has been assigned a value) and false otherwise */
12225
    public boolean isSetUsage() {
12226
      return __isset_bit_vector.get(__USAGE_ISSET_ID);
12227
    }
12228
 
12229
    public void setUsageIsSet(boolean value) {
12230
      __isset_bit_vector.set(__USAGE_ISSET_ID, value);
12231
    }
12232
 
6561 amit.gupta 12233
    public String getPrefix() {
12234
      return this.prefix;
12235
    }
12236
 
12237
    public void setPrefix(String prefix) {
12238
      this.prefix = prefix;
12239
    }
12240
 
12241
    public void unsetPrefix() {
12242
      this.prefix = null;
12243
    }
12244
 
12245
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
12246
    public boolean isSetPrefix() {
12247
      return this.prefix != null;
12248
    }
12249
 
12250
    public void setPrefixIsSet(boolean value) {
12251
      if (!value) {
12252
        this.prefix = null;
12253
      }
12254
    }
12255
 
6250 amit.gupta 12256
    public void setFieldValue(_Fields field, Object value) {
12257
      switch (field) {
12258
      case PROMOTION_ID:
12259
        if (value == null) {
12260
          unsetPromotionId();
12261
        } else {
12262
          setPromotionId((Long)value);
12263
        }
12264
        break;
12265
 
12266
      case END_ON:
12267
        if (value == null) {
12268
          unsetEndOn();
12269
        } else {
12270
          setEndOn((Long)value);
12271
        }
12272
        break;
12273
 
12274
      case EMAIL:
12275
        if (value == null) {
12276
          unsetEmail();
12277
        } else {
12278
          setEmail((String)value);
12279
        }
12280
        break;
12281
 
12282
      case AMOUNT:
12283
        if (value == null) {
12284
          unsetAmount();
12285
        } else {
12286
          setAmount((Long)value);
12287
        }
12288
        break;
12289
 
6356 amit.gupta 12290
      case IS_COD:
12291
        if (value == null) {
12292
          unsetIsCod();
12293
        } else {
12294
          setIsCod((Boolean)value);
12295
        }
12296
        break;
12297
 
6250 amit.gupta 12298
      case USAGE:
12299
        if (value == null) {
12300
          unsetUsage();
12301
        } else {
12302
          setUsage((Long)value);
12303
        }
12304
        break;
12305
 
6561 amit.gupta 12306
      case PREFIX:
12307
        if (value == null) {
12308
          unsetPrefix();
12309
        } else {
12310
          setPrefix((String)value);
12311
        }
12312
        break;
12313
 
6250 amit.gupta 12314
      }
12315
    }
12316
 
12317
    public Object getFieldValue(_Fields field) {
12318
      switch (field) {
12319
      case PROMOTION_ID:
12320
        return Long.valueOf(getPromotionId());
12321
 
12322
      case END_ON:
12323
        return Long.valueOf(getEndOn());
12324
 
12325
      case EMAIL:
12326
        return getEmail();
12327
 
12328
      case AMOUNT:
12329
        return Long.valueOf(getAmount());
12330
 
6356 amit.gupta 12331
      case IS_COD:
12332
        return Boolean.valueOf(isIsCod());
12333
 
6250 amit.gupta 12334
      case USAGE:
12335
        return Long.valueOf(getUsage());
12336
 
6561 amit.gupta 12337
      case PREFIX:
12338
        return getPrefix();
12339
 
6250 amit.gupta 12340
      }
12341
      throw new IllegalStateException();
12342
    }
12343
 
12344
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12345
    public boolean isSet(_Fields field) {
12346
      if (field == null) {
12347
        throw new IllegalArgumentException();
12348
      }
12349
 
12350
      switch (field) {
12351
      case PROMOTION_ID:
12352
        return isSetPromotionId();
12353
      case END_ON:
12354
        return isSetEndOn();
12355
      case EMAIL:
12356
        return isSetEmail();
12357
      case AMOUNT:
12358
        return isSetAmount();
6356 amit.gupta 12359
      case IS_COD:
12360
        return isSetIsCod();
6250 amit.gupta 12361
      case USAGE:
12362
        return isSetUsage();
6561 amit.gupta 12363
      case PREFIX:
12364
        return isSetPrefix();
6250 amit.gupta 12365
      }
12366
      throw new IllegalStateException();
12367
    }
12368
 
12369
    @Override
12370
    public boolean equals(Object that) {
12371
      if (that == null)
12372
        return false;
12373
      if (that instanceof createCoupon_args)
12374
        return this.equals((createCoupon_args)that);
12375
      return false;
12376
    }
12377
 
12378
    public boolean equals(createCoupon_args that) {
12379
      if (that == null)
12380
        return false;
12381
 
12382
      boolean this_present_promotionId = true;
12383
      boolean that_present_promotionId = true;
12384
      if (this_present_promotionId || that_present_promotionId) {
12385
        if (!(this_present_promotionId && that_present_promotionId))
12386
          return false;
12387
        if (this.promotionId != that.promotionId)
12388
          return false;
12389
      }
12390
 
12391
      boolean this_present_endOn = true;
12392
      boolean that_present_endOn = true;
12393
      if (this_present_endOn || that_present_endOn) {
12394
        if (!(this_present_endOn && that_present_endOn))
12395
          return false;
12396
        if (this.endOn != that.endOn)
12397
          return false;
12398
      }
12399
 
12400
      boolean this_present_email = true && this.isSetEmail();
12401
      boolean that_present_email = true && that.isSetEmail();
12402
      if (this_present_email || that_present_email) {
12403
        if (!(this_present_email && that_present_email))
12404
          return false;
12405
        if (!this.email.equals(that.email))
12406
          return false;
12407
      }
12408
 
12409
      boolean this_present_amount = true;
12410
      boolean that_present_amount = true;
12411
      if (this_present_amount || that_present_amount) {
12412
        if (!(this_present_amount && that_present_amount))
12413
          return false;
12414
        if (this.amount != that.amount)
12415
          return false;
12416
      }
12417
 
6356 amit.gupta 12418
      boolean this_present_isCod = true;
12419
      boolean that_present_isCod = true;
12420
      if (this_present_isCod || that_present_isCod) {
12421
        if (!(this_present_isCod && that_present_isCod))
12422
          return false;
12423
        if (this.isCod != that.isCod)
12424
          return false;
12425
      }
12426
 
6250 amit.gupta 12427
      boolean this_present_usage = true;
12428
      boolean that_present_usage = true;
12429
      if (this_present_usage || that_present_usage) {
12430
        if (!(this_present_usage && that_present_usage))
12431
          return false;
12432
        if (this.usage != that.usage)
12433
          return false;
12434
      }
12435
 
6561 amit.gupta 12436
      boolean this_present_prefix = true && this.isSetPrefix();
12437
      boolean that_present_prefix = true && that.isSetPrefix();
12438
      if (this_present_prefix || that_present_prefix) {
12439
        if (!(this_present_prefix && that_present_prefix))
12440
          return false;
12441
        if (!this.prefix.equals(that.prefix))
12442
          return false;
12443
      }
12444
 
6250 amit.gupta 12445
      return true;
12446
    }
12447
 
12448
    @Override
12449
    public int hashCode() {
12450
      return 0;
12451
    }
12452
 
12453
    public int compareTo(createCoupon_args other) {
12454
      if (!getClass().equals(other.getClass())) {
12455
        return getClass().getName().compareTo(other.getClass().getName());
12456
      }
12457
 
12458
      int lastComparison = 0;
12459
      createCoupon_args typedOther = (createCoupon_args)other;
12460
 
12461
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
12462
      if (lastComparison != 0) {
12463
        return lastComparison;
12464
      }
12465
      if (isSetPromotionId()) {
12466
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
12467
        if (lastComparison != 0) {
12468
          return lastComparison;
12469
        }
12470
      }
12471
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
12472
      if (lastComparison != 0) {
12473
        return lastComparison;
12474
      }
12475
      if (isSetEndOn()) {
12476
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
12477
        if (lastComparison != 0) {
12478
          return lastComparison;
12479
        }
12480
      }
12481
      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
12482
      if (lastComparison != 0) {
12483
        return lastComparison;
12484
      }
12485
      if (isSetEmail()) {
12486
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
12487
        if (lastComparison != 0) {
12488
          return lastComparison;
12489
        }
12490
      }
12491
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
12492
      if (lastComparison != 0) {
12493
        return lastComparison;
12494
      }
12495
      if (isSetAmount()) {
12496
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
12497
        if (lastComparison != 0) {
12498
          return lastComparison;
12499
        }
12500
      }
6356 amit.gupta 12501
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
12502
      if (lastComparison != 0) {
12503
        return lastComparison;
12504
      }
12505
      if (isSetIsCod()) {
12506
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
12507
        if (lastComparison != 0) {
12508
          return lastComparison;
12509
        }
12510
      }
6250 amit.gupta 12511
      lastComparison = Boolean.valueOf(isSetUsage()).compareTo(typedOther.isSetUsage());
12512
      if (lastComparison != 0) {
12513
        return lastComparison;
12514
      }
12515
      if (isSetUsage()) {
12516
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usage, typedOther.usage);
12517
        if (lastComparison != 0) {
12518
          return lastComparison;
12519
        }
12520
      }
6561 amit.gupta 12521
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
12522
      if (lastComparison != 0) {
12523
        return lastComparison;
12524
      }
12525
      if (isSetPrefix()) {
12526
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
12527
        if (lastComparison != 0) {
12528
          return lastComparison;
12529
        }
12530
      }
6250 amit.gupta 12531
      return 0;
12532
    }
12533
 
12534
    public _Fields fieldForId(int fieldId) {
12535
      return _Fields.findByThriftId(fieldId);
12536
    }
12537
 
12538
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12539
      org.apache.thrift.protocol.TField field;
12540
      iprot.readStructBegin();
12541
      while (true)
12542
      {
12543
        field = iprot.readFieldBegin();
12544
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12545
          break;
12546
        }
12547
        switch (field.id) {
12548
          case 1: // PROMOTION_ID
12549
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12550
              this.promotionId = iprot.readI64();
12551
              setPromotionIdIsSet(true);
12552
            } else { 
12553
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12554
            }
12555
            break;
12556
          case 2: // END_ON
12557
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12558
              this.endOn = iprot.readI64();
12559
              setEndOnIsSet(true);
12560
            } else { 
12561
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12562
            }
12563
            break;
12564
          case 3: // EMAIL
12565
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12566
              this.email = iprot.readString();
12567
            } else { 
12568
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12569
            }
12570
            break;
12571
          case 4: // AMOUNT
12572
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12573
              this.amount = iprot.readI64();
12574
              setAmountIsSet(true);
12575
            } else { 
12576
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12577
            }
12578
            break;
6356 amit.gupta 12579
          case 5: // IS_COD
12580
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
12581
              this.isCod = iprot.readBool();
12582
              setIsCodIsSet(true);
12583
            } else { 
12584
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12585
            }
12586
            break;
12587
          case 6: // USAGE
6250 amit.gupta 12588
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12589
              this.usage = iprot.readI64();
12590
              setUsageIsSet(true);
12591
            } else { 
12592
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12593
            }
12594
            break;
6561 amit.gupta 12595
          case 7: // PREFIX
12596
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12597
              this.prefix = iprot.readString();
12598
            } else { 
12599
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12600
            }
12601
            break;
6250 amit.gupta 12602
          default:
12603
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12604
        }
12605
        iprot.readFieldEnd();
12606
      }
12607
      iprot.readStructEnd();
12608
      validate();
12609
    }
12610
 
12611
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12612
      validate();
12613
 
12614
      oprot.writeStructBegin(STRUCT_DESC);
12615
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
12616
      oprot.writeI64(this.promotionId);
12617
      oprot.writeFieldEnd();
12618
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
12619
      oprot.writeI64(this.endOn);
12620
      oprot.writeFieldEnd();
12621
      if (this.email != null) {
12622
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
12623
        oprot.writeString(this.email);
12624
        oprot.writeFieldEnd();
12625
      }
12626
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
12627
      oprot.writeI64(this.amount);
12628
      oprot.writeFieldEnd();
6356 amit.gupta 12629
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
12630
      oprot.writeBool(this.isCod);
12631
      oprot.writeFieldEnd();
6250 amit.gupta 12632
      oprot.writeFieldBegin(USAGE_FIELD_DESC);
12633
      oprot.writeI64(this.usage);
12634
      oprot.writeFieldEnd();
6561 amit.gupta 12635
      if (this.prefix != null) {
12636
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
12637
        oprot.writeString(this.prefix);
12638
        oprot.writeFieldEnd();
12639
      }
6250 amit.gupta 12640
      oprot.writeFieldStop();
12641
      oprot.writeStructEnd();
12642
    }
12643
 
12644
    @Override
12645
    public String toString() {
12646
      StringBuilder sb = new StringBuilder("createCoupon_args(");
12647
      boolean first = true;
12648
 
12649
      sb.append("promotionId:");
12650
      sb.append(this.promotionId);
12651
      first = false;
12652
      if (!first) sb.append(", ");
12653
      sb.append("endOn:");
12654
      sb.append(this.endOn);
12655
      first = false;
12656
      if (!first) sb.append(", ");
12657
      sb.append("email:");
12658
      if (this.email == null) {
12659
        sb.append("null");
12660
      } else {
12661
        sb.append(this.email);
12662
      }
12663
      first = false;
12664
      if (!first) sb.append(", ");
12665
      sb.append("amount:");
12666
      sb.append(this.amount);
12667
      first = false;
12668
      if (!first) sb.append(", ");
6356 amit.gupta 12669
      sb.append("isCod:");
12670
      sb.append(this.isCod);
12671
      first = false;
12672
      if (!first) sb.append(", ");
6250 amit.gupta 12673
      sb.append("usage:");
12674
      sb.append(this.usage);
12675
      first = false;
6561 amit.gupta 12676
      if (!first) sb.append(", ");
12677
      sb.append("prefix:");
12678
      if (this.prefix == null) {
12679
        sb.append("null");
12680
      } else {
12681
        sb.append(this.prefix);
12682
      }
12683
      first = false;
6250 amit.gupta 12684
      sb.append(")");
12685
      return sb.toString();
12686
    }
12687
 
12688
    public void validate() throws org.apache.thrift.TException {
12689
      // check for required fields
12690
    }
12691
 
12692
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12693
      try {
12694
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12695
      } catch (org.apache.thrift.TException te) {
12696
        throw new java.io.IOException(te);
12697
      }
12698
    }
12699
 
12700
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12701
      try {
6561 amit.gupta 12702
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
12703
        __isset_bit_vector = new BitSet(1);
6250 amit.gupta 12704
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12705
      } catch (org.apache.thrift.TException te) {
12706
        throw new java.io.IOException(te);
12707
      }
12708
    }
12709
 
12710
  }
12711
 
12712
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12713
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
12714
 
12715
    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);
12716
    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);
12717
 
12718
    private String success; // required
12719
    private PromotionException pex; // required
12720
 
12721
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12722
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12723
      SUCCESS((short)0, "success"),
12724
      PEX((short)1, "pex");
12725
 
12726
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12727
 
12728
      static {
12729
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12730
          byName.put(field.getFieldName(), field);
12731
        }
12732
      }
12733
 
12734
      /**
12735
       * Find the _Fields constant that matches fieldId, or null if its not found.
12736
       */
12737
      public static _Fields findByThriftId(int fieldId) {
12738
        switch(fieldId) {
12739
          case 0: // SUCCESS
12740
            return SUCCESS;
12741
          case 1: // PEX
12742
            return PEX;
12743
          default:
12744
            return null;
12745
        }
12746
      }
12747
 
12748
      /**
12749
       * Find the _Fields constant that matches fieldId, throwing an exception
12750
       * if it is not found.
12751
       */
12752
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12753
        _Fields fields = findByThriftId(fieldId);
12754
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12755
        return fields;
12756
      }
12757
 
12758
      /**
12759
       * Find the _Fields constant that matches name, or null if its not found.
12760
       */
12761
      public static _Fields findByName(String name) {
12762
        return byName.get(name);
12763
      }
12764
 
12765
      private final short _thriftId;
12766
      private final String _fieldName;
12767
 
12768
      _Fields(short thriftId, String fieldName) {
12769
        _thriftId = thriftId;
12770
        _fieldName = fieldName;
12771
      }
12772
 
12773
      public short getThriftFieldId() {
12774
        return _thriftId;
12775
      }
12776
 
12777
      public String getFieldName() {
12778
        return _fieldName;
12779
      }
12780
    }
12781
 
12782
    // isset id assignments
12783
 
12784
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12785
    static {
12786
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12787
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12788
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12789
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12790
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12791
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12792
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
12793
    }
12794
 
12795
    public createCoupon_result() {
12796
    }
12797
 
12798
    public createCoupon_result(
12799
      String success,
12800
      PromotionException pex)
12801
    {
12802
      this();
12803
      this.success = success;
12804
      this.pex = pex;
12805
    }
12806
 
12807
    /**
12808
     * Performs a deep copy on <i>other</i>.
12809
     */
12810
    public createCoupon_result(createCoupon_result other) {
12811
      if (other.isSetSuccess()) {
12812
        this.success = other.success;
12813
      }
12814
      if (other.isSetPex()) {
12815
        this.pex = new PromotionException(other.pex);
12816
      }
12817
    }
12818
 
12819
    public createCoupon_result deepCopy() {
12820
      return new createCoupon_result(this);
12821
    }
12822
 
12823
    @Override
12824
    public void clear() {
12825
      this.success = null;
12826
      this.pex = null;
12827
    }
12828
 
12829
    public String getSuccess() {
12830
      return this.success;
12831
    }
12832
 
12833
    public void setSuccess(String success) {
12834
      this.success = success;
12835
    }
12836
 
12837
    public void unsetSuccess() {
12838
      this.success = null;
12839
    }
12840
 
12841
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12842
    public boolean isSetSuccess() {
12843
      return this.success != null;
12844
    }
12845
 
12846
    public void setSuccessIsSet(boolean value) {
12847
      if (!value) {
12848
        this.success = null;
12849
      }
12850
    }
12851
 
12852
    public PromotionException getPex() {
12853
      return this.pex;
12854
    }
12855
 
12856
    public void setPex(PromotionException pex) {
12857
      this.pex = pex;
12858
    }
12859
 
12860
    public void unsetPex() {
12861
      this.pex = null;
12862
    }
12863
 
12864
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12865
    public boolean isSetPex() {
12866
      return this.pex != null;
12867
    }
12868
 
12869
    public void setPexIsSet(boolean value) {
12870
      if (!value) {
12871
        this.pex = null;
12872
      }
12873
    }
12874
 
12875
    public void setFieldValue(_Fields field, Object value) {
12876
      switch (field) {
12877
      case SUCCESS:
12878
        if (value == null) {
12879
          unsetSuccess();
12880
        } else {
12881
          setSuccess((String)value);
12882
        }
12883
        break;
12884
 
12885
      case PEX:
12886
        if (value == null) {
12887
          unsetPex();
12888
        } else {
12889
          setPex((PromotionException)value);
12890
        }
12891
        break;
12892
 
12893
      }
12894
    }
12895
 
12896
    public Object getFieldValue(_Fields field) {
12897
      switch (field) {
12898
      case SUCCESS:
12899
        return getSuccess();
12900
 
12901
      case PEX:
12902
        return getPex();
12903
 
12904
      }
12905
      throw new IllegalStateException();
12906
    }
12907
 
12908
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12909
    public boolean isSet(_Fields field) {
12910
      if (field == null) {
12911
        throw new IllegalArgumentException();
12912
      }
12913
 
12914
      switch (field) {
12915
      case SUCCESS:
12916
        return isSetSuccess();
12917
      case PEX:
12918
        return isSetPex();
12919
      }
12920
      throw new IllegalStateException();
12921
    }
12922
 
12923
    @Override
12924
    public boolean equals(Object that) {
12925
      if (that == null)
12926
        return false;
12927
      if (that instanceof createCoupon_result)
12928
        return this.equals((createCoupon_result)that);
12929
      return false;
12930
    }
12931
 
12932
    public boolean equals(createCoupon_result that) {
12933
      if (that == null)
12934
        return false;
12935
 
12936
      boolean this_present_success = true && this.isSetSuccess();
12937
      boolean that_present_success = true && that.isSetSuccess();
12938
      if (this_present_success || that_present_success) {
12939
        if (!(this_present_success && that_present_success))
12940
          return false;
12941
        if (!this.success.equals(that.success))
12942
          return false;
12943
      }
12944
 
12945
      boolean this_present_pex = true && this.isSetPex();
12946
      boolean that_present_pex = true && that.isSetPex();
12947
      if (this_present_pex || that_present_pex) {
12948
        if (!(this_present_pex && that_present_pex))
12949
          return false;
12950
        if (!this.pex.equals(that.pex))
12951
          return false;
12952
      }
12953
 
12954
      return true;
12955
    }
12956
 
12957
    @Override
12958
    public int hashCode() {
12959
      return 0;
12960
    }
12961
 
12962
    public int compareTo(createCoupon_result other) {
12963
      if (!getClass().equals(other.getClass())) {
12964
        return getClass().getName().compareTo(other.getClass().getName());
12965
      }
12966
 
12967
      int lastComparison = 0;
12968
      createCoupon_result typedOther = (createCoupon_result)other;
12969
 
12970
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12971
      if (lastComparison != 0) {
12972
        return lastComparison;
12973
      }
12974
      if (isSetSuccess()) {
12975
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12976
        if (lastComparison != 0) {
12977
          return lastComparison;
12978
        }
12979
      }
12980
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12981
      if (lastComparison != 0) {
12982
        return lastComparison;
12983
      }
12984
      if (isSetPex()) {
12985
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12986
        if (lastComparison != 0) {
12987
          return lastComparison;
12988
        }
12989
      }
12990
      return 0;
12991
    }
12992
 
12993
    public _Fields fieldForId(int fieldId) {
12994
      return _Fields.findByThriftId(fieldId);
12995
    }
12996
 
12997
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12998
      org.apache.thrift.protocol.TField field;
12999
      iprot.readStructBegin();
13000
      while (true)
13001
      {
13002
        field = iprot.readFieldBegin();
13003
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13004
          break;
13005
        }
13006
        switch (field.id) {
13007
          case 0: // SUCCESS
13008
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13009
              this.success = iprot.readString();
13010
            } else { 
13011
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13012
            }
13013
            break;
13014
          case 1: // PEX
13015
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13016
              this.pex = new PromotionException();
13017
              this.pex.read(iprot);
13018
            } else { 
13019
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13020
            }
13021
            break;
13022
          default:
13023
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13024
        }
13025
        iprot.readFieldEnd();
13026
      }
13027
      iprot.readStructEnd();
13028
      validate();
13029
    }
13030
 
13031
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13032
      oprot.writeStructBegin(STRUCT_DESC);
13033
 
13034
      if (this.isSetSuccess()) {
13035
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13036
        oprot.writeString(this.success);
13037
        oprot.writeFieldEnd();
13038
      } else if (this.isSetPex()) {
13039
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13040
        this.pex.write(oprot);
13041
        oprot.writeFieldEnd();
13042
      }
13043
      oprot.writeFieldStop();
13044
      oprot.writeStructEnd();
13045
    }
13046
 
13047
    @Override
13048
    public String toString() {
13049
      StringBuilder sb = new StringBuilder("createCoupon_result(");
13050
      boolean first = true;
13051
 
13052
      sb.append("success:");
13053
      if (this.success == null) {
13054
        sb.append("null");
13055
      } else {
13056
        sb.append(this.success);
13057
      }
13058
      first = false;
13059
      if (!first) sb.append(", ");
13060
      sb.append("pex:");
13061
      if (this.pex == null) {
13062
        sb.append("null");
13063
      } else {
13064
        sb.append(this.pex);
13065
      }
13066
      first = false;
13067
      sb.append(")");
13068
      return sb.toString();
13069
    }
13070
 
13071
    public void validate() throws org.apache.thrift.TException {
13072
      // check for required fields
13073
    }
13074
 
13075
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13076
      try {
13077
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13078
      } catch (org.apache.thrift.TException te) {
13079
        throw new java.io.IOException(te);
13080
      }
13081
    }
13082
 
13083
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13084
      try {
13085
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13086
      } catch (org.apache.thrift.TException te) {
13087
        throw new java.io.IOException(te);
13088
      }
13089
    }
13090
 
13091
  }
13092
 
3430 rajveer 13093
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
13094
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 13095
 
3430 rajveer 13096
    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 13097
 
3430 rajveer 13098
    private String couponCode; // required
3385 varun.gupt 13099
 
13100
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13101
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13102
      COUPON_CODE((short)1, "couponCode");
13103
 
13104
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13105
 
13106
      static {
13107
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13108
          byName.put(field.getFieldName(), field);
13109
        }
13110
      }
13111
 
13112
      /**
13113
       * Find the _Fields constant that matches fieldId, or null if its not found.
13114
       */
13115
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13116
        switch(fieldId) {
13117
          case 1: // COUPON_CODE
13118
            return COUPON_CODE;
13119
          default:
13120
            return null;
13121
        }
3385 varun.gupt 13122
      }
13123
 
13124
      /**
13125
       * Find the _Fields constant that matches fieldId, throwing an exception
13126
       * if it is not found.
13127
       */
13128
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13129
        _Fields fields = findByThriftId(fieldId);
13130
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13131
        return fields;
13132
      }
13133
 
13134
      /**
13135
       * Find the _Fields constant that matches name, or null if its not found.
13136
       */
13137
      public static _Fields findByName(String name) {
13138
        return byName.get(name);
13139
      }
13140
 
13141
      private final short _thriftId;
13142
      private final String _fieldName;
13143
 
13144
      _Fields(short thriftId, String fieldName) {
13145
        _thriftId = thriftId;
13146
        _fieldName = fieldName;
13147
      }
13148
 
13149
      public short getThriftFieldId() {
13150
        return _thriftId;
13151
      }
13152
 
13153
      public String getFieldName() {
13154
        return _fieldName;
13155
      }
13156
    }
13157
 
13158
    // isset id assignments
13159
 
3430 rajveer 13160
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13161
    static {
3430 rajveer 13162
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13163
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13164
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13165
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13166
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 13167
    }
13168
 
13169
    public getSuccessfulPaymentCountForCoupon_args() {
13170
    }
13171
 
13172
    public getSuccessfulPaymentCountForCoupon_args(
13173
      String couponCode)
13174
    {
13175
      this();
13176
      this.couponCode = couponCode;
13177
    }
13178
 
13179
    /**
13180
     * Performs a deep copy on <i>other</i>.
13181
     */
13182
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
13183
      if (other.isSetCouponCode()) {
13184
        this.couponCode = other.couponCode;
13185
      }
13186
    }
13187
 
13188
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
13189
      return new getSuccessfulPaymentCountForCoupon_args(this);
13190
    }
13191
 
3430 rajveer 13192
    @Override
13193
    public void clear() {
13194
      this.couponCode = null;
3385 varun.gupt 13195
    }
13196
 
13197
    public String getCouponCode() {
13198
      return this.couponCode;
13199
    }
13200
 
3430 rajveer 13201
    public void setCouponCode(String couponCode) {
3385 varun.gupt 13202
      this.couponCode = couponCode;
13203
    }
13204
 
13205
    public void unsetCouponCode() {
13206
      this.couponCode = null;
13207
    }
13208
 
3430 rajveer 13209
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13210
    public boolean isSetCouponCode() {
13211
      return this.couponCode != null;
13212
    }
13213
 
13214
    public void setCouponCodeIsSet(boolean value) {
13215
      if (!value) {
13216
        this.couponCode = null;
13217
      }
13218
    }
13219
 
13220
    public void setFieldValue(_Fields field, Object value) {
13221
      switch (field) {
13222
      case COUPON_CODE:
13223
        if (value == null) {
13224
          unsetCouponCode();
13225
        } else {
13226
          setCouponCode((String)value);
13227
        }
13228
        break;
13229
 
13230
      }
13231
    }
13232
 
13233
    public Object getFieldValue(_Fields field) {
13234
      switch (field) {
13235
      case COUPON_CODE:
13236
        return getCouponCode();
13237
 
13238
      }
13239
      throw new IllegalStateException();
13240
    }
13241
 
3430 rajveer 13242
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13243
    public boolean isSet(_Fields field) {
13244
      if (field == null) {
13245
        throw new IllegalArgumentException();
13246
      }
3385 varun.gupt 13247
 
13248
      switch (field) {
13249
      case COUPON_CODE:
13250
        return isSetCouponCode();
13251
      }
13252
      throw new IllegalStateException();
13253
    }
13254
 
13255
    @Override
13256
    public boolean equals(Object that) {
13257
      if (that == null)
13258
        return false;
13259
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
13260
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
13261
      return false;
13262
    }
13263
 
13264
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
13265
      if (that == null)
13266
        return false;
13267
 
13268
      boolean this_present_couponCode = true && this.isSetCouponCode();
13269
      boolean that_present_couponCode = true && that.isSetCouponCode();
13270
      if (this_present_couponCode || that_present_couponCode) {
13271
        if (!(this_present_couponCode && that_present_couponCode))
13272
          return false;
13273
        if (!this.couponCode.equals(that.couponCode))
13274
          return false;
13275
      }
13276
 
13277
      return true;
13278
    }
13279
 
13280
    @Override
13281
    public int hashCode() {
13282
      return 0;
13283
    }
13284
 
13285
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
13286
      if (!getClass().equals(other.getClass())) {
13287
        return getClass().getName().compareTo(other.getClass().getName());
13288
      }
13289
 
13290
      int lastComparison = 0;
13291
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
13292
 
3430 rajveer 13293
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 13294
      if (lastComparison != 0) {
13295
        return lastComparison;
13296
      }
3430 rajveer 13297
      if (isSetCouponCode()) {
13298
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
13299
        if (lastComparison != 0) {
13300
          return lastComparison;
13301
        }
3385 varun.gupt 13302
      }
13303
      return 0;
13304
    }
13305
 
3430 rajveer 13306
    public _Fields fieldForId(int fieldId) {
13307
      return _Fields.findByThriftId(fieldId);
13308
    }
13309
 
13310
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13311
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13312
      iprot.readStructBegin();
13313
      while (true)
13314
      {
13315
        field = iprot.readFieldBegin();
3430 rajveer 13316
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13317
          break;
13318
        }
3430 rajveer 13319
        switch (field.id) {
13320
          case 1: // COUPON_CODE
13321
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13322
              this.couponCode = iprot.readString();
13323
            } else { 
13324
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13325
            }
13326
            break;
13327
          default:
13328
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13329
        }
3430 rajveer 13330
        iprot.readFieldEnd();
3385 varun.gupt 13331
      }
13332
      iprot.readStructEnd();
13333
      validate();
13334
    }
13335
 
3430 rajveer 13336
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13337
      validate();
13338
 
13339
      oprot.writeStructBegin(STRUCT_DESC);
13340
      if (this.couponCode != null) {
13341
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
13342
        oprot.writeString(this.couponCode);
13343
        oprot.writeFieldEnd();
13344
      }
13345
      oprot.writeFieldStop();
13346
      oprot.writeStructEnd();
13347
    }
13348
 
13349
    @Override
13350
    public String toString() {
13351
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
13352
      boolean first = true;
13353
 
13354
      sb.append("couponCode:");
13355
      if (this.couponCode == null) {
13356
        sb.append("null");
13357
      } else {
13358
        sb.append(this.couponCode);
13359
      }
13360
      first = false;
13361
      sb.append(")");
13362
      return sb.toString();
13363
    }
13364
 
3430 rajveer 13365
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13366
      // check for required fields
13367
    }
13368
 
3430 rajveer 13369
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13370
      try {
13371
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13372
      } catch (org.apache.thrift.TException te) {
13373
        throw new java.io.IOException(te);
13374
      }
13375
    }
13376
 
13377
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13378
      try {
13379
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13380
      } catch (org.apache.thrift.TException te) {
13381
        throw new java.io.IOException(te);
13382
      }
13383
    }
13384
 
3385 varun.gupt 13385
  }
13386
 
3430 rajveer 13387
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
13388
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 13389
 
3430 rajveer 13390
    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);
13391
    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 13392
 
3430 rajveer 13393
    private long success; // required
13394
    private PromotionException pex; // required
3385 varun.gupt 13395
 
13396
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13397
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13398
      SUCCESS((short)0, "success"),
13399
      PEX((short)1, "pex");
13400
 
13401
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13402
 
13403
      static {
13404
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13405
          byName.put(field.getFieldName(), field);
13406
        }
13407
      }
13408
 
13409
      /**
13410
       * Find the _Fields constant that matches fieldId, or null if its not found.
13411
       */
13412
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13413
        switch(fieldId) {
13414
          case 0: // SUCCESS
13415
            return SUCCESS;
13416
          case 1: // PEX
13417
            return PEX;
13418
          default:
13419
            return null;
13420
        }
3385 varun.gupt 13421
      }
13422
 
13423
      /**
13424
       * Find the _Fields constant that matches fieldId, throwing an exception
13425
       * if it is not found.
13426
       */
13427
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13428
        _Fields fields = findByThriftId(fieldId);
13429
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13430
        return fields;
13431
      }
13432
 
13433
      /**
13434
       * Find the _Fields constant that matches name, or null if its not found.
13435
       */
13436
      public static _Fields findByName(String name) {
13437
        return byName.get(name);
13438
      }
13439
 
13440
      private final short _thriftId;
13441
      private final String _fieldName;
13442
 
13443
      _Fields(short thriftId, String fieldName) {
13444
        _thriftId = thriftId;
13445
        _fieldName = fieldName;
13446
      }
13447
 
13448
      public short getThriftFieldId() {
13449
        return _thriftId;
13450
      }
13451
 
13452
      public String getFieldName() {
13453
        return _fieldName;
13454
      }
13455
    }
13456
 
13457
    // isset id assignments
13458
    private static final int __SUCCESS_ISSET_ID = 0;
13459
    private BitSet __isset_bit_vector = new BitSet(1);
13460
 
3430 rajveer 13461
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13462
    static {
3430 rajveer 13463
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13464
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13465
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13466
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13467
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13468
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13469
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 13470
    }
13471
 
13472
    public getSuccessfulPaymentCountForCoupon_result() {
13473
    }
13474
 
13475
    public getSuccessfulPaymentCountForCoupon_result(
13476
      long success,
13477
      PromotionException pex)
13478
    {
13479
      this();
13480
      this.success = success;
13481
      setSuccessIsSet(true);
13482
      this.pex = pex;
13483
    }
13484
 
13485
    /**
13486
     * Performs a deep copy on <i>other</i>.
13487
     */
13488
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
13489
      __isset_bit_vector.clear();
13490
      __isset_bit_vector.or(other.__isset_bit_vector);
13491
      this.success = other.success;
13492
      if (other.isSetPex()) {
13493
        this.pex = new PromotionException(other.pex);
13494
      }
13495
    }
13496
 
13497
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
13498
      return new getSuccessfulPaymentCountForCoupon_result(this);
13499
    }
13500
 
3430 rajveer 13501
    @Override
13502
    public void clear() {
13503
      setSuccessIsSet(false);
13504
      this.success = 0;
13505
      this.pex = null;
3385 varun.gupt 13506
    }
13507
 
13508
    public long getSuccess() {
13509
      return this.success;
13510
    }
13511
 
3430 rajveer 13512
    public void setSuccess(long success) {
3385 varun.gupt 13513
      this.success = success;
13514
      setSuccessIsSet(true);
13515
    }
13516
 
13517
    public void unsetSuccess() {
13518
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
13519
    }
13520
 
3430 rajveer 13521
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13522
    public boolean isSetSuccess() {
13523
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
13524
    }
13525
 
13526
    public void setSuccessIsSet(boolean value) {
13527
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
13528
    }
13529
 
13530
    public PromotionException getPex() {
13531
      return this.pex;
13532
    }
13533
 
3430 rajveer 13534
    public void setPex(PromotionException pex) {
3385 varun.gupt 13535
      this.pex = pex;
13536
    }
13537
 
13538
    public void unsetPex() {
13539
      this.pex = null;
13540
    }
13541
 
3430 rajveer 13542
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13543
    public boolean isSetPex() {
13544
      return this.pex != null;
13545
    }
13546
 
13547
    public void setPexIsSet(boolean value) {
13548
      if (!value) {
13549
        this.pex = null;
13550
      }
13551
    }
13552
 
13553
    public void setFieldValue(_Fields field, Object value) {
13554
      switch (field) {
13555
      case SUCCESS:
13556
        if (value == null) {
13557
          unsetSuccess();
13558
        } else {
13559
          setSuccess((Long)value);
13560
        }
13561
        break;
13562
 
13563
      case PEX:
13564
        if (value == null) {
13565
          unsetPex();
13566
        } else {
13567
          setPex((PromotionException)value);
13568
        }
13569
        break;
13570
 
13571
      }
13572
    }
13573
 
13574
    public Object getFieldValue(_Fields field) {
13575
      switch (field) {
13576
      case SUCCESS:
3430 rajveer 13577
        return Long.valueOf(getSuccess());
3385 varun.gupt 13578
 
13579
      case PEX:
13580
        return getPex();
13581
 
13582
      }
13583
      throw new IllegalStateException();
13584
    }
13585
 
3430 rajveer 13586
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13587
    public boolean isSet(_Fields field) {
13588
      if (field == null) {
13589
        throw new IllegalArgumentException();
13590
      }
3385 varun.gupt 13591
 
13592
      switch (field) {
13593
      case SUCCESS:
13594
        return isSetSuccess();
13595
      case PEX:
13596
        return isSetPex();
13597
      }
13598
      throw new IllegalStateException();
13599
    }
13600
 
13601
    @Override
13602
    public boolean equals(Object that) {
13603
      if (that == null)
13604
        return false;
13605
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
13606
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
13607
      return false;
13608
    }
13609
 
13610
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
13611
      if (that == null)
13612
        return false;
13613
 
13614
      boolean this_present_success = true;
13615
      boolean that_present_success = true;
13616
      if (this_present_success || that_present_success) {
13617
        if (!(this_present_success && that_present_success))
13618
          return false;
13619
        if (this.success != that.success)
13620
          return false;
13621
      }
13622
 
13623
      boolean this_present_pex = true && this.isSetPex();
13624
      boolean that_present_pex = true && that.isSetPex();
13625
      if (this_present_pex || that_present_pex) {
13626
        if (!(this_present_pex && that_present_pex))
13627
          return false;
13628
        if (!this.pex.equals(that.pex))
13629
          return false;
13630
      }
13631
 
13632
      return true;
13633
    }
13634
 
13635
    @Override
13636
    public int hashCode() {
13637
      return 0;
13638
    }
13639
 
13640
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
13641
      if (!getClass().equals(other.getClass())) {
13642
        return getClass().getName().compareTo(other.getClass().getName());
13643
      }
13644
 
13645
      int lastComparison = 0;
13646
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
13647
 
3430 rajveer 13648
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 13649
      if (lastComparison != 0) {
13650
        return lastComparison;
13651
      }
3430 rajveer 13652
      if (isSetSuccess()) {
13653
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13654
        if (lastComparison != 0) {
13655
          return lastComparison;
13656
        }
3385 varun.gupt 13657
      }
3430 rajveer 13658
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 13659
      if (lastComparison != 0) {
13660
        return lastComparison;
13661
      }
3430 rajveer 13662
      if (isSetPex()) {
13663
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13664
        if (lastComparison != 0) {
13665
          return lastComparison;
13666
        }
3385 varun.gupt 13667
      }
13668
      return 0;
13669
    }
13670
 
3430 rajveer 13671
    public _Fields fieldForId(int fieldId) {
13672
      return _Fields.findByThriftId(fieldId);
13673
    }
13674
 
13675
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13676
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13677
      iprot.readStructBegin();
13678
      while (true)
13679
      {
13680
        field = iprot.readFieldBegin();
3430 rajveer 13681
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13682
          break;
13683
        }
3430 rajveer 13684
        switch (field.id) {
13685
          case 0: // SUCCESS
13686
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13687
              this.success = iprot.readI64();
13688
              setSuccessIsSet(true);
13689
            } else { 
13690
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13691
            }
13692
            break;
13693
          case 1: // PEX
13694
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13695
              this.pex = new PromotionException();
13696
              this.pex.read(iprot);
13697
            } else { 
13698
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13699
            }
13700
            break;
13701
          default:
13702
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13703
        }
3430 rajveer 13704
        iprot.readFieldEnd();
3385 varun.gupt 13705
      }
13706
      iprot.readStructEnd();
13707
      validate();
13708
    }
13709
 
3430 rajveer 13710
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13711
      oprot.writeStructBegin(STRUCT_DESC);
13712
 
13713
      if (this.isSetSuccess()) {
13714
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13715
        oprot.writeI64(this.success);
13716
        oprot.writeFieldEnd();
13717
      } else if (this.isSetPex()) {
13718
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13719
        this.pex.write(oprot);
13720
        oprot.writeFieldEnd();
13721
      }
13722
      oprot.writeFieldStop();
13723
      oprot.writeStructEnd();
13724
    }
13725
 
13726
    @Override
13727
    public String toString() {
13728
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
13729
      boolean first = true;
13730
 
13731
      sb.append("success:");
13732
      sb.append(this.success);
13733
      first = false;
13734
      if (!first) sb.append(", ");
13735
      sb.append("pex:");
13736
      if (this.pex == null) {
13737
        sb.append("null");
13738
      } else {
13739
        sb.append(this.pex);
13740
      }
13741
      first = false;
13742
      sb.append(")");
13743
      return sb.toString();
13744
    }
13745
 
3430 rajveer 13746
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13747
      // check for required fields
13748
    }
13749
 
3430 rajveer 13750
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13751
      try {
13752
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13753
      } catch (org.apache.thrift.TException te) {
13754
        throw new java.io.IOException(te);
13755
      }
13756
    }
13757
 
13758
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13759
      try {
13760
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13761
      } catch (org.apache.thrift.TException te) {
13762
        throw new java.io.IOException(te);
13763
      }
13764
    }
13765
 
3385 varun.gupt 13766
  }
13767
 
3430 rajveer 13768
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
13769
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 13770
 
3430 rajveer 13771
    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 13772
 
3430 rajveer 13773
    private String ruleName; // required
3385 varun.gupt 13774
 
13775
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13776
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13777
      RULE_NAME((short)1, "ruleName");
13778
 
13779
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13780
 
13781
      static {
13782
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13783
          byName.put(field.getFieldName(), field);
13784
        }
13785
      }
13786
 
13787
      /**
13788
       * Find the _Fields constant that matches fieldId, or null if its not found.
13789
       */
13790
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13791
        switch(fieldId) {
13792
          case 1: // RULE_NAME
13793
            return RULE_NAME;
13794
          default:
13795
            return null;
13796
        }
3385 varun.gupt 13797
      }
13798
 
13799
      /**
13800
       * Find the _Fields constant that matches fieldId, throwing an exception
13801
       * if it is not found.
13802
       */
13803
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13804
        _Fields fields = findByThriftId(fieldId);
13805
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13806
        return fields;
13807
      }
13808
 
13809
      /**
13810
       * Find the _Fields constant that matches name, or null if its not found.
13811
       */
13812
      public static _Fields findByName(String name) {
13813
        return byName.get(name);
13814
      }
13815
 
13816
      private final short _thriftId;
13817
      private final String _fieldName;
13818
 
13819
      _Fields(short thriftId, String fieldName) {
13820
        _thriftId = thriftId;
13821
        _fieldName = fieldName;
13822
      }
13823
 
13824
      public short getThriftFieldId() {
13825
        return _thriftId;
13826
      }
13827
 
13828
      public String getFieldName() {
13829
        return _fieldName;
13830
      }
13831
    }
13832
 
13833
    // isset id assignments
13834
 
3430 rajveer 13835
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13836
    static {
3430 rajveer 13837
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13838
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13839
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13840
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13841
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 13842
    }
13843
 
13844
    public getRuleDocString_args() {
13845
    }
13846
 
13847
    public getRuleDocString_args(
13848
      String ruleName)
13849
    {
13850
      this();
13851
      this.ruleName = ruleName;
13852
    }
13853
 
13854
    /**
13855
     * Performs a deep copy on <i>other</i>.
13856
     */
13857
    public getRuleDocString_args(getRuleDocString_args other) {
13858
      if (other.isSetRuleName()) {
13859
        this.ruleName = other.ruleName;
13860
      }
13861
    }
13862
 
13863
    public getRuleDocString_args deepCopy() {
13864
      return new getRuleDocString_args(this);
13865
    }
13866
 
3430 rajveer 13867
    @Override
13868
    public void clear() {
13869
      this.ruleName = null;
3385 varun.gupt 13870
    }
13871
 
13872
    public String getRuleName() {
13873
      return this.ruleName;
13874
    }
13875
 
3430 rajveer 13876
    public void setRuleName(String ruleName) {
3385 varun.gupt 13877
      this.ruleName = ruleName;
13878
    }
13879
 
13880
    public void unsetRuleName() {
13881
      this.ruleName = null;
13882
    }
13883
 
3430 rajveer 13884
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13885
    public boolean isSetRuleName() {
13886
      return this.ruleName != null;
13887
    }
13888
 
13889
    public void setRuleNameIsSet(boolean value) {
13890
      if (!value) {
13891
        this.ruleName = null;
13892
      }
13893
    }
13894
 
13895
    public void setFieldValue(_Fields field, Object value) {
13896
      switch (field) {
13897
      case RULE_NAME:
13898
        if (value == null) {
13899
          unsetRuleName();
13900
        } else {
13901
          setRuleName((String)value);
13902
        }
13903
        break;
13904
 
13905
      }
13906
    }
13907
 
13908
    public Object getFieldValue(_Fields field) {
13909
      switch (field) {
13910
      case RULE_NAME:
13911
        return getRuleName();
13912
 
13913
      }
13914
      throw new IllegalStateException();
13915
    }
13916
 
3430 rajveer 13917
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13918
    public boolean isSet(_Fields field) {
13919
      if (field == null) {
13920
        throw new IllegalArgumentException();
13921
      }
3385 varun.gupt 13922
 
13923
      switch (field) {
13924
      case RULE_NAME:
13925
        return isSetRuleName();
13926
      }
13927
      throw new IllegalStateException();
13928
    }
13929
 
13930
    @Override
13931
    public boolean equals(Object that) {
13932
      if (that == null)
13933
        return false;
13934
      if (that instanceof getRuleDocString_args)
13935
        return this.equals((getRuleDocString_args)that);
13936
      return false;
13937
    }
13938
 
13939
    public boolean equals(getRuleDocString_args that) {
13940
      if (that == null)
13941
        return false;
13942
 
13943
      boolean this_present_ruleName = true && this.isSetRuleName();
13944
      boolean that_present_ruleName = true && that.isSetRuleName();
13945
      if (this_present_ruleName || that_present_ruleName) {
13946
        if (!(this_present_ruleName && that_present_ruleName))
13947
          return false;
13948
        if (!this.ruleName.equals(that.ruleName))
13949
          return false;
13950
      }
13951
 
13952
      return true;
13953
    }
13954
 
13955
    @Override
13956
    public int hashCode() {
13957
      return 0;
13958
    }
13959
 
13960
    public int compareTo(getRuleDocString_args other) {
13961
      if (!getClass().equals(other.getClass())) {
13962
        return getClass().getName().compareTo(other.getClass().getName());
13963
      }
13964
 
13965
      int lastComparison = 0;
13966
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
13967
 
3430 rajveer 13968
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 13969
      if (lastComparison != 0) {
13970
        return lastComparison;
13971
      }
3430 rajveer 13972
      if (isSetRuleName()) {
13973
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
13974
        if (lastComparison != 0) {
13975
          return lastComparison;
13976
        }
3385 varun.gupt 13977
      }
13978
      return 0;
13979
    }
13980
 
3430 rajveer 13981
    public _Fields fieldForId(int fieldId) {
13982
      return _Fields.findByThriftId(fieldId);
13983
    }
13984
 
13985
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13986
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13987
      iprot.readStructBegin();
13988
      while (true)
13989
      {
13990
        field = iprot.readFieldBegin();
3430 rajveer 13991
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13992
          break;
13993
        }
3430 rajveer 13994
        switch (field.id) {
13995
          case 1: // RULE_NAME
13996
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13997
              this.ruleName = iprot.readString();
13998
            } else { 
13999
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14000
            }
14001
            break;
14002
          default:
14003
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14004
        }
3430 rajveer 14005
        iprot.readFieldEnd();
3385 varun.gupt 14006
      }
14007
      iprot.readStructEnd();
14008
      validate();
14009
    }
14010
 
3430 rajveer 14011
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14012
      validate();
14013
 
14014
      oprot.writeStructBegin(STRUCT_DESC);
14015
      if (this.ruleName != null) {
14016
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
14017
        oprot.writeString(this.ruleName);
14018
        oprot.writeFieldEnd();
14019
      }
14020
      oprot.writeFieldStop();
14021
      oprot.writeStructEnd();
14022
    }
14023
 
14024
    @Override
14025
    public String toString() {
14026
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
14027
      boolean first = true;
14028
 
14029
      sb.append("ruleName:");
14030
      if (this.ruleName == null) {
14031
        sb.append("null");
14032
      } else {
14033
        sb.append(this.ruleName);
14034
      }
14035
      first = false;
14036
      sb.append(")");
14037
      return sb.toString();
14038
    }
14039
 
3430 rajveer 14040
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14041
      // check for required fields
14042
    }
14043
 
3430 rajveer 14044
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14045
      try {
14046
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14047
      } catch (org.apache.thrift.TException te) {
14048
        throw new java.io.IOException(te);
14049
      }
14050
    }
14051
 
14052
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14053
      try {
14054
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14055
      } catch (org.apache.thrift.TException te) {
14056
        throw new java.io.IOException(te);
14057
      }
14058
    }
14059
 
3385 varun.gupt 14060
  }
14061
 
3430 rajveer 14062
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
14063
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 14064
 
3430 rajveer 14065
    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 14066
 
3430 rajveer 14067
    private String success; // required
3385 varun.gupt 14068
 
14069
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 14070
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 14071
      SUCCESS((short)0, "success");
14072
 
14073
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14074
 
14075
      static {
14076
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14077
          byName.put(field.getFieldName(), field);
14078
        }
14079
      }
14080
 
14081
      /**
14082
       * Find the _Fields constant that matches fieldId, or null if its not found.
14083
       */
14084
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 14085
        switch(fieldId) {
14086
          case 0: // SUCCESS
14087
            return SUCCESS;
14088
          default:
14089
            return null;
14090
        }
3385 varun.gupt 14091
      }
14092
 
14093
      /**
14094
       * Find the _Fields constant that matches fieldId, throwing an exception
14095
       * if it is not found.
14096
       */
14097
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14098
        _Fields fields = findByThriftId(fieldId);
14099
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14100
        return fields;
14101
      }
14102
 
14103
      /**
14104
       * Find the _Fields constant that matches name, or null if its not found.
14105
       */
14106
      public static _Fields findByName(String name) {
14107
        return byName.get(name);
14108
      }
14109
 
14110
      private final short _thriftId;
14111
      private final String _fieldName;
14112
 
14113
      _Fields(short thriftId, String fieldName) {
14114
        _thriftId = thriftId;
14115
        _fieldName = fieldName;
14116
      }
14117
 
14118
      public short getThriftFieldId() {
14119
        return _thriftId;
14120
      }
14121
 
14122
      public String getFieldName() {
14123
        return _fieldName;
14124
      }
14125
    }
14126
 
14127
    // isset id assignments
14128
 
3430 rajveer 14129
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 14130
    static {
3430 rajveer 14131
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14132
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14133
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
14134
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14135
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 14136
    }
14137
 
14138
    public getRuleDocString_result() {
14139
    }
14140
 
14141
    public getRuleDocString_result(
14142
      String success)
14143
    {
14144
      this();
14145
      this.success = success;
14146
    }
14147
 
14148
    /**
14149
     * Performs a deep copy on <i>other</i>.
14150
     */
14151
    public getRuleDocString_result(getRuleDocString_result other) {
14152
      if (other.isSetSuccess()) {
14153
        this.success = other.success;
14154
      }
14155
    }
14156
 
14157
    public getRuleDocString_result deepCopy() {
14158
      return new getRuleDocString_result(this);
14159
    }
14160
 
3430 rajveer 14161
    @Override
14162
    public void clear() {
14163
      this.success = null;
3385 varun.gupt 14164
    }
14165
 
14166
    public String getSuccess() {
14167
      return this.success;
14168
    }
14169
 
3430 rajveer 14170
    public void setSuccess(String success) {
3385 varun.gupt 14171
      this.success = success;
14172
    }
14173
 
14174
    public void unsetSuccess() {
14175
      this.success = null;
14176
    }
14177
 
3430 rajveer 14178
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14179
    public boolean isSetSuccess() {
14180
      return this.success != null;
14181
    }
14182
 
14183
    public void setSuccessIsSet(boolean value) {
14184
      if (!value) {
14185
        this.success = null;
14186
      }
14187
    }
14188
 
14189
    public void setFieldValue(_Fields field, Object value) {
14190
      switch (field) {
14191
      case SUCCESS:
14192
        if (value == null) {
14193
          unsetSuccess();
14194
        } else {
14195
          setSuccess((String)value);
14196
        }
14197
        break;
14198
 
14199
      }
14200
    }
14201
 
14202
    public Object getFieldValue(_Fields field) {
14203
      switch (field) {
14204
      case SUCCESS:
14205
        return getSuccess();
14206
 
14207
      }
14208
      throw new IllegalStateException();
14209
    }
14210
 
3430 rajveer 14211
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14212
    public boolean isSet(_Fields field) {
14213
      if (field == null) {
14214
        throw new IllegalArgumentException();
14215
      }
3385 varun.gupt 14216
 
14217
      switch (field) {
14218
      case SUCCESS:
14219
        return isSetSuccess();
14220
      }
14221
      throw new IllegalStateException();
14222
    }
14223
 
14224
    @Override
14225
    public boolean equals(Object that) {
14226
      if (that == null)
14227
        return false;
14228
      if (that instanceof getRuleDocString_result)
14229
        return this.equals((getRuleDocString_result)that);
14230
      return false;
14231
    }
14232
 
14233
    public boolean equals(getRuleDocString_result that) {
14234
      if (that == null)
14235
        return false;
14236
 
14237
      boolean this_present_success = true && this.isSetSuccess();
14238
      boolean that_present_success = true && that.isSetSuccess();
14239
      if (this_present_success || that_present_success) {
14240
        if (!(this_present_success && that_present_success))
14241
          return false;
14242
        if (!this.success.equals(that.success))
14243
          return false;
14244
      }
14245
 
14246
      return true;
14247
    }
14248
 
14249
    @Override
14250
    public int hashCode() {
14251
      return 0;
14252
    }
14253
 
14254
    public int compareTo(getRuleDocString_result other) {
14255
      if (!getClass().equals(other.getClass())) {
14256
        return getClass().getName().compareTo(other.getClass().getName());
14257
      }
14258
 
14259
      int lastComparison = 0;
14260
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
14261
 
3430 rajveer 14262
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 14263
      if (lastComparison != 0) {
14264
        return lastComparison;
14265
      }
3430 rajveer 14266
      if (isSetSuccess()) {
14267
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14268
        if (lastComparison != 0) {
14269
          return lastComparison;
14270
        }
3385 varun.gupt 14271
      }
14272
      return 0;
14273
    }
14274
 
3430 rajveer 14275
    public _Fields fieldForId(int fieldId) {
14276
      return _Fields.findByThriftId(fieldId);
14277
    }
14278
 
14279
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14280
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14281
      iprot.readStructBegin();
14282
      while (true)
14283
      {
14284
        field = iprot.readFieldBegin();
3430 rajveer 14285
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14286
          break;
14287
        }
3430 rajveer 14288
        switch (field.id) {
14289
          case 0: // SUCCESS
14290
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14291
              this.success = iprot.readString();
14292
            } else { 
14293
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14294
            }
14295
            break;
14296
          default:
14297
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14298
        }
3430 rajveer 14299
        iprot.readFieldEnd();
3385 varun.gupt 14300
      }
14301
      iprot.readStructEnd();
14302
      validate();
14303
    }
14304
 
3430 rajveer 14305
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14306
      oprot.writeStructBegin(STRUCT_DESC);
14307
 
14308
      if (this.isSetSuccess()) {
14309
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14310
        oprot.writeString(this.success);
14311
        oprot.writeFieldEnd();
14312
      }
14313
      oprot.writeFieldStop();
14314
      oprot.writeStructEnd();
14315
    }
14316
 
14317
    @Override
14318
    public String toString() {
14319
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
14320
      boolean first = true;
14321
 
14322
      sb.append("success:");
14323
      if (this.success == null) {
14324
        sb.append("null");
14325
      } else {
14326
        sb.append(this.success);
14327
      }
14328
      first = false;
14329
      sb.append(")");
14330
      return sb.toString();
14331
    }
14332
 
3430 rajveer 14333
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14334
      // check for required fields
14335
    }
14336
 
3430 rajveer 14337
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14338
      try {
14339
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14340
      } catch (org.apache.thrift.TException te) {
14341
        throw new java.io.IOException(te);
14342
      }
14343
    }
14344
 
14345
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14346
      try {
14347
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14348
      } catch (org.apache.thrift.TException te) {
14349
        throw new java.io.IOException(te);
14350
      }
14351
    }
14352
 
3385 varun.gupt 14353
  }
14354
 
4189 varun.gupt 14355
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
14356
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
14357
 
14358
    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);
14359
 
14360
    private List<Long> itemIds; // required
14361
 
14362
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14363
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14364
      ITEM_IDS((short)1, "itemIds");
14365
 
14366
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14367
 
14368
      static {
14369
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14370
          byName.put(field.getFieldName(), field);
14371
        }
14372
      }
14373
 
14374
      /**
14375
       * Find the _Fields constant that matches fieldId, or null if its not found.
14376
       */
14377
      public static _Fields findByThriftId(int fieldId) {
14378
        switch(fieldId) {
14379
          case 1: // ITEM_IDS
14380
            return ITEM_IDS;
14381
          default:
14382
            return null;
14383
        }
14384
      }
14385
 
14386
      /**
14387
       * Find the _Fields constant that matches fieldId, throwing an exception
14388
       * if it is not found.
14389
       */
14390
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14391
        _Fields fields = findByThriftId(fieldId);
14392
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14393
        return fields;
14394
      }
14395
 
14396
      /**
14397
       * Find the _Fields constant that matches name, or null if its not found.
14398
       */
14399
      public static _Fields findByName(String name) {
14400
        return byName.get(name);
14401
      }
14402
 
14403
      private final short _thriftId;
14404
      private final String _fieldName;
14405
 
14406
      _Fields(short thriftId, String fieldName) {
14407
        _thriftId = thriftId;
14408
        _fieldName = fieldName;
14409
      }
14410
 
14411
      public short getThriftFieldId() {
14412
        return _thriftId;
14413
      }
14414
 
14415
      public String getFieldName() {
14416
        return _fieldName;
14417
      }
14418
    }
14419
 
14420
    // isset id assignments
14421
 
14422
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14423
    static {
14424
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14425
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14426
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14427
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
14428
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14429
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
14430
    }
14431
 
14432
    public getItemDiscountMap_args() {
14433
    }
14434
 
14435
    public getItemDiscountMap_args(
14436
      List<Long> itemIds)
14437
    {
14438
      this();
14439
      this.itemIds = itemIds;
14440
    }
14441
 
14442
    /**
14443
     * Performs a deep copy on <i>other</i>.
14444
     */
14445
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
14446
      if (other.isSetItemIds()) {
14447
        List<Long> __this__itemIds = new ArrayList<Long>();
14448
        for (Long other_element : other.itemIds) {
14449
          __this__itemIds.add(other_element);
14450
        }
14451
        this.itemIds = __this__itemIds;
14452
      }
14453
    }
14454
 
14455
    public getItemDiscountMap_args deepCopy() {
14456
      return new getItemDiscountMap_args(this);
14457
    }
14458
 
14459
    @Override
14460
    public void clear() {
14461
      this.itemIds = null;
14462
    }
14463
 
14464
    public int getItemIdsSize() {
14465
      return (this.itemIds == null) ? 0 : this.itemIds.size();
14466
    }
14467
 
14468
    public java.util.Iterator<Long> getItemIdsIterator() {
14469
      return (this.itemIds == null) ? null : this.itemIds.iterator();
14470
    }
14471
 
14472
    public void addToItemIds(long elem) {
14473
      if (this.itemIds == null) {
14474
        this.itemIds = new ArrayList<Long>();
14475
      }
14476
      this.itemIds.add(elem);
14477
    }
14478
 
14479
    public List<Long> getItemIds() {
14480
      return this.itemIds;
14481
    }
14482
 
14483
    public void setItemIds(List<Long> itemIds) {
14484
      this.itemIds = itemIds;
14485
    }
14486
 
14487
    public void unsetItemIds() {
14488
      this.itemIds = null;
14489
    }
14490
 
14491
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
14492
    public boolean isSetItemIds() {
14493
      return this.itemIds != null;
14494
    }
14495
 
14496
    public void setItemIdsIsSet(boolean value) {
14497
      if (!value) {
14498
        this.itemIds = null;
14499
      }
14500
    }
14501
 
14502
    public void setFieldValue(_Fields field, Object value) {
14503
      switch (field) {
14504
      case ITEM_IDS:
14505
        if (value == null) {
14506
          unsetItemIds();
14507
        } else {
14508
          setItemIds((List<Long>)value);
14509
        }
14510
        break;
14511
 
14512
      }
14513
    }
14514
 
14515
    public Object getFieldValue(_Fields field) {
14516
      switch (field) {
14517
      case ITEM_IDS:
14518
        return getItemIds();
14519
 
14520
      }
14521
      throw new IllegalStateException();
14522
    }
14523
 
14524
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14525
    public boolean isSet(_Fields field) {
14526
      if (field == null) {
14527
        throw new IllegalArgumentException();
14528
      }
14529
 
14530
      switch (field) {
14531
      case ITEM_IDS:
14532
        return isSetItemIds();
14533
      }
14534
      throw new IllegalStateException();
14535
    }
14536
 
14537
    @Override
14538
    public boolean equals(Object that) {
14539
      if (that == null)
14540
        return false;
14541
      if (that instanceof getItemDiscountMap_args)
14542
        return this.equals((getItemDiscountMap_args)that);
14543
      return false;
14544
    }
14545
 
14546
    public boolean equals(getItemDiscountMap_args that) {
14547
      if (that == null)
14548
        return false;
14549
 
14550
      boolean this_present_itemIds = true && this.isSetItemIds();
14551
      boolean that_present_itemIds = true && that.isSetItemIds();
14552
      if (this_present_itemIds || that_present_itemIds) {
14553
        if (!(this_present_itemIds && that_present_itemIds))
14554
          return false;
14555
        if (!this.itemIds.equals(that.itemIds))
14556
          return false;
14557
      }
14558
 
14559
      return true;
14560
    }
14561
 
14562
    @Override
14563
    public int hashCode() {
14564
      return 0;
14565
    }
14566
 
14567
    public int compareTo(getItemDiscountMap_args other) {
14568
      if (!getClass().equals(other.getClass())) {
14569
        return getClass().getName().compareTo(other.getClass().getName());
14570
      }
14571
 
14572
      int lastComparison = 0;
14573
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
14574
 
14575
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
14576
      if (lastComparison != 0) {
14577
        return lastComparison;
14578
      }
14579
      if (isSetItemIds()) {
14580
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
14581
        if (lastComparison != 0) {
14582
          return lastComparison;
14583
        }
14584
      }
14585
      return 0;
14586
    }
14587
 
14588
    public _Fields fieldForId(int fieldId) {
14589
      return _Fields.findByThriftId(fieldId);
14590
    }
14591
 
14592
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14593
      org.apache.thrift.protocol.TField field;
14594
      iprot.readStructBegin();
14595
      while (true)
14596
      {
14597
        field = iprot.readFieldBegin();
14598
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14599
          break;
14600
        }
14601
        switch (field.id) {
14602
          case 1: // ITEM_IDS
14603
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14604
              {
6497 amit.gupta 14605
                org.apache.thrift.protocol.TList _list29 = iprot.readListBegin();
14606
                this.itemIds = new ArrayList<Long>(_list29.size);
14607
                for (int _i30 = 0; _i30 < _list29.size; ++_i30)
4189 varun.gupt 14608
                {
6497 amit.gupta 14609
                  long _elem31; // required
14610
                  _elem31 = iprot.readI64();
14611
                  this.itemIds.add(_elem31);
4189 varun.gupt 14612
                }
14613
                iprot.readListEnd();
14614
              }
14615
            } else { 
14616
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14617
            }
14618
            break;
14619
          default:
14620
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14621
        }
14622
        iprot.readFieldEnd();
14623
      }
14624
      iprot.readStructEnd();
14625
      validate();
14626
    }
14627
 
14628
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14629
      validate();
14630
 
14631
      oprot.writeStructBegin(STRUCT_DESC);
14632
      if (this.itemIds != null) {
14633
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
14634
        {
14635
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
6497 amit.gupta 14636
          for (long _iter32 : this.itemIds)
4189 varun.gupt 14637
          {
6497 amit.gupta 14638
            oprot.writeI64(_iter32);
4189 varun.gupt 14639
          }
14640
          oprot.writeListEnd();
14641
        }
14642
        oprot.writeFieldEnd();
14643
      }
14644
      oprot.writeFieldStop();
14645
      oprot.writeStructEnd();
14646
    }
14647
 
14648
    @Override
14649
    public String toString() {
14650
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
14651
      boolean first = true;
14652
 
14653
      sb.append("itemIds:");
14654
      if (this.itemIds == null) {
14655
        sb.append("null");
14656
      } else {
14657
        sb.append(this.itemIds);
14658
      }
14659
      first = false;
14660
      sb.append(")");
14661
      return sb.toString();
14662
    }
14663
 
14664
    public void validate() throws org.apache.thrift.TException {
14665
      // check for required fields
14666
    }
14667
 
14668
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14669
      try {
14670
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14671
      } catch (org.apache.thrift.TException te) {
14672
        throw new java.io.IOException(te);
14673
      }
14674
    }
14675
 
14676
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14677
      try {
14678
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14679
      } catch (org.apache.thrift.TException te) {
14680
        throw new java.io.IOException(te);
14681
      }
14682
    }
14683
 
14684
  }
14685
 
14686
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
14687
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
14688
 
14689
    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);
14690
    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);
14691
 
14692
    private List<ItemCouponDiscount> success; // required
14693
    private PromotionException pex; // required
14694
 
14695
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14696
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14697
      SUCCESS((short)0, "success"),
14698
      PEX((short)1, "pex");
14699
 
14700
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14701
 
14702
      static {
14703
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14704
          byName.put(field.getFieldName(), field);
14705
        }
14706
      }
14707
 
14708
      /**
14709
       * Find the _Fields constant that matches fieldId, or null if its not found.
14710
       */
14711
      public static _Fields findByThriftId(int fieldId) {
14712
        switch(fieldId) {
14713
          case 0: // SUCCESS
14714
            return SUCCESS;
14715
          case 1: // PEX
14716
            return PEX;
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
 
14758
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14759
    static {
14760
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14761
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14762
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14763
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
14764
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14765
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14766
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14767
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
14768
    }
14769
 
14770
    public getItemDiscountMap_result() {
14771
    }
14772
 
14773
    public getItemDiscountMap_result(
14774
      List<ItemCouponDiscount> success,
14775
      PromotionException pex)
14776
    {
14777
      this();
14778
      this.success = success;
14779
      this.pex = pex;
14780
    }
14781
 
14782
    /**
14783
     * Performs a deep copy on <i>other</i>.
14784
     */
14785
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
14786
      if (other.isSetSuccess()) {
14787
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
14788
        for (ItemCouponDiscount other_element : other.success) {
14789
          __this__success.add(new ItemCouponDiscount(other_element));
14790
        }
14791
        this.success = __this__success;
14792
      }
14793
      if (other.isSetPex()) {
14794
        this.pex = new PromotionException(other.pex);
14795
      }
14796
    }
14797
 
14798
    public getItemDiscountMap_result deepCopy() {
14799
      return new getItemDiscountMap_result(this);
14800
    }
14801
 
14802
    @Override
14803
    public void clear() {
14804
      this.success = null;
14805
      this.pex = null;
14806
    }
14807
 
14808
    public int getSuccessSize() {
14809
      return (this.success == null) ? 0 : this.success.size();
14810
    }
14811
 
14812
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
14813
      return (this.success == null) ? null : this.success.iterator();
14814
    }
14815
 
14816
    public void addToSuccess(ItemCouponDiscount elem) {
14817
      if (this.success == null) {
14818
        this.success = new ArrayList<ItemCouponDiscount>();
14819
      }
14820
      this.success.add(elem);
14821
    }
14822
 
14823
    public List<ItemCouponDiscount> getSuccess() {
14824
      return this.success;
14825
    }
14826
 
14827
    public void setSuccess(List<ItemCouponDiscount> success) {
14828
      this.success = success;
14829
    }
14830
 
14831
    public void unsetSuccess() {
14832
      this.success = null;
14833
    }
14834
 
14835
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
14836
    public boolean isSetSuccess() {
14837
      return this.success != null;
14838
    }
14839
 
14840
    public void setSuccessIsSet(boolean value) {
14841
      if (!value) {
14842
        this.success = null;
14843
      }
14844
    }
14845
 
14846
    public PromotionException getPex() {
14847
      return this.pex;
14848
    }
14849
 
14850
    public void setPex(PromotionException pex) {
14851
      this.pex = pex;
14852
    }
14853
 
14854
    public void unsetPex() {
14855
      this.pex = null;
14856
    }
14857
 
14858
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
14859
    public boolean isSetPex() {
14860
      return this.pex != null;
14861
    }
14862
 
14863
    public void setPexIsSet(boolean value) {
14864
      if (!value) {
14865
        this.pex = null;
14866
      }
14867
    }
14868
 
14869
    public void setFieldValue(_Fields field, Object value) {
14870
      switch (field) {
14871
      case SUCCESS:
14872
        if (value == null) {
14873
          unsetSuccess();
14874
        } else {
14875
          setSuccess((List<ItemCouponDiscount>)value);
14876
        }
14877
        break;
14878
 
14879
      case PEX:
14880
        if (value == null) {
14881
          unsetPex();
14882
        } else {
14883
          setPex((PromotionException)value);
14884
        }
14885
        break;
14886
 
14887
      }
14888
    }
14889
 
14890
    public Object getFieldValue(_Fields field) {
14891
      switch (field) {
14892
      case SUCCESS:
14893
        return getSuccess();
14894
 
14895
      case PEX:
14896
        return getPex();
14897
 
14898
      }
14899
      throw new IllegalStateException();
14900
    }
14901
 
14902
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14903
    public boolean isSet(_Fields field) {
14904
      if (field == null) {
14905
        throw new IllegalArgumentException();
14906
      }
14907
 
14908
      switch (field) {
14909
      case SUCCESS:
14910
        return isSetSuccess();
14911
      case PEX:
14912
        return isSetPex();
14913
      }
14914
      throw new IllegalStateException();
14915
    }
14916
 
14917
    @Override
14918
    public boolean equals(Object that) {
14919
      if (that == null)
14920
        return false;
14921
      if (that instanceof getItemDiscountMap_result)
14922
        return this.equals((getItemDiscountMap_result)that);
14923
      return false;
14924
    }
14925
 
14926
    public boolean equals(getItemDiscountMap_result that) {
14927
      if (that == null)
14928
        return false;
14929
 
14930
      boolean this_present_success = true && this.isSetSuccess();
14931
      boolean that_present_success = true && that.isSetSuccess();
14932
      if (this_present_success || that_present_success) {
14933
        if (!(this_present_success && that_present_success))
14934
          return false;
14935
        if (!this.success.equals(that.success))
14936
          return false;
14937
      }
14938
 
14939
      boolean this_present_pex = true && this.isSetPex();
14940
      boolean that_present_pex = true && that.isSetPex();
14941
      if (this_present_pex || that_present_pex) {
14942
        if (!(this_present_pex && that_present_pex))
14943
          return false;
14944
        if (!this.pex.equals(that.pex))
14945
          return false;
14946
      }
14947
 
14948
      return true;
14949
    }
14950
 
14951
    @Override
14952
    public int hashCode() {
14953
      return 0;
14954
    }
14955
 
14956
    public int compareTo(getItemDiscountMap_result other) {
14957
      if (!getClass().equals(other.getClass())) {
14958
        return getClass().getName().compareTo(other.getClass().getName());
14959
      }
14960
 
14961
      int lastComparison = 0;
14962
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
14963
 
14964
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
14965
      if (lastComparison != 0) {
14966
        return lastComparison;
14967
      }
14968
      if (isSetSuccess()) {
14969
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14970
        if (lastComparison != 0) {
14971
          return lastComparison;
14972
        }
14973
      }
14974
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
14975
      if (lastComparison != 0) {
14976
        return lastComparison;
14977
      }
14978
      if (isSetPex()) {
14979
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14980
        if (lastComparison != 0) {
14981
          return lastComparison;
14982
        }
14983
      }
14984
      return 0;
14985
    }
14986
 
14987
    public _Fields fieldForId(int fieldId) {
14988
      return _Fields.findByThriftId(fieldId);
14989
    }
14990
 
14991
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14992
      org.apache.thrift.protocol.TField field;
14993
      iprot.readStructBegin();
14994
      while (true)
14995
      {
14996
        field = iprot.readFieldBegin();
14997
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14998
          break;
14999
        }
15000
        switch (field.id) {
15001
          case 0: // SUCCESS
15002
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
15003
              {
6497 amit.gupta 15004
                org.apache.thrift.protocol.TList _list33 = iprot.readListBegin();
15005
                this.success = new ArrayList<ItemCouponDiscount>(_list33.size);
15006
                for (int _i34 = 0; _i34 < _list33.size; ++_i34)
4189 varun.gupt 15007
                {
6497 amit.gupta 15008
                  ItemCouponDiscount _elem35; // required
15009
                  _elem35 = new ItemCouponDiscount();
15010
                  _elem35.read(iprot);
15011
                  this.success.add(_elem35);
4189 varun.gupt 15012
                }
15013
                iprot.readListEnd();
15014
              }
15015
            } else { 
15016
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15017
            }
15018
            break;
15019
          case 1: // PEX
15020
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15021
              this.pex = new PromotionException();
15022
              this.pex.read(iprot);
15023
            } else { 
15024
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15025
            }
15026
            break;
15027
          default:
15028
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15029
        }
15030
        iprot.readFieldEnd();
15031
      }
15032
      iprot.readStructEnd();
15033
      validate();
15034
    }
15035
 
15036
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15037
      oprot.writeStructBegin(STRUCT_DESC);
15038
 
15039
      if (this.isSetSuccess()) {
15040
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15041
        {
15042
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6497 amit.gupta 15043
          for (ItemCouponDiscount _iter36 : this.success)
4189 varun.gupt 15044
          {
6497 amit.gupta 15045
            _iter36.write(oprot);
4189 varun.gupt 15046
          }
15047
          oprot.writeListEnd();
15048
        }
15049
        oprot.writeFieldEnd();
15050
      } else if (this.isSetPex()) {
15051
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15052
        this.pex.write(oprot);
15053
        oprot.writeFieldEnd();
15054
      }
15055
      oprot.writeFieldStop();
15056
      oprot.writeStructEnd();
15057
    }
15058
 
15059
    @Override
15060
    public String toString() {
15061
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
15062
      boolean first = true;
15063
 
15064
      sb.append("success:");
15065
      if (this.success == null) {
15066
        sb.append("null");
15067
      } else {
15068
        sb.append(this.success);
15069
      }
15070
      first = false;
15071
      if (!first) sb.append(", ");
15072
      sb.append("pex:");
15073
      if (this.pex == null) {
15074
        sb.append("null");
15075
      } else {
15076
        sb.append(this.pex);
15077
      }
15078
      first = false;
15079
      sb.append(")");
15080
      return sb.toString();
15081
    }
15082
 
15083
    public void validate() throws org.apache.thrift.TException {
15084
      // check for required fields
15085
    }
15086
 
15087
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15088
      try {
15089
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15090
      } catch (org.apache.thrift.TException te) {
15091
        throw new java.io.IOException(te);
15092
      }
15093
    }
15094
 
15095
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15096
      try {
15097
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15098
      } catch (org.apache.thrift.TException te) {
15099
        throw new java.io.IOException(te);
15100
      }
15101
    }
15102
 
15103
  }
15104
 
4494 varun.gupt 15105
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
15106
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
15107
 
15108
    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);
15109
 
15110
    private long entityId; // required
15111
 
15112
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15113
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15114
      ENTITY_ID((short)1, "entityId");
15115
 
15116
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15117
 
15118
      static {
15119
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15120
          byName.put(field.getFieldName(), field);
15121
        }
15122
      }
15123
 
15124
      /**
15125
       * Find the _Fields constant that matches fieldId, or null if its not found.
15126
       */
15127
      public static _Fields findByThriftId(int fieldId) {
15128
        switch(fieldId) {
15129
          case 1: // ENTITY_ID
15130
            return ENTITY_ID;
15131
          default:
15132
            return null;
15133
        }
15134
      }
15135
 
15136
      /**
15137
       * Find the _Fields constant that matches fieldId, throwing an exception
15138
       * if it is not found.
15139
       */
15140
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15141
        _Fields fields = findByThriftId(fieldId);
15142
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15143
        return fields;
15144
      }
15145
 
15146
      /**
15147
       * Find the _Fields constant that matches name, or null if its not found.
15148
       */
15149
      public static _Fields findByName(String name) {
15150
        return byName.get(name);
15151
      }
15152
 
15153
      private final short _thriftId;
15154
      private final String _fieldName;
15155
 
15156
      _Fields(short thriftId, String fieldName) {
15157
        _thriftId = thriftId;
15158
        _fieldName = fieldName;
15159
      }
15160
 
15161
      public short getThriftFieldId() {
15162
        return _thriftId;
15163
      }
15164
 
15165
      public String getFieldName() {
15166
        return _fieldName;
15167
      }
15168
    }
15169
 
15170
    // isset id assignments
15171
    private static final int __ENTITYID_ISSET_ID = 0;
15172
    private BitSet __isset_bit_vector = new BitSet(1);
15173
 
15174
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15175
    static {
15176
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15177
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15178
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15179
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15180
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
15181
    }
15182
 
15183
    public getDiscountsForEntity_args() {
15184
    }
15185
 
15186
    public getDiscountsForEntity_args(
15187
      long entityId)
15188
    {
15189
      this();
15190
      this.entityId = entityId;
15191
      setEntityIdIsSet(true);
15192
    }
15193
 
15194
    /**
15195
     * Performs a deep copy on <i>other</i>.
15196
     */
15197
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
15198
      __isset_bit_vector.clear();
15199
      __isset_bit_vector.or(other.__isset_bit_vector);
15200
      this.entityId = other.entityId;
15201
    }
15202
 
15203
    public getDiscountsForEntity_args deepCopy() {
15204
      return new getDiscountsForEntity_args(this);
15205
    }
15206
 
15207
    @Override
15208
    public void clear() {
15209
      setEntityIdIsSet(false);
15210
      this.entityId = 0;
15211
    }
15212
 
15213
    public long getEntityId() {
15214
      return this.entityId;
15215
    }
15216
 
15217
    public void setEntityId(long entityId) {
15218
      this.entityId = entityId;
15219
      setEntityIdIsSet(true);
15220
    }
15221
 
15222
    public void unsetEntityId() {
15223
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
15224
    }
15225
 
15226
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
15227
    public boolean isSetEntityId() {
15228
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
15229
    }
15230
 
15231
    public void setEntityIdIsSet(boolean value) {
15232
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
15233
    }
15234
 
15235
    public void setFieldValue(_Fields field, Object value) {
15236
      switch (field) {
15237
      case ENTITY_ID:
15238
        if (value == null) {
15239
          unsetEntityId();
15240
        } else {
15241
          setEntityId((Long)value);
15242
        }
15243
        break;
15244
 
15245
      }
15246
    }
15247
 
15248
    public Object getFieldValue(_Fields field) {
15249
      switch (field) {
15250
      case ENTITY_ID:
15251
        return Long.valueOf(getEntityId());
15252
 
15253
      }
15254
      throw new IllegalStateException();
15255
    }
15256
 
15257
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15258
    public boolean isSet(_Fields field) {
15259
      if (field == null) {
15260
        throw new IllegalArgumentException();
15261
      }
15262
 
15263
      switch (field) {
15264
      case ENTITY_ID:
15265
        return isSetEntityId();
15266
      }
15267
      throw new IllegalStateException();
15268
    }
15269
 
15270
    @Override
15271
    public boolean equals(Object that) {
15272
      if (that == null)
15273
        return false;
15274
      if (that instanceof getDiscountsForEntity_args)
15275
        return this.equals((getDiscountsForEntity_args)that);
15276
      return false;
15277
    }
15278
 
15279
    public boolean equals(getDiscountsForEntity_args that) {
15280
      if (that == null)
15281
        return false;
15282
 
15283
      boolean this_present_entityId = true;
15284
      boolean that_present_entityId = true;
15285
      if (this_present_entityId || that_present_entityId) {
15286
        if (!(this_present_entityId && that_present_entityId))
15287
          return false;
15288
        if (this.entityId != that.entityId)
15289
          return false;
15290
      }
15291
 
15292
      return true;
15293
    }
15294
 
15295
    @Override
15296
    public int hashCode() {
15297
      return 0;
15298
    }
15299
 
15300
    public int compareTo(getDiscountsForEntity_args other) {
15301
      if (!getClass().equals(other.getClass())) {
15302
        return getClass().getName().compareTo(other.getClass().getName());
15303
      }
15304
 
15305
      int lastComparison = 0;
15306
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
15307
 
15308
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
15309
      if (lastComparison != 0) {
15310
        return lastComparison;
15311
      }
15312
      if (isSetEntityId()) {
15313
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
15314
        if (lastComparison != 0) {
15315
          return lastComparison;
15316
        }
15317
      }
15318
      return 0;
15319
    }
15320
 
15321
    public _Fields fieldForId(int fieldId) {
15322
      return _Fields.findByThriftId(fieldId);
15323
    }
15324
 
15325
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15326
      org.apache.thrift.protocol.TField field;
15327
      iprot.readStructBegin();
15328
      while (true)
15329
      {
15330
        field = iprot.readFieldBegin();
15331
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15332
          break;
15333
        }
15334
        switch (field.id) {
15335
          case 1: // ENTITY_ID
15336
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15337
              this.entityId = iprot.readI64();
15338
              setEntityIdIsSet(true);
15339
            } else { 
15340
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15341
            }
15342
            break;
15343
          default:
15344
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15345
        }
15346
        iprot.readFieldEnd();
15347
      }
15348
      iprot.readStructEnd();
15349
      validate();
15350
    }
15351
 
15352
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15353
      validate();
15354
 
15355
      oprot.writeStructBegin(STRUCT_DESC);
15356
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
15357
      oprot.writeI64(this.entityId);
15358
      oprot.writeFieldEnd();
15359
      oprot.writeFieldStop();
15360
      oprot.writeStructEnd();
15361
    }
15362
 
15363
    @Override
15364
    public String toString() {
15365
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
15366
      boolean first = true;
15367
 
15368
      sb.append("entityId:");
15369
      sb.append(this.entityId);
15370
      first = false;
15371
      sb.append(")");
15372
      return sb.toString();
15373
    }
15374
 
15375
    public void validate() throws org.apache.thrift.TException {
15376
      // check for required fields
15377
    }
15378
 
15379
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15380
      try {
15381
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15382
      } catch (org.apache.thrift.TException te) {
15383
        throw new java.io.IOException(te);
15384
      }
15385
    }
15386
 
15387
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15388
      try {
15389
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
15390
        __isset_bit_vector = new BitSet(1);
15391
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15392
      } catch (org.apache.thrift.TException te) {
15393
        throw new java.io.IOException(te);
15394
      }
15395
    }
15396
 
15397
  }
15398
 
15399
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
15400
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
15401
 
15402
    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);
15403
 
15404
    private Map<String,Double> success; // required
15405
 
15406
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15407
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15408
      SUCCESS((short)0, "success");
15409
 
15410
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15411
 
15412
      static {
15413
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15414
          byName.put(field.getFieldName(), field);
15415
        }
15416
      }
15417
 
15418
      /**
15419
       * Find the _Fields constant that matches fieldId, or null if its not found.
15420
       */
15421
      public static _Fields findByThriftId(int fieldId) {
15422
        switch(fieldId) {
15423
          case 0: // SUCCESS
15424
            return SUCCESS;
15425
          default:
15426
            return null;
15427
        }
15428
      }
15429
 
15430
      /**
15431
       * Find the _Fields constant that matches fieldId, throwing an exception
15432
       * if it is not found.
15433
       */
15434
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15435
        _Fields fields = findByThriftId(fieldId);
15436
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15437
        return fields;
15438
      }
15439
 
15440
      /**
15441
       * Find the _Fields constant that matches name, or null if its not found.
15442
       */
15443
      public static _Fields findByName(String name) {
15444
        return byName.get(name);
15445
      }
15446
 
15447
      private final short _thriftId;
15448
      private final String _fieldName;
15449
 
15450
      _Fields(short thriftId, String fieldName) {
15451
        _thriftId = thriftId;
15452
        _fieldName = fieldName;
15453
      }
15454
 
15455
      public short getThriftFieldId() {
15456
        return _thriftId;
15457
      }
15458
 
15459
      public String getFieldName() {
15460
        return _fieldName;
15461
      }
15462
    }
15463
 
15464
    // isset id assignments
15465
 
15466
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15467
    static {
15468
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15469
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15470
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
15471
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
15472
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
15473
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15474
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
15475
    }
15476
 
15477
    public getDiscountsForEntity_result() {
15478
    }
15479
 
15480
    public getDiscountsForEntity_result(
15481
      Map<String,Double> success)
15482
    {
15483
      this();
15484
      this.success = success;
15485
    }
15486
 
15487
    /**
15488
     * Performs a deep copy on <i>other</i>.
15489
     */
15490
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
15491
      if (other.isSetSuccess()) {
15492
        Map<String,Double> __this__success = new HashMap<String,Double>();
15493
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
15494
 
15495
          String other_element_key = other_element.getKey();
15496
          Double other_element_value = other_element.getValue();
15497
 
15498
          String __this__success_copy_key = other_element_key;
15499
 
15500
          Double __this__success_copy_value = other_element_value;
15501
 
15502
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
15503
        }
15504
        this.success = __this__success;
15505
      }
15506
    }
15507
 
15508
    public getDiscountsForEntity_result deepCopy() {
15509
      return new getDiscountsForEntity_result(this);
15510
    }
15511
 
15512
    @Override
15513
    public void clear() {
15514
      this.success = null;
15515
    }
15516
 
15517
    public int getSuccessSize() {
15518
      return (this.success == null) ? 0 : this.success.size();
15519
    }
15520
 
15521
    public void putToSuccess(String key, double val) {
15522
      if (this.success == null) {
15523
        this.success = new HashMap<String,Double>();
15524
      }
15525
      this.success.put(key, val);
15526
    }
15527
 
15528
    public Map<String,Double> getSuccess() {
15529
      return this.success;
15530
    }
15531
 
15532
    public void setSuccess(Map<String,Double> success) {
15533
      this.success = success;
15534
    }
15535
 
15536
    public void unsetSuccess() {
15537
      this.success = null;
15538
    }
15539
 
15540
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15541
    public boolean isSetSuccess() {
15542
      return this.success != null;
15543
    }
15544
 
15545
    public void setSuccessIsSet(boolean value) {
15546
      if (!value) {
15547
        this.success = null;
15548
      }
15549
    }
15550
 
15551
    public void setFieldValue(_Fields field, Object value) {
15552
      switch (field) {
15553
      case SUCCESS:
15554
        if (value == null) {
15555
          unsetSuccess();
15556
        } else {
15557
          setSuccess((Map<String,Double>)value);
15558
        }
15559
        break;
15560
 
15561
      }
15562
    }
15563
 
15564
    public Object getFieldValue(_Fields field) {
15565
      switch (field) {
15566
      case SUCCESS:
15567
        return getSuccess();
15568
 
15569
      }
15570
      throw new IllegalStateException();
15571
    }
15572
 
15573
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15574
    public boolean isSet(_Fields field) {
15575
      if (field == null) {
15576
        throw new IllegalArgumentException();
15577
      }
15578
 
15579
      switch (field) {
15580
      case SUCCESS:
15581
        return isSetSuccess();
15582
      }
15583
      throw new IllegalStateException();
15584
    }
15585
 
15586
    @Override
15587
    public boolean equals(Object that) {
15588
      if (that == null)
15589
        return false;
15590
      if (that instanceof getDiscountsForEntity_result)
15591
        return this.equals((getDiscountsForEntity_result)that);
15592
      return false;
15593
    }
15594
 
15595
    public boolean equals(getDiscountsForEntity_result that) {
15596
      if (that == null)
15597
        return false;
15598
 
15599
      boolean this_present_success = true && this.isSetSuccess();
15600
      boolean that_present_success = true && that.isSetSuccess();
15601
      if (this_present_success || that_present_success) {
15602
        if (!(this_present_success && that_present_success))
15603
          return false;
15604
        if (!this.success.equals(that.success))
15605
          return false;
15606
      }
15607
 
15608
      return true;
15609
    }
15610
 
15611
    @Override
15612
    public int hashCode() {
15613
      return 0;
15614
    }
15615
 
15616
    public int compareTo(getDiscountsForEntity_result other) {
15617
      if (!getClass().equals(other.getClass())) {
15618
        return getClass().getName().compareTo(other.getClass().getName());
15619
      }
15620
 
15621
      int lastComparison = 0;
15622
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
15623
 
15624
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15625
      if (lastComparison != 0) {
15626
        return lastComparison;
15627
      }
15628
      if (isSetSuccess()) {
15629
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15630
        if (lastComparison != 0) {
15631
          return lastComparison;
15632
        }
15633
      }
15634
      return 0;
15635
    }
15636
 
15637
    public _Fields fieldForId(int fieldId) {
15638
      return _Fields.findByThriftId(fieldId);
15639
    }
15640
 
15641
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15642
      org.apache.thrift.protocol.TField field;
15643
      iprot.readStructBegin();
15644
      while (true)
15645
      {
15646
        field = iprot.readFieldBegin();
15647
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15648
          break;
15649
        }
15650
        switch (field.id) {
15651
          case 0: // SUCCESS
15652
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
15653
              {
6497 amit.gupta 15654
                org.apache.thrift.protocol.TMap _map37 = iprot.readMapBegin();
15655
                this.success = new HashMap<String,Double>(2*_map37.size);
15656
                for (int _i38 = 0; _i38 < _map37.size; ++_i38)
4494 varun.gupt 15657
                {
6497 amit.gupta 15658
                  String _key39; // required
15659
                  double _val40; // required
15660
                  _key39 = iprot.readString();
15661
                  _val40 = iprot.readDouble();
15662
                  this.success.put(_key39, _val40);
4494 varun.gupt 15663
                }
15664
                iprot.readMapEnd();
15665
              }
15666
            } else { 
15667
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15668
            }
15669
            break;
15670
          default:
15671
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15672
        }
15673
        iprot.readFieldEnd();
15674
      }
15675
      iprot.readStructEnd();
15676
      validate();
15677
    }
15678
 
15679
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15680
      oprot.writeStructBegin(STRUCT_DESC);
15681
 
15682
      if (this.isSetSuccess()) {
15683
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15684
        {
15685
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
6497 amit.gupta 15686
          for (Map.Entry<String, Double> _iter41 : this.success.entrySet())
4494 varun.gupt 15687
          {
6497 amit.gupta 15688
            oprot.writeString(_iter41.getKey());
15689
            oprot.writeDouble(_iter41.getValue());
4494 varun.gupt 15690
          }
15691
          oprot.writeMapEnd();
15692
        }
15693
        oprot.writeFieldEnd();
15694
      }
15695
      oprot.writeFieldStop();
15696
      oprot.writeStructEnd();
15697
    }
15698
 
15699
    @Override
15700
    public String toString() {
15701
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
15702
      boolean first = true;
15703
 
15704
      sb.append("success:");
15705
      if (this.success == null) {
15706
        sb.append("null");
15707
      } else {
15708
        sb.append(this.success);
15709
      }
15710
      first = false;
15711
      sb.append(")");
15712
      return sb.toString();
15713
    }
15714
 
15715
    public void validate() throws org.apache.thrift.TException {
15716
      // check for required fields
15717
    }
15718
 
15719
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15720
      try {
15721
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15722
      } catch (org.apache.thrift.TException te) {
15723
        throw new java.io.IOException(te);
15724
      }
15725
    }
15726
 
15727
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15728
      try {
15729
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15730
      } catch (org.apache.thrift.TException te) {
15731
        throw new java.io.IOException(te);
15732
      }
15733
    }
15734
 
15735
  }
15736
 
5469 rajveer 15737
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
15738
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
15739
 
15740
    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);
15741
 
15742
    private Voucher voucher; // required
15743
 
15744
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15745
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15746
      VOUCHER((short)1, "voucher");
15747
 
15748
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15749
 
15750
      static {
15751
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15752
          byName.put(field.getFieldName(), field);
15753
        }
15754
      }
15755
 
15756
      /**
15757
       * Find the _Fields constant that matches fieldId, or null if its not found.
15758
       */
15759
      public static _Fields findByThriftId(int fieldId) {
15760
        switch(fieldId) {
15761
          case 1: // VOUCHER
15762
            return VOUCHER;
15763
          default:
15764
            return null;
15765
        }
15766
      }
15767
 
15768
      /**
15769
       * Find the _Fields constant that matches fieldId, throwing an exception
15770
       * if it is not found.
15771
       */
15772
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15773
        _Fields fields = findByThriftId(fieldId);
15774
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15775
        return fields;
15776
      }
15777
 
15778
      /**
15779
       * Find the _Fields constant that matches name, or null if its not found.
15780
       */
15781
      public static _Fields findByName(String name) {
15782
        return byName.get(name);
15783
      }
15784
 
15785
      private final short _thriftId;
15786
      private final String _fieldName;
15787
 
15788
      _Fields(short thriftId, String fieldName) {
15789
        _thriftId = thriftId;
15790
        _fieldName = fieldName;
15791
      }
15792
 
15793
      public short getThriftFieldId() {
15794
        return _thriftId;
15795
      }
15796
 
15797
      public String getFieldName() {
15798
        return _fieldName;
15799
      }
15800
    }
15801
 
15802
    // isset id assignments
15803
 
15804
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15805
    static {
15806
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15807
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15808
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
15809
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15810
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
15811
    }
15812
 
15813
    public addVoucher_args() {
15814
    }
15815
 
15816
    public addVoucher_args(
15817
      Voucher voucher)
15818
    {
15819
      this();
15820
      this.voucher = voucher;
15821
    }
15822
 
15823
    /**
15824
     * Performs a deep copy on <i>other</i>.
15825
     */
15826
    public addVoucher_args(addVoucher_args other) {
15827
      if (other.isSetVoucher()) {
15828
        this.voucher = new Voucher(other.voucher);
15829
      }
15830
    }
15831
 
15832
    public addVoucher_args deepCopy() {
15833
      return new addVoucher_args(this);
15834
    }
15835
 
15836
    @Override
15837
    public void clear() {
15838
      this.voucher = null;
15839
    }
15840
 
15841
    public Voucher getVoucher() {
15842
      return this.voucher;
15843
    }
15844
 
15845
    public void setVoucher(Voucher voucher) {
15846
      this.voucher = voucher;
15847
    }
15848
 
15849
    public void unsetVoucher() {
15850
      this.voucher = null;
15851
    }
15852
 
15853
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
15854
    public boolean isSetVoucher() {
15855
      return this.voucher != null;
15856
    }
15857
 
15858
    public void setVoucherIsSet(boolean value) {
15859
      if (!value) {
15860
        this.voucher = null;
15861
      }
15862
    }
15863
 
15864
    public void setFieldValue(_Fields field, Object value) {
15865
      switch (field) {
15866
      case VOUCHER:
15867
        if (value == null) {
15868
          unsetVoucher();
15869
        } else {
15870
          setVoucher((Voucher)value);
15871
        }
15872
        break;
15873
 
15874
      }
15875
    }
15876
 
15877
    public Object getFieldValue(_Fields field) {
15878
      switch (field) {
15879
      case VOUCHER:
15880
        return getVoucher();
15881
 
15882
      }
15883
      throw new IllegalStateException();
15884
    }
15885
 
15886
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15887
    public boolean isSet(_Fields field) {
15888
      if (field == null) {
15889
        throw new IllegalArgumentException();
15890
      }
15891
 
15892
      switch (field) {
15893
      case VOUCHER:
15894
        return isSetVoucher();
15895
      }
15896
      throw new IllegalStateException();
15897
    }
15898
 
15899
    @Override
15900
    public boolean equals(Object that) {
15901
      if (that == null)
15902
        return false;
15903
      if (that instanceof addVoucher_args)
15904
        return this.equals((addVoucher_args)that);
15905
      return false;
15906
    }
15907
 
15908
    public boolean equals(addVoucher_args that) {
15909
      if (that == null)
15910
        return false;
15911
 
15912
      boolean this_present_voucher = true && this.isSetVoucher();
15913
      boolean that_present_voucher = true && that.isSetVoucher();
15914
      if (this_present_voucher || that_present_voucher) {
15915
        if (!(this_present_voucher && that_present_voucher))
15916
          return false;
15917
        if (!this.voucher.equals(that.voucher))
15918
          return false;
15919
      }
15920
 
15921
      return true;
15922
    }
15923
 
15924
    @Override
15925
    public int hashCode() {
15926
      return 0;
15927
    }
15928
 
15929
    public int compareTo(addVoucher_args other) {
15930
      if (!getClass().equals(other.getClass())) {
15931
        return getClass().getName().compareTo(other.getClass().getName());
15932
      }
15933
 
15934
      int lastComparison = 0;
15935
      addVoucher_args typedOther = (addVoucher_args)other;
15936
 
15937
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
15938
      if (lastComparison != 0) {
15939
        return lastComparison;
15940
      }
15941
      if (isSetVoucher()) {
15942
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
15943
        if (lastComparison != 0) {
15944
          return lastComparison;
15945
        }
15946
      }
15947
      return 0;
15948
    }
15949
 
15950
    public _Fields fieldForId(int fieldId) {
15951
      return _Fields.findByThriftId(fieldId);
15952
    }
15953
 
15954
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15955
      org.apache.thrift.protocol.TField field;
15956
      iprot.readStructBegin();
15957
      while (true)
15958
      {
15959
        field = iprot.readFieldBegin();
15960
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15961
          break;
15962
        }
15963
        switch (field.id) {
15964
          case 1: // VOUCHER
15965
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15966
              this.voucher = new Voucher();
15967
              this.voucher.read(iprot);
15968
            } else { 
15969
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15970
            }
15971
            break;
15972
          default:
15973
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15974
        }
15975
        iprot.readFieldEnd();
15976
      }
15977
      iprot.readStructEnd();
15978
      validate();
15979
    }
15980
 
15981
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15982
      validate();
15983
 
15984
      oprot.writeStructBegin(STRUCT_DESC);
15985
      if (this.voucher != null) {
15986
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
15987
        this.voucher.write(oprot);
15988
        oprot.writeFieldEnd();
15989
      }
15990
      oprot.writeFieldStop();
15991
      oprot.writeStructEnd();
15992
    }
15993
 
15994
    @Override
15995
    public String toString() {
15996
      StringBuilder sb = new StringBuilder("addVoucher_args(");
15997
      boolean first = true;
15998
 
15999
      sb.append("voucher:");
16000
      if (this.voucher == null) {
16001
        sb.append("null");
16002
      } else {
16003
        sb.append(this.voucher);
16004
      }
16005
      first = false;
16006
      sb.append(")");
16007
      return sb.toString();
16008
    }
16009
 
16010
    public void validate() throws org.apache.thrift.TException {
16011
      // check for required fields
16012
    }
16013
 
16014
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16015
      try {
16016
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16017
      } catch (org.apache.thrift.TException te) {
16018
        throw new java.io.IOException(te);
16019
      }
16020
    }
16021
 
16022
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16023
      try {
16024
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16025
      } catch (org.apache.thrift.TException te) {
16026
        throw new java.io.IOException(te);
16027
      }
16028
    }
16029
 
16030
  }
16031
 
16032
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
16033
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
16034
 
16035
 
16036
 
16037
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16038
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16039
;
16040
 
16041
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16042
 
16043
      static {
16044
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16045
          byName.put(field.getFieldName(), field);
16046
        }
16047
      }
16048
 
16049
      /**
16050
       * Find the _Fields constant that matches fieldId, or null if its not found.
16051
       */
16052
      public static _Fields findByThriftId(int fieldId) {
16053
        switch(fieldId) {
16054
          default:
16055
            return null;
16056
        }
16057
      }
16058
 
16059
      /**
16060
       * Find the _Fields constant that matches fieldId, throwing an exception
16061
       * if it is not found.
16062
       */
16063
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16064
        _Fields fields = findByThriftId(fieldId);
16065
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16066
        return fields;
16067
      }
16068
 
16069
      /**
16070
       * Find the _Fields constant that matches name, or null if its not found.
16071
       */
16072
      public static _Fields findByName(String name) {
16073
        return byName.get(name);
16074
      }
16075
 
16076
      private final short _thriftId;
16077
      private final String _fieldName;
16078
 
16079
      _Fields(short thriftId, String fieldName) {
16080
        _thriftId = thriftId;
16081
        _fieldName = fieldName;
16082
      }
16083
 
16084
      public short getThriftFieldId() {
16085
        return _thriftId;
16086
      }
16087
 
16088
      public String getFieldName() {
16089
        return _fieldName;
16090
      }
16091
    }
16092
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16093
    static {
16094
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16095
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16096
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
16097
    }
16098
 
16099
    public addVoucher_result() {
16100
    }
16101
 
16102
    /**
16103
     * Performs a deep copy on <i>other</i>.
16104
     */
16105
    public addVoucher_result(addVoucher_result other) {
16106
    }
16107
 
16108
    public addVoucher_result deepCopy() {
16109
      return new addVoucher_result(this);
16110
    }
16111
 
16112
    @Override
16113
    public void clear() {
16114
    }
16115
 
16116
    public void setFieldValue(_Fields field, Object value) {
16117
      switch (field) {
16118
      }
16119
    }
16120
 
16121
    public Object getFieldValue(_Fields field) {
16122
      switch (field) {
16123
      }
16124
      throw new IllegalStateException();
16125
    }
16126
 
16127
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16128
    public boolean isSet(_Fields field) {
16129
      if (field == null) {
16130
        throw new IllegalArgumentException();
16131
      }
16132
 
16133
      switch (field) {
16134
      }
16135
      throw new IllegalStateException();
16136
    }
16137
 
16138
    @Override
16139
    public boolean equals(Object that) {
16140
      if (that == null)
16141
        return false;
16142
      if (that instanceof addVoucher_result)
16143
        return this.equals((addVoucher_result)that);
16144
      return false;
16145
    }
16146
 
16147
    public boolean equals(addVoucher_result that) {
16148
      if (that == null)
16149
        return false;
16150
 
16151
      return true;
16152
    }
16153
 
16154
    @Override
16155
    public int hashCode() {
16156
      return 0;
16157
    }
16158
 
16159
    public int compareTo(addVoucher_result other) {
16160
      if (!getClass().equals(other.getClass())) {
16161
        return getClass().getName().compareTo(other.getClass().getName());
16162
      }
16163
 
16164
      int lastComparison = 0;
16165
      addVoucher_result typedOther = (addVoucher_result)other;
16166
 
16167
      return 0;
16168
    }
16169
 
16170
    public _Fields fieldForId(int fieldId) {
16171
      return _Fields.findByThriftId(fieldId);
16172
    }
16173
 
16174
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16175
      org.apache.thrift.protocol.TField field;
16176
      iprot.readStructBegin();
16177
      while (true)
16178
      {
16179
        field = iprot.readFieldBegin();
16180
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16181
          break;
16182
        }
16183
        switch (field.id) {
16184
          default:
16185
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16186
        }
16187
        iprot.readFieldEnd();
16188
      }
16189
      iprot.readStructEnd();
16190
      validate();
16191
    }
16192
 
16193
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16194
      oprot.writeStructBegin(STRUCT_DESC);
16195
 
16196
      oprot.writeFieldStop();
16197
      oprot.writeStructEnd();
16198
    }
16199
 
16200
    @Override
16201
    public String toString() {
16202
      StringBuilder sb = new StringBuilder("addVoucher_result(");
16203
      boolean first = true;
16204
 
16205
      sb.append(")");
16206
      return sb.toString();
16207
    }
16208
 
16209
    public void validate() throws org.apache.thrift.TException {
16210
      // check for required fields
16211
    }
16212
 
16213
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16214
      try {
16215
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16216
      } catch (org.apache.thrift.TException te) {
16217
        throw new java.io.IOException(te);
16218
      }
16219
    }
16220
 
16221
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16222
      try {
16223
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16224
      } catch (org.apache.thrift.TException te) {
16225
        throw new java.io.IOException(te);
16226
      }
16227
    }
16228
 
16229
  }
16230
 
16231
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
16232
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
16233
 
16234
    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);
16235
    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);
16236
    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);
16237
    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);
16238
 
16239
    private long userId; // required
16240
    private String userEmail; // required
16241
    private VoucherType voucherType; // required
16242
    private long amount; // required
16243
 
16244
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16245
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16246
      USER_ID((short)1, "userId"),
16247
      USER_EMAIL((short)2, "userEmail"),
16248
      /**
16249
       * 
16250
       * @see VoucherType
16251
       */
16252
      VOUCHER_TYPE((short)3, "voucherType"),
16253
      AMOUNT((short)4, "amount");
16254
 
16255
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16256
 
16257
      static {
16258
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16259
          byName.put(field.getFieldName(), field);
16260
        }
16261
      }
16262
 
16263
      /**
16264
       * Find the _Fields constant that matches fieldId, or null if its not found.
16265
       */
16266
      public static _Fields findByThriftId(int fieldId) {
16267
        switch(fieldId) {
16268
          case 1: // USER_ID
16269
            return USER_ID;
16270
          case 2: // USER_EMAIL
16271
            return USER_EMAIL;
16272
          case 3: // VOUCHER_TYPE
16273
            return VOUCHER_TYPE;
16274
          case 4: // AMOUNT
16275
            return AMOUNT;
16276
          default:
16277
            return null;
16278
        }
16279
      }
16280
 
16281
      /**
16282
       * Find the _Fields constant that matches fieldId, throwing an exception
16283
       * if it is not found.
16284
       */
16285
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16286
        _Fields fields = findByThriftId(fieldId);
16287
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16288
        return fields;
16289
      }
16290
 
16291
      /**
16292
       * Find the _Fields constant that matches name, or null if its not found.
16293
       */
16294
      public static _Fields findByName(String name) {
16295
        return byName.get(name);
16296
      }
16297
 
16298
      private final short _thriftId;
16299
      private final String _fieldName;
16300
 
16301
      _Fields(short thriftId, String fieldName) {
16302
        _thriftId = thriftId;
16303
        _fieldName = fieldName;
16304
      }
16305
 
16306
      public short getThriftFieldId() {
16307
        return _thriftId;
16308
      }
16309
 
16310
      public String getFieldName() {
16311
        return _fieldName;
16312
      }
16313
    }
16314
 
16315
    // isset id assignments
16316
    private static final int __USERID_ISSET_ID = 0;
16317
    private static final int __AMOUNT_ISSET_ID = 1;
16318
    private BitSet __isset_bit_vector = new BitSet(2);
16319
 
16320
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16321
    static {
16322
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16323
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16324
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16325
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16326
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16327
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16328
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
16329
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16330
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16331
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16332
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
16333
    }
16334
 
16335
    public assignVoucher_args() {
16336
    }
16337
 
16338
    public assignVoucher_args(
16339
      long userId,
16340
      String userEmail,
16341
      VoucherType voucherType,
16342
      long amount)
16343
    {
16344
      this();
16345
      this.userId = userId;
16346
      setUserIdIsSet(true);
16347
      this.userEmail = userEmail;
16348
      this.voucherType = voucherType;
16349
      this.amount = amount;
16350
      setAmountIsSet(true);
16351
    }
16352
 
16353
    /**
16354
     * Performs a deep copy on <i>other</i>.
16355
     */
16356
    public assignVoucher_args(assignVoucher_args other) {
16357
      __isset_bit_vector.clear();
16358
      __isset_bit_vector.or(other.__isset_bit_vector);
16359
      this.userId = other.userId;
16360
      if (other.isSetUserEmail()) {
16361
        this.userEmail = other.userEmail;
16362
      }
16363
      if (other.isSetVoucherType()) {
16364
        this.voucherType = other.voucherType;
16365
      }
16366
      this.amount = other.amount;
16367
    }
16368
 
16369
    public assignVoucher_args deepCopy() {
16370
      return new assignVoucher_args(this);
16371
    }
16372
 
16373
    @Override
16374
    public void clear() {
16375
      setUserIdIsSet(false);
16376
      this.userId = 0;
16377
      this.userEmail = null;
16378
      this.voucherType = null;
16379
      setAmountIsSet(false);
16380
      this.amount = 0;
16381
    }
16382
 
16383
    public long getUserId() {
16384
      return this.userId;
16385
    }
16386
 
16387
    public void setUserId(long userId) {
16388
      this.userId = userId;
16389
      setUserIdIsSet(true);
16390
    }
16391
 
16392
    public void unsetUserId() {
16393
      __isset_bit_vector.clear(__USERID_ISSET_ID);
16394
    }
16395
 
16396
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
16397
    public boolean isSetUserId() {
16398
      return __isset_bit_vector.get(__USERID_ISSET_ID);
16399
    }
16400
 
16401
    public void setUserIdIsSet(boolean value) {
16402
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
16403
    }
16404
 
16405
    public String getUserEmail() {
16406
      return this.userEmail;
16407
    }
16408
 
16409
    public void setUserEmail(String userEmail) {
16410
      this.userEmail = userEmail;
16411
    }
16412
 
16413
    public void unsetUserEmail() {
16414
      this.userEmail = null;
16415
    }
16416
 
16417
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
16418
    public boolean isSetUserEmail() {
16419
      return this.userEmail != null;
16420
    }
16421
 
16422
    public void setUserEmailIsSet(boolean value) {
16423
      if (!value) {
16424
        this.userEmail = null;
16425
      }
16426
    }
16427
 
16428
    /**
16429
     * 
16430
     * @see VoucherType
16431
     */
16432
    public VoucherType getVoucherType() {
16433
      return this.voucherType;
16434
    }
16435
 
16436
    /**
16437
     * 
16438
     * @see VoucherType
16439
     */
16440
    public void setVoucherType(VoucherType voucherType) {
16441
      this.voucherType = voucherType;
16442
    }
16443
 
16444
    public void unsetVoucherType() {
16445
      this.voucherType = null;
16446
    }
16447
 
16448
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
16449
    public boolean isSetVoucherType() {
16450
      return this.voucherType != null;
16451
    }
16452
 
16453
    public void setVoucherTypeIsSet(boolean value) {
16454
      if (!value) {
16455
        this.voucherType = null;
16456
      }
16457
    }
16458
 
16459
    public long getAmount() {
16460
      return this.amount;
16461
    }
16462
 
16463
    public void setAmount(long amount) {
16464
      this.amount = amount;
16465
      setAmountIsSet(true);
16466
    }
16467
 
16468
    public void unsetAmount() {
16469
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
16470
    }
16471
 
16472
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
16473
    public boolean isSetAmount() {
16474
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
16475
    }
16476
 
16477
    public void setAmountIsSet(boolean value) {
16478
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
16479
    }
16480
 
16481
    public void setFieldValue(_Fields field, Object value) {
16482
      switch (field) {
16483
      case USER_ID:
16484
        if (value == null) {
16485
          unsetUserId();
16486
        } else {
16487
          setUserId((Long)value);
16488
        }
16489
        break;
16490
 
16491
      case USER_EMAIL:
16492
        if (value == null) {
16493
          unsetUserEmail();
16494
        } else {
16495
          setUserEmail((String)value);
16496
        }
16497
        break;
16498
 
16499
      case VOUCHER_TYPE:
16500
        if (value == null) {
16501
          unsetVoucherType();
16502
        } else {
16503
          setVoucherType((VoucherType)value);
16504
        }
16505
        break;
16506
 
16507
      case AMOUNT:
16508
        if (value == null) {
16509
          unsetAmount();
16510
        } else {
16511
          setAmount((Long)value);
16512
        }
16513
        break;
16514
 
16515
      }
16516
    }
16517
 
16518
    public Object getFieldValue(_Fields field) {
16519
      switch (field) {
16520
      case USER_ID:
16521
        return Long.valueOf(getUserId());
16522
 
16523
      case USER_EMAIL:
16524
        return getUserEmail();
16525
 
16526
      case VOUCHER_TYPE:
16527
        return getVoucherType();
16528
 
16529
      case AMOUNT:
16530
        return Long.valueOf(getAmount());
16531
 
16532
      }
16533
      throw new IllegalStateException();
16534
    }
16535
 
16536
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16537
    public boolean isSet(_Fields field) {
16538
      if (field == null) {
16539
        throw new IllegalArgumentException();
16540
      }
16541
 
16542
      switch (field) {
16543
      case USER_ID:
16544
        return isSetUserId();
16545
      case USER_EMAIL:
16546
        return isSetUserEmail();
16547
      case VOUCHER_TYPE:
16548
        return isSetVoucherType();
16549
      case AMOUNT:
16550
        return isSetAmount();
16551
      }
16552
      throw new IllegalStateException();
16553
    }
16554
 
16555
    @Override
16556
    public boolean equals(Object that) {
16557
      if (that == null)
16558
        return false;
16559
      if (that instanceof assignVoucher_args)
16560
        return this.equals((assignVoucher_args)that);
16561
      return false;
16562
    }
16563
 
16564
    public boolean equals(assignVoucher_args that) {
16565
      if (that == null)
16566
        return false;
16567
 
16568
      boolean this_present_userId = true;
16569
      boolean that_present_userId = true;
16570
      if (this_present_userId || that_present_userId) {
16571
        if (!(this_present_userId && that_present_userId))
16572
          return false;
16573
        if (this.userId != that.userId)
16574
          return false;
16575
      }
16576
 
16577
      boolean this_present_userEmail = true && this.isSetUserEmail();
16578
      boolean that_present_userEmail = true && that.isSetUserEmail();
16579
      if (this_present_userEmail || that_present_userEmail) {
16580
        if (!(this_present_userEmail && that_present_userEmail))
16581
          return false;
16582
        if (!this.userEmail.equals(that.userEmail))
16583
          return false;
16584
      }
16585
 
16586
      boolean this_present_voucherType = true && this.isSetVoucherType();
16587
      boolean that_present_voucherType = true && that.isSetVoucherType();
16588
      if (this_present_voucherType || that_present_voucherType) {
16589
        if (!(this_present_voucherType && that_present_voucherType))
16590
          return false;
16591
        if (!this.voucherType.equals(that.voucherType))
16592
          return false;
16593
      }
16594
 
16595
      boolean this_present_amount = true;
16596
      boolean that_present_amount = true;
16597
      if (this_present_amount || that_present_amount) {
16598
        if (!(this_present_amount && that_present_amount))
16599
          return false;
16600
        if (this.amount != that.amount)
16601
          return false;
16602
      }
16603
 
16604
      return true;
16605
    }
16606
 
16607
    @Override
16608
    public int hashCode() {
16609
      return 0;
16610
    }
16611
 
16612
    public int compareTo(assignVoucher_args other) {
16613
      if (!getClass().equals(other.getClass())) {
16614
        return getClass().getName().compareTo(other.getClass().getName());
16615
      }
16616
 
16617
      int lastComparison = 0;
16618
      assignVoucher_args typedOther = (assignVoucher_args)other;
16619
 
16620
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
16621
      if (lastComparison != 0) {
16622
        return lastComparison;
16623
      }
16624
      if (isSetUserId()) {
16625
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
16626
        if (lastComparison != 0) {
16627
          return lastComparison;
16628
        }
16629
      }
16630
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
16631
      if (lastComparison != 0) {
16632
        return lastComparison;
16633
      }
16634
      if (isSetUserEmail()) {
16635
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
16636
        if (lastComparison != 0) {
16637
          return lastComparison;
16638
        }
16639
      }
16640
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
16641
      if (lastComparison != 0) {
16642
        return lastComparison;
16643
      }
16644
      if (isSetVoucherType()) {
16645
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
16646
        if (lastComparison != 0) {
16647
          return lastComparison;
16648
        }
16649
      }
16650
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
16651
      if (lastComparison != 0) {
16652
        return lastComparison;
16653
      }
16654
      if (isSetAmount()) {
16655
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
16656
        if (lastComparison != 0) {
16657
          return lastComparison;
16658
        }
16659
      }
16660
      return 0;
16661
    }
16662
 
16663
    public _Fields fieldForId(int fieldId) {
16664
      return _Fields.findByThriftId(fieldId);
16665
    }
16666
 
16667
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16668
      org.apache.thrift.protocol.TField field;
16669
      iprot.readStructBegin();
16670
      while (true)
16671
      {
16672
        field = iprot.readFieldBegin();
16673
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16674
          break;
16675
        }
16676
        switch (field.id) {
16677
          case 1: // USER_ID
16678
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16679
              this.userId = iprot.readI64();
16680
              setUserIdIsSet(true);
16681
            } else { 
16682
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16683
            }
16684
            break;
16685
          case 2: // USER_EMAIL
16686
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16687
              this.userEmail = iprot.readString();
16688
            } else { 
16689
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16690
            }
16691
            break;
16692
          case 3: // VOUCHER_TYPE
16693
            if (field.type == org.apache.thrift.protocol.TType.I32) {
16694
              this.voucherType = VoucherType.findByValue(iprot.readI32());
16695
            } else { 
16696
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16697
            }
16698
            break;
16699
          case 4: // AMOUNT
16700
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16701
              this.amount = iprot.readI64();
16702
              setAmountIsSet(true);
16703
            } else { 
16704
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16705
            }
16706
            break;
16707
          default:
16708
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16709
        }
16710
        iprot.readFieldEnd();
16711
      }
16712
      iprot.readStructEnd();
16713
      validate();
16714
    }
16715
 
16716
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16717
      validate();
16718
 
16719
      oprot.writeStructBegin(STRUCT_DESC);
16720
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
16721
      oprot.writeI64(this.userId);
16722
      oprot.writeFieldEnd();
16723
      if (this.userEmail != null) {
16724
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
16725
        oprot.writeString(this.userEmail);
16726
        oprot.writeFieldEnd();
16727
      }
16728
      if (this.voucherType != null) {
16729
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
16730
        oprot.writeI32(this.voucherType.getValue());
16731
        oprot.writeFieldEnd();
16732
      }
16733
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
16734
      oprot.writeI64(this.amount);
16735
      oprot.writeFieldEnd();
16736
      oprot.writeFieldStop();
16737
      oprot.writeStructEnd();
16738
    }
16739
 
16740
    @Override
16741
    public String toString() {
16742
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
16743
      boolean first = true;
16744
 
16745
      sb.append("userId:");
16746
      sb.append(this.userId);
16747
      first = false;
16748
      if (!first) sb.append(", ");
16749
      sb.append("userEmail:");
16750
      if (this.userEmail == null) {
16751
        sb.append("null");
16752
      } else {
16753
        sb.append(this.userEmail);
16754
      }
16755
      first = false;
16756
      if (!first) sb.append(", ");
16757
      sb.append("voucherType:");
16758
      if (this.voucherType == null) {
16759
        sb.append("null");
16760
      } else {
16761
        sb.append(this.voucherType);
16762
      }
16763
      first = false;
16764
      if (!first) sb.append(", ");
16765
      sb.append("amount:");
16766
      sb.append(this.amount);
16767
      first = false;
16768
      sb.append(")");
16769
      return sb.toString();
16770
    }
16771
 
16772
    public void validate() throws org.apache.thrift.TException {
16773
      // check for required fields
16774
    }
16775
 
16776
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16777
      try {
16778
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16779
      } catch (org.apache.thrift.TException te) {
16780
        throw new java.io.IOException(te);
16781
      }
16782
    }
16783
 
16784
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16785
      try {
16786
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
16787
        __isset_bit_vector = new BitSet(1);
16788
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16789
      } catch (org.apache.thrift.TException te) {
16790
        throw new java.io.IOException(te);
16791
      }
16792
    }
16793
 
16794
  }
16795
 
16796
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
16797
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
16798
 
16799
    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);
16800
 
16801
    private Voucher success; // required
16802
 
16803
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16804
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16805
      SUCCESS((short)0, "success");
16806
 
16807
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16808
 
16809
      static {
16810
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16811
          byName.put(field.getFieldName(), field);
16812
        }
16813
      }
16814
 
16815
      /**
16816
       * Find the _Fields constant that matches fieldId, or null if its not found.
16817
       */
16818
      public static _Fields findByThriftId(int fieldId) {
16819
        switch(fieldId) {
16820
          case 0: // SUCCESS
16821
            return SUCCESS;
16822
          default:
16823
            return null;
16824
        }
16825
      }
16826
 
16827
      /**
16828
       * Find the _Fields constant that matches fieldId, throwing an exception
16829
       * if it is not found.
16830
       */
16831
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16832
        _Fields fields = findByThriftId(fieldId);
16833
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16834
        return fields;
16835
      }
16836
 
16837
      /**
16838
       * Find the _Fields constant that matches name, or null if its not found.
16839
       */
16840
      public static _Fields findByName(String name) {
16841
        return byName.get(name);
16842
      }
16843
 
16844
      private final short _thriftId;
16845
      private final String _fieldName;
16846
 
16847
      _Fields(short thriftId, String fieldName) {
16848
        _thriftId = thriftId;
16849
        _fieldName = fieldName;
16850
      }
16851
 
16852
      public short getThriftFieldId() {
16853
        return _thriftId;
16854
      }
16855
 
16856
      public String getFieldName() {
16857
        return _fieldName;
16858
      }
16859
    }
16860
 
16861
    // isset id assignments
16862
 
16863
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16864
    static {
16865
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16866
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16867
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
16868
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16869
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
16870
    }
16871
 
16872
    public assignVoucher_result() {
16873
    }
16874
 
16875
    public assignVoucher_result(
16876
      Voucher success)
16877
    {
16878
      this();
16879
      this.success = success;
16880
    }
16881
 
16882
    /**
16883
     * Performs a deep copy on <i>other</i>.
16884
     */
16885
    public assignVoucher_result(assignVoucher_result other) {
16886
      if (other.isSetSuccess()) {
16887
        this.success = new Voucher(other.success);
16888
      }
16889
    }
16890
 
16891
    public assignVoucher_result deepCopy() {
16892
      return new assignVoucher_result(this);
16893
    }
16894
 
16895
    @Override
16896
    public void clear() {
16897
      this.success = null;
16898
    }
16899
 
16900
    public Voucher getSuccess() {
16901
      return this.success;
16902
    }
16903
 
16904
    public void setSuccess(Voucher success) {
16905
      this.success = success;
16906
    }
16907
 
16908
    public void unsetSuccess() {
16909
      this.success = null;
16910
    }
16911
 
16912
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
16913
    public boolean isSetSuccess() {
16914
      return this.success != null;
16915
    }
16916
 
16917
    public void setSuccessIsSet(boolean value) {
16918
      if (!value) {
16919
        this.success = null;
16920
      }
16921
    }
16922
 
16923
    public void setFieldValue(_Fields field, Object value) {
16924
      switch (field) {
16925
      case SUCCESS:
16926
        if (value == null) {
16927
          unsetSuccess();
16928
        } else {
16929
          setSuccess((Voucher)value);
16930
        }
16931
        break;
16932
 
16933
      }
16934
    }
16935
 
16936
    public Object getFieldValue(_Fields field) {
16937
      switch (field) {
16938
      case SUCCESS:
16939
        return getSuccess();
16940
 
16941
      }
16942
      throw new IllegalStateException();
16943
    }
16944
 
16945
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16946
    public boolean isSet(_Fields field) {
16947
      if (field == null) {
16948
        throw new IllegalArgumentException();
16949
      }
16950
 
16951
      switch (field) {
16952
      case SUCCESS:
16953
        return isSetSuccess();
16954
      }
16955
      throw new IllegalStateException();
16956
    }
16957
 
16958
    @Override
16959
    public boolean equals(Object that) {
16960
      if (that == null)
16961
        return false;
16962
      if (that instanceof assignVoucher_result)
16963
        return this.equals((assignVoucher_result)that);
16964
      return false;
16965
    }
16966
 
16967
    public boolean equals(assignVoucher_result that) {
16968
      if (that == null)
16969
        return false;
16970
 
16971
      boolean this_present_success = true && this.isSetSuccess();
16972
      boolean that_present_success = true && that.isSetSuccess();
16973
      if (this_present_success || that_present_success) {
16974
        if (!(this_present_success && that_present_success))
16975
          return false;
16976
        if (!this.success.equals(that.success))
16977
          return false;
16978
      }
16979
 
16980
      return true;
16981
    }
16982
 
16983
    @Override
16984
    public int hashCode() {
16985
      return 0;
16986
    }
16987
 
16988
    public int compareTo(assignVoucher_result other) {
16989
      if (!getClass().equals(other.getClass())) {
16990
        return getClass().getName().compareTo(other.getClass().getName());
16991
      }
16992
 
16993
      int lastComparison = 0;
16994
      assignVoucher_result typedOther = (assignVoucher_result)other;
16995
 
16996
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
16997
      if (lastComparison != 0) {
16998
        return lastComparison;
16999
      }
17000
      if (isSetSuccess()) {
17001
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17002
        if (lastComparison != 0) {
17003
          return lastComparison;
17004
        }
17005
      }
17006
      return 0;
17007
    }
17008
 
17009
    public _Fields fieldForId(int fieldId) {
17010
      return _Fields.findByThriftId(fieldId);
17011
    }
17012
 
17013
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17014
      org.apache.thrift.protocol.TField field;
17015
      iprot.readStructBegin();
17016
      while (true)
17017
      {
17018
        field = iprot.readFieldBegin();
17019
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17020
          break;
17021
        }
17022
        switch (field.id) {
17023
          case 0: // SUCCESS
17024
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
17025
              this.success = new Voucher();
17026
              this.success.read(iprot);
17027
            } else { 
17028
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17029
            }
17030
            break;
17031
          default:
17032
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17033
        }
17034
        iprot.readFieldEnd();
17035
      }
17036
      iprot.readStructEnd();
17037
      validate();
17038
    }
17039
 
17040
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17041
      oprot.writeStructBegin(STRUCT_DESC);
17042
 
17043
      if (this.isSetSuccess()) {
17044
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17045
        this.success.write(oprot);
17046
        oprot.writeFieldEnd();
17047
      }
17048
      oprot.writeFieldStop();
17049
      oprot.writeStructEnd();
17050
    }
17051
 
17052
    @Override
17053
    public String toString() {
17054
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
17055
      boolean first = true;
17056
 
17057
      sb.append("success:");
17058
      if (this.success == null) {
17059
        sb.append("null");
17060
      } else {
17061
        sb.append(this.success);
17062
      }
17063
      first = false;
17064
      sb.append(")");
17065
      return sb.toString();
17066
    }
17067
 
17068
    public void validate() throws org.apache.thrift.TException {
17069
      // check for required fields
17070
    }
17071
 
17072
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17073
      try {
17074
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17075
      } catch (org.apache.thrift.TException te) {
17076
        throw new java.io.IOException(te);
17077
      }
17078
    }
17079
 
17080
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17081
      try {
17082
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17083
      } catch (org.apache.thrift.TException te) {
17084
        throw new java.io.IOException(te);
17085
      }
17086
    }
17087
 
17088
  }
17089
 
17090
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
17091
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
17092
 
17093
    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);
17094
    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);
17095
 
17096
    private String voucherCode; // required
17097
    private long redeemedOn; // required
17098
 
17099
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17100
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17101
      VOUCHER_CODE((short)1, "voucherCode"),
17102
      REDEEMED_ON((short)2, "redeemedOn");
17103
 
17104
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17105
 
17106
      static {
17107
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17108
          byName.put(field.getFieldName(), field);
17109
        }
17110
      }
17111
 
17112
      /**
17113
       * Find the _Fields constant that matches fieldId, or null if its not found.
17114
       */
17115
      public static _Fields findByThriftId(int fieldId) {
17116
        switch(fieldId) {
17117
          case 1: // VOUCHER_CODE
17118
            return VOUCHER_CODE;
17119
          case 2: // REDEEMED_ON
17120
            return REDEEMED_ON;
17121
          default:
17122
            return null;
17123
        }
17124
      }
17125
 
17126
      /**
17127
       * Find the _Fields constant that matches fieldId, throwing an exception
17128
       * if it is not found.
17129
       */
17130
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17131
        _Fields fields = findByThriftId(fieldId);
17132
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17133
        return fields;
17134
      }
17135
 
17136
      /**
17137
       * Find the _Fields constant that matches name, or null if its not found.
17138
       */
17139
      public static _Fields findByName(String name) {
17140
        return byName.get(name);
17141
      }
17142
 
17143
      private final short _thriftId;
17144
      private final String _fieldName;
17145
 
17146
      _Fields(short thriftId, String fieldName) {
17147
        _thriftId = thriftId;
17148
        _fieldName = fieldName;
17149
      }
17150
 
17151
      public short getThriftFieldId() {
17152
        return _thriftId;
17153
      }
17154
 
17155
      public String getFieldName() {
17156
        return _fieldName;
17157
      }
17158
    }
17159
 
17160
    // isset id assignments
17161
    private static final int __REDEEMEDON_ISSET_ID = 0;
17162
    private BitSet __isset_bit_vector = new BitSet(1);
17163
 
17164
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17165
    static {
17166
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17167
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17168
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
17169
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17170
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17171
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17172
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
17173
    }
17174
 
17175
    public markVoucherAsRedeemed_args() {
17176
    }
17177
 
17178
    public markVoucherAsRedeemed_args(
17179
      String voucherCode,
17180
      long redeemedOn)
17181
    {
17182
      this();
17183
      this.voucherCode = voucherCode;
17184
      this.redeemedOn = redeemedOn;
17185
      setRedeemedOnIsSet(true);
17186
    }
17187
 
17188
    /**
17189
     * Performs a deep copy on <i>other</i>.
17190
     */
17191
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
17192
      __isset_bit_vector.clear();
17193
      __isset_bit_vector.or(other.__isset_bit_vector);
17194
      if (other.isSetVoucherCode()) {
17195
        this.voucherCode = other.voucherCode;
17196
      }
17197
      this.redeemedOn = other.redeemedOn;
17198
    }
17199
 
17200
    public markVoucherAsRedeemed_args deepCopy() {
17201
      return new markVoucherAsRedeemed_args(this);
17202
    }
17203
 
17204
    @Override
17205
    public void clear() {
17206
      this.voucherCode = null;
17207
      setRedeemedOnIsSet(false);
17208
      this.redeemedOn = 0;
17209
    }
17210
 
17211
    public String getVoucherCode() {
17212
      return this.voucherCode;
17213
    }
17214
 
17215
    public void setVoucherCode(String voucherCode) {
17216
      this.voucherCode = voucherCode;
17217
    }
17218
 
17219
    public void unsetVoucherCode() {
17220
      this.voucherCode = null;
17221
    }
17222
 
17223
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
17224
    public boolean isSetVoucherCode() {
17225
      return this.voucherCode != null;
17226
    }
17227
 
17228
    public void setVoucherCodeIsSet(boolean value) {
17229
      if (!value) {
17230
        this.voucherCode = null;
17231
      }
17232
    }
17233
 
17234
    public long getRedeemedOn() {
17235
      return this.redeemedOn;
17236
    }
17237
 
17238
    public void setRedeemedOn(long redeemedOn) {
17239
      this.redeemedOn = redeemedOn;
17240
      setRedeemedOnIsSet(true);
17241
    }
17242
 
17243
    public void unsetRedeemedOn() {
17244
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
17245
    }
17246
 
17247
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
17248
    public boolean isSetRedeemedOn() {
17249
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
17250
    }
17251
 
17252
    public void setRedeemedOnIsSet(boolean value) {
17253
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
17254
    }
17255
 
17256
    public void setFieldValue(_Fields field, Object value) {
17257
      switch (field) {
17258
      case VOUCHER_CODE:
17259
        if (value == null) {
17260
          unsetVoucherCode();
17261
        } else {
17262
          setVoucherCode((String)value);
17263
        }
17264
        break;
17265
 
17266
      case REDEEMED_ON:
17267
        if (value == null) {
17268
          unsetRedeemedOn();
17269
        } else {
17270
          setRedeemedOn((Long)value);
17271
        }
17272
        break;
17273
 
17274
      }
17275
    }
17276
 
17277
    public Object getFieldValue(_Fields field) {
17278
      switch (field) {
17279
      case VOUCHER_CODE:
17280
        return getVoucherCode();
17281
 
17282
      case REDEEMED_ON:
17283
        return Long.valueOf(getRedeemedOn());
17284
 
17285
      }
17286
      throw new IllegalStateException();
17287
    }
17288
 
17289
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17290
    public boolean isSet(_Fields field) {
17291
      if (field == null) {
17292
        throw new IllegalArgumentException();
17293
      }
17294
 
17295
      switch (field) {
17296
      case VOUCHER_CODE:
17297
        return isSetVoucherCode();
17298
      case REDEEMED_ON:
17299
        return isSetRedeemedOn();
17300
      }
17301
      throw new IllegalStateException();
17302
    }
17303
 
17304
    @Override
17305
    public boolean equals(Object that) {
17306
      if (that == null)
17307
        return false;
17308
      if (that instanceof markVoucherAsRedeemed_args)
17309
        return this.equals((markVoucherAsRedeemed_args)that);
17310
      return false;
17311
    }
17312
 
17313
    public boolean equals(markVoucherAsRedeemed_args that) {
17314
      if (that == null)
17315
        return false;
17316
 
17317
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
17318
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
17319
      if (this_present_voucherCode || that_present_voucherCode) {
17320
        if (!(this_present_voucherCode && that_present_voucherCode))
17321
          return false;
17322
        if (!this.voucherCode.equals(that.voucherCode))
17323
          return false;
17324
      }
17325
 
17326
      boolean this_present_redeemedOn = true;
17327
      boolean that_present_redeemedOn = true;
17328
      if (this_present_redeemedOn || that_present_redeemedOn) {
17329
        if (!(this_present_redeemedOn && that_present_redeemedOn))
17330
          return false;
17331
        if (this.redeemedOn != that.redeemedOn)
17332
          return false;
17333
      }
17334
 
17335
      return true;
17336
    }
17337
 
17338
    @Override
17339
    public int hashCode() {
17340
      return 0;
17341
    }
17342
 
17343
    public int compareTo(markVoucherAsRedeemed_args other) {
17344
      if (!getClass().equals(other.getClass())) {
17345
        return getClass().getName().compareTo(other.getClass().getName());
17346
      }
17347
 
17348
      int lastComparison = 0;
17349
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
17350
 
17351
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
17352
      if (lastComparison != 0) {
17353
        return lastComparison;
17354
      }
17355
      if (isSetVoucherCode()) {
17356
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
17357
        if (lastComparison != 0) {
17358
          return lastComparison;
17359
        }
17360
      }
17361
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
17362
      if (lastComparison != 0) {
17363
        return lastComparison;
17364
      }
17365
      if (isSetRedeemedOn()) {
17366
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
17367
        if (lastComparison != 0) {
17368
          return lastComparison;
17369
        }
17370
      }
17371
      return 0;
17372
    }
17373
 
17374
    public _Fields fieldForId(int fieldId) {
17375
      return _Fields.findByThriftId(fieldId);
17376
    }
17377
 
17378
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17379
      org.apache.thrift.protocol.TField field;
17380
      iprot.readStructBegin();
17381
      while (true)
17382
      {
17383
        field = iprot.readFieldBegin();
17384
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17385
          break;
17386
        }
17387
        switch (field.id) {
17388
          case 1: // VOUCHER_CODE
17389
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
17390
              this.voucherCode = iprot.readString();
17391
            } else { 
17392
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17393
            }
17394
            break;
17395
          case 2: // REDEEMED_ON
17396
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17397
              this.redeemedOn = iprot.readI64();
17398
              setRedeemedOnIsSet(true);
17399
            } else { 
17400
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17401
            }
17402
            break;
17403
          default:
17404
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17405
        }
17406
        iprot.readFieldEnd();
17407
      }
17408
      iprot.readStructEnd();
17409
      validate();
17410
    }
17411
 
17412
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17413
      validate();
17414
 
17415
      oprot.writeStructBegin(STRUCT_DESC);
17416
      if (this.voucherCode != null) {
17417
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
17418
        oprot.writeString(this.voucherCode);
17419
        oprot.writeFieldEnd();
17420
      }
17421
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
17422
      oprot.writeI64(this.redeemedOn);
17423
      oprot.writeFieldEnd();
17424
      oprot.writeFieldStop();
17425
      oprot.writeStructEnd();
17426
    }
17427
 
17428
    @Override
17429
    public String toString() {
17430
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
17431
      boolean first = true;
17432
 
17433
      sb.append("voucherCode:");
17434
      if (this.voucherCode == null) {
17435
        sb.append("null");
17436
      } else {
17437
        sb.append(this.voucherCode);
17438
      }
17439
      first = false;
17440
      if (!first) sb.append(", ");
17441
      sb.append("redeemedOn:");
17442
      sb.append(this.redeemedOn);
17443
      first = false;
17444
      sb.append(")");
17445
      return sb.toString();
17446
    }
17447
 
17448
    public void validate() throws org.apache.thrift.TException {
17449
      // check for required fields
17450
    }
17451
 
17452
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17453
      try {
17454
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17455
      } catch (org.apache.thrift.TException te) {
17456
        throw new java.io.IOException(te);
17457
      }
17458
    }
17459
 
17460
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17461
      try {
17462
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17463
        __isset_bit_vector = new BitSet(1);
17464
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17465
      } catch (org.apache.thrift.TException te) {
17466
        throw new java.io.IOException(te);
17467
      }
17468
    }
17469
 
17470
  }
17471
 
17472
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
17473
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
17474
 
17475
    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);
17476
 
17477
    private boolean success; // required
17478
 
17479
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17480
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17481
      SUCCESS((short)0, "success");
17482
 
17483
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17484
 
17485
      static {
17486
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17487
          byName.put(field.getFieldName(), field);
17488
        }
17489
      }
17490
 
17491
      /**
17492
       * Find the _Fields constant that matches fieldId, or null if its not found.
17493
       */
17494
      public static _Fields findByThriftId(int fieldId) {
17495
        switch(fieldId) {
17496
          case 0: // SUCCESS
17497
            return SUCCESS;
17498
          default:
17499
            return null;
17500
        }
17501
      }
17502
 
17503
      /**
17504
       * Find the _Fields constant that matches fieldId, throwing an exception
17505
       * if it is not found.
17506
       */
17507
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17508
        _Fields fields = findByThriftId(fieldId);
17509
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17510
        return fields;
17511
      }
17512
 
17513
      /**
17514
       * Find the _Fields constant that matches name, or null if its not found.
17515
       */
17516
      public static _Fields findByName(String name) {
17517
        return byName.get(name);
17518
      }
17519
 
17520
      private final short _thriftId;
17521
      private final String _fieldName;
17522
 
17523
      _Fields(short thriftId, String fieldName) {
17524
        _thriftId = thriftId;
17525
        _fieldName = fieldName;
17526
      }
17527
 
17528
      public short getThriftFieldId() {
17529
        return _thriftId;
17530
      }
17531
 
17532
      public String getFieldName() {
17533
        return _fieldName;
17534
      }
17535
    }
17536
 
17537
    // isset id assignments
17538
    private static final int __SUCCESS_ISSET_ID = 0;
17539
    private BitSet __isset_bit_vector = new BitSet(1);
17540
 
17541
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17542
    static {
17543
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17544
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17545
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
17546
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17547
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
17548
    }
17549
 
17550
    public markVoucherAsRedeemed_result() {
17551
    }
17552
 
17553
    public markVoucherAsRedeemed_result(
17554
      boolean success)
17555
    {
17556
      this();
17557
      this.success = success;
17558
      setSuccessIsSet(true);
17559
    }
17560
 
17561
    /**
17562
     * Performs a deep copy on <i>other</i>.
17563
     */
17564
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
17565
      __isset_bit_vector.clear();
17566
      __isset_bit_vector.or(other.__isset_bit_vector);
17567
      this.success = other.success;
17568
    }
17569
 
17570
    public markVoucherAsRedeemed_result deepCopy() {
17571
      return new markVoucherAsRedeemed_result(this);
17572
    }
17573
 
17574
    @Override
17575
    public void clear() {
17576
      setSuccessIsSet(false);
17577
      this.success = false;
17578
    }
17579
 
17580
    public boolean isSuccess() {
17581
      return this.success;
17582
    }
17583
 
17584
    public void setSuccess(boolean success) {
17585
      this.success = success;
17586
      setSuccessIsSet(true);
17587
    }
17588
 
17589
    public void unsetSuccess() {
17590
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
17591
    }
17592
 
17593
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17594
    public boolean isSetSuccess() {
17595
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
17596
    }
17597
 
17598
    public void setSuccessIsSet(boolean value) {
17599
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
17600
    }
17601
 
17602
    public void setFieldValue(_Fields field, Object value) {
17603
      switch (field) {
17604
      case SUCCESS:
17605
        if (value == null) {
17606
          unsetSuccess();
17607
        } else {
17608
          setSuccess((Boolean)value);
17609
        }
17610
        break;
17611
 
17612
      }
17613
    }
17614
 
17615
    public Object getFieldValue(_Fields field) {
17616
      switch (field) {
17617
      case SUCCESS:
17618
        return Boolean.valueOf(isSuccess());
17619
 
17620
      }
17621
      throw new IllegalStateException();
17622
    }
17623
 
17624
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17625
    public boolean isSet(_Fields field) {
17626
      if (field == null) {
17627
        throw new IllegalArgumentException();
17628
      }
17629
 
17630
      switch (field) {
17631
      case SUCCESS:
17632
        return isSetSuccess();
17633
      }
17634
      throw new IllegalStateException();
17635
    }
17636
 
17637
    @Override
17638
    public boolean equals(Object that) {
17639
      if (that == null)
17640
        return false;
17641
      if (that instanceof markVoucherAsRedeemed_result)
17642
        return this.equals((markVoucherAsRedeemed_result)that);
17643
      return false;
17644
    }
17645
 
17646
    public boolean equals(markVoucherAsRedeemed_result that) {
17647
      if (that == null)
17648
        return false;
17649
 
17650
      boolean this_present_success = true;
17651
      boolean that_present_success = true;
17652
      if (this_present_success || that_present_success) {
17653
        if (!(this_present_success && that_present_success))
17654
          return false;
17655
        if (this.success != that.success)
17656
          return false;
17657
      }
17658
 
17659
      return true;
17660
    }
17661
 
17662
    @Override
17663
    public int hashCode() {
17664
      return 0;
17665
    }
17666
 
17667
    public int compareTo(markVoucherAsRedeemed_result other) {
17668
      if (!getClass().equals(other.getClass())) {
17669
        return getClass().getName().compareTo(other.getClass().getName());
17670
      }
17671
 
17672
      int lastComparison = 0;
17673
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
17674
 
17675
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17676
      if (lastComparison != 0) {
17677
        return lastComparison;
17678
      }
17679
      if (isSetSuccess()) {
17680
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17681
        if (lastComparison != 0) {
17682
          return lastComparison;
17683
        }
17684
      }
17685
      return 0;
17686
    }
17687
 
17688
    public _Fields fieldForId(int fieldId) {
17689
      return _Fields.findByThriftId(fieldId);
17690
    }
17691
 
17692
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17693
      org.apache.thrift.protocol.TField field;
17694
      iprot.readStructBegin();
17695
      while (true)
17696
      {
17697
        field = iprot.readFieldBegin();
17698
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17699
          break;
17700
        }
17701
        switch (field.id) {
17702
          case 0: // SUCCESS
17703
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
17704
              this.success = iprot.readBool();
17705
              setSuccessIsSet(true);
17706
            } else { 
17707
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17708
            }
17709
            break;
17710
          default:
17711
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17712
        }
17713
        iprot.readFieldEnd();
17714
      }
17715
      iprot.readStructEnd();
17716
      validate();
17717
    }
17718
 
17719
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17720
      oprot.writeStructBegin(STRUCT_DESC);
17721
 
17722
      if (this.isSetSuccess()) {
17723
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17724
        oprot.writeBool(this.success);
17725
        oprot.writeFieldEnd();
17726
      }
17727
      oprot.writeFieldStop();
17728
      oprot.writeStructEnd();
17729
    }
17730
 
17731
    @Override
17732
    public String toString() {
17733
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
17734
      boolean first = true;
17735
 
17736
      sb.append("success:");
17737
      sb.append(this.success);
17738
      first = false;
17739
      sb.append(")");
17740
      return sb.toString();
17741
    }
17742
 
17743
    public void validate() throws org.apache.thrift.TException {
17744
      // check for required fields
17745
    }
17746
 
17747
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17748
      try {
17749
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17750
      } catch (org.apache.thrift.TException te) {
17751
        throw new java.io.IOException(te);
17752
      }
17753
    }
17754
 
17755
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17756
      try {
17757
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17758
      } catch (org.apache.thrift.TException te) {
17759
        throw new java.io.IOException(te);
17760
      }
17761
    }
17762
 
17763
  }
17764
 
1982 varun.gupt 17765
}